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

Remove libfreetype.so from adoptopenjdk's derivation. #57750

Merged
merged 1 commit into from Mar 26, 2019
Merged

Remove libfreetype.so from adoptopenjdk's derivation. #57750

merged 1 commit into from Mar 26, 2019

Conversation

tomfitzhenry
Copy link
Contributor

@tomfitzhenry tomfitzhenry commented Mar 16, 2019

Motivation for this change

This caused some reverse dependencies of adoptopenjdk to depend on
adoptopenjdk's libfreetype, rather than the NixOS
libfreetype. For example: #57733

Now the derivation does not contain libfreetype.so . The JRE links to
nixpkg's freetype:

$ ldd /nix/store/9iyxm1nkn35xhjgri041r980z4p5ls5g-adoptopenjdk-hotspot-bin-11.0.2/lib/libfontmanager.so | grep -i freetype
	libfreetype.so => /nix/store/ycbkq39cngzx19j829qzgdnw3mx3z78g-freetype-2.9.1/lib/libfreetype.so (0x0000795e30702000)
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option 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/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Assured whether relevant documentation is up to date
  • Fits CONTRIBUTING.md.

This caused some reverse dependencies of adoptopenjdk to depend on
adoptopenjdk's libfreetype, rather than the NixOS
libfreetype. For example: #57733

Now the derivation does not contain libfreetype.so . The JRE links to
nixpkg's freetype:

$ ldd /nix/store/9iyxm1nkn35xhjgri041r980z4p5ls5g-adoptopenjdk-hotspot-bin-11.0.2/lib/libfontmanager.so | grep -i freetype
	libfreetype.so => /nix/store/ycbkq39cngzx19j829qzgdnw3mx3z78g-freetype-2.9.1/lib/libfreetype.so (0x0000795e30702000)
@tomfitzhenry
Copy link
Contributor Author

I'm unfamiliar with Nixos policy on which is preferable:
(i) force adoptopenjdk to depend on the NixOS freetype
(ii) allow adoptopenjdk to depend on its own freetype, but do not expose that to adoptopenjdk's reverse dependencies

This PR implements (i).

@tomfitzhenry
Copy link
Contributor Author

I think (ii) is a better solution because it means we aren't overriding adoptopenjdk's dependencies.

Looks like (ii) could be done via https://nixos.org/nixpkgs/manual/#chap-multiple-output .

@tomfitzhenry
Copy link
Contributor Author

tomfitzhenry commented Mar 16, 2019

(i) seems to be the NixOS solution: use NixOS packages where possible.

So I'll leave this PR as it is. This changes the JRE to use NixOS's libfreetype, and hence benefit from libfreetype security updates. This fixes #57733 too.

A separate PR can split the JRE's shared libraries to a separate libs package, which will prevent similar issues from re-occurring.

@tomfitzhenry
Copy link
Contributor Author

tomfitzhenry commented Mar 16, 2019

nox-review has checked all adoptopenjdk packages build:

$ nox-review pr 57750
[...]
/nix/store/3qflynhxj679p1gdi7dycf5368f7cpjj-adoptopenjdk-jre-hotspot-bin-11.0.2
/nix/store/ldyq8wh8j3lkracmm19jhnmq4jmq47pc-adoptopenjdk-jre-openj9-bin-11.0.2
/nix/store/9iyxm1nkn35xhjgri041r980z4p5ls5g-adoptopenjdk-hotspot-bin-11.0.2
/nix/store/bwn3k3mszynmz66lfwbk0my5nqf0dw5b-adoptopenjdk-openj9-bin-11.0.2
[...]

Closure size has dropped, as expected (since libfreetype.so has been removed):

$ nix path-info -S /nix/store/9iyxm1nkn35xhjgri041r980z4p5ls5g-adoptopenjdk-hotspot-bin-11.0.2
/nix/store/9iyxm1nkn35xhjgri041r980z4p5ls5g-adoptopenjdk-hotspot-bin-11.0.2	  502782664
$ git checkout upstream/master
$ nix-build -A  adoptopenjdk-hotspot-bin-11
/nix/store/y3zcg85csnq7x6rzzgri4jhv1hx54byk-adoptopenjdk-hotspot-bin-11.0.2
$ nix path-info -S /nix/store/y3zcg85csnq7x6rzzgri4jhv1hx54byk-adoptopenjdk-hotspot-bin-11.0.2
/nix/store/y3zcg85csnq7x6rzzgri4jhv1hx54byk-adoptopenjdk-hotspot-bin-11.0.2	  503590816

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
8.has: port to stable A PR already has a backport to the stable release. 10.rebuild-darwin: 0 10.rebuild-linux: 1-10
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants