Closed
Bug 1412044
Opened 7 years ago
Closed 7 years ago
Getting "error: codegen option `opt-level` requires a string (C opt-level=<value>)" when compiling m-c tip
Categories
(Firefox Build System :: General, defect)
Firefox Build System
General
Tracking
(firefox58 fixed)
RESOLVED
FIXED
mozilla58
Tracking | Status | |
---|---|---|
firefox58 | --- | fixed |
People
(Reporter: u408661, Assigned: gps)
References
Details
Attachments
(1 file)
This appears to be fallout from bug 1411081. I've tried clobbering, and even rm -rf'ing my entire objdir with no luck. My mozconfig uses --enable-debug, but even if I get rid of that, the build still fails. This doesn't happen on one particular file, the file that complains about the missing argument appears to be random. I've no idea why this might be.
The only thing that fixes this is rolling back to a commit before the changes to the rust opt-level.
Here's the offending mozconfig:
mk_add_options MOZ_MAKE_FLAGS="-s"
mk_add_options AUTOCLOBBER=1
ac_add_options --enable-warnings-as-errors
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-dbg
ac_add_options --enable-debug
ac_add_options --with-ccache=/usr/local/bin/ccache
mk_add_options "export RUSTC_WRAPPER=$HOME/.cargo/bin/sccache"
Assignee | ||
Comment 1•7 years ago
|
||
I'm attempting to reproduce.
While I wait on that...
> mk_add_options MOZ_MAKE_FLAGS="-s"
This is the default and this line can be removed.
> ac_add_options --with-ccache=/usr/local/bin/ccache
> mk_add_options "export RUSTC_WRAPPER=$HOME/.cargo/bin/sccache"
These can be replaced with:
ac_add_options --with-ccache=$HOME/.cargo/bin/sccache
Assignee: nobody → gps
Status: NEW → ASSIGNED
Assignee | ||
Comment 2•7 years ago
|
||
I can repro with simply:
ac_add_options --with-ccache=~/bin/sccache
I tried with both sccache 0.2.0-pre (5a4ea95) and latest master (3df9205).
)$ ./mach build -v -j1 toolkit/library/rust
0:00.12 /usr/bin/make -C /home/gps/src/firefox/objdir -j8 -s backend
0:00.16 /usr/bin/make -C toolkit/library/rust -j1
0:00.16 make: Entering directory '/home/gps/src/firefox/objdir/toolkit/library/rust'
0:00.17 make[1]: Entering directory '/home/gps/src/firefox/objdir/toolkit/library/rust'
0:00.17 make[1]: Nothing to be done for 'pre-export'.
0:00.17 make[1]: Leaving directory '/home/gps/src/firefox/objdir/toolkit/library/rust'
0:00.17 make[1]: Entering directory '/home/gps/src/firefox/objdir/toolkit/library/rust'
0:00.17 make[1]: Nothing to be done for 'export'.
0:00.17 make[1]: Leaving directory '/home/gps/src/firefox/objdir/toolkit/library/rust'
0:00.17 make[1]: Entering directory '/home/gps/src/firefox/objdir/toolkit/library/rust'
0:00.17 force-cargo-library-build
0:00.17 env RUSTFLAGS='-Copt-level=1 -Cdebuginfo=2 ' RUSTC_WRAPPER='/home/gps/bin/sccache' CARGO_TARGET_DIR=/home/gps/src/firefox/objdir/toolkit/library RUSTC=/home/gps/.cargo/bin/rustc MOZ_SRC=/home/gps/src/firefox MOZ_DIST=/home/gps/src/firefox/objdir/dist LIBCLANG_PATH="/usr/lib/llvm-4.0/lib" CLANG_PATH="/usr/lib/llvm-4.0/bin/clang" PKG_CONFIG_ALLOW_CROSS=1 RUST_BACKTRACE=full MOZ_TOPOBJDIR=/home/gps/src/firefox/objdir MOZ_CARGO_WRAP_LDFLAGS="-lpthread -Wl,-z,noexecstack -Wl,-z,text -Wl,-z,relro -Wl,--build-id -B /home/gps/src/firefox/objdir/build/unix/gold -Wl,-rpath-link,/home/gps/src/firefox/objdir/dist/bin -Wl,-rpath-link,/usr/local/lib -fdiagnostics-color" MOZ_CARGO_WRAP_LD=" /usr/bin/ccache /usr/bin/gcc -std=gnu99" CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER=/home/gps/src/firefox/build/cargo-linker /home/gps/.cargo/bin/cargo rustc --release --frozen --manifest-path /home/gps/src/firefox/toolkit/library/rust/Cargo.toml --color=always --lib --target=x86_64-unknown-linux-gnu --features "servo bindgen quantum_render cubeb_pulse_rust cubeb-remoting no-static-ideograph-encoder-tables" --
0:00.86 Compiling nom v1.2.4
0:00.86 Compiling bitreader v0.3.0
0:00.86 Compiling runloop v0.1.0
0:00.86 Compiling bitflags v0.7.0
0:00.86 Compiling bitflags v0.8.2
0:00.86 Compiling fnv v1.0.5
0:00.86 Compiling smallbitvec v1.0.6
0:00.86 Compiling either v1.1.0
0:01.26 error: codegen option `opt-level` requires a string (C opt-level=<value>)
0:01.26
0:01.26 error: Could not compile `bitreader`.
0:01.26 warning: build failed, waiting for other jobs to finish...
0:01.30 error: codegen option `opt-level` requires a string (C opt-level=<value>)
0:01.30
0:01.30 error: Could not compile `bitflags`.
0:01.30 warning: build failed, waiting for other jobs to finish...
0:01.30 error: codegen option `opt-level` requires a string (C opt-level=<value>)
0:01.30
0:01.30 error: Could not compile `either`.
0:01.30 warning: build failed, waiting for other jobs to finish...
0:01.31 error: codegen option `opt-level` requires a string (C opt-level=<value>)
0:01.31
0:01.31 error: Could not compile `runloop`.
0:01.31 warning: build failed, waiting for other jobs to finish...
0:01.32 error: codegen option `opt-level` requires a string (C opt-level=<value>)
0:01.32
0:01.32 error: Could not compile `bitflags`.
0:01.32 warning: build failed, waiting for other jobs to finish...
0:01.32 error: codegen option `opt-level` requires a string (C opt-level=<value>)
0:01.32
0:01.32 error: Could not compile `smallbitvec`.
0:01.32 warning: build failed, waiting for other jobs to finish...
0:01.32 error: codegen option `opt-level` requires a string (C opt-level=<value>)
0:01.32
0:01.32 error: Could not compile `fnv`.
0:01.32 warning: build failed, waiting for other jobs to finish...
0:02.71 error: build failed
0:02.72 /home/gps/src/firefox/config/rules.mk:975: recipe for target 'force-cargo-library-build' failed
0:02.72 make[1]: *** [force-cargo-library-build] Error 101
0:02.72 make[1]: Leaving directory '/home/gps/src/firefox/objdir/toolkit/library/rust'
0:02.72 /home/gps/src/firefox/config/rules.mk:452: recipe for target 'default' failed
0:02.72 make: *** [default] Error 2
0:02.72 make: Leaving directory '/home/gps/src/firefox/objdir/toolkit/library/rust'
Assignee | ||
Comment 3•7 years ago
|
||
If we switch from -Copt-level=1 to "-C opt-level=1" (note the space), things work.
I reckon this is a bug in sccache's parser for rustc arguments?
We should probably work around it by using separate arguments. The change is easy enough.
Comment hidden (mozreview-request) |
Comment 5•7 years ago
|
||
Yeah, that seems likely.
Comment 6•7 years ago
|
||
mozreview-review |
Comment on attachment 8922445 [details]
Bug 1412044 - Use separate arguments for rustc's -C option;
https://reviewboard.mozilla.org/r/193508/#review198710
Attachment #8922445 -
Flags: review?(ted) → review+
Pushed by gszorc@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/bc103ec9d0b3
Use separate arguments for rustc's -C option; r=ted
Pushed by gszorc@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/6d2368c95edb
Fix linting failure; r=me
Comment 9•7 years ago
|
||
(In reply to Gregory Szorc [:gps] from comment #3)
> If we switch from -Copt-level=1 to "-C opt-level=1" (note the space), things
> work.
>
> I reckon this is a bug in sccache's parser for rustc arguments?
>
> We should probably work around it by using separate arguments. The change is
> easy enough.
Well, there's definitely a bug in sccache (and I sent a PR for it: https://github.com/mozilla/sccache/pull/198), but the result of that bug is that the -Copt-level=1 should have been passed down to rust unchanged, leading to no error. Which, by the way, I'm unable to reproduce locally, and neither is automation, as a matter of fact.
Comment 10•7 years ago
|
||
Considering comment 9, if people who do reproduce the problem could give a try to that sccache PR (with, obviously, the gecko build system workaround removed), that would be helpful.
![]() |
||
Comment 11•7 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/bc103ec9d0b3
https://hg.mozilla.org/mozilla-central/rev/6d2368c95edb
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
status-firefox58:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla58
Updated•7 years ago
|
Product: Core → Firefox Build System
You need to log in
before you can comment on or make changes to this bug.
Description
•