Open Bug 1476339 Opened 6 years ago Updated 2 years ago

--enable-coverage should set appropriate cflags/ldflags

Categories

(Firefox Build System :: General, enhancement)

enhancement

Tracking

(Not tracked)

REOPENED

People

(Reporter: ted, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

We added an `--enable-coverage` configure option a while back, and our code coverage builds use it, but they still manually set `CFLAGS=--coverage`: https://dxr.mozilla.org/mozilla-central/rev/085cdfb90903d4985f0de1dc7786522d9fb45596/browser/config/mozconfigs/linux64/code-coverage#12 We should just make it so `--enable-coverage` sets the proper cflags/ldflags for the compiler in use.
it does appear that Clang and GCC builds are slightly different. For Clang it looks like this: export CFLAGS="--coverage" export CXXFLAGS="--coverage" export LDFLAGS="--coverage -L$topsrcdir/clang/lib/clang/7.0.0/lib/linux/" export LIBS="-lclang_rt.profile-x86_64" for GCC it looks like: export CFLAGS="--coverage" export CXXFLAGS="--coverage" export LDFLAGS="--coverage -lgcov"
The libs shouldn't be necessary. If they are, I'd say there's something wrong with the compilers in how they handle their flags. Or some flag is missing.

Bug 1491004 is doing this for CFLAGS.

(In reply to Mike Hommey [:glandium] from comment #2)

The libs shouldn't be necessary. If they are, I'd say there's something
wrong with the compilers in how they handle their flags. Or some flag is
missing.

For Clang, probably https://bugs.llvm.org/show_bug.cgi?id=40877.

For GCC, I think we can remove lgcov.

Pushed by mcastelluccio@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/098dacd3fabe Set coverage LDFLAGS as part of configure. r=firefox-build-system-reviewers,chmanchester
Pushed by mcastelluccio@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/db0e1ce31ac3 Set coverage LDFLAGS as part of configure. r=firefox-build-system-reviewers,chmanchester
Regressions: 1590714
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla72
Assignee: nobody → mcastelluccio

Push with failures: https://treeherder.mozilla.org/#/jobs?repo=mozilla-central&group_state=expanded&selectedJob=272598501&resultStatus=testfailed%2Cbusted%2Cexception&searchStr=windows%2C2012%2Cx64%2Cccov%2Cbuild-win64-ccov%2Fdebug%2C%28b%29&revision=782f341be605f1a30e8a9bfbfc13ce389e620a24

Failure log: https://treeherder.mozilla.org/logviewer.html#?job_id=272598501&repo=mozilla-central
https://treeherder.mozilla.org/logviewer.html#?job_id=272598499&repo=mozilla-central

Backout link: https://hg.mozilla.org/integration/autoland/rev/ce5ef7099b4ad932af94a5554a4aaadb45015853

[task 2019-10-23T16:14:47.614Z] 16:14:47 INFO - warning: trait objects without an explicit dyn are deprecated
[task 2019-10-23T16:14:47.615Z] 16:14:47 INFO - --> Z:\build\build\src\third_party\rust\gleam\src\gles_fns.rs:20:53
[task 2019-10-23T16:14:47.615Z] 16:14:47 INFO - |
[task 2019-10-23T16:14:47.615Z] 16:14:47 INFO - 20 | Rc::new(GlesFns { ffi_gl_: ffi_gl_ }) as Rc<Gl>
[task 2019-10-23T16:14:47.615Z] 16:14:47 INFO - | ^^ help: use dyn: dyn Gl
[task 2019-10-23T16:14:47.615Z] 16:14:47 INFO - warning: trait objects without an explicit dyn are deprecated
[task 2019-10-23T16:14:47.615Z] 16:14:47 INFO - --> z:/build/build/src/obj-firefox\x86_64-pc-windows-msvc\debug\build\gleam-26545dc4d8d16efe\out/gl_and_gles_bindings.rs:2758:47
[task 2019-10-23T16:14:47.616Z] 16:14:47 INFO - |
[task 2019-10-23T16:14:47.616Z] 16:14:47 INFO - 2758 | fn do_metaloadfn(loadfn: &mut FnMut(&'static str) -> *const __gl_imports::raw::c_void,
[task 2019-10-23T16:14:47.616Z] 16:14:47 INFO - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use dyn: dyn FnMut(&'static str) -> *const __gl_imports::raw::c_void
[task 2019-10-23T16:14:47.616Z] 16:14:47 INFO - warning: trait objects without an explicit dyn are deprecated
[task 2019-10-23T16:14:47.616Z] 16:14:47 INFO - --> z:/build/build/src/obj-firefox\x86_64-pc-windows-msvc\debug\build\gleam-26545dc4d8d16efe\out/gl_bindings.rs:2641:47
[task 2019-10-23T16:14:47.616Z] 16:14:47 INFO - |
[task 2019-10-23T16:14:47.617Z] 16:14:47 INFO - 2641 | fn do_metaloadfn(loadfn: &mut FnMut(&'static str) -> *const __gl_imports::raw::c_void,
[task 2019-10-23T16:14:47.617Z] 16:14:47 INFO - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use dyn: dyn FnMut(&'static str) -> *const __gl_imports::raw::c_void
[task 2019-10-23T16:14:47.617Z] 16:14:47 INFO - warning: trait objects without an explicit dyn are deprecated
[task 2019-10-23T16:14:47.617Z] 16:14:47 INFO - --> z:/build/build/src/obj-firefox\x86_64-pc-windows-msvc\debug\build\gleam-26545dc4d8d16efe\out/gles_bindings.rs:1401:47
[task 2019-10-23T16:14:47.618Z] 16:14:47 INFO - |
[task 2019-10-23T16:14:47.618Z] 16:14:47 INFO - 1401 | fn do_metaloadfn(loadfn: &mut FnMut(&'static str) -> *const __gl_imports::raw::c_void,
[task 2019-10-23T16:14:47.618Z] 16:14:47 INFO - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use dyn: dyn FnMut(&'static str) -> *const __gl_imports::raw::c_void
[task 2019-10-23T16:14:47.618Z] 16:14:47 INFO - error: build failed
[task 2019-10-23T16:14:47.618Z] 16:14:47 INFO - z:/build/build/src/config/makefiles/rust.mk:259: recipe for target 'force-cargo-library-build' failed
[task 2019-10-23T16:14:47.619Z] 16:14:47 INFO - mozmake.EXE[4]: *** [force-cargo-library-build] Error 101
[task 2019-10-23T16:14:47.619Z] 16:14:47 INFO - mozmake.EXE[4]: Leaving directory 'z:/build/build/src/obj-firefox/toolkit/library/gtest/rust'
[task 2019-10-23T16:14:47.619Z] 16:14:47 INFO - z:/build/build/src/config/recurse.mk:74: recipe for target 'toolkit/library/gtest/rust/target' failed
[task 2019-10-23T16:14:47.619Z] 16:14:47 INFO - mozmake.EXE[3]: *** [toolkit/library/gtest/rust/target] Error 2
[task 2019-10-23T16:14:47.619Z] 16:14:47 INFO - mozmake.EXE[3]: *** Waiting for unfinished jobs....
[task 2019-10-23T16:14:47.619Z] 16:14:47 INFO - mozmake.EXE[4]: Entering directory 'z:/build/build/src/obj-firefox/js/src'
[task 2019-10-23T16:14:47.620Z] 16:14:47 INFO - js/src/Unified_cpp_js_src16.obj
[task 2019-10-23T16:14:47.620Z] 16:14:47 INFO - mozmake.EXE[4]: Leaving directory 'z:/build/build/src/obj-firefox/js/src'
[task 2019-10-23T16:14:47.620Z] 16:14:47 INFO - mozmake.EXE[4]: Entering directory 'z:/build/build/src/obj-firefox/modules/zlib/src'
[task 2019-10-23T16:14:47.620Z] 16:14:47 INFO - modules/zlib/src/deflate.obj

Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Target Milestone: mozilla72 → ---

The failure is:

[task 2019-10-23T16:14:47.577Z] 16:14:47 INFO - cargo:warning=clang: error: no such file or directory: ''@z:/build/build/src/obj-firefox\code_coverage_cflags''

I pushed to try a patch which is basically equivalent to this a few days ago and it worked. So it's either something that landed in-between (chmanchester suggested a rustup) or it wasn't really "basically equivalent".

There's a r+ patch which didn't land and no activity in this bug for 2 weeks.
:marco, could you have a look please?
For more information, please visit auto_nag documentation.

Flags: needinfo?(mcastelluccio)

It landed and was backed-out.

Flags: needinfo?(mcastelluccio)
Assignee: mcastelluccio → nobody
Severity: normal → --
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: