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

buildGoPackage: re-enable GOCACHE #49346

Merged
merged 1 commit into from Oct 28, 2018
Merged

buildGoPackage: re-enable GOCACHE #49346

merged 1 commit into from Oct 28, 2018

Conversation

Mic92
Copy link
Member

@Mic92 Mic92 commented Oct 28, 2018

If projects uses go1.11 modules GOCACHE is required.
Also if buildGoPackage is used in a nix-shell setting we don't
want to override GOCACHE to allow incremental builds.
This should be backported to 18.09

Motivation for this change
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)
  • Fits CONTRIBUTING.md.

If projects uses go1.11 modules GOCACHE is required.
Also if buildGoPackage is used in a nix-shell setting we don't
want to override GOCACHE to allow incremental builds.
This should be backported to 18.09
@@ -103,6 +103,7 @@ go.stdenv.mkDerivation (

'') + ''
export GOPATH=$NIX_BUILD_TOP/go:$GOPATH
export GOCACHE=$TMPDIR/go-cache
Copy link
Member Author

Choose a reason for hiding this comment

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

This will be /build/go-cache in practice.

@@ -193,9 +194,6 @@ go.stdenv.mkDerivation (
find $bin/bin -type f -exec ${removeExpr removeReferences} '{}' + || true
'';

# Disable go cache, which is not reused in nix anyway
GOCACHE = "off";
Copy link
Member Author

Choose a reason for hiding this comment

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

This was also set in nix-shell which was not ideal.

@Mic92
Copy link
Member Author

Mic92 commented Oct 28, 2018

@GrahamcOfBorg build direnv

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: direnv

Partial log (click to expand)

strip is /nix/store/p9akxn2sfy4wkhqdqa3li97pc6jaz3r1-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/vvygqv2418nlcsr6h1vcz4nvg11fj50v-direnv-2.17.0-bin/bin
patching script interpreter paths in /nix/store/vvygqv2418nlcsr6h1vcz4nvg11fj50v-direnv-2.17.0-bin
checking for references to /build in /nix/store/vvygqv2418nlcsr6h1vcz4nvg11fj50v-direnv-2.17.0-bin...
cannot find section .dynamic
shrinking RPATHs of ELF executables and libraries in /nix/store/l9zap3hlv39hdyq0r3hmxy8fhrzkbkvy-direnv-2.17.0
strip is /nix/store/p9akxn2sfy4wkhqdqa3li97pc6jaz3r1-binutils-2.30/bin/strip
patching script interpreter paths in /nix/store/l9zap3hlv39hdyq0r3hmxy8fhrzkbkvy-direnv-2.17.0
checking for references to /build in /nix/store/l9zap3hlv39hdyq0r3hmxy8fhrzkbkvy-direnv-2.17.0...
/nix/store/vvygqv2418nlcsr6h1vcz4nvg11fj50v-direnv-2.17.0-bin

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: direnv

Partial log (click to expand)

strip is /nix/store/vcc4svb8gy29g4pam2zja6llkbcwsyiq-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/ff5kdlf0q8024wygsn7gq6iqjf7hkmpg-direnv-2.17.0-bin/bin
patching script interpreter paths in /nix/store/ff5kdlf0q8024wygsn7gq6iqjf7hkmpg-direnv-2.17.0-bin
checking for references to /build in /nix/store/ff5kdlf0q8024wygsn7gq6iqjf7hkmpg-direnv-2.17.0-bin...
cannot find section .dynamic
shrinking RPATHs of ELF executables and libraries in /nix/store/qkzch66cpz4zb9y0wvcilj1y2gm9yss7-direnv-2.17.0
strip is /nix/store/vcc4svb8gy29g4pam2zja6llkbcwsyiq-binutils-2.30/bin/strip
patching script interpreter paths in /nix/store/qkzch66cpz4zb9y0wvcilj1y2gm9yss7-direnv-2.17.0
checking for references to /build in /nix/store/qkzch66cpz4zb9y0wvcilj1y2gm9yss7-direnv-2.17.0...
/nix/store/ff5kdlf0q8024wygsn7gq6iqjf7hkmpg-direnv-2.17.0-bin

@GrahamcOfBorg
Copy link

Success on x86_64-darwin (full log)

Attempted: direnv

Partial log (click to expand)

install direnv /nix/store/9riz9jf33pgnxnpy0zh2qxf1clszx1yw-direnv-2.17.0-bin/bin
cp -R man/*.1 /nix/store/9riz9jf33pgnxnpy0zh2qxf1clszx1yw-direnv-2.17.0-bin/share/man/man1
post-installation fixup
gzipping man pages under /nix/store/9riz9jf33pgnxnpy0zh2qxf1clszx1yw-direnv-2.17.0-bin/share/man/
strip is /nix/store/g5r4apl0za012ffs6ladinwa5w0m1l3k-cctools-binutils-darwin/bin/strip
stripping (with command strip and flags -S) in /nix/store/9riz9jf33pgnxnpy0zh2qxf1clszx1yw-direnv-2.17.0-bin/bin
patching script interpreter paths in /nix/store/9riz9jf33pgnxnpy0zh2qxf1clszx1yw-direnv-2.17.0-bin
strip is /nix/store/g5r4apl0za012ffs6ladinwa5w0m1l3k-cctools-binutils-darwin/bin/strip
patching script interpreter paths in /nix/store/vz112dchzdwdbcpzbajvzmz2d9vhxh45-direnv-2.17.0
/nix/store/9riz9jf33pgnxnpy0zh2qxf1clszx1yw-direnv-2.17.0-bin

@Mic92
Copy link
Member Author

Mic92 commented Oct 28, 2018

Tested on a significant part of our go packages.

@Mic92 Mic92 merged commit ee73826 into NixOS:master Oct 28, 2018
@Mic92 Mic92 deleted the gocache branch October 28, 2018 16:02
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

2 participants