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
buildGoModule: copy vendor instead of symlinking #101374
Conversation
@@ -126,7 +126,7 @@ let | |||
inherit (go) GOOS GOARCH; | |||
|
|||
GO111MODULE = "on"; | |||
GOFLAGS = "-mod=vendor"; | |||
GOFLAGS = "-mod=vendor -trimpath"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this make find $out/{bin,libexec,lib} -type f 2>/dev/null | xargs -r ${removeExpr removeReferences} || true
obsolete or what paths does it remove?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we should be able to drop removeReferences
.
I started working on this on a different branch and thought I'd combine them to save a few rebuilds but I seem to have messed them up. I'll need to fix it and retest.
pkgs/tools/misc/direnv/default.nix
Outdated
@@ -18,6 +18,11 @@ buildGoModule rec { | |||
stdenv.lib.optionalString (!stdenv.hostPlatform.isWindows) | |||
"${bash}/bin/bash"; | |||
|
|||
# fix hardcoded GOFLAGS in makefile | |||
postPatch = '' | |||
substituteInPlace GNUmakefile --replace "export GOFLAGS=-mod=vendor" "" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
makefiles, etc that don't respect our GOFLAGS
are a problem. I haven't checked everything yet but a lot of packages that override phases do respect our flags or they set trimpath
themselves.
We could keep removeReferences
anyway to avoid needing to do this type of fix?
Not that many packages override a *Phase
, probably better to drop removeReferences
.
Allow the second phase to modify the contents of the vendor directory.
We should have new versions of |
Motivation for this change
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)