MCPcopy Index your code
hub / github.com/nodejs/node / get_cargo_version

Function get_cargo_version

configure.py:1502–1519  ·  view source on GitHub ↗
(cargo)

Source from the content-addressed store, hash-verified

1500 return 0
1501
1502def get_cargo_version(cargo):
1503 try:
1504 proc = subprocess.Popen(shlex.split(cargo) + ['--version'],
1505 stdin=subprocess.PIPE, stderr=subprocess.PIPE,
1506 stdout=subprocess.PIPE)
1507 except OSError:
1508 return '0.0'
1509
1510 with proc:
1511 cargo_ret = to_utf8(proc.communicate()[0])
1512
1513 match = re.match(r"cargo ([0-9]+\.[0-9]+\.[0-9]+)", cargo_ret)
1514
1515 if match:
1516 return match.group(1)
1517
1518 warn(f'Could not recognize `cargo`: {cargo_ret}')
1519 return '0.0'
1520
1521def get_rustc_version(rustc):
1522 try:

Callers 1

check_compilerFunction · 0.85

Calls 4

to_utf8Function · 0.85
warnFunction · 0.70
matchMethod · 0.65
splitMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…