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

goimports from gotools seems to depend on go at runtime in some cases. #390770

Merged
merged 1 commit into from
Mar 22, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions pkgs/by-name/go/gotools/package.nix
Original file line number Diff line number Diff line change
@@ -2,6 +2,8 @@
lib,
buildGoModule,
fetchFromGitHub,
makeWrapper,
go,
}:

buildGoModule rec {
@@ -16,23 +18,31 @@ buildGoModule rec {
hash = "sha256-yUkdZSe/GV0w1qK8aQjcFE4tNKYC8f4JeFgPiv8GlQc=";
};

allowGoReference = true;
doCheck = false;

vendorHash = "sha256-+jhCNi7bGkRdI1Ywfe3q4i+zcm3UJ0kbQalsDD3WkS4=";

nativeBuildInputs = [ makeWrapper ];

postPatch = ''
# The gopls folder contains a Go submodule which causes a build failure
# and lives in its own package named gopls.
rm -r gopls
'';

vendorHash = "sha256-+jhCNi7bGkRdI1Ywfe3q4i+zcm3UJ0kbQalsDD3WkS4=";

doCheck = false;

# Set GOTOOLDIR for derivations adding this to buildInputs
postInstall = ''
mkdir -p $out/nix-support
substitute ${./setup-hook.sh} $out/nix-support/setup-hook \
--subst-var-by bin $out
'';

postFixup = ''
wrapProgram $out/bin/goimports \
--suffix PATH : ${lib.makeBinPath [ go ]}
'';

meta = with lib; {
description = "Additional tools for Go development";
longDescription = ''