Open Bug 1451312 Opened 7 years ago Updated 2 years ago

Make Ubuntu bootstrap able to install GCC 6 on older Ubuntu releases

Categories

(Firefox Build System :: Bootstrap Configuration, enhancement)

3 Branch
enhancement

Tracking

(Not tracked)

People

(Reporter: ted, Unassigned)

References

Details

The latest Ubuntu LTS (16.04, xenial) includes gcc 5.3.1: https://packages.ubuntu.com/xenial/gcc Now that we're requiring GCC 6 we should ensure that `mach bootstrap` can install GCC 6 on older Ubuntu releases. There's a toolchain PPA that is very easy to use: https://launchpad.net/~ubuntu-toolchain-r/+archive/ubuntu/test We should probably just make bootstrap enable that and install its gcc-6 package. (We might have to do additional fiddling then to make sure configure picks those compilers up by default.)
Arguably, there's a flaw in configure, where if you have an unsupported gcc but a supported clang, that won't be autodetected. And the version of clang in ubuntu should work just fine.
Alternatively, we should download the gcc-6 package we have into .mozbuild, and instruct configure to look at that location in addition to all other locations.
(In reply to Mike Hommey [:glandium] from comment #1) > And the version of clang > in ubuntu should work just fine. For the record, the version of clang I have on Ubuntu 16.04.4 LTS is this: clang version 3.8.0-2ubuntu4 (tags/RELEASE_380/final) Target: x86_64-pc-linux-gnu Thread model: posix InstalledDir: /usr/bin And compiling with this fails. Using the clang from ~/.mozbuild/clang/bin works though.
(In reply to Kartikaya Gupta (email:kats@mozilla.com) from comment #3) > And compiling with this fails. Using the clang from ~/.mozbuild/clang/bin > works though. I'd also note that we make people get clang anyway because of bindgen / servo stuff. That is, I just jumped through the gcc hoops only to find that then my VM had to download >1gb of clang stuff anyway. Might as well use that for compiling if we can!
A workaround that worked for me on my Linux Mint machine is to convince mach it really does want to use mozbuild's clang to compile by adding this to my mozconfig: export CC=/path/to/.mozbuild/clang/bin/clang export CXX=/path/to/.mozbuild/clang/bin/clang++
(In reply to Chris H-C :chutten from comment #5) > export CC=/path/to/.mozbuild/clang/bin/clang > export CXX=/path/to/.mozbuild/clang/bin/clang++ This works for Linux host builds, but now I need to do an android build on my Linux machine and this doesn't work for that. It still tries to use the gcc for the host compilation, and rejects it for being too old.
Ah, using HOST_CC and HOST_CXX instead seems to do the job for Android builds.
I think the build system should default to managing toolchains for you. i.e. when you `mach build` it sees which toolchain is being used by CI (this is defined in repo), downloads and extracts it to ~/.mozbuild if it isn't available, and automatically picks it up in configure. I think this is the best workflow for the average developer, as it will produce builds that are more similar to what official CI produces. It will eliminate a whole class of problems introduced by the local toolchain varying from the official toolchain. Obviously this default is not suitable for everyone, so there should be a --disable-toolchain-management configure flag or some such.
(In reply to Gregory Szorc [:gps] from comment #8) > I think the build system should default to managing toolchains for you. i.e. > when you `mach build` it sees which toolchain is being used by CI (this is > defined in repo), downloads and extracts it to ~/.mozbuild if it isn't > available, and automatically picks it up in configure. > > I think this is the best workflow for the average developer, as it will > produce builds that are more similar to what official CI produces. It will > eliminate a whole class of problems introduced by the local toolchain > varying from the official toolchain. > > Obviously this default is not suitable for everyone, so there should be a > --disable-toolchain-management configure flag or some such. Please warn loudly (or fail) if CC/CXX are set.
I just ran into this problem yesterday, too, after installing Ubuntu 16.04 into Windows 10 as a WSL app. After I followed these instructions[1], and updated the Rust package for Linux-Android builds, I got a Fennec build completed in the WSL. We should definitely make sure that we install the correct GCC with the bootstrap script, as Ubuntu 16.04 is the only Ubuntu people currently get from the Microsoft Store when enabling WSL. [1] https://gist.github.com/application2000/73fd6f4bf1be6600a2cf9f56315a2d91
Component: General → Bootstrap Configuration
(In reply to Gregory Szorc [:gps] from comment #8) > I think the build system should default to managing toolchains for you. i.e. > when you `mach build` it sees which toolchain is being used by CI (this is > defined in repo), downloads and extracts it to ~/.mozbuild if it isn't > available, and automatically picks it up in configure. Even if this makes me a bit sad (see bug 1388008), what would it take to implement that?
Works for Ubuntu 16.04 (In reply to Chris H-C :chutten from comment #5) > A workaround that worked for me on my Linux Mint machine is to convince mach > it really does want to use mozbuild's clang to compile by adding this to my > mozconfig: > > export CC=/path/to/.mozbuild/clang/bin/clang > export CXX=/path/to/.mozbuild/clang/bin/clang++
Version: Version 3 → 3 Branch
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.