From 10183e7beea0ca8b4201e2260e694bae45e686da Mon Sep 17 00:00:00 2001 From: Elliot Cameron Date: Wed, 10 Apr 2024 17:17:26 -0400 Subject: [PATCH] buildGoModule: propagate setSourceRoot to goModules The underlying goModules derivation must have the same source root as the overall package. sourceRoot is being propagated already, but setSourceRoot was not. This was surely an oversight. This is implemented in such a way that it cannot break existing vendorHashes unless the package is using setSourceRoot already. If that's the case, then the package is either broken or found a workaround to do deal with this very issue (e.g. by using `cd path` in an early phase). A simple search (`rg setSourceRoot $(rg -l buildGoModule)`) reveals that no such packages obviously exist in Nixpkgs. --- pkgs/build-support/go/module.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/build-support/go/module.nix b/pkgs/build-support/go/module.nix index a5e722b0ac08..afe97d12ea6a 100644 --- a/pkgs/build-support/go/module.nix +++ b/pkgs/build-support/go/module.nix @@ -84,6 +84,7 @@ let preBuild = args.preBuild or ""; postBuild = args.modPostBuild or ""; sourceRoot = args.sourceRoot or ""; + setSourceRoot = args.setSourceRoot or ""; env = args.env or { }; impureEnvVars = lib.fetchers.proxyImpureEnvVars ++ [