nodejs / node

Node.js JavaScript runtime ✨🐢🚀✨
https://nodejs.org
Other
107.43k stars 29.52k forks source link

Error while running coverage #19057

Closed trivikr closed 4 years ago

trivikr commented 6 years ago

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?

evanlucas commented 6 years ago

I can reproduce on High Sierra. Bisecting now

killagu commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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

nigelhanlon commented 6 years ago

I am having the same issue when running make coverage.

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 commented 6 years ago

Did this ever work?

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

mhdawson commented 6 years ago

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

evanlucas commented 6 years ago

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 commented 6 years ago

@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? :wink:

evanlucas commented 6 years ago

@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 commented 6 years ago

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 commented 6 years ago

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

boneskull commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

^ +1

Trott commented 5 years ago

@trivikr Still happening?

trivikr commented 5 years ago

Reran the following commands on latest commit in master 14707b681da02ef290a986f7613797a3c7ec1ad5

$ ./configure --coverage
$ make coverage

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 commented 5 years ago

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 commented 5 years ago

@nodejs/gyp

boneskull commented 5 years ago

did #24520 fix it?

boneskull commented 5 years ago

I suppose I can just find out myself.

jasnell commented 4 years ago

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