Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 627676 - www-client/firefox-55.0 fails to build on musl due to testing only for --target=x86_64-unknown-linux-gnu
Summary: www-client/firefox-55.0 fails to build on musl due to testing only for --targ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Mozilla Gentoo Team
URL:
Whiteboard:
Keywords: InOverlay
Depends on:
Blocks:
 
Reported: 2017-08-12 07:38 UTC by tt_1
Modified: 2017-12-03 18:32 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
trivial patch to fix this (firefox-55.0-musl-rust-target.patch,691 bytes, patch)
2017-08-12 07:44 UTC, tt_1
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description tt_1 2017-08-12 07:38:57 UTC
The hard dependency of >firefox-53 on rust (and cargo) has been kind of a bummer for some time now if you don't have glibc as your systems libc. In case of musl, there are ebuilds for rust and cargo to build both of them successfully (the ebuilds can be found here https://github.com/smaeul/portage-overlay) 

It is not my project, but I asked the person to push or merge it to the gentoo tree, so to make it more officiall. 

However, even though the dependency on rust and cargo is satisfied with the ebuilds from the overlay and the rust compiler is up and working, firefox-55.0 compilation still breaks during src_configure, as it searches for the glibc rust target (--target=x86_64-unknown-linux-gnu) and hence cannot find the correct musl target (--target=x86_64-unknown-linux-musl). 

snipet from build.log

checking for libffi > 3.0.9... yes
checking MOZ_FFI_CFLAGS... -I/usr/lib/libffi-3.2.1/include
checking MOZ_FFI_LIBS... -L/usr/lib/../lib64 -lffi
checking for rustc... /usr/bin/rustc
checking for cargo... /usr/bin/cargo
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
Comment 1 tt_1 2017-08-12 07:44:36 UTC
Created attachment 488672 [details, diff]
trivial patch to fix this

The patch attached works around the problem at the cost of breaking glibc builds. 

Any ideas how to solve this properly?
Comment 2 Jory A. Pratt gentoo-dev 2017-08-12 12:47:56 UTC
Until musl has support for rust/cargo in main gentoo I will not continue to support it via the mozilla overlay. Your patch is also incorrect and would need to be applied based on useflag which I am not interested in either as it is not upstreamable.
Comment 3 tt_1 2017-08-12 13:36:45 UTC
Ehr, the patch is of course not upstreamable. Neither is it complete, but it is correct for the case that a user on a amd64-musl profile runs into the above described failure in src_configure. 

The ebuild has epatch_user, so let's just keep this open. I don't know if mozilla accepts bugs from new bugzilla accounts without a patch, but I'm going to open a bug upstream.
Comment 4 Jory A. Pratt gentoo-dev 2017-08-13 23:05:07 UTC
(In reply to tt_1 from comment #3)
> Ehr, the patch is of course not upstreamable. Neither is it complete, but it
> is correct for the case that a user on a amd64-musl profile runs into the
> above described failure in src_configure. 
> 
> The ebuild has epatch_user, so let's just keep this open. I don't know if
> mozilla accepts bugs from new bugzilla accounts without a patch, but I'm
> going to open a bug upstream.

Please do not reopen. They can search for your bug report without it being open. When rust is supported in the tree officially for musl that is when musl support will be added back into the tree, I am maintaining all musl patches already in the patchset just for those who are using custom overlays. Feel free to apply it via /etc/portage/patches/www-client/firefox
Comment 5 Jory A. Pratt gentoo-dev 2017-12-03 18:32:24 UTC
58.0_beta8 is in the mozilla overlay, it no longer requires patching.