From ceb1674e9f66bcbf382130bb195d367d269ddf86 Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Wed, 11 Oct 2023 11:21:57 +0200 Subject: refactor(tvix/nar-bridge): pass root node to storev1pb.Export Bumps the go module past cl/9604 and update the consumer side. Change-Id: Id44245017f1dc2f8aac28051cdbb45b83bdc5be3 Reviewed-on: https://cl.tvl.fyi/c/depot/+/9650 Reviewed-by: Brian McGee Tested-by: BuildkiteCI --- tvix/nar-bridge/default.nix | 2 +- tvix/nar-bridge/go.mod | 2 +- tvix/nar-bridge/go.sum | 4 ++-- tvix/nar-bridge/pkg/http/nar_get.go | 2 +- tvix/nar-bridge/pkg/importer/roundtrip_test.go | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tvix/nar-bridge/default.nix b/tvix/nar-bridge/default.nix index d2984c5bad53..db31bd865790 100644 --- a/tvix/nar-bridge/default.nix +++ b/tvix/nar-bridge/default.nix @@ -6,5 +6,5 @@ pkgs.buildGoModule { name = "nar-bridge"; src = depot.third_party.gitignoreSource ./.; - vendorHash = "sha256-Lb0MOziF86JrnrA9SibHYQAaS7H054Nuf3l8tm/9Sf8="; + vendorHash = "sha256-gieFaLB3vgoSqCARCe8PZeJE8H2YQ48Fj2h2DBzUXu8="; } diff --git a/tvix/nar-bridge/go.mod b/tvix/nar-bridge/go.mod index 6e02277a4dbb..dbf120876122 100644 --- a/tvix/nar-bridge/go.mod +++ b/tvix/nar-bridge/go.mod @@ -2,7 +2,7 @@ module code.tvl.fyi/tvix/nar-bridge require ( code.tvl.fyi/tvix/castore/protos v0.0.0-20231009220507-d6e0c5ab9bb7 - code.tvl.fyi/tvix/store/protos v0.0.0-20231010185549-e7ea67342035 + code.tvl.fyi/tvix/store/protos v0.0.0-20231010202247-8ec3506856aa github.com/alecthomas/kong v0.7.1 github.com/go-chi/chi v1.5.4 github.com/go-chi/chi/v5 v5.0.7 diff --git a/tvix/nar-bridge/go.sum b/tvix/nar-bridge/go.sum index 469a6970bfdc..f237b4dcdbe1 100644 --- a/tvix/nar-bridge/go.sum +++ b/tvix/nar-bridge/go.sum @@ -1,7 +1,7 @@ code.tvl.fyi/tvix/castore/protos v0.0.0-20231009220507-d6e0c5ab9bb7 h1:gX2LWo/QHwGZK2QsDap9Lx1GrKLPX6mfgeNbGK3mwrU= code.tvl.fyi/tvix/castore/protos v0.0.0-20231009220507-d6e0c5ab9bb7/go.mod h1:hj0y8RPthqn1QPj8u2jFe2vzH7NouUoclrwo1/CSbuc= -code.tvl.fyi/tvix/store/protos v0.0.0-20231010185549-e7ea67342035 h1:/CjyjG/4PiByWnO6q26bLGjFPP96oZCMMX63UA9wkdc= -code.tvl.fyi/tvix/store/protos v0.0.0-20231010185549-e7ea67342035/go.mod h1:RmijF3bfElwtZpNkBtW66QEj/jldGNu+W2HlgZro7lw= +code.tvl.fyi/tvix/store/protos v0.0.0-20231010202247-8ec3506856aa h1:FwMglyEtXebo5rXgtLkxs+y11UVxAekGboFotdbfHcg= +code.tvl.fyi/tvix/store/protos v0.0.0-20231010202247-8ec3506856aa/go.mod h1:RmijF3bfElwtZpNkBtW66QEj/jldGNu+W2HlgZro7lw= github.com/alecthomas/assert/v2 v2.1.0 h1:tbredtNcQnoSd3QBhQWI7QZ3XHOVkw1Moklp2ojoH/0= github.com/alecthomas/kong v0.7.1 h1:azoTh0IOfwlAX3qN9sHWTxACE2oV8Bg2gAwBsMwDQY4= github.com/alecthomas/kong v0.7.1/go.mod h1:n1iCIO2xS46oE8ZfYCNDqdR0b0wZNrXAIAqro/2132U= diff --git a/tvix/nar-bridge/pkg/http/nar_get.go b/tvix/nar-bridge/pkg/http/nar_get.go index 85405d81f463..eecc59900784 100644 --- a/tvix/nar-bridge/pkg/http/nar_get.go +++ b/tvix/nar-bridge/pkg/http/nar_get.go @@ -95,7 +95,7 @@ func renderNar( // render the NAR file err := storev1pb.Export( w, - pathInfo, + pathInfo.Node, func(directoryDigest []byte) (*castorev1pb.Directory, error) { log.WithField("directory", base64.StdEncoding.EncodeToString(directoryDigest)).Debug("Get directory") directoryRefStr := hex.EncodeToString(directoryDigest) diff --git a/tvix/nar-bridge/pkg/importer/roundtrip_test.go b/tvix/nar-bridge/pkg/importer/roundtrip_test.go index 89603cfcfdbe..1daba449bd33 100644 --- a/tvix/nar-bridge/pkg/importer/roundtrip_test.go +++ b/tvix/nar-bridge/pkg/importer/roundtrip_test.go @@ -59,7 +59,7 @@ func TestRoundtrip(t *testing.T) { var buf bytes.Buffer err = storev1pb.Export( &buf, - pathInfo, + pathInfo.Node, func(directoryDgst []byte) (*castorev1pb.Directory, error) { d, found := directoriesMap[base64.StdEncoding.EncodeToString(directoryDgst)] if !found { -- cgit 1.4.1