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

nodejs: ship with development headers #35568

Merged
merged 1 commit into from Feb 27, 2018
Merged

Conversation

zimbatm
Copy link
Member

@zimbatm zimbatm commented Feb 25, 2018

Motivation for this change

the headers are used by node-gyp to build C extensions and need to match
the exact node version that is going to be used at runtime.

This allows to install the headers in other node build environment like yarn2nix

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

@GrahamcOfBorg
Copy link

Failure on aarch64-linux (full log)

Partial log (click to expand)

        --release-urlbase= \
         --download=all --with-intl=small-icu
Usage: configure [options]

configure: error: option --dest-cpu: invalid choice: 'aarch64' (choose from 'arm', 'arm64', 'ia32', 'mips', 'mipsel', 'mips64el', 'ppc', 'ppc64', 'x32', 'x64', 'x86', 's390', 's390x')
make: *** [Makefile:664: node-v6.13.0.tar-headers] Error 2
builder for '/nix/store/mdr99p34wa40k0r8lphmq2mm8gc4j5zk-nodejs-headers-6.13.0.tar.gz.drv' failed with exit code 2
cannot build derivation '/nix/store/aj15nancvm6whjfc226p0lsqs83fmwib-nodejs-install-headers.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/2d58k6p6qax0dyk2h9qpfr0j2mg61hsw-nodejs-6.13.0.drv': 1 dependencies couldn't be built
�[31;1merror:�[0m build of '/nix/store/2d58k6p6qax0dyk2h9qpfr0j2mg61hsw-nodejs-6.13.0.drv' failed

@GrahamcOfBorg
Copy link

Failure on x86_64-darwin (full log)

Partial log (click to expand)

                 'want_separate_host_toolset': 0,
                 'xcode_version': 0}}
creating config.gypi
creating config.mk
Error running GYP
make: *** [Makefile:664: node-v6.13.0.tar-headers] Error 1
builder for '/nix/store/qb2kr6rcdq5fni2iapqcscfsmcjjk63l-nodejs-headers-6.13.0.tar.gz.drv' failed with exit code 2
cannot build derivation '/nix/store/191xijvga2n8imn1h74lv0lifj0n798c-nodejs-install-headers.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/8icxavynzkv9238bnlzamf1szzx2y22d-nodejs-6.13.0.drv': 1 dependencies couldn't be built
error: build of '/nix/store/8icxavynzkv9238bnlzamf1szzx2y22d-nodejs-6.13.0.drv' failed

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Partial log (click to expand)

gzipping man pages under /nix/store/337mwnh184war0hf7gpn7k90k7qjxc2p-nodejs-6.13.0/share/man/
strip is /nix/store/b0zlxla7dmy1iwc3g459rjznx59797xy-binutils-2.28.1/bin/strip
stripping (with command strip and flags -S) in /nix/store/337mwnh184war0hf7gpn7k90k7qjxc2p-nodejs-6.13.0/lib  /nix/store/337mwnh184war0hf7gpn7k90k7qjxc2p-nodejs-6.13.0/bin 
patching script interpreter paths in /nix/store/337mwnh184war0hf7gpn7k90k7qjxc2p-nodejs-6.13.0
checking for references to /tmp/nix-build-nodejs-6.13.0.drv-0 in /nix/store/337mwnh184war0hf7gpn7k90k7qjxc2p-nodejs-6.13.0...
shrinking RPATHs of ELF executables and libraries in /nix/store/132qa5in1lp3kq8q43hq8m31mclcwbkq-nodejs-6.13.0-dev
strip is /nix/store/b0zlxla7dmy1iwc3g459rjznx59797xy-binutils-2.28.1/bin/strip
stripping (with command strip and flags -S) in /nix/store/132qa5in1lp3kq8q43hq8m31mclcwbkq-nodejs-6.13.0-dev/bin 
patching script interpreter paths in /nix/store/132qa5in1lp3kq8q43hq8m31mclcwbkq-nodejs-6.13.0-dev
checking for references to /tmp/nix-build-nodejs-6.13.0.drv-0 in /nix/store/132qa5in1lp3kq8q43hq8m31mclcwbkq-nodejs-6.13.0-dev...

@zimbatm zimbatm changed the title nodejs: ship with development headers WIP: nodejs: ship with development headers Feb 25, 2018
@zimbatm
Copy link
Member Author

zimbatm commented Feb 25, 2018

The nodejs package already has an /include/node folder but it's missing some files:

0a1
> android-ifaddrs.h
12a14,30
> openssl
> pthread-barrier.h
> stdint-msvc2008.h
> tree.h
> uv-aix.h
> uv-bsd.h
> uv-darwin.h
> uv-errno.h
> uv.h
> uv-linux.h
> uv-os390.h
> uv-posix.h
> uv-sunos.h
> uv-threadpool.h
> uv-unix.h
> uv-version.h
> uv-win.h
21a40,41
> zconf.h
> zlib.h

Maybe there is a way to generate those at build time..

Provide all the development headers to node-gyp
@zimbatm
Copy link
Member Author

zimbatm commented Feb 25, 2018

@GrahamcOfBorg build nodejs

@zimbatm zimbatm changed the title WIP: nodejs: ship with development headers nodejs: ship with development headers Feb 25, 2018
@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Partial log (click to expand)

/nix/store/ygaswcr6xmwypzms32dglzb9ck26wn5k-nodejs-6.13.0/lib/node_modules/npm/cli.js: interpreter directive changed from "/usr/bin/env node" to "/nix/store/ygaswcr6xmwypzms32dglzb9ck26wn5k-nodejs-6.13.0/bin/node"
post-installation fixup
shrinking RPATHs of ELF executables and libraries in /nix/store/ygaswcr6xmwypzms32dglzb9ck26wn5k-nodejs-6.13.0
shrinking /nix/store/ygaswcr6xmwypzms32dglzb9ck26wn5k-nodejs-6.13.0/bin/node
gzipping man pages under /nix/store/ygaswcr6xmwypzms32dglzb9ck26wn5k-nodejs-6.13.0/share/man/
strip is /nix/store/lvx1acn1ig1j2km8jds5x3ggh3f2wa8v-binutils-2.28.1/bin/strip
stripping (with command strip and flags -S) in /nix/store/ygaswcr6xmwypzms32dglzb9ck26wn5k-nodejs-6.13.0/lib  /nix/store/ygaswcr6xmwypzms32dglzb9ck26wn5k-nodejs-6.13.0/bin
patching script interpreter paths in /nix/store/ygaswcr6xmwypzms32dglzb9ck26wn5k-nodejs-6.13.0
checking for references to /build in /nix/store/ygaswcr6xmwypzms32dglzb9ck26wn5k-nodejs-6.13.0...
/nix/store/ygaswcr6xmwypzms32dglzb9ck26wn5k-nodejs-6.13.0

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Partial log (click to expand)

/nix/store/zpa0sg1q6l7hls48nxyamj9za5al6db4-nodejs-6.13.0/lib/node_modules/npm/scripts/maketest: interpreter directive changed from "/usr/bin/env node" to "/nix/store/zpa0sg1q6l7hls48nxyamj9za5al6db4-nodejs-6.13.0/bin/node"
/nix/store/zpa0sg1q6l7hls48nxyamj9za5al6db4-nodejs-6.13.0/lib/node_modules/npm/scripts/index-build.js: interpreter directive changed from "/usr/bin/env node" to "/nix/store/zpa0sg1q6l7hls48nxyamj9za5al6db4-nodejs-6.13.0/bin/node"
post-installation fixup
shrinking RPATHs of ELF executables and libraries in /nix/store/zpa0sg1q6l7hls48nxyamj9za5al6db4-nodejs-6.13.0
shrinking /nix/store/zpa0sg1q6l7hls48nxyamj9za5al6db4-nodejs-6.13.0/bin/node
gzipping man pages under /nix/store/zpa0sg1q6l7hls48nxyamj9za5al6db4-nodejs-6.13.0/share/man/
strip is /nix/store/b0zlxla7dmy1iwc3g459rjznx59797xy-binutils-2.28.1/bin/strip
stripping (with command strip and flags -S) in /nix/store/zpa0sg1q6l7hls48nxyamj9za5al6db4-nodejs-6.13.0/lib  /nix/store/zpa0sg1q6l7hls48nxyamj9za5al6db4-nodejs-6.13.0/bin 
patching script interpreter paths in /nix/store/zpa0sg1q6l7hls48nxyamj9za5al6db4-nodejs-6.13.0
checking for references to /tmp/nix-build-nodejs-6.13.0.drv-0 in /nix/store/zpa0sg1q6l7hls48nxyamj9za5al6db4-nodejs-6.13.0...

@GrahamcOfBorg
Copy link

Failure on x86_64-darwin (full log)

Partial log (click to expand)

                          ^
../deps/v8/src/crankshaft/lithium.h:322:45: note: add an explicit instantiation declaration to suppress this warning if 'v8::internal::LSubKindOperand<v8::internal::LOperand::Kind::STACK_SLOT, 128>::cache' is explicitly instantiated in another translation unit
    if (index < kNumCachedOperands) return &cache[index];
                                            ^
2 warnings generated.
  clang++ '-D_DARWIN_USE_64_BIT_INODE=1' '-DV8_TARGET_ARCH_X64' '-DENABLE_DISASSEMBLER' '-DV8_I18N_SUPPORT' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' '-DUCONFIG_NO_TRANSLITERATION=1' '-DUCONFIG_NO_SERVICE=1' '-DUCONFIG_NO_REGULAR_EXPRESSIONS=1' '-DU_ENABLE_DYLOAD=0' '-DU_STATIC_IMPLEMENTATION=1' '-DU_HAVE_STD_STRING=0' '-DUCONFIG_NO_BREAK_ITERATION=0' '-DUCONFIG_NO_LEGACY_CONVERSION=1' '-DUCONFIG_NO_CONVERSION=1' -I../deps/v8 -I../deps -I/nix/store/cnc0bkx679bir5911vjkhbmgzz01dw50-zlib-1.2.11-dev/include -I/nix/store/wcyj6bymy0y1bql8rh9x12xggcb1b5i7-libuv-1.19.1/include -I/nix/store/10r3ph2pz4z3yxxjnvnqkkvn5pz01ipm-openssl-1.0.2n-dev/include -I../deps/icu-small/source/i18n -I../deps/icu-small/source/common  -O3 -gdwarf-2 -fstrict-aliasing -mmacosx-version-min=10.7 -arch x86_64 -Wall -Wendif-labels -W -Wno-unused-parameter -std=gnu++0x -fno-rtti -fno-exceptions -fno-threadsafe-statics -fno-strict-aliasing -MMD -MF /private/tmp/nix-build-nodejs-6.13.0.drv-0/node-v6.13.0/out/Release/.deps//private/tmp/nix-build-nodejs-6.13.0.drv-0/node-v6.13.0/out/Release/obj.target/v8_base/deps/v8/src/full-codegen/x64/full-codegen-x64.o.d.raw   -c -o /private/tmp/nix-build-nodejs-6.13.0.drv-0/node-v6.13.0/out/Release/obj.target/v8_base/deps/v8/src/full-codegen/x64/full-codegen-x64.o ../deps/v8/src/full-codegen/x64/full-codegen-x64.cc
  clang++ '-D_DARWIN_USE_64_BIT_INODE=1' '-DV8_TARGET_ARCH_X64' '-DENABLE_DISASSEMBLER' '-DV8_I18N_SUPPORT' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' '-DUCONFIG_NO_TRANSLITERATION=1' '-DUCONFIG_NO_SERVICE=1' '-DUCONFIG_NO_REGULAR_EXPRESSIONS=1' '-DU_ENABLE_DYLOAD=0' '-DU_STATIC_IMPLEMENTATION=1' '-DU_HAVE_STD_STRING=0' '-DUCONFIG_NO_BREAK_ITERATION=0' '-DUCONFIG_NO_LEGACY_CONVERSION=1' '-DUCONFIG_NO_CONVERSION=1' -I../deps/v8 -I../deps -I/nix/store/cnc0bkx679bir5911vjkhbmgzz01dw50-zlib-1.2.11-dev/include -I/nix/store/wcyj6bymy0y1bql8rh9x12xggcb1b5i7-libuv-1.19.1/include -I/nix/store/10r3ph2pz4z3yxxjnvnqkkvn5pz01ipm-openssl-1.0.2n-dev/include -I../deps/icu-small/source/i18n -I../deps/icu-small/source/common  -O3 -gdwarf-2 -fstrict-aliasing -mmacosx-version-min=10.7 -arch x86_64 -Wall -Wendif-labels -W -Wno-unused-parameter -std=gnu++0x -fno-rtti -fno-exceptions -fno-threadsafe-statics -fno-strict-aliasing -MMD -MF /private/tmp/nix-build-nodejs-6.13.0.drv-0/node-v6.13.0/out/Release/.deps//private/tmp/nix-build-nodejs-6.13.0.drv-0/node-v6.13.0/out/Release/obj.target/v8_base/deps/v8/src/ic/x64/access-compiler-x64.o.d.raw   -c -o /private/tmp/nix-build-nodejs-6.13.0.drv-0/node-v6.13.0/out/Release/obj.target/v8_base/deps/v8/src/ic/x64/access-compiler-x64.o ../deps/v8/src/ic/x64/access-compiler-x64.cc
  clang++ '-D_DARWIN_USE_64_BIT_INODE=1' '-DV8_TARGET_ARCH_X64' '-DENABLE_DISASSEMBLER' '-DV8_I18N_SUPPORT' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' '-DUCONFIG_NO_TRANSLITERATION=1' '-DUCONFIG_NO_SERVICE=1' '-DUCONFIG_NO_REGULAR_EXPRESSIONS=1' '-DU_ENABLE_DYLOAD=0' '-DU_STATIC_IMPLEMENTATION=1' '-DU_HAVE_STD_STRING=0' '-DUCONFIG_NO_BREAK_ITERATION=0' '-DUCONFIG_NO_LEGACY_CONVERSION=1' '-DUCONFIG_NO_CONVERSION=1' -I../deps/v8 -I../deps -I/nix/store/cnc0bkx679bir5911vjkhbmgzz01dw50-zlib-1.2.11-dev/include -I/nix/store/wcyj6bymy0y1bql8rh9x12xggcb1b5i7-libuv-1.19.1/include -I/nix/store/10r3ph2pz4z3yxxjnvnqkkvn5pz01ipm-openssl-1.0.2n-dev/include -I../deps/icu-small/source/i18n -I../deps/icu-small/source/common  -O3 -gdwarf-2 -fstrict-aliasing -mmacosx-version-min=10.7 -arch x86_64 -Wall -Wendif-labels -W -Wno-unused-parameter -std=gnu++0x -fno-rtti -fno-exceptions -fno-threadsafe-statics -fno-strict-aliasing -MMD -MF /private/tmp/nix-build-nodejs-6.13.0.drv-0/node-v6.13.0/out/Release/.deps//private/tmp/nix-build-nodejs-6.13.0.drv-0/node-v6.13.0/out/Release/obj.target/v8_base/deps/v8/src/ic/x64/handler-compiler-x64.o.d.raw   -c -o /private/tmp/nix-build-nodejs-6.13.0.drv-0/node-v6.13.0/out/Release/obj.target/v8_base/deps/v8/src/ic/x64/handler-compiler-x64.o ../deps/v8/src/ic/x64/handler-compiler-x64.cc
building of '/nix/store/jglcc6smx1a40n6zgw8ymrd2iywz4kly-nodejs-6.13.0.drv' timed out after 1800 seconds
error: build of '/nix/store/jglcc6smx1a40n6zgw8ymrd2iywz4kly-nodejs-6.13.0.drv' failed

@zimbatm
Copy link
Member Author

zimbatm commented Feb 27, 2018

@GrahamcOfBorg build nodejs

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Partial log (click to expand)

/nix/store/ygaswcr6xmwypzms32dglzb9ck26wn5k-nodejs-6.13.0/lib/node_modules/npm/cli.js: interpreter directive changed from "/usr/bin/env node" to "/nix/store/ygaswcr6xmwypzms32dglzb9ck26wn5k-nodejs-6.13.0/bin/node"
post-installation fixup
shrinking RPATHs of ELF executables and libraries in /nix/store/ygaswcr6xmwypzms32dglzb9ck26wn5k-nodejs-6.13.0
shrinking /nix/store/ygaswcr6xmwypzms32dglzb9ck26wn5k-nodejs-6.13.0/bin/node
gzipping man pages under /nix/store/ygaswcr6xmwypzms32dglzb9ck26wn5k-nodejs-6.13.0/share/man/
strip is /nix/store/lvx1acn1ig1j2km8jds5x3ggh3f2wa8v-binutils-2.28.1/bin/strip
stripping (with command strip and flags -S) in /nix/store/ygaswcr6xmwypzms32dglzb9ck26wn5k-nodejs-6.13.0/lib  /nix/store/ygaswcr6xmwypzms32dglzb9ck26wn5k-nodejs-6.13.0/bin
patching script interpreter paths in /nix/store/ygaswcr6xmwypzms32dglzb9ck26wn5k-nodejs-6.13.0
checking for references to /build in /nix/store/ygaswcr6xmwypzms32dglzb9ck26wn5k-nodejs-6.13.0...
/nix/store/ygaswcr6xmwypzms32dglzb9ck26wn5k-nodejs-6.13.0

@GrahamcOfBorg
Copy link

Success on x86_64-darwin (full log)

Partial log (click to expand)

/nix/store/7rba6g76nn731kbhyc1kka2hkrfk0v6y-nodejs-6.13.0/lib/node_modules/npm/node_modules/semver/bin/semver: interpreter directive changed from "/usr/bin/env node" to "/nix/store/7rba6g76nn731kbhyc1kka2hkrfk0v6y-nodejs-6.13.0/bin/node"
/nix/store/7rba6g76nn731kbhyc1kka2hkrfk0v6y-nodejs-6.13.0/lib/node_modules/npm/node_modules/which/bin/which: interpreter directive changed from "/usr/bin/env node" to "/nix/store/7rba6g76nn731kbhyc1kka2hkrfk0v6y-nodejs-6.13.0/bin/node"
/nix/store/7rba6g76nn731kbhyc1kka2hkrfk0v6y-nodejs-6.13.0/lib/node_modules/npm/scripts/index-build.js: interpreter directive changed from "/usr/bin/env node" to "/nix/store/7rba6g76nn731kbhyc1kka2hkrfk0v6y-nodejs-6.13.0/bin/node"
/nix/store/7rba6g76nn731kbhyc1kka2hkrfk0v6y-nodejs-6.13.0/lib/node_modules/npm/scripts/maketest: interpreter directive changed from "/usr/bin/env node" to "/nix/store/7rba6g76nn731kbhyc1kka2hkrfk0v6y-nodejs-6.13.0/bin/node"
post-installation fixup
gzipping man pages under /nix/store/7rba6g76nn731kbhyc1kka2hkrfk0v6y-nodejs-6.13.0/share/man/
strip is /nix/store/4sdh09gmvl15cy0zb6i7mbvxh5syz206-cctools-binutils-darwin/bin/strip
stripping (with command strip and flags -S) in /nix/store/7rba6g76nn731kbhyc1kka2hkrfk0v6y-nodejs-6.13.0/lib  /nix/store/7rba6g76nn731kbhyc1kka2hkrfk0v6y-nodejs-6.13.0/bin
patching script interpreter paths in /nix/store/7rba6g76nn731kbhyc1kka2hkrfk0v6y-nodejs-6.13.0
/nix/store/7rba6g76nn731kbhyc1kka2hkrfk0v6y-nodejs-6.13.0

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Partial log (click to expand)

/nix/store/zpa0sg1q6l7hls48nxyamj9za5al6db4-nodejs-6.13.0/lib/node_modules/npm/scripts/maketest: interpreter directive changed from "/usr/bin/env node" to "/nix/store/zpa0sg1q6l7hls48nxyamj9za5al6db4-nodejs-6.13.0/bin/node"
/nix/store/zpa0sg1q6l7hls48nxyamj9za5al6db4-nodejs-6.13.0/lib/node_modules/npm/scripts/index-build.js: interpreter directive changed from "/usr/bin/env node" to "/nix/store/zpa0sg1q6l7hls48nxyamj9za5al6db4-nodejs-6.13.0/bin/node"
post-installation fixup
shrinking RPATHs of ELF executables and libraries in /nix/store/zpa0sg1q6l7hls48nxyamj9za5al6db4-nodejs-6.13.0
shrinking /nix/store/zpa0sg1q6l7hls48nxyamj9za5al6db4-nodejs-6.13.0/bin/node
gzipping man pages under /nix/store/zpa0sg1q6l7hls48nxyamj9za5al6db4-nodejs-6.13.0/share/man/
strip is /nix/store/b0zlxla7dmy1iwc3g459rjznx59797xy-binutils-2.28.1/bin/strip
stripping (with command strip and flags -S) in /nix/store/zpa0sg1q6l7hls48nxyamj9za5al6db4-nodejs-6.13.0/lib  /nix/store/zpa0sg1q6l7hls48nxyamj9za5al6db4-nodejs-6.13.0/bin 
patching script interpreter paths in /nix/store/zpa0sg1q6l7hls48nxyamj9za5al6db4-nodejs-6.13.0
checking for references to /tmp/nix-build-nodejs-6.13.0.drv-0 in /nix/store/zpa0sg1q6l7hls48nxyamj9za5al6db4-nodejs-6.13.0...

@zimbatm zimbatm merged commit fda4b93 into NixOS:master Feb 27, 2018
globin pushed a commit to mayflower/nixpkgs that referenced this pull request Feb 27, 2018
Provide all the development headers to node-gyp
adisbladis added a commit to nix-community/pnpm2nix that referenced this pull request Mar 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants