Closed
Bug 1389774
Opened 8 years ago
Closed 8 years ago
configure fails on systems with musl libc for firefox 55.0 with: rustc --target=x86_64-unknown-linux-gnu
Categories
(Firefox Build System :: General, defect, P5)
Tracking
(firefox57 fix-optional)
RESOLVED
WORKSFORME
| Tracking | Status | |
|---|---|---|
| firefox57 | --- | fix-optional |
People
(Reporter: herrtimson, Unassigned)
Details
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0
Build ID: 20170810142818
Steps to reproduce:
I was about to configure firefox-55.0 to be build within a musl environement. I have working rust and cargo installed.
Actual results:
I was not able to complete the configure script as the rust configure script in build/moz.configure/rust.configure does except rust with --target=x86_64-unknown-linux-gnu on the build system.
a snipet from the build log:
checking rustc version... 1.19.0
checking cargo version... 0.20.0
DEBUG: Executing: `/usr/bin/rustc --crate-type staticlib --target=x86_64-unknown-linux-gnu -o /var/tmp/portage/www-client/firefox-55.0/temp/conftestqcCUms.rlib /var/tmp/portage/www-client/firefox-55.0/temp/conftests3GLTh.rs`
DEBUG: The command returned non-zero exit status 101.
DEBUG: Its error output was:
DEBUG: | error[E0463]: can't find crate for `std`
DEBUG: | |
DEBUG: | = note: the `x86_64-unknown-linux-gnu` target may not be installed
DEBUG: |
DEBUG: | error: aborting due to previous error(s)
DEBUG: |
ERROR: Cannot compile for x86_64-gentoo-linux-musl with /usr/bin/rustc
The target may be unsupported, or you may not have
a rust std library for that target installed. Try:
rustup target add x86_64-unknown-linux-gnu
*** Fix above errors and then restart with\
"make -f client.mk build"
make: *** [client.mk:383: configure] Error 1
Expected results:
Since this is a musl system, the configure script should test for --target=x86_64-unknown-linux-musl. This can be changed in build/moz.configure/rust.configure by replacing x86_64-unknown-linux-gnu with x86_64-unknown-linux-musl. With this change the configure script can be finished and firefox compiles and runs just fine.
However, this approach does of course break glibc builds and is not acceptable from your point of view. At this moment I cannot imagine how to write the rust.configure script in a way that it can bypass the problem of testing for different libc's automatically.
I used this patch on my system to bypass the configure error, but as I mentioned before this is not legit for upstream.
diff --git a/build/moz.configure/rust.configure b/build/moz.configure/rust.configure
index 13eb772..3443ec1 100644
--- a/build/moz.configure/rust.configure
+++ b/build/moz.configure/rust.configure
@@ -150,7 +150,7 @@ def rust_triple_alias(host_or_target):
('arm', 'Linux'): 'armv7-unknown-linux-gnueabihf',
('sparc64', 'Linux'): 'sparc64-unknown-linux-gnu',
('x86', 'Linux'): 'i686-unknown-linux-gnu',
- ('x86_64', 'Linux'): 'x86_64-unknown-linux-gnu',
+ ('x86_64', 'Linux'): 'x86_64-unknown-linux-musl',
# OS X
('x86', 'OSX'): 'i686-apple-darwin',
('x86_64', 'OSX'): 'x86_64-apple-darwin',
Updated•8 years ago
|
Component: Untriaged → Build Config
Product: Firefox → Core
Comment 2•8 years ago
|
||
Yes, this is a problem. The best fix is probably to consult an environment variable for the requested Rust target and fallback to the current scheme if the environment variable isn't available. I think that's preferable to an option, because needing to set such a thing should be relatively uncommon.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Priority: -- → P5
Comment 3•8 years ago
|
||
I think the right thing to do is bug 1319332.
Updated•8 years ago
|
status-firefox57:
--- → fix-optional
Updated•8 years ago
|
Product: Core → Firefox Build System
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → WORKSFORME
You need to log in
before you can comment on or make changes to this bug.
Description
•