84aa07a736
Previously, nar-bridge, had a couple of bugs with tracking the current directory when traversing a NAR file. The included test case looks like: ``` / (dir) /test (dir) /test/tested (file) /tested (file) ``` Previously, we would do a string prefix match between the current node and the top of the directory stack to determine if the node is in the directory. In this case `/test` is a substring of `/tested`; however, `/tested` is not in the `/test` directory. The fix is to append a `/` to the directory name when doing the prefix match, so `/test/` is not a prefix of `/tested`. Additionally, when popping the stack, we need to continuously pop the stack until the new node is in the directory at the top of the stack (stopping before we pop the root directory) Example: ``` / (dir) /a (dir) /a/b (dir) /a/b/c (file) /z (file) ``` Previously, `z` would end up in directory `/a` because we only the pop the stack once. The included test case requires both of these issues to be fixed for it to pass, so I think it is sufficient. Change-Id: I22f601babf04d39d85535ba7ad585d3970757211 Reviewed-on: https://cl.tvl.fyi/c/depot/+/9348 Tested-by: BuildkiteCI Reviewed-by: flokli <flokli@flokli.de> Autosubmit: Connor Brewster <cbrewster@hey.com> |
||
---|---|---|
.. | ||
cmd/nar_bridge | ||
pkg | ||
testdata | ||
.gitignore | ||
default.nix | ||
go.mod | ||
go.sum | ||
README.md |
//tvix/nar-bridge
This exposes a HTTP Binary cache interface (GET/HEAD/PUT requests) for a tvix- store
.
It can be used to configure a tvix-store as a substitutor for Nix, or to upload
store paths from Nix via nix copy
into a tvix-store
.