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

Function get_rustc_version

configure.py:1521–1538  ·  view source on GitHub ↗
(rustc)

Source from the content-addressed store, hash-verified

1519 return '0.0'
1520
1521def get_rustc_version(rustc):
1522 try:
1523 proc = subprocess.Popen(shlex.split(rustc) + ['--version'],
1524 stdin=subprocess.PIPE, stderr=subprocess.PIPE,
1525 stdout=subprocess.PIPE)
1526 except OSError:
1527 return '0.0'
1528
1529 with proc:
1530 rustc_ret = to_utf8(proc.communicate()[0])
1531
1532 match = re.match(r"rustc ([0-9]+\.[0-9]+\.[0-9]+)", rustc_ret)
1533
1534 if match:
1535 return match.group(1)
1536
1537 warn(f'Could not recognize `rustc`: {rustc_ret}')
1538 return '0.0'
1539
1540# Note: Apple clang self-reports as clang 4.2.0 and gcc 4.2.1. It passes
1541# the version check more by accident than anything else but a more rigorous

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…