Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error while running coverage #19057

Closed
trivikr opened this issue Feb 28, 2018 · 23 comments
Closed

Error while running coverage #19057

trivikr opened this issue Feb 28, 2018 · 23 comments
Labels
build Issues and PRs related to build files or the CI. macos Issues and PRs related to the macOS platform / OSX.

Comments

@trivikr
Copy link
Member

trivikr commented Feb 28, 2018

  • Version: master
  • Platform: macOS Sierra Version 10.12.6
  • Subsystem: N/A
  • Xcode: Version 9.2 (9C40b)

I tried to run coverage by following the instructions given in https://github.com/nodejs/node/blob/master/BUILDING.md#building-nodejs-1

The following commands were run:

$ ./configure --coverage
$ make coverage

Coverage failed with the following error:

error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: unknown option character `-' in: --coverage
Usage: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool -static [-] file [...] [-filelist listfile[,dirname]] [-arch_only arch] [-sacLT] [-no_warning_for_no_symbols]
Usage: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool -dynamic [-] file [...] [-filelist listfile[,dirname]] [-arch_only arch] [-o output] [-install_name name] [-compatibility_version #] [-current_version #] [-seg1addr 0x#] [-segs_read_only_addr 0x#] [-segs_read_write_addr 0x#] [-seg_addr_table <filename>] [-seg_addr_table_filename <file_system_path>] [-all_load] [-noall_load]
make[1]: *** [/Users/trivikr/workspace/node/out/Release/libnode.a] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [node] Error 2

Is anyone else facing the same issue?

@addaleax addaleax added build Issues and PRs related to build files or the CI. macos Issues and PRs related to the macOS platform / OSX. labels Feb 28, 2018
@evanlucas
Copy link
Contributor

I can reproduce on High Sierra. Bisecting now

@killagu
Copy link
Contributor

killagu commented Mar 1, 2018

It's failed on my mac too. Apple's libtool is not support --coverage.

When I try to fix the coverage bug, I just use the CentOS.

@trivikr Can you try the glibtool?

@jvelezpo
Copy link
Contributor

jvelezpo commented Mar 6, 2018

I can reproduce this on High Sierra.

And I dont know if i should create a new issue, but i found that make doc throws a similar error

error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: unknown option character `-' in: --coverage
Usage: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool -static [-] file [...] [-filelist listfile[,dirname]] [-arch_only arch] [-sacLT] [-no_warning_for_no_symbols]
Usage: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool -dynamic [-] file [...] [-filelist listfile[,dirname]] [-arch_only arch] [-o output] [-install_name name] [-compatibility_version #] [-current_version #] [-seg1addr 0x#] [-segs_read_only_addr 0x#] [-segs_read_write_addr 0x#] [-seg_addr_table <filename>] [-seg_addr_table_filename <file_system_path>] [-all_load] [-noall_load]
make[1]: *** [/Users/sebastian/Desktop/TEMP/node/out/Release/libnode.a] Error 1
rm 11dfd781c7c2539ee10fb0ab5ee933e2636fb641.intermediate
make: *** [node] Error 2

@trivikr
Copy link
Member Author

trivikr commented Mar 6, 2018

@jvelezpo Looks like it's the same error, so new issue is not required.
unknown option character `-' in: --coverage

@nigelhanlon
Copy link

I am having the same issue when running make coverage.

  • Version: master
  • Platform: macOS High Sierra Version 10.13.3.
  • Subsystem: N/A
  • Xcode: Version 9.2 (9C40b)
hello.o /Users/nigelhanlon/Source/node/node/out/Release/obj.target/node_lib/src/tls_wrap.o
error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: unknown option character `-' in: --coverage
Usage: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool -static [-] file [...] [-filelist listfile[,dirname]] [-arch_only arch] [-sacLT] [-no_warning_for_no_symbols]
Usage: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool -dynamic [-] file [...] [-filelist listfile[,dirname]] [-arch_only arch] [-o output] [-install_name name] [-compatibility_version #] [-current_version #] [-seg1addr 0x#] [-segs_read_only_addr 0x#] [-segs_read_write_addr 0x#] [-seg_addr_table <filename>] [-seg_addr_table_filename <file_system_path>] [-all_load] [-noall_load]
make[1]: *** [/Users/nigelhanlon/Source/node/node/out/Release/libnode.a] Error 1
rm 7080b3e45e89e1cd86c4d606e0421ef4647f1b29.intermediate
make: *** [node] Error 2

@boneskull
Copy link
Contributor

Did this ever work?

Using glibtool introduces other errors (like no support for -static)

@mhdawson
Copy link
Member

@boneskull I seem to remember a PR that made coverage work on OSX but I never checked it out myself.

@evanlucas
Copy link
Contributor

This did use to work. (I submitted the PR). I haven't been able to figure out why it no longer works though. I may be able to dig into it again in the next few days

@boneskull
Copy link
Contributor

@evanlucas Were you able to make any progress here? I'm not sure how I'd figure it out short of just bisecting. If you don't have time to look into it yourself, I was wondering if you had any hints? 😉

@evanlucas
Copy link
Contributor

@boneskull nah I haven't been able to make any progress on it. I'd bet it has to do with changes to something that gets pulled in during make coverage, so I'd start by looking if anything gets cloned from that step. I vaguely remember something like that.

@boneskull
Copy link
Contributor

I think #19094 may have fixed this, at least in part. I'll double-check, but it seems like I'm not getting cxx coverage, but am getting JS coverage.

@boneskull
Copy link
Contributor

either way, it's not just dying with some fatal error

@boneskull
Copy link
Contributor

Here's my output from running make coverage against master (as of ~12:30p PDT today): https://gist.github.com/boneskull/0138ce1875a129889c24e08e84e8f035

I get JS coverage, but no cxx coverage. This is macOS 10.13.4.

@JMGordon
Copy link
Contributor

JMGordon commented Jun 14, 2018

I was able to work around this issue, and successfully run coverage, by removing all instances of
'--coverage' under 'xcode_settings' in node.gypi.

@trivikr
Copy link
Member Author

trivikr commented Sep 16, 2018

Just ran the command again, and the error still exists:

Command run:

$ ./configure --coverage
$ make coverage

Output:

error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: unknown option character `-' in: --coverage
Usage: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool -static [-] file [...] [-filelist listfile[,dirname]] [-arch_only arch] [-sacLT] [-no_warning_for_no_symbols]
Usage: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool -dynamic [-] file [...] [-filelist listfile[,dirname]] [-arch_only arch] [-o output] [-install_name name] [-compatibility_version #] [-current_version #] [-seg1addr 0x#] [-segs_read_only_addr 0x#] [-segs_read_write_addr 0x#] [-seg_addr_table <filename>] [-seg_addr_table_filename <file_system_path>] [-all_load] [-noall_load]
make[1]: *** [/Users/trivikr/workspace/node/out/Release/libnode.a] Error 1
rm fe8ab35490735ccf58b5bb5ee41587142c802a9c.intermediate 9c280ee27c161e9cf4be5752a3de68c3efbd84ee.intermediate eadcfc64740f0bee152539c96322dceec2a7e2e0.intermediate
make: *** [node] Error 2

@zzidante

This comment has been minimized.

evanlucas added a commit to evanlucas/node that referenced this issue Oct 31, 2018
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
@Trott
Copy link
Member

Trott commented Nov 25, 2018

@trivikr Still happening?

@trivikr
Copy link
Member Author

trivikr commented Nov 25, 2018

Reran the following commands on latest commit in master 14707b6

$ ./configure --coverage
$ make coverage
  • Platform: macOS Sierra Version 10.12.6
  • Xcode: Version 9.2 (9C40b)

The error still appears:

error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: unknown option character `-' in: --coverage
Usage: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool -static [-] file [...] [-filelist listfile[,dirname]] [-arch_only arch] [-sacLT] [-no_warning_for_no_symbols]
Usage: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool -dynamic [-] file [...] [-filelist listfile[,dirname]] [-arch_only arch] [-o output] [-install_name name] [-compatibility_version #] [-current_version #] [-seg1addr 0x#] [-segs_read_only_addr 0x#] [-segs_read_write_addr 0x#] [-seg_addr_table <filename>] [-seg_addr_table_filename <file_system_path>] [-all_load] [-noall_load]
make[1]: *** [/Users/trivikr/workspace/node/out/Release/libnode.a] Error 1
rm 9c280ee27c161e9cf4be5752a3de68c3efbd84ee.intermediate eb99de95421e51fe982ce7140f9ff76202ab1948.intermediate 188d45c50a358224b69281c9b5680d5150a74d46.intermediate
make: *** [node] Error 2

@nanomosfet
Copy link
Contributor

nanomosfet commented Nov 30, 2018

Still happening here. Any work arounds?

I tried @JMGordon workaround and it seems to work :)

I was able to work around this issue, and successfully run coverage, by removing all instances of
'--coverage' under 'xcode_settings' in node.gypi.

@Trott
Copy link
Member

Trott commented Dec 4, 2018

@nodejs/gyp

@boneskull
Copy link
Contributor

did #24520 fix it?

@boneskull
Copy link
Contributor

I suppose I can just find out myself.

@jasnell
Copy link
Member

jasnell commented Jun 25, 2020

There's been no further activity in well over a year. Closing.

@jasnell jasnell closed this as completed Jun 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Issues and PRs related to build files or the CI. macos Issues and PRs related to the macOS platform / OSX.
Projects
None yet
Development

No branches or pull requests