Commit e6adf150 authored by Elliot Cameron's avatar Elliot Cameron
Browse files

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.
parent e81285a4
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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 ++ [