chore(tvix/nar-bridge): bump go-nix dependency

nixpath.FromString -> storepath.FromAbsolutePath.

See https://github.com/nix-community/go-nix/pull/113 for details.

Closes: https://b.tvl.fyi/issues/314
Change-Id: I25277fb6006cbbb2a323ffb5809a1be500822a97
Reviewed-on: https://cl.tvl.fyi/c/depot/+/9551
Autosubmit: flokli <flokli@flokli.de>
Tested-by: BuildkiteCI
Reviewed-by: Connor Brewster <cbrewster@hey.com>
This commit is contained in:
Florian Klink 2023-10-05 18:26:30 +03:00 committed by clbot
parent 600815c168
commit 61e5a63fe1
6 changed files with 11 additions and 9 deletions

View file

@ -9,7 +9,7 @@ import (
"github.com/go-chi/chi/v5"
"github.com/nix-community/go-nix/pkg/narinfo"
"github.com/nix-community/go-nix/pkg/nixbase32"
"github.com/nix-community/go-nix/pkg/nixpath"
"github.com/nix-community/go-nix/pkg/storepath"
"github.com/sirupsen/logrus"
log "github.com/sirupsen/logrus"
)
@ -82,7 +82,7 @@ func registerNarinfoPut(s *Server) {
// the bytes in pathInfo.References, and the full strings in pathInfo.Narinfo.ReferenceNames.
referencesBytes := make([][]byte, 0)
for _, reference := range narInfo.References {
np, err := nixpath.FromString(path.Join(nixpath.StoreDir, reference))
storePath, err := storepath.FromString(reference)
if err != nil {
log.WithField("reference", reference).WithError(err).Error("unable to parse reference")
w.WriteHeader(http.StatusBadRequest)
@ -93,7 +93,7 @@ func registerNarinfoPut(s *Server) {
return
}
referencesBytes = append(referencesBytes, np.Digest)
referencesBytes = append(referencesBytes, storePath.Digest)
}
// assemble the []*storev1pb.NARInfo_Signature{} from narinfo.Signatures.