Skip to content

Commit 9dc999e

Browse files
committed
Handle crates which show as "compiled by an incompatible version of rustc"
1 parent a6d099c commit 9dc999e

File tree

1 file changed

+9
-0
lines changed
  • src/test/run-make-fulldeps/sysroot-crates-are-unstable

1 file changed

+9
-0
lines changed

src/test/run-make-fulldeps/sysroot-crates-are-unstable/test.py

+9
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@
1111
'rsbegin.o', 'rsend.o', 'dllcrt2.o', 'crt2.o', 'clang_rt']
1212

1313

14+
# This is a whitelist of crates which give an "compiled by an incompatible version of rustc"
15+
# error, due to being copied into the sysroot as proc-macro deps. See #69976
16+
INCOMPATIBLE_VER_CRATES = ['autocfg', 'cc']
17+
1418
def convert_to_string(s):
1519
if s.__class__.__name__ == 'bytes':
1620
return s.decode('utf-8')
@@ -34,6 +38,11 @@ def check_lib(lib):
3438
stdout, stderr = exec_command([os.environ['RUSTC'], '-', '--crate-type', 'rlib',
3539
'--extern', '{}={}'.format(lib['name'], lib['path'])],
3640
to_input=('extern crate {};'.format(lib['name'])).encode('utf-8'))
41+
42+
if 'compiled by an incompatible version of rustc' in '{}{}'.format(stdout, stderr):
43+
if lib['name'] in INCOMPATIBLE_VER_CRATES:
44+
return True
45+
3746
if not 'use of unstable library feature' in '{}{}'.format(stdout, stderr):
3847
print('crate {} "{}" is not unstable'.format(lib['name'], lib['path']))
3948
print('{}{}'.format(stdout, stderr))

0 commit comments

Comments
 (0)