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

openjdk: Clean up platform conditionals #35450

Merged
merged 1 commit into from Feb 27, 2018

Conversation

Ericson2314
Copy link
Member

Motivation for this change

Better style, more robust with an eye towards cross compilation / portability.

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.

@Ericson2314 Ericson2314 added the 6.topic: cross-compilation Building packages on a different sort platform than than they will be run on label Feb 24, 2018
done

find $out -name \*.so\* | while read lib; do
patchelf --set-interpreter ${glibc.out}/lib/ld-linux*.so.2 $lib || true
patchelf --set-rpath "${glibc.out}/lib:${stdenv.cc.cc.lib}/lib:$LIBDIRS" $lib || true
patchelf --set-interpreter ${stdenv.cc.libc}/lib/ld-linux*.so.2 $lib || true
Copy link
Member Author

Choose a reason for hiding this comment

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

Not sure whether glibc can be dropped like that.

Copy link
Member

Choose a reason for hiding this comment

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

There are nss modules in glibc, but musl don't support those anyway.
On at least NixOS we also use nscd, which is apparently also supported by musl.
I have not seen any port of jdk, that uses anything but glibc though.

Copy link
Member

@andir andir Feb 24, 2018

Choose a reason for hiding this comment

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

While we are touching this wouldn't it make sense to use $NIX_CC/nix-support/dynamic-linker instead of ld-linux*.so.2?

In my yet not working WIP for aarch64 for openjdk I had to do that. Due to time constraints that work might not continue soon on my end thought..

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for the info you two!

Yeah my thoughts are even if it doesn't work, its better to require stdenv.cc.libc to be glibc (which could be achieved with a one-off override, rather than whole-world stdenv switch) than hack it in like that.

@GrahamcOfBorg
Copy link

Failure on aarch64-linux (full log)

Partial log (click to expand)

�[31;1merror:�[0m while evaluating the attribute 'buildInputs' of the derivation 'openjdk-8u172b02' at �[1m/var/lib/gc-of-borg/nix-test-rs-2/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/grahamc-aarch64-community-2/pkgs/stdenv/generic/make-derivation.nix�[0m:148:11:
while evaluating the attribute 'buildCommand' of the derivation 'openjdk-bootstrap' at �[1m/var/lib/gc-of-borg/nix-test-rs-2/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/grahamc-aarch64-community-2/pkgs/stdenv/generic/make-derivation.nix�[0m:148:11:
No bootstrap for system

@GrahamcOfBorg
Copy link

Failure on x86_64-darwin (full log)

Partial log (click to expand)

cannot build derivation '/nix/store/x8kg2z0wzqhmd1a7vsj4j1lba94hlfai-hook.drv': 2 dependencies couldn't be built
cannot build derivation '/nix/store/6klpzkg42ik557195k563zm5r76sdi6z-stdenv-darwin.drv': 35 dependencies couldn't be built
cannot build derivation '/nix/store/z689fa6lk02wlv7vgdh1kz94w7q4di5r-libiconv-osx-10.11.6.drv': 2 dependencies couldn't be built
cannot build derivation '/nix/store/biam5gxmaxz0w1i1kldnj4gc9i0fdcf7-libpng-apng-1.6.34.drv': 3 dependencies couldn't be built
cannot build derivation '/nix/store/jncbhqasqbpr3474jbfq47y39varvfm4-unzip-6.0.drv': 3 dependencies couldn't be built
cannot build derivation '/nix/store/hw3fpbqzldx68irn1fm1cnl3p3by95k0-which-2.21.drv': 2 dependencies couldn't be built
cannot build derivation '/nix/store/sddwz2zaslwm2rmn74imngy8jz2x3v8f-pkg-config-0.29.2.drv': 3 dependencies couldn't be built
cannot build derivation '/nix/store/p9za9v427w7c36mvyhc9js8p1vqnr8wa-freetype-2.7.1.drv': 8 dependencies couldn't be built
cannot build derivation '/nix/store/20a1ybgzwnkav2s53vhshw6d777pwnrf-zulu1.8.0_121-8.20.0.5.drv': 5 dependencies couldn't be built
error: build of '/nix/store/20a1ybgzwnkav2s53vhshw6d777pwnrf-zulu1.8.0_121-8.20.0.5.drv' failed

@Mic92
Copy link
Member

Mic92 commented Feb 24, 2018

cc @andir

@GrahamcOfBorg
Copy link

Failure on x86_64-linux (full log)

Partial log (click to expand)

cannot build derivation ‘/nix/store/h20bassi7qvmmamn2yfy07f9pqzpk8h9-texlive-core-big.bin-2017.drv’: 3 dependencies couldn't be built
cannot build derivation ‘/nix/store/0yvdvqbvns5hq8kpm990x8fbb6pl4prr-gtk+-2.24.32.drv’: 5 dependencies couldn't be built
cannot build derivation ‘/nix/store/lgkrn9a129dwikzpq7qz6sbjr4hr1kys-texlive-combined-2017.drv’: 2 dependencies couldn't be built
cannot build derivation ‘/nix/store/lk0cnnnc3z08lxn1icm5r4ryzfnv4bx0-dblatex-0.3.10.drv’: 1 dependencies couldn't be built
cannot build derivation ‘/nix/store/zr5v1aq6aq8gac6hhl1a6v8g8nl94f07-gtk-doc-1.25.drv’: 1 dependencies couldn't be built
cannot build derivation ‘/nix/store/8bm6krb7hc9cisk1g0sij155b48qiwdr-polkit-0.113.drv’: 2 dependencies couldn't be built
cannot build derivation ‘/nix/store/gqcmdm8gv03irg4yf4p66q2di0pfwdkh-gconf-2.32.4.drv’: 1 dependencies couldn't be built
cannot build derivation ‘/nix/store/2pg0c4g81bsv9l8pmvahhbw78qzjjhgs-gnome-vfs-2.24.4.drv’: 1 dependencies couldn't be built
cannot build derivation ‘/nix/store/511l31mnwxji2wgflk1iahy7svrkx966-openjdk-8u172b02.drv’: 3 dependencies couldn't be built
error: build of ‘/nix/store/511l31mnwxji2wgflk1iahy7svrkx966-openjdk-8u172b02.drv’ failed

@GrahamcOfBorg
Copy link

Failure on aarch64-linux (full log)

Partial log (click to expand)

�[31;1merror:�[0m while evaluating the attribute 'buildInputs' of the derivation 'openjdk-8u172b02' at �[1m/var/lib/gc-of-borg/nix-test-rs-3/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/grahamc-aarch64-community-3/pkgs/stdenv/generic/make-derivation.nix�[0m:148:11:
while evaluating the attribute 'buildCommand' of the derivation 'openjdk-bootstrap' at �[1m/var/lib/gc-of-borg/nix-test-rs-3/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/grahamc-aarch64-community-3/pkgs/stdenv/generic/make-derivation.nix�[0m:148:11:
No bootstrap for system

@GrahamcOfBorg
Copy link

Success on x86_64-darwin (full log)

Partial log (click to expand)

  inflating: ZuluJCEPolicies/DISCLAIMER
  inflating: ZuluJCEPolicies/local_policy.jar
  inflating: ZuluJCEPolicies/US_export_policy.jar
post-installation fixup
moving /nix/store/5qa4b4x1dckarlh7x3gsc938k3dchlab-zulu1.8.0_121-8.20.0.5/man to /nix/store/5qa4b4x1dckarlh7x3gsc938k3dchlab-zulu1.8.0_121-8.20.0.5/share/man
gzipping man pages under /nix/store/5qa4b4x1dckarlh7x3gsc938k3dchlab-zulu1.8.0_121-8.20.0.5/share/man/
strip is /nix/store/s9jx32z9rbvzqaaa4fyndfz0zjfvl646-cctools-binutils-darwin/bin/strip
stripping (with command strip and flags -S) in /nix/store/5qa4b4x1dckarlh7x3gsc938k3dchlab-zulu1.8.0_121-8.20.0.5/lib  /nix/store/5qa4b4x1dckarlh7x3gsc938k3dchlab-zulu1.8.0_121-8.20.0.5/bin
patching script interpreter paths in /nix/store/5qa4b4x1dckarlh7x3gsc938k3dchlab-zulu1.8.0_121-8.20.0.5
/nix/store/5qa4b4x1dckarlh7x3gsc938k3dchlab-zulu1.8.0_121-8.20.0.5

@GrahamcOfBorg
Copy link

Failure on x86_64-linux (full log)

Partial log (click to expand)

checking for lftp... no
checking for ftp... no
checking headful support... include support for both headful and headless
configure: Found potential Boot JDK using configure arguments
configure: Potential Boot JDK found at /nix/store/g436csvys387lx4imxgwq85rw0rmrrhk-openjdk-bootstrap/lib/openjdk is incorrect JDK version (./common/autoconf/generated-configure.sh: line 11397: /nix/store/g436csvys387lx4imxgwq85rw0rmrrhk-openjdk-bootstrap/lib/openjdk/bin/java: No such file or directory); ignoring
configure: (Your Boot JDK must be version 7 or 8)
configure: error: The path given by --with-boot-jdk does not contain a valid Boot JDK
configure exiting with result code 1
builder for ‘/nix/store/zapvp47dljw48cyfq3v3msh0rm10yy3y-openjdk-8u172b02.drv’ failed with exit code 1
error: build of ‘/nix/store/zapvp47dljw48cyfq3v3msh0rm10yy3y-openjdk-8u172b02.drv’ failed

@GrahamcOfBorg
Copy link

Failure on aarch64-linux (full log)

Partial log (click to expand)

�[31;1merror:�[0m while evaluating the attribute 'buildInputs' of the derivation 'openjdk-8u172b02' at �[1m/var/lib/gc-of-borg/nix-test-rs-1/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/grahamc-aarch64-community-1/pkgs/stdenv/generic/make-derivation.nix�[0m:148:11:
while evaluating the attribute 'buildCommand' of the derivation 'openjdk-bootstrap' at �[1m/var/lib/gc-of-borg/nix-test-rs-1/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/grahamc-aarch64-community-1/pkgs/stdenv/generic/make-derivation.nix�[0m:148:11:
No bootstrap for system

@GrahamcOfBorg
Copy link

Failure on x86_64-darwin (full log)

Partial log (click to expand)

cannot build derivation '/nix/store/l0y8axrl76193ajv5cyhk7jbzx4axhq1-hook.drv': 2 dependencies couldn't be built
cannot build derivation '/nix/store/8py9i1sxksyjiimnskilhcjiqvz68g08-stdenv-darwin.drv': 35 dependencies couldn't be built
cannot build derivation '/nix/store/f0pg5l7rp68xhi6m7l23kgnmkvdmpj0w-libiconv-osx-10.11.6.drv': 2 dependencies couldn't be built
cannot build derivation '/nix/store/y9im4a59ig0wfvp332bcfsh2kiincdlg-libpng-apng-1.6.34.drv': 3 dependencies couldn't be built
cannot build derivation '/nix/store/8qlsfagzkz4s01fj2d1d6wy3psjgypry-unzip-6.0.drv': 3 dependencies couldn't be built
cannot build derivation '/nix/store/brldapwhv9bqxfndcsqgd472av382ais-which-2.21.drv': 2 dependencies couldn't be built
cannot build derivation '/nix/store/22c87286av8qxn0l0xjfgr3c7avi913y-pkg-config-0.29.2.drv': 3 dependencies couldn't be built
cannot build derivation '/nix/store/2rsy0mjfhgkrjyli9nmxmna78fw99hsv-freetype-2.7.1.drv': 8 dependencies couldn't be built
cannot build derivation '/nix/store/qa1vdh409i1mp4v4cbv8jszkqg585z05-zulu1.8.0_121-8.20.0.5.drv': 5 dependencies couldn't be built
error: build of '/nix/store/qa1vdh409i1mp4v4cbv8jszkqg585z05-zulu1.8.0_121-8.20.0.5.drv' failed

@GrahamcOfBorg
Copy link

Failure on x86_64-linux (full log)

Partial log (click to expand)

cannot build derivation ‘/nix/store/rc7klscg5683ddxmk5qwsqk067qz8rh3-texlive-core-big.bin-2017.drv’: 19 dependencies couldn't be built
cannot build derivation ‘/nix/store/s41wvpg8ff742zfqfr3di4ammmdmd4d6-gtk+-2.24.32.drv’: 18 dependencies couldn't be built
cannot build derivation ‘/nix/store/1s2rz0d1zzc0q1mmha8rvvil4ixxiwx5-texlive-combined-2017.drv’: 7 dependencies couldn't be built
cannot build derivation ‘/nix/store/2wkffm4vjpj35xkcmjgc7yahhxzc8bvb-dblatex-0.3.10.drv’: 5 dependencies couldn't be built
cannot build derivation ‘/nix/store/2ahkwnvs908b8s5ihhkcfiwj07nw8pai-gtk-doc-1.25.drv’: 15 dependencies couldn't be built
cannot build derivation ‘/nix/store/wlqfr23hqql3jb8v7nazn0mbnlshqjbv-polkit-0.113.drv’: 15 dependencies couldn't be built
cannot build derivation ‘/nix/store/4kgv0dhiw8p9aqw9jhpkghsfwz1m4y6d-gconf-2.32.4.drv’: 10 dependencies couldn't be built
cannot build derivation ‘/nix/store/jk9783wn8rfs0p3fmbjviypf91n988zv-gnome-vfs-2.24.4.drv’: 15 dependencies couldn't be built
cannot build derivation ‘/nix/store/bbjy65pgxf06g75pyj5f92pyjyzlkvap-openjdk-8u172b02.drv’: 32 dependencies couldn't be built
error: build of ‘/nix/store/bbjy65pgxf06g75pyj5f92pyjyzlkvap-openjdk-8u172b02.drv’ failed

@Ericson2314
Copy link
Member Author

Built manually.

@Ericson2314 Ericson2314 merged commit 089aaa1 into NixOS:staging Feb 27, 2018
@Ericson2314 Ericson2314 deleted the android-clean branch February 27, 2018 16:16
@Ericson2314 Ericson2314 added this to After big PR in Cross compilation Mar 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: cross-compilation Building packages on a different sort platform than than they will be run on 10.rebuild-darwin: 0 10.rebuild-linux: 101-500
Projects
No open projects
Cross compilation
After big PR
Development

Successfully merging this pull request may close these issues.

None yet

5 participants