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: Neon only builds with --release. For tests, try `cargo test --release`. #357

Open
mlengse opened this Issue Sep 15, 2018 · 2 comments

Comments

Projects
None yet
3 participants
@mlengse
Copy link

mlengse commented Sep 15, 2018

environment

  • windows 10 pro 1083 OS build 17134.191
  • system type 64-bit OS, x64-based processor
  • rustc 1.29.0 (aa3ca1994 2018-09-11)
  • cargo 1.29.0 (524a578d7 2018-08-05)
  • node v8.11.3
  • npm 6.4.1
  • yarn v1.9.4
  • msvs_version 2015
  • python 2.7.14
  • neon 0.2.0

step

  • npm install --global --production windows-build-tools
  • npm install --global neon-cli
  • neon new threading-hint
  • cd threading-hint
  • yarn

error message

yarn install v1.9.4
info No lockfile found.
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Saved lockfile.
$ neon build
[##############################################################------------------------------------------------] 96/171neon info forcing rebuild for new build settings
neon info running cargo
    Updating registry `https://github.com/rust-lang/crates.io-index`
   Compiling version_check v0.1.4
   Compiling libc v0.2.43
   Compiling regex v0.2.11
   Compiling ucd-util v0.1.1
   Compiling utf8-ranges v1.0.1
   Compiling gcc v0.3.54
   Compiling neon-build v0.2.0
   Compiling semver-parser v0.7.0
   Compiling cslice v0.2.0
   Compiling memchr v2.0.2
   Compiling regex-syntax v0.5.6
   Compiling lazy_static v1.1.0
   Compiling neon v0.2.0
   Compiling threading-hint v0.1.0 (file:///E:/proj/threading-hint/native)
   Compiling aho-corasick v0.6.8
   Compiling semver v0.9.0
   Compiling thread_local v0.3.6
   Compiling neon-runtime v0.2.0
error: Neon only builds with --release. For tests, try `cargo test --release`.
   --> C:\Users\USER\.cargo\registry\src\github.com-1ecc6299db9ec823\neon-0.2.0\src\lib.rs:288:1
    |
288 | compile_error!("Neon only builds with --release. For tests, try `cargo test --release`.");
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to previous error

error: Could not compile `neon`.

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

Error: cargo build failed
    at Target.<anonymous> (E:\proj\threading-hint\node_modules\neon-cli\lib\target.js:121:35)
    at step (E:\proj\threading-hint\node_modules\neon-cli\lib\target.js:32:23)
    at Object.next (E:\proj\threading-hint\node_modules\neon-cli\lib\target.js:13:53)
    at fulfilled (E:\proj\threading-hint\node_modules\neon-cli\lib\target.js:4:58)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

additional step

  • cd native
  • cargo test --release

result ok

   Compiling version_check v0.1.4
   Compiling libc v0.2.43
   Compiling ucd-util v0.1.1
   Compiling regex v0.2.11
   Compiling utf8-ranges v1.0.1
   Compiling gcc v0.3.54
   Compiling neon-build v0.2.0
   Compiling semver-parser v0.7.0
   Compiling cslice v0.2.0
   Compiling memchr v2.0.2
   Compiling regex-syntax v0.5.6
   Compiling lazy_static v1.1.0
   Compiling neon v0.2.0
   Compiling threading-hint v0.1.0 (file:///E:/proj/threading-hint/native)
   Compiling aho-corasick v0.6.8
   Compiling semver v0.9.0
   Compiling thread_local v0.3.6
   Compiling neon-runtime v0.2.0
    Finished release [optimized] target(s) in 1m 04s
     Running target\release\deps\threading_hint-b2f5de0c8ba20141.exe

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out

Do i missed some step or configuration?

@olup

This comment has been minimized.

Copy link

olup commented Oct 25, 2018

Same here, just run it with the release flag, no ? like neon build --release

@dialogbox

This comment has been minimized.

Copy link

dialogbox commented Nov 18, 2018

Similar, but little different here.

My Environments

% neon version
0.2.0
% node -v
v11.2.0
% npm -v
6.4.1
% rustup show
Default host: x86_64-apple-darwin

stable-x86_64-apple-darwin (default)
rustc 1.30.1 (1433507eb 2018-11-07)

Build and run itself is ok.

% neon new my-project
...
% cd my-project
% neon build
neon info forcing rebuild for new build settings
neon info running cargo
    Updating crates.io index
   Compiling version_check v0.1.5
   Compiling cfg-if v0.1.6
   Compiling libc v0.2.43
   Compiling ucd-util v0.1.3
   Compiling regex v0.2.11
   Compiling lazy_static v1.2.0
   Compiling utf8-ranges v1.0.2
   Compiling gcc v0.3.55
   Compiling neon-build v0.2.0
   Compiling semver-parser v0.7.0
   Compiling cslice v0.2.0
   Compiling regex-syntax v0.5.6
   Compiling memchr v2.1.1
   Compiling thread_local v0.3.6
   Compiling neon v0.2.0
   Compiling my-project v0.1.0 (/Users/dialogbox/works/rust/my-project/native)
   Compiling semver v0.9.0
   Compiling aho-corasick v0.6.9
   Compiling neon-runtime v0.2.0
    Finished dev [unoptimized + debuginfo] target(s) in 16.84s
neon info generating native/index.node
% node -e 'require("./")'
hello node

But, cargo test fails.

% cd native
% cargo test
   Compiling my-project v0.1.0 (/Users/dialogbox/works/rust/my-project/native)
error: linking with `cc` failed: exit code: 1
  |
  = note: "cc" "-m64" "-L" "/Users/dialogbox/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib" "/Users/dialogbox/works/rust/my-project/native/target/debug/deps/my_project-07ec78272dd7cf7e.14epkf1b9s0eu4lx.rcgu.o" "/Users/dialogbox/works/rust/my-project/native/target/debug/deps/my_project-07ec78272dd7cf7e.14mgytbfuj2h4z0v.rcgu.o" "/Users/dialogbox/works/rust/my-project/native/target/debug/deps/my_project-07ec78272dd7cf7e.1gxpkm8fdjdavua5.rcgu.o" "/Users/dialogbox/works/rust/my-project/native/target/debug/deps/my_project-07ec78272dd7cf7e.1wor61c1ey36etk8.rcgu.o" "/Users/dialogbox/works/rust/my-project/native/target/debug/deps/my_project-07ec78272dd7cf7e.23e8pyazmgu3e389.rcgu.o" "/Users/dialogbox/works/rust/my-project/native/target/debug/deps/my_project-07ec78272dd7cf7e.2b4x87fd6kqn94bu.rcgu.o" "/Users/dialogbox/works/rust/my-project/native/target/debug/deps/my_project-07ec78272dd7cf7e.2eyi022e5k1uw0gc.rcgu.o" "/Users/dialogbox/works/rust/my-project/native/target/debug/deps/my_project-07ec78272dd7cf7e.2m2teyp6596owcoh.rcgu.o" "/Users/dialogbox/works/rust/my-project/native/target/debug/deps/my_project-07ec78272dd7cf7e.2o29w6mw6r2zavyp.rcgu.o" "/Users/dialogbox/works/rust/my-project/native/target/debug/deps/my_project-07ec78272dd7cf7e.2qgcxusy3crbrtot.rcgu.o" "/Users/dialogbox/works/rust/my-project/native/target/debug/deps/my_project-07ec78272dd7cf7e.3015gbbydlzlhstk.rcgu.o" "/Users/dialogbox/works/rust/my-project/native/target/debug/deps/my_project-07ec78272dd7cf7e.3mxkp2jzsftrlj3n.rcgu.o" "/Users/dialogbox/works/rust/my-project/native/target/debug/deps/my_project-07ec78272dd7cf7e.3qtj9hj1ouu2pga3.rcgu.o" "/Users/dialogbox/works/rust/my-project/native/target/debug/deps/my_project-07ec78272dd7cf7e.3ucmrxxiet7mg5nj.rcgu.o" "/Users/dialogbox/works/rust/my-project/native/target/debug/deps/my_project-07ec78272dd7cf7e.466d9pval0vf9hvs.rcgu.o" "/Users/dialogbox/works/rust/my-project/native/target/debug/deps/my_project-07ec78272dd7cf7e.4arr4zizqwsnr22p.rcgu.o" "/Users/dialogbox/works/rust/my-project/native/target/debug/deps/my_project-07ec78272dd7cf7e.4cw8aeyq1ax1acuc.rcgu.o" "/Users/dialogbox/works/rust/my-project/native/target/debug/deps/my_project-07ec78272dd7cf7e.4dxv5hg4hxe9arxs.rcgu.o" "/Users/dialogbox/works/rust/my-project/native/target/debug/deps/my_project-07ec78272dd7cf7e.4oe4w2qhku5wzzny.rcgu.o" "/Users/dialogbox/works/rust/my-project/native/target/debug/deps/my_project-07ec78272dd7cf7e.4ot4ygm7vwx4i2ry.rcgu.o" "/Users/dialogbox/works/rust/my-project/native/target/debug/deps/my_project-07ec78272dd7cf7e.4q5kyru7gzu0bdp6.rcgu.o" "/Users/dialogbox/works/rust/my-project/native/target/debug/deps/my_project-07ec78272dd7cf7e.4qaviprejw6vfdt6.rcgu.o" "/Users/dialogbox/works/rust/my-project/native/target/debug/deps/my_project-07ec78272dd7cf7e.553dzu3pgi8bk4vh.rcgu.o" "/Users/dialogbox/works/rust/my-project/native/target/debug/deps/my_project-07ec78272dd7cf7e.556uoze9yki50qvz.rcgu.o" "/Users/dialogbox/works/rust/my-project/native/target/debug/deps/my_project-07ec78272dd7cf7e.7gems98o2bpvo0a.rcgu.o" "/Users/dialogbox/works/rust/my-project/native/target/debug/deps/my_project-07ec78272dd7cf7e.f6v5kbadjn7e56z.rcgu.o" "/Users/dialogbox/works/rust/my-project/native/target/debug/deps/my_project-07ec78272dd7cf7e.seaa2imba682v2m.rcgu.o" "-o" "/Users/dialogbox/works/rust/my-project/native/target/debug/deps/my_project-07ec78272dd7cf7e" "/Users/dialogbox/works/rust/my-project/native/target/debug/deps/my_project-07ec78272dd7cf7e.1ml3bdzfsnw6ouub.rcgu.o" "-Wl,-dead_strip" "-nodefaultlibs" "-L" "/Users/dialogbox/works/rust/my-project/native/target/debug/deps" "-L" "/Users/dialogbox/works/rust/my-project/native/target/debug/build/neon-runtime-8bc2027f8ac5020b/out" "-L" "/Users/dialogbox/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib" "/Users/dialogbox/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libtest-c2b92ef38bc65339.rlib" "/Users/dialogbox/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libterm-6349508393622615.rlib" "/Users/dialogbox/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libgetopts-f1e85f00c34fa59c.rlib" "/Users/dialogbox/works/rust/my-project/native/target/debug/deps/libneon-a8c3ebd2089333f8.rlib" "/Users/dialogbox/works/rust/my-project/native/target/debug/deps/libsemver-c9201ffb83659839.rlib" "/Users/dialogbox/works/rust/my-project/native/target/debug/deps/libsemver_parser-a914c88bd9416303.rlib" "/Users/dialogbox/works/rust/my-project/native/target/debug/deps/libcslice-07c1a1164871e0f1.rlib" "/Users/dialogbox/works/rust/my-project/native/target/debug/deps/libneon_runtime-6f2797e2fc93d4a1.rlib" "/Users/dialogbox/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libstd-a5984f6fc2a4870f.rlib" "/Users/dialogbox/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libpanic_unwind-7c9487d161f01b59.rlib" "/Users/dialogbox/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liballoc_jemalloc-e146b9b98ab73364.rlib" "/Users/dialogbox/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libunwind-acb39784a181deae.rlib" "/Users/dialogbox/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liballoc_system-89f97a4bae8c89d2.rlib" "/Users/dialogbox/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liblibc-cd336d4bb1fade3c.rlib" "/Users/dialogbox/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liballoc-d6545438808205eb.rlib" "/Users/dialogbox/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libcore-8aa8397108285683.rlib" "/Users/dialogbox/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libcompiler_builtins-83c21e81fef8188c.rlib" "-lSystem" "-lresolv" "-lpthread" "-lc" "-lm"
  = note: Undefined symbols for architecture x86_64:
            "v8::V8::ToLocalEmpty()", referenced from:
                v8::MaybeLocal<v8::String>::ToLocalChecked() in libneon_runtime-6f2797e2fc93d4a1.rlib(neon.o)
            "v8::Isolate::ThrowException(v8::Local<v8::Value>)", referenced from:
                Nan::ThrowError(v8::Local<v8::Value>) in libneon_runtime-6f2797e2fc93d4a1.rlib(neon.o)
                Nan::ThrowError(char const*) in libneon_runtime-6f2797e2fc93d4a1.rlib(neon.o)
            "v8::HandleScope::~HandleScope()", referenced from:
                Nan::Set(v8::Local<v8::Object>, v8::Local<v8::Value>, v8::Local<v8::Value>) in libneon_runtime-6f2797e2fc93d4a1.rlib(neon.o)
                _Neon_Scope_Exit in libneon_runtime-6f2797e2fc93d4a1.rlib(neon.o)
                Nan::HandleScope::~HandleScope() in libneon_runtime-6f2797e2fc93d4a1.rlib(neon.o)
            "v8::External::Value() const", referenced from:
                _Neon_Fun_GetDynamicCallback in libneon_runtime-6f2797e2fc93d4a1.rlib(neon.o)
            "v8::Function::New(v8::Local<v8::Context>, void (*)(v8::FunctionCallbackInfo<v8::Value> const&), v8::Local<v8::Value>, int, v8::ConstructorBehavior, v8::SideEffectType)", referenced from:
                _Neon_Fun_New in libneon_runtime-6f2797e2fc93d4a1.rlib(neon.o)
            "v8::Isolate::GetCurrentContext()", referenced from:
                Nan::Set(v8::Local<v8::Object>, v8::Local<v8::Value>, v8::Local<v8::Value>) in libneon_runtime-6f2797e2fc93d4a1.rlib(neon.o)
                _Neon_Fun_New in libneon_runtime-6f2797e2fc93d4a1.rlib(neon.o)
            "v8::Exception::Error(v8::Local<v8::String>)", referenced from:
                _Neon_Error_ThrowErrorFromUtf8 in libneon_runtime-6f2797e2fc93d4a1.rlib(neon.o)
                Nan::ThrowError(char const*) in libneon_runtime-6f2797e2fc93d4a1.rlib(neon.o)
            "v8::Object::Set(v8::Local<v8::Context>, v8::Local<v8::Value>, v8::Local<v8::Value>)", referenced from:
                Nan::Set(v8::Local<v8::Object>, v8::Local<v8::Value>, v8::Local<v8::Value>) in libneon_runtime-6f2797e2fc93d4a1.rlib(neon.o)
            "v8::Isolate::GetCurrent()", referenced from:
                _Neon_Call_CurrentIsolate in libneon_runtime-6f2797e2fc93d4a1.rlib(neon.o)
                Neon_ASCII_Key(v8::Local<v8::String>*, unsigned char const*, int) in libneon_runtime-6f2797e2fc93d4a1.rlib(neon.o)
                Nan::Set(v8::Local<v8::Object>, v8::Local<v8::Value>, v8::Local<v8::Value>) in libneon_runtime-6f2797e2fc93d4a1.rlib(neon.o)
                Nan::ThrowError(v8::Local<v8::Value>) in libneon_runtime-6f2797e2fc93d4a1.rlib(neon.o)
                _Neon_Error_ThrowErrorFromUtf8 in libneon_runtime-6f2797e2fc93d4a1.rlib(neon.o)
                Nan::ThrowError(char const*) in libneon_runtime-6f2797e2fc93d4a1.rlib(neon.o)
                Nan::HandleScope::HandleScope() in libneon_runtime-6f2797e2fc93d4a1.rlib(neon.o)
                ...
            "v8::External::New(v8::Isolate*, void*)", referenced from:
                _Neon_Fun_New in libneon_runtime-6f2797e2fc93d4a1.rlib(neon.o)
            "v8::HandleScope::HandleScope(v8::Isolate*)", referenced from:
                Nan::Set(v8::Local<v8::Object>, v8::Local<v8::Value>, v8::Local<v8::Value>) in libneon_runtime-6f2797e2fc93d4a1.rlib(neon.o)
                _Neon_Scope_Enter in libneon_runtime-6f2797e2fc93d4a1.rlib(neon.o)
                Nan::HandleScope::HandleScope() in libneon_runtime-6f2797e2fc93d4a1.rlib(neon.o)
            "v8::String::NewFromUtf8(v8::Isolate*, char const*, v8::NewStringType, int)", referenced from:
                Neon_ASCII_Key(v8::Local<v8::String>*, unsigned char const*, int) in libneon_runtime-6f2797e2fc93d4a1.rlib(neon.o)
                _Neon_String_New in libneon_runtime-6f2797e2fc93d4a1.rlib(neon.o)
                _Neon_Error_ThrowErrorFromUtf8 in libneon_runtime-6f2797e2fc93d4a1.rlib(neon.o)
                Nan::imp::Factory<v8::String>::New(char const*, int) in libneon_runtime-6f2797e2fc93d4a1.rlib(neon.o)
            "v8::V8::FromJustIsNothing()", referenced from:
                v8::Maybe<bool>::FromJust() const in libneon_runtime-6f2797e2fc93d4a1.rlib(neon.o)
            "_node_module_register", referenced from:
                my_project::__LOAD_NEON_MODULE::__load_neon_module::h21032fe34cbef846 in my_project-07ec78272dd7cf7e.f6v5kbadjn7e56z.rcgu.o
          ld: symbol(s) not found for architecture x86_64
          clang: error: linker command failed with exit code 1 (use -v to see invocation)


error: aborting due to previous error

error: Could not compile `my-project`.

To learn more, run the command again with --verbose.

cargo test --release works.

% cargo test --release
   Compiling version_check v0.1.5
   Compiling cfg-if v0.1.6
   Compiling libc v0.2.43
   Compiling lazy_static v1.2.0
   Compiling ucd-util v0.1.3
   Compiling regex v0.2.11
   Compiling utf8-ranges v1.0.2
   Compiling gcc v0.3.55
   Compiling neon-build v0.2.0
   Compiling semver-parser v0.7.0
   Compiling cslice v0.2.0
   Compiling thread_local v0.3.6
   Compiling regex-syntax v0.5.6
   Compiling memchr v2.1.1
   Compiling neon v0.2.0
   Compiling my-project v0.1.0 (/Users/dialogbox/works/rust/my-project/native)
   Compiling semver v0.9.0
   Compiling aho-corasick v0.6.9
   Compiling neon-runtime v0.2.0
    Finished release [optimized] target(s) in 21.26s
     Running target/release/deps/my_project-cd47d2683dbb12d3

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment