From e6adf1505c5413a7e43ad9c7e770a228b7f414f0 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 6f568c0eb4f9..e0b7eb81328b 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 ++ [