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

dotty: wrap to prevent installing all the files in profile #33330

Merged
merged 1 commit into from Jan 8, 2018

Conversation

karolchmist
Copy link
Member

Motivation for this change

Fixes #31858

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.

@karolchmist
Copy link
Member Author

@GrahamcOfBorg build dotty

@karolchmist
Copy link
Member Author

Pinging @yegortimoshenko, hello :) You've helped me with the last PR of dotty suggesting wrapping the derivation to prevent the leaking of /bin, would you mind reviewing this PR? Thanks!

@lukateras
Copy link
Member

@GrahamcOfBorg build dotty

Copy link

@GrahamcOfBorg GrahamcOfBorg left a comment

Choose a reason for hiding this comment

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

Failure for system: aarch64-linux

error: while evaluating the attribute 'installPhase' of the derivation 'dotty-0.4.0-RC1' at /var/lib/gc-of-borg/nix-test-rs-2/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/grahamc-aarch64-community-2/pkgs/stdenv/generic/make-derivation.nix:134:11:
while evaluating the attribute 'fixupPhase' of the derivation 'dotty-bare-0.4.0-RC1' at /var/lib/gc-of-borg/nix-test-rs-2/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/grahamc-aarch64-community-2/pkgs/stdenv/generic/make-derivation.nix:134:11:
while evaluating the attribute 'buildInputs' of the derivation 'openjdk-8u152b16' at /var/lib/gc-of-borg/nix-test-rs-2/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/grahamc-aarch64-community-2/pkgs/stdenv/generic/make-derivation.nix:134:11:
while evaluating the attribute 'buildCommand' of the derivation 'openjdk-bootstrap' at /var/lib/gc-of-borg/nix-test-rs-2/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/grahamc-aarch64-community-2/pkgs/stdenv/generic/make-derivation.nix:134:11:
No bootstrap for system

Copy link

@GrahamcOfBorg GrahamcOfBorg left a comment

Choose a reason for hiding this comment

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

Failure for system: x86_64-darwin

0:00
:01 --:--:-- 9827
k

building path(s) ‘/nix/store/sfxlq7ncb8ffw6crs36a2559mrdwf84x-dotty-bare-0.4.0-RC1’
/nix/store/zsn4rc9p48hsq6a53357fmk314b0ahg4-stdenv-darwin/setup: fork: Operation not permitted
/nix/store/zsn4rc9p48hsq6a53357fmk314b0ahg4-stdenv-darwin/setup: fork: Operation not permitted
builder for ‘/nix/store/cr88l5w48z0fwgnx2h1izzk9xdp9a5yp-dotty-bare-0.4.0-RC1.drv’ failed with exit code 254
cannot build derivation ‘/nix/store/mzkz2p68i1vfvl3xy9szid46164bifqf-dotty-0.4.0-RC1.drv’: 1 dependencies couldn't be built
error: build of ‘/nix/store/mzkz2p68i1vfvl3xy9szid46164bifqf-dotty-0.4.0-RC1.drv’ failed

Copy link

@GrahamcOfBorg GrahamcOfBorg left a comment

Choose a reason for hiding this comment

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

Success for system: x86_64-linux

building
no Makefile, doing nothing
installing
post-installation fixup
shrinking RPATHs of ELF executables and libraries in /nix/store/mgvn2hhz532c1l9jscxgjl4hc0d72cff-dotty-0.4.0-RC1
strip is /nix/store/wxn5gn8amxm1w0ikcx4gbs8a17wvss4j-binutils-2.28.1/bin/strip
stripping (with command strip and flags -S) in /nix/store/mgvn2hhz532c1l9jscxgjl4hc0d72cff-dotty-0.4.0-RC1/bin 
patching script interpreter paths in /nix/store/mgvn2hhz532c1l9jscxgjl4hc0d72cff-dotty-0.4.0-RC1
checking for references to /tmp/nix-build-dotty-0.4.0-RC1.drv-0 in /nix/store/mgvn2hhz532c1l9jscxgjl4hc0d72cff-dotty-0.4.0-RC1...
/nix/store/mgvn2hhz532c1l9jscxgjl4hc0d72cff-dotty-0.4.0-RC1

@lukateras
Copy link
Member

lukateras commented Jan 6, 2018

@grahamc: x86_64-darwin is having some issues...

Copy link
Member

@lukateras lukateras left a comment

Choose a reason for hiding this comment

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

Other than minor syntactical nitpicks, this is great!

url = "https://github.com/lampepfl/dotty/releases/download/${version}/${name}.tar.gz";
sha256 = "1d1ab08b85bd6898ce6273fa50818de0d314fc6e5377fb6ee05494827043321b";
let
self = {
Copy link
Member

Choose a reason for hiding this comment

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

This self only has one attribute and thus could be omitted:

let
    dotty-bare = callPackage ./dotty-bare.nix {
      inherit stdenv fetchurl makeWrapper jre;
    };
in

'';

fixupPhase = ''
for p in $out/bin/* ; do
Copy link
Member

Choose a reason for hiding this comment

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

If $out/bin/* here were to be replaced with $(find $out/bin -type f ! -name common), conditions below would not be required.

license = licenses.bsd3;
platforms = platforms.all;
maintainers = [maintainers.karolchmist];
meta = with dotty-bare.meta; {
Copy link
Member

Choose a reason for hiding this comment

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

  inherit (dotty-bare) meta;

@karolchmist
Copy link
Member Author

Thanks @yegortimoshenko , I've modified the code as you suggested.

@lukateras lukateras merged commit d0cfab8 into NixOS:master Jan 8, 2018
@karolchmist karolchmist deleted the fix-dotty-lib-folder-public branch January 8, 2018 13:31
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

3 participants