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

go: Remove pkg/obj directory from the build outputs. #47260

Merged
merged 1 commit into from Sep 25, 2018
Merged

Conversation

c00w
Copy link
Contributor

@c00w c00w commented Sep 24, 2018

Motivation for this change

This appears to be causing the go package to be roughly 900MB in size.

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)
  • [ x] Fits CONTRIBUTING.md.

This appears to be causing the go package to be roughly 900MB in size.
@@ -178,6 +178,7 @@ stdenv.mkDerivation rec {

preFixup = ''
rm -r $out/share/go/pkg/bootstrap
rm -r $out/share/go/pkg/obj
Copy link
Member

@Mic92 Mic92 Sep 24, 2018

Choose a reason for hiding this comment

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

But does not then everybody has to recompile the standardlibary on their own?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So I'm pretty sure this is the object cache directory - the actual libraries end up in folders called $GOOS_$GOARCH and a tool and include folder. It's also not shipped by go in their download (https://golang.org/dl/). Oddly enough it also doesn't seem to be working since the folder is still present.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nevermind - I was confused. The obj folder is correctly deleted and running go install with the modified package doesn't appear to cause any standard library recompilation.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For reference - the go release tool also deletes this directory.

https://go-review.googlesource.com/c/build/+/82095

Copy link
Member

Choose a reason for hiding this comment

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

I mixed up the prefix, because the static archives where right below this.

@Mic92
Copy link
Member

Mic92 commented Sep 25, 2018

@GrahamcOfBorg build docker

@GrahamcOfBorg
Copy link

Failure on x86_64-darwin (full log)

Attempted: docker

Partial log (click to expand)

copying path '/nix/store/v7v9r8zkyyx2q4rxdyb659flx63qg1n6-go-bootstrap' from 'https://cache.nixos.org'...
/nix/store/cz8xwi6lmz86lbhj7a1nzlhz2n8j6i9f-stdenv-darwin/setup: fork: retry: Resource temporarily unavailable
/nix/store/cz8xwi6lmz86lbhj7a1nzlhz2n8j6i9f-stdenv-darwin/setup: fork: Resource temporarily unavailable
mkdir: cannot create directory '': No such file or directory
builder for '/nix/store/dbzl8lvjkxjgjgc5irg8fp73if560k1p-clang.drv' failed with exit code 1
cannot build derivation '/nix/store/yhag5fp7cdy2x6zn1gimwbkzilhkkpvk-go-1.11.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/5yqgm1p4q9kj986vczy58il507csr72z-govers-20150109-3b5f175.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/9r8ajx4g50sffbih0l23dvkm7df4n3pj-go-md2man-1.0.6.drv': 2 dependencies couldn't be built
cannot build derivation '/nix/store/ydswjk63gs0hrcw71hzvpzf3fp5aah2v-docker-18.06.1-ce.drv': 2 dependencies couldn't be built
error: build of '/nix/store/ydswjk63gs0hrcw71hzvpzf3fp5aah2v-docker-18.06.1-ce.drv' failed

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: docker

Partial log (click to expand)

shrinking RPATHs of ELF executables and libraries in /nix/store/q4bwnmcdwlnv6pfzw7g75hhg2fah8y6x-docker-18.06.1-ce
shrinking /nix/store/q4bwnmcdwlnv6pfzw7g75hhg2fah8y6x-docker-18.06.1-ce/libexec/docker/docker
shrinking /nix/store/q4bwnmcdwlnv6pfzw7g75hhg2fah8y6x-docker-18.06.1-ce/libexec/docker/dockerd
patching script interpreter paths in /nix/store/q4bwnmcdwlnv6pfzw7g75hhg2fah8y6x-docker-18.06.1-ce
checking for references to /build in /nix/store/q4bwnmcdwlnv6pfzw7g75hhg2fah8y6x-docker-18.06.1-ce...
shrinking RPATHs of ELF executables and libraries in /nix/store/dq09xbdbxfslnnnqicf7vyszvswsb8pg-docker-18.06.1-ce-man
gzipping man pages under /nix/store/dq09xbdbxfslnnnqicf7vyszvswsb8pg-docker-18.06.1-ce-man/share/man/
patching script interpreter paths in /nix/store/dq09xbdbxfslnnnqicf7vyszvswsb8pg-docker-18.06.1-ce-man
checking for references to /build in /nix/store/dq09xbdbxfslnnnqicf7vyszvswsb8pg-docker-18.06.1-ce-man...
/nix/store/q4bwnmcdwlnv6pfzw7g75hhg2fah8y6x-docker-18.06.1-ce

@Mic92 Mic92 merged commit 4335a92 into NixOS:master Sep 25, 2018
@Mic92
Copy link
Member

Mic92 commented Sep 25, 2018

backport: 86406e2

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: docker

Partial log (click to expand)

shrinking RPATHs of ELF executables and libraries in /nix/store/sgjdr2vnkz00f3gqgq3pivc4n4ddfm91-docker-18.06.1-ce
shrinking /nix/store/sgjdr2vnkz00f3gqgq3pivc4n4ddfm91-docker-18.06.1-ce/libexec/docker/docker
shrinking /nix/store/sgjdr2vnkz00f3gqgq3pivc4n4ddfm91-docker-18.06.1-ce/libexec/docker/dockerd
patching script interpreter paths in /nix/store/sgjdr2vnkz00f3gqgq3pivc4n4ddfm91-docker-18.06.1-ce
checking for references to /build in /nix/store/sgjdr2vnkz00f3gqgq3pivc4n4ddfm91-docker-18.06.1-ce...
shrinking RPATHs of ELF executables and libraries in /nix/store/sc5amzflnlkim5my2gv46rxfrkhdjf09-docker-18.06.1-ce-man
gzipping man pages under /nix/store/sc5amzflnlkim5my2gv46rxfrkhdjf09-docker-18.06.1-ce-man/share/man/
patching script interpreter paths in /nix/store/sc5amzflnlkim5my2gv46rxfrkhdjf09-docker-18.06.1-ce-man
checking for references to /build in /nix/store/sc5amzflnlkim5my2gv46rxfrkhdjf09-docker-18.06.1-ce-man...
/nix/store/sgjdr2vnkz00f3gqgq3pivc4n4ddfm91-docker-18.06.1-ce

@c00w
Copy link
Contributor Author

c00w commented Sep 26, 2018

Thanks for merging this :D

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