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: add headers output #36910

Closed
wants to merge 1 commit into from

Conversation

globin
Copy link
Member

@globin globin commented Mar 13, 2018

Motivation for this change

These headers are needed when building npm modules that include natively compiled code.
They can now be accessed with nodejs.headers.

See i.e. #35334

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.

cc @manveru @zimbatm @domenkozar @rvl @cleverca22

cc @fpletz @vcunat for potential backporting candidate

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: nodejs

Partial log (click to expand)

gzipping man pages under /nix/store/1rpsbb1n4bn04x8bcds69vpnhynhyfwg-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/1rpsbb1n4bn04x8bcds69vpnhynhyfwg-nodejs-6.13.0/lib  /nix/store/1rpsbb1n4bn04x8bcds69vpnhynhyfwg-nodejs-6.13.0/bin
patching script interpreter paths in /nix/store/1rpsbb1n4bn04x8bcds69vpnhynhyfwg-nodejs-6.13.0
checking for references to /build in /nix/store/1rpsbb1n4bn04x8bcds69vpnhynhyfwg-nodejs-6.13.0...
shrinking RPATHs of ELF executables and libraries in /nix/store/rjpsqvjp62f499zms0c41grs5r1wqaxr-nodejs-6.13.0-headers
strip is /nix/store/lvx1acn1ig1j2km8jds5x3ggh3f2wa8v-binutils-2.28.1/bin/strip
patching script interpreter paths in /nix/store/rjpsqvjp62f499zms0c41grs5r1wqaxr-nodejs-6.13.0-headers
checking for references to /build in /nix/store/rjpsqvjp62f499zms0c41grs5r1wqaxr-nodejs-6.13.0-headers...
/nix/store/1rpsbb1n4bn04x8bcds69vpnhynhyfwg-nodejs-6.13.0

@GrahamcOfBorg
Copy link

Success on x86_64-darwin (full log)

Attempted: nodejs

Partial log (click to expand)

/nix/store/h8jp0q7yvs5gpihz05mik0305636flh1-nodejs-6.13.0/lib/node_modules/npm/scripts/index-build.js: interpreter directive changed from "/usr/bin/env node" to "/nix/store/h8jp0q7yvs5gpihz05mik0305636flh1-nodejs-6.13.0/bin/node"
/nix/store/h8jp0q7yvs5gpihz05mik0305636flh1-nodejs-6.13.0/lib/node_modules/npm/scripts/maketest: interpreter directive changed from "/usr/bin/env node" to "/nix/store/h8jp0q7yvs5gpihz05mik0305636flh1-nodejs-6.13.0/bin/node"
post-installation fixup
gzipping man pages under /nix/store/h8jp0q7yvs5gpihz05mik0305636flh1-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/h8jp0q7yvs5gpihz05mik0305636flh1-nodejs-6.13.0/lib  /nix/store/h8jp0q7yvs5gpihz05mik0305636flh1-nodejs-6.13.0/bin
patching script interpreter paths in /nix/store/h8jp0q7yvs5gpihz05mik0305636flh1-nodejs-6.13.0
strip is /nix/store/4sdh09gmvl15cy0zb6i7mbvxh5syz206-cctools-binutils-darwin/bin/strip
patching script interpreter paths in /nix/store/qqc8g2kfvh1j0hkwmjkqsmvsxrgsq2xg-nodejs-6.13.0-headers
/nix/store/h8jp0q7yvs5gpihz05mik0305636flh1-nodejs-6.13.0

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: nodejs

Partial log (click to expand)

gzipping man pages under /nix/store/zqk3avbg7pnp3f0i1xvcm0b60klyl64p-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/zqk3avbg7pnp3f0i1xvcm0b60klyl64p-nodejs-6.13.0/lib  /nix/store/zqk3avbg7pnp3f0i1xvcm0b60klyl64p-nodejs-6.13.0/bin 
patching script interpreter paths in /nix/store/zqk3avbg7pnp3f0i1xvcm0b60klyl64p-nodejs-6.13.0
checking for references to /tmp/nix-build-nodejs-6.13.0.drv-0 in /nix/store/zqk3avbg7pnp3f0i1xvcm0b60klyl64p-nodejs-6.13.0...
shrinking RPATHs of ELF executables and libraries in /nix/store/6xspgmbaiirfxxx21b75rd7kgc97r6ad-nodejs-6.13.0-headers
strip is /nix/store/b0zlxla7dmy1iwc3g459rjznx59797xy-binutils-2.28.1/bin/strip
patching script interpreter paths in /nix/store/6xspgmbaiirfxxx21b75rd7kgc97r6ad-nodejs-6.13.0-headers
checking for references to /tmp/nix-build-nodejs-6.13.0.drv-0 in /nix/store/6xspgmbaiirfxxx21b75rd7kgc97r6ad-nodejs-6.13.0-headers...
/nix/store/zqk3avbg7pnp3f0i1xvcm0b60klyl64p-nodejs-6.13.0

@fpletz fpletz added this to the 18.03 milestone Mar 13, 2018
@zimbatm
Copy link
Member

zimbatm commented Mar 13, 2018

@globin did my changes get reverted? the headers should already be available in nodejs.dev $out

@@ -87,6 +94,9 @@ in

# install the missing headers for node-gyp
cp -r ${concatStringsSep " " copyLibHeaders} $out/include/node
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually they are already here in $out

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: nodejs

Partial log (click to expand)

gzipping man pages under /nix/store/343l96crk0v9c2hmlpn66964lhydg4q9-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/343l96crk0v9c2hmlpn66964lhydg4q9-nodejs-6.13.0/lib  /nix/store/343l96crk0v9c2hmlpn66964lhydg4q9-nodejs-6.13.0/bin
patching script interpreter paths in /nix/store/343l96crk0v9c2hmlpn66964lhydg4q9-nodejs-6.13.0
checking for references to /build in /nix/store/343l96crk0v9c2hmlpn66964lhydg4q9-nodejs-6.13.0...
shrinking RPATHs of ELF executables and libraries in /nix/store/6d07rvvijzsxj5qaml5vsg82yw3wdyav-nodejs-6.13.0-headers
strip is /nix/store/lvx1acn1ig1j2km8jds5x3ggh3f2wa8v-binutils-2.28.1/bin/strip
patching script interpreter paths in /nix/store/6d07rvvijzsxj5qaml5vsg82yw3wdyav-nodejs-6.13.0-headers
checking for references to /build in /nix/store/6d07rvvijzsxj5qaml5vsg82yw3wdyav-nodejs-6.13.0-headers...
/nix/store/343l96crk0v9c2hmlpn66964lhydg4q9-nodejs-6.13.0

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: nodejs

Partial log (click to expand)

shrinking /nix/store/9s53ngi4d4wzca7g25qpz15v9pr570sn-nodejs-6.13.0/bin/node
gzipping man pages under /nix/store/9s53ngi4d4wzca7g25qpz15v9pr570sn-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/9s53ngi4d4wzca7g25qpz15v9pr570sn-nodejs-6.13.0/lib  /nix/store/9s53ngi4d4wzca7g25qpz15v9pr570sn-nodejs-6.13.0/bin 
patching script interpreter paths in /nix/store/9s53ngi4d4wzca7g25qpz15v9pr570sn-nodejs-6.13.0
checking for references to /tmp/nix-build-nodejs-6.13.0.drv-0 in /nix/store/9s53ngi4d4wzca7g25qpz15v9pr570sn-nodejs-6.13.0...
shrinking RPATHs of ELF executables and libraries in /nix/store/sp4dwyn6knwkyin9l456yklx7p0jb8mb-nodejs-6.13.0-headers
strip is /nix/store/b0zlxla7dmy1iwc3g459rjznx59797xy-binutils-2.28.1/bin/strip
patching script interpreter paths in /nix/store/sp4dwyn6knwkyin9l456yklx7p0jb8mb-nodejs-6.13.0-headers
checking for references to /tmp/nix-build-nodejs-6.13.0.drv-0 in /nix/store/sp4dwyn6knwkyin9l456yklx7p0jb8mb-nodejs-6.13.0-headers...

@GrahamcOfBorg
Copy link

Success on x86_64-darwin (full log)

Attempted: nodejs

Partial log (click to expand)

/nix/store/pc2jcs6a934jlzhi0j0mf114h1n0xzy8-nodejs-6.13.0/lib/node_modules/npm/scripts/maketest: interpreter directive changed from "/usr/bin/env node" to "/nix/store/pc2jcs6a934jlzhi0j0mf114h1n0xzy8-nodejs-6.13.0/bin/node"
/nix/store/pc2jcs6a934jlzhi0j0mf114h1n0xzy8-nodejs-6.13.0/lib/node_modules/npm/cli.js: interpreter directive changed from "/usr/bin/env node" to "/nix/store/pc2jcs6a934jlzhi0j0mf114h1n0xzy8-nodejs-6.13.0/bin/node"
post-installation fixup
gzipping man pages under /nix/store/pc2jcs6a934jlzhi0j0mf114h1n0xzy8-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/pc2jcs6a934jlzhi0j0mf114h1n0xzy8-nodejs-6.13.0/lib  /nix/store/pc2jcs6a934jlzhi0j0mf114h1n0xzy8-nodejs-6.13.0/bin
patching script interpreter paths in /nix/store/pc2jcs6a934jlzhi0j0mf114h1n0xzy8-nodejs-6.13.0
strip is /nix/store/4sdh09gmvl15cy0zb6i7mbvxh5syz206-cctools-binutils-darwin/bin/strip
patching script interpreter paths in /nix/store/llrys77apnw13191nic4h557w6g2wvrc-nodejs-6.13.0-headers
/nix/store/pc2jcs6a934jlzhi0j0mf114h1n0xzy8-nodejs-6.13.0

@globin
Copy link
Member Author

globin commented Mar 14, 2018

Thanks as @zimbatm pointed out this is not needed, for yarn2nix's mkYarnPackage one can add:

  yarnPreBuild = ''
    mkdir -p $HOME/.node-gyp/${nodejs.version}
    echo 9 > $HOME/.node-gyp/${nodejs.version}/installVersion
    ln -sfv ${nodejs}/include $HOME/.node-gyp/${nodejs.version}
  '';

@globin globin closed this Mar 14, 2018
@globin globin deleted the nodejs-headers-output branch March 14, 2018 12:25
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

4 participants