Commit a1422a7f authored by Sergei Trofimovich's avatar Sergei Trofimovich Committed by zowoq
Browse files

build-support/go: fix eval of `vendorSha256` accesses

Before the change there was no way to poll for presence of
`vendorSha256` attribute:

    $ nix-instantiate --strict --eval --expr 'with import ./. {}; _3mux.vendorSha256 or "no hash"'
       error: attribute 'vendorSha256' missing
          292|     passthru = passthru // { inherit go goModules vendorHash; } // { inherit (args') vendorSha256; };
             |                                                                     ^

After the change the poll happens as expected:

    $ nix-instantiate --strict --eval --expr 'with import ./. {}; _3mux.vendorSha256 or "no hash"'
    "no hash"
parent 7b4bde6b
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -289,7 +289,8 @@ let

    disallowedReferences = lib.optional (!allowGoReference) go;

    passthru = passthru // { inherit go goModules vendorHash; } // { inherit (args') vendorSha256; };
    passthru = passthru // { inherit go goModules vendorHash; }
                        // lib.optionalAttrs (args' ? vendorSha256 ) { inherit (args') vendorSha256; };

    meta = {
      # Add default meta information