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 compiling helloworld, node.js 8.3? #222

Closed
ctaggart opened this issue Aug 15, 2017 · 9 comments
Closed

error compiling helloworld, node.js 8.3? #222

ctaggart opened this issue Aug 15, 2017 · 9 comments

Comments

@ctaggart
Copy link

I installed Node, which is version 8.3. Is it compatible?

   Compiling neon v0.1.19
   Compiling neon-helloworld v0.1.0 (file:///C:/Users/camer/ts/neon-helloworld/native)
error: renaming of the library `C` was specified, however this crate contains no #[link(...)] attributes referencing
this library.

error: aborting due to previous error(s)

error: Could not compile `neon-helloworld`.

To learn more, run the command again with --verbose.
neon ERR! cargo build failed

Error: cargo build failed
    at Target.<anonymous> (C:\Users\camer\ts\neon-helloworld\node_modules\neon-cli\dist\neon-cli\target.js:124:35)
    at step (C:\Users\camer\ts\neon-helloworld\node_modules\neon-cli\dist\neon-cli\target.js:32:23)
    at Object.next (C:\Users\camer\ts\neon-helloworld\node_modules\neon-cli\dist\neon-cli\target.js:13:53)
    at fulfilled (C:\Users\camer\ts\neon-helloworld\node_modules\neon-cli\dist\neon-cli\target.js:4:58)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)
Done in 17.43s.

With verbose

     Running `C:\Users\camer\ts\neon-helloworld\native\target\debug\build\neon-10e6b03c08a64c79\build-script-build`
     Running `C:\Users\camer\ts\neon-helloworld\native\target\debug\build\neon-helloworld-ab961cc18098c4ca\build-scri
pt-build`
     Running `rustc --crate-name neon C:\Users\camer\.cargo\registry\src\github.com-1ecc6299db9ec823\neon-0.1.19\src\
lib.rs --crate-type lib --emit=dep-info,link -C debuginfo=2 -C metadata=c1fd326fe713320e -C extra-filename=-c1fd326fe
713320e --out-dir C:\Users\camer\ts\neon-helloworld\native\target\debug\deps -L dependency=C:\Users\camer\ts\neon-hel
loworld\native\target\debug\deps --extern neon_runtime=C:\Users\camer\ts\neon-helloworld\native\target\debug\deps\lib
neon_runtime-3cf2af37de2815be.rlib --extern cslice=C:\Users\camer\ts\neon-helloworld\native\target\debug\deps\libcsli
ce-1f842f2c3778fa27.rlib --cap-lints allow -L native=C:\Users\camer\ts\neon-helloworld\native\target\debug\build\neon
-runtime-dfd76f3d82f144d3\out`




.0\\<(target_arch)\\node -L native=C:\Users\camer\ts\neon-helloworld\native\target\debug\build\neon-runtime-dfd76f3d82f144d3\out`
error: renaming of the library `C` was specified, however this crate contains no #[link(...)] attributes referencing this library.

error: aborting due to previous error(s)

error: Could not compile `neon-helloworld`.

Caused by:
  process didn't exit successfully: `rustc --crate-name neon_helloworld src\lib.rs --crate-type dylib --emit=dep-info,link -C debuginfo=2 -C metadata=80a09b81c4229a9d --out-dir C:\Users\camer\ts\n
eon-helloworld\native\target\debug\deps -L dependency=C:\Users\camer\ts\neon-helloworld\native\target\debug\deps --extern neon=C:\Users\camer\ts\neon-helloworld\native\target\debug\deps\libneon-c1
fd326fe713320e.rlib -L C:\\Users\\camer\\.node-gyp\\8.3.0\Debug -l C:\\Users\\camer\\.node-gyp\\8.3.0\\<(target_arch)\\node -L native=C:\Users\camer\ts\neon-helloworld\native\target\debug\build\ne
on-runtime-dfd76f3d82f144d3\out` (exit code: 101)
C:\Users\camer\ts\neon-helloworld\native>
@ctaggart
Copy link
Author

It looks like it is the Node.js version. I downgraded to the latest LTS version and it works:

     Running `rustc --crate-name neon_helloworld src\lib.rs --crate-type dylib --emit=dep-info,link -C debuginfo=2 -C metadata=80a09b81c4229a9d --out-dir C:\Users\camer\ts\neon-helloworld\native\t
arget\debug\deps -L dependency=C:\Users\camer\ts\neon-helloworld\native\target\debug\deps --extern neon=C:\Users\camer\ts\neon-helloworld\native\target\debug\deps\libneon-c1fd326fe713320e.rlib -L
C:\\Users\\camer\\.node-gyp\\6.11.2\Debug -l node -L native=C:\Users\camer\ts\neon-helloworld\native\target\debug\build\neon-runtime-dfd76f3d82f144d3\out`
    Finished dev [unoptimized + debuginfo] target(s) in 16.84 secs

@ctaggart
Copy link
Author

I was able to build helloworld with Node.js 6.11.2 installed, but I get a native module version mismatch error, see #223. I downgraded to Node.js 8.2.1, but I get the same error as above with 8.3.0.

@ctaggart
Copy link
Author

ctaggart commented Aug 16, 2017

When I search for the error message, the links end up at this pull request:
https://github.com/neon-bindings/neon/pull/221/files

related info: rust-lang/rust#38850 (comment)

I don't understand currently how the Node.js version is related. It is failing the same way with 8.1.4, but working with 8.0.0. cc @hone

@ctaggart
Copy link
Author

Oh I see, this error should indeed be fixed by #221. The errors are complaining about -l C:\\Users\\camer\\.node-gyp\\8.3.0\\<(target_arch)\\node which should just be -l node. That appears to have been broken on Windows with Node.js versions > 8.0.0.

@ctaggart
Copy link
Author

#222 isn't passing tests and isn't quite right yet.

It looks like node-gyp switched to just ia32 and x64 folders at 8.1.0.

C:\users\camer\.node-gyp> Show-Tree.ps1 -MaxDepth 2
+---6.11.2
|   +---ia32
|   +---include
|   +---Release
|   +---x64
+---8.0.0
|   +---Debug
|   +---ia32
|   +---include
|   +---Release
|   +---x64
+---8.1.0
|   +---ia32
|   +---include
|   +---x64
+---8.1.4
|   +---ia32
|   +---include
|   +---x64

When you run

C:\Users\camer\rs\neon\crates\neon-runtime [windows ≡ +1 ~0 -0 !]> npm run configure-release

the output looks like this:

gyp info spawn C:\Users\camer\.windows-build-tools\python27\python.exe
gyp info spawn args [ 'C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\gyp\\gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'msvs',
gyp info spawn args   '-G',
gyp info spawn args   'msvs_version=2017',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\camer\\rs\\neon\\crates\\neon-runtime\\build\\config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\camer\\.node-gyp\\8.0.0\\include\\node\\common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=C:\\Users\\camer\\.node-gyp\\8.0.0',
gyp info spawn args   '-Dnode_gyp_dir=C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp',
gyp info spawn args   '-Dnode_lib_file=node.lib',
gyp info spawn args   '-Dmodule_root_dir=C:\\Users\\camer\\rs\\neon\\crates\\neon-runtime',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'C:\\Users\\camer\\rs\\neon\\crates\\neon-runtime\\build',
gyp info spawn args   '-Goutput_dir=.' ]

With #222, the cargo ends up passing:

cargo:rustc-link-search=C:\\Users\\camer\\.node-gyp\\8.0.0\Release
cargo:rustc-link-search=native=
cargo:rustc-link-lib=node

The 2nd line is what is failing the tests. I'll attempt to rollback some of the changes and see how far I get.

@dfcarpenter
Copy link

I just came across this and love the idea but I am having some problems with getting the helloworld example to build on OSX. I tried node versions, 8.3.0, 8.0.0, and 6.10.0.
Macbook Pro 15 Touchbar
OSX V10.12.6
Rust rustc 1.19.0 (0ade33941 2017-07-17)
Error:

Admins-MacBook-Pro-3:threading-hint dan$ neon build
neon info forcing rebuild for new build settings
neon info running cargo
   Compiling neon-build v0.1.19
   Compiling cslice v0.2.0
   Compiling gcc v0.3.52
   Compiling neon v0.1.19
   Compiling threading-hint v0.1.0 (file:///Users/dan/work/threading-hint/native)
   Compiling neon-runtime v0.1.19
error: failed to run custom build command for `neon-runtime v0.1.19`
process didn't exit successfully: `/Users/dan/work/threading-hint/native/target/release/build/neon-runtime-139fe67be68a432e/build-script-build` (exit code: 101)
--- stdout
Skipping node-gyp installation as part of npm install.

> @ build-release /Users/dan/.cargo/registry/src/github.com-1ecc6299db9ec823/neon-runtime-0.1.19
> node-gyp build

TARGET = Some("x86_64-apple-darwin")
TARGET = Some("x86_64-apple-darwin")
HOST = Some("x86_64-apple-darwin")
AR_x86_64-apple-darwin = None
AR_x86_64_apple_darwin = None
HOST_AR = None
AR = None
TARGET = Some("x86_64-apple-darwin")
TARGET = Some("x86_64-apple-darwin")
running: "ar" "crs" "/Users/dan/work/threading-hint/native/target/release/build/neon-runtime-0af1ff8547b4440d/out/libneon.a" "build/Release/obj.target/neon/src/neon.o"
cargo:warning=ar: build/Release/obj.target/neon/src/neon.o: No such file or directory
exit code: 1

--- stderr
gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
gyp ERR! build error 
gyp ERR! stack Error: You must run `node-gyp configure` first!
gyp ERR! stack     at ReadFileContext.<anonymous> (/Users/dan/.nvm/versions/node/v6.10.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:51:20)
gyp ERR! stack     at ReadFileContext.callback (/Users/dan/.nvm/versions/node/v6.10.0/lib/node_modules/npm/node_modules/graceful-fs/graceful-fs.js:78:16)
gyp ERR! stack     at FSReqWrap.readFileAfterOpen [as oncomplete] (fs.js:365:13)
gyp ERR! System Darwin 16.7.0
gyp ERR! command "/Users/dan/.nvm/versions/node/v6.10.0/bin/node" "/Users/dan/.nvm/versions/node/v6.10.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build"
gyp ERR! cwd /Users/dan/.cargo/registry/src/github.com-1ecc6299db9ec823/neon-runtime-0.1.19
gyp ERR! node -v v6.10.0
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok 

npm ERR! Darwin 16.7.0
npm ERR! argv "/Users/dan/.nvm/versions/node/v6.10.0/bin/node" "/Users/dan/.nvm/versions/node/v6.10.0/bin/npm" "run" "build-release"
npm ERR! node v6.10.0
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! @ build-release: `node-gyp build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the @ build-release script 'node-gyp build'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the  package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp build
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs 
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls 
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/dan/.cargo/registry/src/github.com-1ecc6299db9ec823/neon-runtime-0.1.19/npm-debug.log
thread 'main' panicked at '

Internal error occurred: Command "ar" "crs" "/Users/dan/work/threading-hint/native/target/release/build/neon-runtime-0af1ff8547b4440d/out/libneon.a" "build/Release/obj.target/neon/src/neon.o" with args "ar" did not execute successfully (status code exit code: 1).

', /Users/dan/.cargo/registry/src/github.com-1ecc6299db9ec823/gcc-0.3.52/src/lib.rs:1654
note: Run with `RUST_BACKTRACE=1` for a backtrace.

neon ERR! cargo build failed

Error: cargo build failed
    at Target.<anonymous> (/Users/dan/.nvm/versions/node/v6.10.0/lib/node_modules/neon-cli/dist/neon-cli/target.js:124:35)
    at step (/Users/dan/.nvm/versions/node/v6.10.0/lib/node_modules/neon-cli/dist/neon-cli/target.js:32:23)
    at Object.next (/Users/dan/.nvm/versions/node/v6.10.0/lib/node_modules/neon-cli/dist/neon-cli/target.js:13:53)
    at fulfilled (/Users/dan/.nvm/versions/node/v6.10.0/lib/node_modules/neon-cli/dist/neon-cli/target.js:4:58)
    at process._tickCallback (internal/process/next_tick.js:103:7)
Admins-MacBook-Pro-3:threading-hint dan$ 

@ctaggart
Copy link
Author

ctaggart commented Aug 18, 2017

@dfcarpenter, the error I created this issue was related a Windows problem related to node-gyp and I think it is fixed with #221. You are on macOS, so a bit different, but looks node-gyp related as well. Did you try running node-gyp configure like the error ERR! stack Error: You must run 'node-gyp configure' first! mentioned?

@dfcarpenter
Copy link

Running node-gyp configure produces this:

Admins-MacBook-Pro-3:threading-hint dan$ node-gyp configure
gyp info it worked if it ends with ok
gyp info using node-gyp@3.6.2
gyp info using node@6.10.0 | darwin | x64
gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
gyp http GET https://nodejs.org/dist/v6.10.0/node-v6.10.0-headers.tar.gz
gyp http 200 https://nodejs.org/dist/v6.10.0/node-v6.10.0-headers.tar.gz
gyp http GET https://nodejs.org/dist/v6.10.0/SHASUMS256.txt
gyp http 200 https://nodejs.org/dist/v6.10.0/SHASUMS256.txt
gyp info spawn /Users/dan/.pyenv/shims/python2
gyp info spawn args [ '/Users/dan/.nvm/versions/node/v6.10.0/lib/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'make',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/dan/work/threading-hint/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/dan/.nvm/versions/node/v6.10.0/lib/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/dan/.node-gyp/6.10.0/include/node/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/Users/dan/.node-gyp/6.10.0',
gyp info spawn args   '-Dnode_gyp_dir=/Users/dan/.nvm/versions/node/v6.10.0/lib/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/Users/dan/.node-gyp/6.10.0/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/Users/dan/work/threading-hint',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'build',
gyp info spawn args   '-Goutput_dir=.' ]
gyp: binding.gyp not found (cwd: /Users/dan/work/threading-hint) while trying to load binding.gyp
gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/Users/dan/.nvm/versions/node/v6.10.0/lib/node_modules/node-gyp/lib/configure.js:336:16)
gyp ERR! stack     at emitTwo (events.js:106:13)
gyp ERR! stack     at ChildProcess.emit (events.js:191:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
gyp ERR! System Darwin 16.7.0
gyp ERR! command "/Users/dan/.nvm/versions/node/v6.10.0/bin/node" "/Users/dan/.nvm/versions/node/v6.10.0/bin/node-gyp" "configure"
gyp ERR! cwd /Users/dan/work/threading-hint
gyp ERR! node -v v6.10.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok 

@ctaggart
Copy link
Author

The issue I reported here is fixed for me with #221. @dfcarpenter, if you continue to have issues on macOS, can you open a separate issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants