Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.

Bug 1435585

Summary: FTBFS with Rust enabled for all arches
Product: [Fedora] Fedora Reporter: Dan Horák <dan>
Component: firefoxAssignee: Jan Horak <jhorak>
Status: CLOSED UPSTREAM QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: bugproxy, gecko-bugs-nobody, hannsj_uhl, jhorak, jistone, kengert, normand, pjasicek, stransky, timo
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-05-29 10:19:25 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 467765, 1071880    

Description Dan Horák 2017-03-24 10:03:51 UTC
I've tried to build FF with Rust enabled on all arches as Rust will become a mandatory BR in later FF version, with this change in the spec file

diff --git a/firefox.spec b/firefox.spec
index 2ae80f6..fbe8f09 100644
--- a/firefox.spec
+++ b/firefox.spec
@@ -54,9 +54,9 @@
 %define build_with_rust   0
 
 %if 0%{?fedora} > 23
-%ifarch x86_64
+#%ifarch x86_64
 %define build_with_rust   1
-%endif
+#%endif
 %endif
 
 # Build as a debug package?

And started scratch builds in Rawhide
https://koji.fedoraproject.org/koji/taskinfo?taskID=18564726
https://s390.koji.fedoraproject.org/koji/taskinfo?taskID=2531796

Unfortunately they all failed with a similar error
...
checking the host C++ compiler works... yes
checking for 64-bit OS... yes
checking for rustc... /usr/bin/rustc
checking for cargo... /usr/bin/cargo
checking rustc version... 1.16.0
checking cargo support for --frozen... yes
ERROR: Don't know how to translate powerpc64le-unknown-linux-gnu for rustc
*** Fix above errors and then restart with\
               "make -f client.mk build"
make[2]: *** [/builddir/build/BUILD/firefox-52.0/firefox-52.0/client.mk:379: configure] Error 1

Is it some magic missing the FF configure script or is it a Rust issue? The Rust maintainer is in CC.

Version-Release number of selected component (if applicable):
firefox-52.0-6.fc27

Comment 1 Michel Normand 2017-03-24 10:15:19 UTC
FYI, I made few days ago two rust related patches for ppc64 and ppc64le to allow to build firefox (on openSUSE)(1)   I assume this should apply to fedora.

I do not know how to reconcile the two as only one patch, because do not understand enough the internals of firefox.

(1) https://michelmno.fedorapeople.org/MozillaFirefox_openSUSE/

Comment 2 Josh Stone 2017-03-24 16:34:14 UTC
At least x86_64 looks like it got through... :)

> DEBUG: Executing: `/usr/bin/rustc --crate-type staticlib --target=i586-unknown-linux-gnu -o /tmp/conftestKgxLjk.rlib /tmp/conftest0If1n3.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 `i586-unknown-linux-gnu` target may not be installed
> DEBUG: | 
> DEBUG: | error: aborting due to previous error
> DEBUG: | 
> ERROR: Cannot compile for i686-pc-linux-gnu with /usr/bin/rustc

This should be targeting i686-unknown-linux-gnu, not i586.

> ERROR: Don't know how to translate armv7l-unknown-linux-gnueabihf for rustc

armv7-unknown-linux-gnueabihf

> ERROR: Don't know how to translate s390x-ibm-linux-gnu for rustc

s390x-unknown-linux-gnu

> ERROR: Don't know how to translate aarch64-unknown-linux-gnu for rustc
> ERROR: Don't know how to translate powerpc64-unknown-linux-gnu for rustc
> ERROR: Don't know how to translate powerpc64le-unknown-linux-gnu for rustc

These triples look fine as-is.

Comment 3 Josh Stone 2017-03-24 16:40:12 UTC
If it helps, you could just fall back to rustc's own triple from:

$ /usr/bin/rustc -Vv
rustc 1.16.0
binary: rustc
commit-hash: unknown
commit-date: unknown
host: x86_64-unknown-linux-gnu
release: 1.16.0
LLVM version: 3.9

That's what it will use if you don't specify --target=... at all.

Comment 4 Martin Stransky 2017-05-24 20:33:47 UTC
(In reply to Michel Normand from comment #1)
> FYI, I made few days ago two rust related patches for ppc64 and ppc64le to
> allow to build firefox (on openSUSE)(1)   I assume this should apply to
> fedora.
> 
> I do not know how to reconcile the two as only one patch, because do not
> understand enough the internals of firefox.
> 
> (1) https://michelmno.fedorapeople.org/MozillaFirefox_openSUSE/

Thanks. Is the bug reported upstream or shall we report that?

Comment 5 Michel Normand 2017-05-29 08:00:06 UTC
(In reply to Martin Stransky from comment #4)
> (In reply to Michel Normand from comment #1)
> > FYI, I made few days ago two rust related patches for ppc64 and ppc64le to
> > allow to build firefox (on openSUSE)(1)   I assume this should apply to
> > fedora.
> > 
> > I do not know how to reconcile the two as only one patch, because do not
> > understand enough the internals of firefox.
> > 
> > (1) https://michelmno.fedorapeople.org/MozillaFirefox_openSUSE/
> 
> Thanks. Is the bug reported upstream or shall we report that?

I did not reported it upstream.

Comment 6 Martin Stransky 2017-05-29 10:19:25 UTC
Okay, reported as https://bugzilla.mozilla.org/show_bug.cgi?id=1368458