Mingw builds fail with "ERROR: Don't know how to translate i686-w64-mingw32 for rustc" with rustc 1.38
Categories
(Firefox Build System :: General, defect)
Tracking
(firefox-esr68 fixed, firefox71 fixed)
People
(Reporter: chmanchester, Assigned: chmanchester)
References
Details
Attachments
(1 file)
|
47 bytes,
text/x-phabricator-request
|
jcristau
:
approval-mozilla-esr68+
|
Details | Review |
Comment 1•6 years ago
|
||
1.38 added *-uwp-windows-gnu targets, which makes mingw ambiguous.
It also added a armv7-unknown-linux-gnueabi target which breaks armv7-unknown-linux-gnueabihf detection.
And a x86_64-pc-solaris that breaks the x86_64-sun-solaris2 test.
Reproducible with:
diff --git a/python/mozbuild/mozbuild/test/configure/test_toolchain_configure.py b/python/mozbuild/mozbuild/test/configure/test_toolchain_configure.py
index 4e4ec162a6454..67918446b5de4 100755
--- a/python/mozbuild/mozbuild/test/configure/test_toolchain_configure.py
+++ b/python/mozbuild/mozbuild/test/configure/test_toolchain_configure.py
@@ -1585,28 +1585,52 @@ def gen_invoke_rustc(version, rustup_wrapper=False):
]
# Additional targets from 1.36
if Version(version) >= '1.36.0':
rust_targets += [
'wasm32-wasi',
]
rust_targets.remove('wasm32-unknown-wasi')
rust_targets.remove('x86_64-unknown-bitrig')
+ # Additional targets from 1.37
+ if Version(version) >= '1.37.0':
+ rust_targets += [
+ 'x86_64-pc-solaris',
+ ]
+ # Additional targets from 1.38
+ if Version(version) >= '1.38.0':
+ rust_targets += [
+ 'aarch64-unknown-redox',
+ 'aarch64-wrs-vxworks',
+ 'armv7-unknown-linux-gnueabi',
+ 'armv7-unknown-linux-musleabi',
+ 'armv7-wrs-vxworks',
+ 'hexagon-unknown-linux-musl',
+ 'i586-wrs-vxworks',
+ 'i686-uwp-windows-gnu',
+ 'i686-wrs-vxworks',
+ 'powerpc-wrs-vxworks',
+ 'powerpc-wrs-vxworks-spe',
+ 'powerpc64-wrs-vxworks',
+ 'riscv32i-unknown-none-elf',
+ 'x86_64-uwp-windows-gnu',
+ 'x86_64-wrs-vxworks',
+ ]
return 0, '\n'.join(sorted(rust_targets)), ''
if (len(args) == 6 and args[:2] == ('--crate-type', 'staticlib') and
args[2].startswith('--target=') and args[3] == '-o'):
with open(args[4], 'w') as fh:
fh.write('foo')
return 0, '', ''
raise NotImplementedError('unsupported arguments')
return invoke_rustc
class RustTest(BaseConfigureTest):
- def get_rust_target(self, target, compiler_type='gcc', version='1.36.0',
+ def get_rust_target(self, target, compiler_type='gcc', version='1.38.0',
arm_target=None):
environ = {
'PATH': os.pathsep.join(
mozpath.abspath(p) for p in ('/bin', '/usr/bin')),
}
paths = {
mozpath.abspath('/usr/bin/cargo'): gen_invoke_cargo(version),
@@ -1678,16 +1702,18 @@ class RustTest(BaseConfigureTest):
# Windows
for autoconf, building_with_gcc, rust in (
('i686-pc-mingw32', 'cl', 'i686-pc-windows-msvc'),
('x86_64-pc-mingw32', 'cl', 'x86_64-pc-windows-msvc'),
('i686-pc-mingw32', 'gcc', 'i686-pc-windows-gnu'),
('x86_64-pc-mingw32', 'gcc', 'x86_64-pc-windows-gnu'),
('i686-pc-mingw32', 'clang', 'i686-pc-windows-gnu'),
('x86_64-pc-mingw32', 'clang', 'x86_64-pc-windows-gnu'),
+ ('i686-w64-mingw32', 'clang', 'i686-pc-windows-gnu'),
+ ('x86_64-w64-mingw32', 'clang', 'x86_64-pc-windows-gnu'),
):
self.assertEqual(self.get_rust_target(autoconf, building_with_gcc), rust)
# Arm special cases
self.assertEqual(
self.get_rust_target('arm-unknown-linux-androideabi',
arm_target=ReadOnlyNamespace(
arm_arch=7, fpu='neon', thumb2=True, float_abi='softfp')),
| Assignee | ||
Comment 2•6 years ago
|
||
In the case of armv7-unknown-linux-gnueabihf it seems like our test has just been invalidated, because we're providing a default arm_target with float_abi='softfp'. We're already checking that target with a more realistic arm_target later in the test. For the others it looks like we need to start taking manufacturer into account.
| Assignee | ||
Comment 3•6 years ago
|
||
Comment 5•6 years ago
|
||
| bugherder | ||
Comment 8•5 years ago
|
||
Comment on attachment 9100521 [details]
Bug 1587913 - Fix rust target detection for rustc 1.38.
ESR Uplift Approval Request
- If this is not a sec:{high,crit} bug, please state case for ESR consideration: Build issues with more modern rust compiler. Dependency for bug 1595218.
- User impact if declined:
- Fix Landed on Version: 71
- Risk to taking this patch: Low
- Why is the change risky/not risky? (and alternatives if risky): Only a configure check. This brings rust.configure close to being on par with what we have in central (and I'm going to a? some more that will get us even closer)
Note there's a trivial conflict in init.configure that needs manual application of the patch. I can provide an updated patch if necessary.
- String or UUID changes made by this patch:
Comment 9•5 years ago
|
||
Comment on attachment 9100521 [details]
Bug 1587913 - Fix rust target detection for rustc 1.38.
approved for 68.9esr
Comment 10•5 years ago
|
||
| bugherder uplift | ||
Description
•