Building Firefox for Desktop Artifact Mode incorrectly requires C compiler
Categories
(Firefox Build System :: General, defect)
Tracking
(Not tracked)
People
(Reporter: rachel, Unassigned)
References
Details
(Keywords: in-triage)
I found this when trying to build Firefox for the first time on macOS.
Steps to repro:
- Bootstrap, selecting building for desktop artifact mode.
- Build an artifact build.
- Fail. See error output below:
0:05.73 checking for target system type... x86_64-apple-darwin19.4.0
0:06.18 checking whether cross compiling... no
0:06.29 checking for hg... /usr/local/bin/hg
0:06.53 checking for Mercurial version... 5.3
0:06.67 checking for sparse checkout... no
0:06.67 checking for yasm... /usr/local/bin/yasm
0:06.74 checking yasm version... 1.3.0
0:06.81 checking for the target C compiler... not found
0:06.81 DEBUG: _cc: Trying clang-mp-3.7
0:06.81 ERROR: Cannot find the target C compiler
0:06.84 *** Fix above errors and then restart with “./mach build”
0:06.84 make: *** [configure] Error 1
Expected results:
- I would not expect a c compiler to be required for artifact builds.
Actual results:
- Build failed.
Cannot find the target C compiler.
--
It's also worth noting that I finally got artifact builds to work by first building for desktop mode (not artifact). That installed the required c compiler on my system so that the next time I tried to run an artifact build, it worked.
Comment 1•6 years ago
|
||
Did you set up your mozconfig in the way the message at the end of mach bootstrap tells you to:
https://searchfox.org/mozilla-central/source/python/mozboot/mozboot/base.py#144-152
? Maybe this is related to bug 1606753, which tracks making that message a little clearer?
| Reporter | ||
Comment 2•6 years ago
|
||
(In reply to Nathan Froyd [:froydnj] [away until 4 May] from comment #1)
Did you set up your mozconfig in the way the message at the end of
mach bootstraptells you to:https://searchfox.org/mozilla-central/source/python/mozboot/mozboot/base.py#144-152
? Maybe this is related to bug 1606753, which tracks making that message a little clearer?
Yes, I had the ac_add_options --enable-artifact-builds option set. For reference, here's my full mozconfig when I was trying this:
# Define where build files should go. This places them in the directory
# "obj-ff-dbg" under the current source directory
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-ff-dbg
# Enable debug builds
ac_add_options --enable-debug
ac_add_options --enable-artifact-builds
# Use the local copy of specific version of macOS SDK compatible with Mozilla source code
ac_add_options --with-macos-sdk=$HOME/SDK-archive/MacOSX10.11.sdk
FWIW, I didn't find the instructions to be terribly confusing as-is.
Comment 3•6 years ago
|
||
I can't reproduce this. When I don't have the clang tools installed on my macOS machine, configure succeeds and according to the log output it never checked for clang or any other low-level compilation tools. This agrees with the code that performs the check and avoids configuring any toolchain stuff if you're building with artifact builds.
I'm inclined to agree with Nathan's hunch that this was originally user error and you forgot to set --enable-artifact-builds the first time you performed the build. (If not, I would appreciate seeing the full output of mach build in that case rather than just the bits copy-pasted here.)
Comment 4•5 years ago
|
||
I've just had 2 separate MSU students run into this on macOS.
I just checked and I think the issue is caused by the following:
on https://firefox-source-docs.mozilla.org/setup/macos_build.html, the steps at the top run bootstrap after putting macOS header stuff into the mozconfig file, followed immediately by running ./mach build. It stands to reason that if you pick "artifact builds" in the wizard, and the page doesn't mention any other steps, that just following these steps should suffice.
However, the SDK echo will create the mozconfig file, so the logic in bug 1606753 will not add the --enable-artifact-builds to the mozconfig file (because a file exists so we don't mess with it), and then it'll try to do a full build and error out.
Similarly, in the extended steps, there is no mention of mach bootstrap but we do require installing xcode and all the rest of it, with no instructions around the use of artifact builds or how to configure them.
So I'm going to reopen this bug. I think we should:
(a) adapt the logic from bug 1606753 so that if the mozconfig doesn't include --enable-artifact-builds yet the user selected artifact builds in the wizard, we explicitly prompt the user saying "do you want us to modify the config file". Perhaps if we know that this is the first time we're bootstrapping, we can even just do it automatically; and
(b) we should update the above documentation such that it is clearer how to set up artifact builds.
Right now our build documentation treats artifact builds as a sort of esoteric separate thing. This belies the fact that they are an integral part of how most of the Firefox frontend teams get stuff done, and that they're much lower-effort and lower-impact-on-your-machine to set up for casual / new contributors who are interested in fixing bugs that can be fixed using those builds (e.g. in the devtools, or in the rest of the frontend). Ideally we should fix this...
Mike, is this something that's on your radar in terms of your new role around contributors / volunteers / whatever the term-du-jour is?
Comment 5•5 years ago
|
||
Bootstrap and docs are presently both in a state of significant flux - I've been testing it regularly for the last two or three weeks, and hitting some bugs like this. Ricky is on point for Bootstrap right now, and once we've got this sorted I'll make sure the docs are updated.
Comment 6•5 years ago
|
||
I'm going to re-close this bug because opening a new bug is probably what should have been done in the first place.
The suggestion to have bootstrap (offer to) automatically update mozconfigs for you is sensible and doable, so I'll open a new bug to track that.
I'll also open a new bug to track improvements to documentation that have more respect for artifact builds. I'm not sure exactly what that looks like right now. In the immediate future mhoye might drive or have some say in that work.
Description
•