Uh oh!
There was an error while loading. Please reload this page.
tools: fix c++ code coverage on macOS - #24004
Conversation
Recent libtool on macOS does not support the --coverage flag that was being passed through in the final linking stage. This change patches gyp-mac-tool to not pass the --coverage flag through to libtool. It is now possible to generate code coverage for src/ on macOS. Fixes: nodejs#19057
richardlau
commented
Oct 31, 2018
Can we not remove Lines 272 to 291 in c515e5c |
evanlucas
commented
Oct 31, 2018
@richardlau that broke coverage when I tried it |
| libtoolflags = [] | ||
| for libtoolflag in self._Settings().get('OTHER_LDFLAGS', []): | ||
| if libtoolflag == "--coverage": |
There was a problem hiding this comment.
Ok after some digging is seem like the native libtool does not accept any flag that starts with --
Can I suggest this instead of the whole for expression (From L948 to L955)
self.configname=confignamelibtoolflags=self._Settings().get('OTHER_LDFLAGS', [])
# Native macOS libtool does not except any flags with '--' prefixlibtoolflags= [fforfinlibtoolflagsifnotf.startswith('--')]
# TODO(thakis): ARCHS?
refack
left a comment
There was a problem hiding this comment.
IMHO there should be a more direct way.
refack
commented
Oct 31, 2018
Hello @evanlucas I'm going to look into solving this by a more direct means. If I can't I'll dismiss my review. /CC @nodejs/python @nodejs/gyp |
| libtoolflags = [] | ||
| for libtoolflag in self._Settings().get('OTHER_LDFLAGS', []): | ||
| if libtoolflag == "--coverage": |
There was a problem hiding this comment.
Ok after some digging is seem like the native libtool does not accept any flag that starts with --
Can I suggest this instead of the whole for expression (From L948 to L955)
self.configname=confignamelibtoolflags=self._Settings().get('OTHER_LDFLAGS', [])
# Native macOS libtool does not except any flags with '--' prefixlibtoolflags= [fforfinlibtoolflagsifnotf.startswith('--')]
# TODO(thakis): ARCHS?refack
commented
Oct 31, 2018
I've tested my suggestion and it generate the same make scaffolding as the current PR. And allows building |
refack
commented
Oct 31, 2018
I've been thinking about this some more, and I think the settings in Lines 272 to 291 in c515e5c are wrong. They should only be applied to the binary target, not to the libnode.lib indermidiary. I'll work on that tomorrow... |
antsmartian
commented
Nov 3, 2018
Thanks. I added your change and tried running I'm on Mojave 0.14. I even tried cleaning up coverage and run several times, but ended up in the same issue above. Anything I'm missing? |
Trott
commented
Nov 4, 2018
@antsmartian Do you mean @refack's change or @cjihrig's changes in this PR or something else? |
@Trott I have added the changes from this PR: |
cjihrig
commented
Nov 4, 2018
I assume this was supposed to be @evanlucas, but please let me know if I missed something. |
richardlau
commented
Nov 4, 2018
@antsmartian Maybe check what version of |
Trott
commented
Nov 18, 2018
@nodejs/platform-macos @evanlucas@refack Any chance someone can get this unstuck? Seems like it's close.... |
refack
commented
Nov 20, 2018
Alternative PR: #24520 |
Trott
commented
Dec 1, 2018
Since #24520 landed, I assume this can be closed. But if I'm wrong about that, please re-open! |
Recent libtool on macOS does not support the --coverage flag that was
being passed through in the final linking stage.
This change patches gyp-mac-tool to not pass the --coverage flag through
to libtool. It is now possible to generate code coverage for src/ on macOS.
Fixes: #19057
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes