diff --git a/api/unpack/index.go b/api/unpack/index.go index d590d41..5d10aff 100644 --- a/api/unpack/index.go +++ b/api/unpack/index.go @@ -11,8 +11,8 @@ import ( "path/filepath" "strings" - "github.com/numtide/nar-serve/go-nix/libstore" - "github.com/numtide/nar-serve/go-nix/nar" + "github.com/numtide/go-nix/nar" + "github.com/numtide/nar-serve/libstore" "github.com/ulikunitz/xz" ) diff --git a/go-nix/nar/common.go b/go-nix/nar/common.go deleted file mode 100644 index 6dd7979..0000000 --- a/go-nix/nar/common.go +++ /dev/null @@ -1,22 +0,0 @@ -package nar - -// magic! -const narVersionMagic1 = "nix-archive-1" - -// Enum of all the entry types possible -type EntryType string - -const ( - // TypeUnknown represents a broken entry - TypeUnknown = EntryType("") - // TypeRegular represents a regular file - TypeRegular = EntryType("regular") - // TypeDirectory represents a directory entry - TypeDirectory = EntryType("directory") - // TypeSymlink represents a file symlink - TypeSymlink = EntryType("symlink") -) - -func (t EntryType) String() string { - return string(t) -} diff --git a/go-nix/nar/doc.go b/go-nix/nar/doc.go deleted file mode 100644 index d654646..0000000 --- a/go-nix/nar/doc.go +++ /dev/null @@ -1,3 +0,0 @@ -// Package nar implement functions to deal with the Nix Archive format. This -// is the format that is being used to pack and distribute Nix build results. -package nar diff --git a/go-nix/nar/fixtures/nar_1094wph9z4nwlgvsd53abfz8i117ykiv5dwnq9nnhz846s7xqd7d.nar b/go-nix/nar/fixtures/nar_1094wph9z4nwlgvsd53abfz8i117ykiv5dwnq9nnhz846s7xqd7d.nar deleted file mode 100644 index 6cb0b16..0000000 Binary files a/go-nix/nar/fixtures/nar_1094wph9z4nwlgvsd53abfz8i117ykiv5dwnq9nnhz846s7xqd7d.nar and /dev/null differ diff --git a/go-nix/nar/header.go b/go-nix/nar/header.go deleted file mode 100644 index 8f68cbb..0000000 --- a/go-nix/nar/header.go +++ /dev/null @@ -1,49 +0,0 @@ -package nar - -import ( - "os" - "time" -) - -// Header represents a single header in a NAR archive. Some fields may not -// be populated depending on the Type. -type Header struct { - Type EntryType // Typeflag is the type of header entry. - Name string // Name of the file entry - Linkname string // Target name of link (valid for TypeSymlink) - Size int64 // Logical file size in bytes - Executable bool // Set to true for files that are executable -} - -// FileInfo returns an os.FileInfo for the Header. -func (h *Header) FileInfo() os.FileInfo { - return headerFileInfo{h} -} - -type headerFileInfo struct { - h *Header -} - -func (fi headerFileInfo) Size() int64 { return fi.h.Size } -func (fi headerFileInfo) IsDir() bool { return fi.h.Type == TypeDirectory } -func (fi headerFileInfo) ModTime() time.Time { return time.Unix(0, 0) } -func (fi headerFileInfo) Sys() interface{} { return fi.h } - -// FIXME: make sure that this is OK -func (fi headerFileInfo) Name() string { return fi.h.Name } -func (fi headerFileInfo) Mode() (mode os.FileMode) { - if fi.h.Executable || fi.h.Type == TypeDirectory { - mode = 0755 - } else { - mode = 0644 - } - - switch fi.h.Type { - case TypeDirectory: - mode |= os.ModeDir - case TypeSymlink: - mode |= os.ModeSymlink - } - - return mode -} diff --git a/go-nix/nar/list.go b/go-nix/nar/list.go deleted file mode 100644 index a853496..0000000 --- a/go-nix/nar/list.go +++ /dev/null @@ -1,41 +0,0 @@ -package nar - -import ( - "encoding/json" - "fmt" - "io" -) - -// LSRoot represents the .ls file root entry -type LSRoot struct { - Version int `json:"version"` - Root LSEntry -} - -// LSEntry is one of the entr -type LSEntry struct { - Type EntryType `json:"type"` - Entries map[string]LSEntry `json:"entries"` - Size int64 `json:"size"` - Target string `json:"target"` - Executable bool `json:"executable"` - NAROffset int64 `json:"narOffset"` -} - -// ParseLS parses the NAR .ls file format -func ParseLS(r io.Reader) (*LSRoot, error) { - root := LSRoot{} - - dec := json.NewDecoder(r) - dec.DisallowUnknownFields() - - err := dec.Decode(&root) - if err != nil { - return nil, err - } - if root.Version != 1 { - return nil, fmt.Errorf("invalide version %d", root.Version) - } - - return &root, err -} diff --git a/go-nix/nar/list_test.go b/go-nix/nar/list_test.go deleted file mode 100644 index 7771209..0000000 --- a/go-nix/nar/list_test.go +++ /dev/null @@ -1,39 +0,0 @@ -package nar_test - -import ( - "fmt" - "strings" - "testing" - - "github.com/numtide/nar-serve/go-nix/nar" - "github.com/stretchr/testify/assert" -) - -const fixture = ` -{ - "version": 1, - "root": { - "type": "directory", - "entries": { - "bin": { - "type": "directory", - "entries": { - "curl": { - "type": "regular", - "size": 182520, - "executable": true, - "narOffset": 400 - } - } - } - } - } -} -` - -func TestLS(t *testing.T) { - r := strings.NewReader(fixture) - root, err := nar.ParseLS(r) - assert.NoError(t, err) - fmt.Println(root) -} diff --git a/go-nix/nar/reader.go b/go-nix/nar/reader.go deleted file mode 100644 index 040a070..0000000 --- a/go-nix/nar/reader.go +++ /dev/null @@ -1,368 +0,0 @@ -package nar - -import ( - "fmt" - "io" - "io/ioutil" - "path" -) - -const ( - Node = "node" - Entry = "entry" -) - -// Reader providers sequential access to the contents of a NAR archive. -// Reader.Next advances to the next file in the archive (including the first), -// and then Reader can be treated as an io.Reader to access the file's data. -type Reader struct { - r io.Reader - - magic bool - level []string - - path string // Tracks the current path - - pad int64 // Amount of padding (ignored) after current file entry - curr fileReader // Reader for current file entry - - // err is a perssitent error. - // Is it the responsibility of every exported method of Reader to ensure - // that this error is sticky. - err error -} - -// NewReader creates a new Reader reading from r. -func NewReader(r io.Reader) *Reader { - return &Reader{r: r, curr: &nullFileReader{}} -} - -// Next advances tot he next entry in the NAR archive. The Header.Size -// determines how many bytes can be read for the next file. Any remaining data -// in the current file is automatically discarded. -// -// io.EOF is returned at the end of input. -func (nar *Reader) Next() (*Header, error) { - if nar.err != nil { - return nil, nar.err - } - - hdr, err := nar.next() - nar.err = err - return hdr, err -} - -func pop(stack []string) ([]string, string, error) { - if len(stack) == 0 { - return nil, "", fmt.Errorf("cannot pop an empty stack") - } - item := stack[len(stack)-1] - newStack := stack[:len(stack)-1] - return newStack, item, nil -} - -func pop2(stack []string, expected string) ([]string, error) { - newStack, item, err := pop(stack) - if err != nil { - return nil, err - } - if item != expected { - return nil, fmt.Errorf("expect %s but got %s", expected, item) - } - return newStack, nil -} - -func (nar *Reader) next() (*Header, error) { - // Parse the magic header first - if !nar.magic { - nar.magic = true - - s, err := readString(nar.r) - if err != nil { - return nil, err - } - - if s != narVersionMagic1 { - return nil, fmt.Errorf("expected '%s', got '%s'", narVersionMagic1, s) - } - - err = expectString(nar.r, "(") - if err != nil { - return nil, err - } - - nar.level = append(nar.level, Node) - } - - if _, ok := nar.curr.(*resFileReader); ok { - // Discard the remainder of the file and any padding. - if err := discard(nar.r, nar.curr.PhysicalRemaining()+nar.pad); err != nil { - return nil, err - } - nar.pad = 0 - nar.curr = &nullFileReader{} - - err := expectString(nar.r, ")") - if err != nil { - return nil, err - } - - nar.level, err = pop2(nar.level, Node) - if err != nil { - return nil, err - } - } - - h := &Header{} - - for { - s, err := readString(nar.r) - if err != nil { - return nil, err - } - - switch s { - case ")": - var item string - nar.level, item, err = pop(nar.level) - - switch item { - case Node: - // nothing to do, node from a directory - case Entry: - nar.path = path.Dir(nar.path) - if nar.path == "." { - nar.path = "" - } - default: - err = fmt.Errorf("BUG: unknown item type %s", item) - } - - // end of file - if len(nar.level) == 0 { - s, err := readString(nar.r) - if err == nil { - return nil, fmt.Errorf("expected end of file, got %s", s) - } - // should return io.EOF - return nil, err - } - case "type": - if h.Type != TypeUnknown { - return nil, fmt.Errorf("multiple type fields") - } - - s, err = readString(nar.r) - if err != nil { - return nil, err - } - - switch s { - case "regular": - h.Type = TypeRegular - case "directory": - h.Type = TypeDirectory - return h, nil - case "symlink": - h.Type = TypeSymlink - - if err = expectString(nar.r, "target"); err != nil { - return nil, err - } - s, err := readString(nar.r) - if err != nil { - return nil, err - } - h.Linkname = s - if err = expectString(nar.r, ")"); err != nil { - return nil, err - } - nar.level, err = pop2(nar.level, Node) - if err != nil { - return nil, err - } - return h, nil - default: - return nil, fmt.Errorf("unknown file type %s", s) - } - case "contents": - if h.Type != TypeRegular { - return nil, fmt.Errorf("contents for a non-regular file") - } - - h.Size, err = readLongLong(nar.r) - if err != nil { - return nil, err - } - - nar.pad = blockPadding(h.Size) - nar.curr = &resFileReader{nar.r, h.Size} - //fmt.Println("pad", nar.pad) - - return h, nil - case "executable": - if h.Type != TypeRegular { - return nil, fmt.Errorf("executable marker for a non-regular file") - } - s, err = readString(nar.r) - if err != nil { - return nil, err - } - if s != "" { - return nil, fmt.Errorf("executable marker has non-empty value") - } - h.Executable = true - case "entry": - /* - if h.Type != TypeDirectory { - return nil, fmt.Errorf("entry for a non-directory") - } - */ - err = expectString(nar.r, "(") - if err != nil { - return nil, err - } - nar.level = append(nar.level, Entry) - // TODO: read the directory - //return h, nil - case "name": - name, err := readString(nar.r) - if err != nil { - return nil, err - } - - if name == "." || name == ".." { - return nil, fmt.Errorf("NAR contains invalid file name '%s", name) - } - for _, char := range name { - if char == '/' || char == 0 { - return nil, fmt.Errorf("NAR contains invalid file name '%s", name) - } - } - - if nar.path == "" { - h.Name = name - } else { - h.Name = nar.path + "/" + name - } - nar.path = h.Name - case "node": - if h.Name == "" { - return nil, fmt.Errorf("entry name missing") - } - err = expectString(nar.r, "(") - if err != nil { - return nil, err - } - nar.level = append(nar.level, Node) - // recurse - default: - return nil, fmt.Errorf("unexpected field '%s'", s) - } - } -} - -// Read reads from the current file in the NAR archive. It returns (0, io.EOF) -// when it reaches the end of that file, until Next is called to advance to -// the next file. -// -// Calling Read on special types like TypeSymlink or TypeDir returns (0, -// io.EOF) regardless of what the Header.Size claims. -func (nar *Reader) Read(b []byte) (int, error) { - if nar.err != nil { - return 0, nar.err - } - - n, err := nar.curr.Read(b) - if err != nil && err != io.EOF { - nar.err = err - } - return n, err -} - -type fileReader interface { - Read(b []byte) (n int, err error) - WriteTo(w io.Writer) (int64, error) - PhysicalRemaining() int64 -} - -type nullFileReader struct{} - -func (fr *nullFileReader) Read(b []byte) (n int, err error) { - return 0, io.EOF -} - -func (fr *nullFileReader) WriteTo(w io.Writer) (int64, error) { - return 0, io.EOF -} - -func (fr nullFileReader) PhysicalRemaining() int64 { - return int64(0) -} - -type resFileReader struct { - r io.Reader // Underlying Reader - nb int64 // Number of remaining bytes to read -} - -func (fr *resFileReader) Read(b []byte) (n int, err error) { - if int64(len(b)) > fr.nb { - b = b[:fr.nb] - } - - if len(b) > 0 { - n, err = fr.r.Read(b) - fr.nb -= int64(n) - } - - switch { - case err == io.EOF && fr.nb > 0: - return n, io.ErrUnexpectedEOF - case err == nil && fr.nb == 0: - return n, io.EOF - default: - return n, err - } -} - -func (fr *resFileReader) WriteTo(w io.Writer) (int64, error) { - return io.Copy(w, struct{ io.Reader }{fr}) -} - -func (fr resFileReader) PhysicalRemaining() int64 { - return fr.nb -} - -func blockPadding(n int64) int64 { - return (8 - (n % 8)) % 8 -} - -// discard skips n bytes in r, reporting an error if unable to do so. -func discard(r io.Reader, n int64) error { - // If possible, Seek to the last byte before the end of the data section. - // Do this because Seek is often lazy about reporting errors; this will mask - // the fact that the stream may be truncated. We can rely on the - // io.CopyN done shortly afterwards to trigger any IO errors. - var seekSkipped int64 // Number of bytes skipped via Seek - if sr, ok := r.(io.Seeker); ok && n > 1 { - // Not all io.Seeker can actually Seek. For example, os.Stdin implements - // io.Seeker, but calling Seek always returns an error and performs - // no action. Thus, we try an innocent seek to the current position - // to see if Seek is really supported. - pos1, err := sr.Seek(0, io.SeekCurrent) - if pos1 >= 0 && err == nil { - // Seek seems supported, so perform the real Seek. - pos2, err := sr.Seek(int64(n-1), io.SeekCurrent) - if pos2 < 0 || err != nil { - return err - } - seekSkipped = pos2 - pos1 - } - } - - copySkipped, err := io.CopyN(ioutil.Discard, r, n-seekSkipped) - if err == io.EOF && seekSkipped+copySkipped < n { - err = io.ErrUnexpectedEOF - } - return err -} diff --git a/go-nix/nar/reader_test.go b/go-nix/nar/reader_test.go deleted file mode 100644 index 9962c4e..0000000 --- a/go-nix/nar/reader_test.go +++ /dev/null @@ -1,210 +0,0 @@ -package nar_test - -import ( - "io" - "os" - "testing" - - "github.com/numtide/nar-serve/go-nix/nar" - "github.com/stretchr/testify/assert" -) - -func TestReader(t *testing.T) { - f, err := os.Open("fixtures/nar_1094wph9z4nwlgvsd53abfz8i117ykiv5dwnq9nnhz846s7xqd7d.nar") - if !assert.NoError(t, err) { - return - } - - p := nar.NewReader(f) - - n, err := p.Read(make([]byte, 1000)) - assert.Equal(t, 0, n) - assert.Equal(t, io.EOF, err) - - headers := []nar.Header{ - {Type: nar.TypeDirectory}, - {Type: nar.TypeDirectory, Name: "bin"}, - { - Type: nar.TypeRegular, - Name: "bin/arp", - Executable: true, - Size: 55288, - }, - { - Type: nar.TypeSymlink, - Name: "bin/dnsdomainname", - Linkname: "hostname", - }, - { - Type: nar.TypeSymlink, - Name: "bin/domainname", - Linkname: "hostname", - }, - { - Type: nar.TypeRegular, - Name: "bin/hostname", - Executable: true, - Size: 17704, - }, - { - Type: nar.TypeRegular, - Name: "bin/ifconfig", - Executable: true, - Size: 72576, - }, - { - Type: nar.TypeRegular, - Name: "bin/nameif", - Executable: true, - Size: 18776, - }, - { - Type: nar.TypeRegular, - Name: "bin/netstat", - Executable: true, - Size: 131784, - }, - { - Type: nar.TypeSymlink, - Name: "bin/nisdomainname", - Linkname: "hostname", - }, - { - Type: nar.TypeRegular, - Name: "bin/plipconfig", - Executable: true, - Size: 13160, - }, - { - Type: nar.TypeRegular, - Name: "bin/rarp", - Executable: true, - Size: 30384, - }, - { - Type: nar.TypeRegular, - Name: "bin/route", - Executable: true, - Size: 61928, - }, - { - Type: nar.TypeRegular, - Name: "bin/slattach", - Executable: true, - Size: 35672, - }, - { - Type: nar.TypeSymlink, - Name: "bin/ypdomainname", - Linkname: "hostname", - }, - { - Type: nar.TypeSymlink, - Name: "sbin", - Linkname: "bin", - }, - { - Type: nar.TypeDirectory, - Name: "share", - }, - { - Type: nar.TypeDirectory, - Name: "share/man", - }, - { - Type: nar.TypeDirectory, - Name: "share/man/man1", - }, - { - Type: nar.TypeRegular, - Name: "share/man/man1/dnsdomainname.1.gz", - Size: 40, - }, - { - Type: nar.TypeRegular, - Name: "share/man/man1/domainname.1.gz", - Size: 40, - }, - { - Type: nar.TypeRegular, - Name: "share/man/man1/hostname.1.gz", - Size: 1660, - }, - { - Type: nar.TypeRegular, - Name: "share/man/man1/nisdomainname.1.gz", - Size: 40, - }, - { - Type: nar.TypeRegular, - Name: "share/man/man1/ypdomainname.1.gz", - Size: 40, - }, - { - Type: nar.TypeDirectory, - Name: "share/man/man5", // FIXME: "share/man/man5" - }, - { - Type: nar.TypeRegular, - Name: "share/man/man5/ethers.5.gz", - Size: 563, - }, - { - Type: nar.TypeDirectory, - Name: "share/man/man8", - }, - { - Type: nar.TypeRegular, - Name: "share/man/man8/arp.8.gz", - Size: 2464, - }, - { - Type: nar.TypeRegular, - Name: "share/man/man8/ifconfig.8.gz", - Size: 3382, - }, - { - Type: nar.TypeRegular, - Name: "share/man/man8/nameif.8.gz", - Size: 523, - }, - { - Type: nar.TypeRegular, - Name: "share/man/man8/netstat.8.gz", - Size: 4284, - }, - { - Type: nar.TypeRegular, - Name: "share/man/man8/plipconfig.8.gz", - Size: 889, - }, - { - Type: nar.TypeRegular, - Name: "share/man/man8/rarp.8.gz", - Size: 1198, - }, - { - Type: nar.TypeRegular, - Name: "share/man/man8/route.8.gz", - Size: 3525, - }, - { - Type: nar.TypeRegular, - Name: "share/man/man8/slattach.8.gz", - Size: 1441, - }, - } - - for i, expectH := range headers { - hdr, err := p.Next() - if !assert.NoError(t, err, i) { - return - } - assert.Equal(t, &expectH, hdr) - } - - hdr, err := p.Next() - assert.Nil(t, hdr) - // expect to be finished - assert.Equal(t, io.EOF, err) -} diff --git a/go-nix/nar/serialize.go b/go-nix/nar/serialize.go deleted file mode 100644 index b567d9b..0000000 --- a/go-nix/nar/serialize.go +++ /dev/null @@ -1,104 +0,0 @@ -package nar - -import ( - "fmt" - "io" -) - -func readString(r io.Reader) (string, error) { - size, err := readLongLong(r) - if err != nil { - return "", err - } - bs := make([]byte, size) - n, err := r.Read(bs) - if err != nil { - return "", err - } - if int64(n) != size { - return "", fmt.Errorf("expected %d bytes, not %d", size, n) - } - - for _, char := range bs { - if char == 0 { - return "", fmt.Errorf("expected no zeros, got %d %v", size, bs) - } - } - - err = readPadding(r, size) - if err != nil { - return "", err - } - - //fmt.Println("STR", string(bs)) - - return string(bs), nil -} - -func readPadding(r io.Reader, l int64) error { - pad := 8 - (l % 8) - if pad == 8 { - // lucky! no need for padding here - return nil - } - - bs := make([]byte, pad) - n, err := r.Read(bs) - if err != nil { - return err - } - if int64(n) != pad { - return fmt.Errorf("expected to read %d, got %d", pad, n) - } - for _, char := range bs { - if char != 0 { - return fmt.Errorf("expected zero padding, got %v", bs) - } - } - return nil -} - -const maxInt64 = 1<<63 - 1 - -func readLongLong(r io.Reader) (int64, error) { - var num uint64 - bs := make([]byte, 8, 8) - n, err := r.Read(bs) - if err != nil { - return 0, err - } - // FIXME: I think that io.Reader guarantees that - if n != 8 { - return 0, fmt.Errorf("expected to read 8 bytes, not %d", n) - } - - num = - uint64(bs[0]) | - uint64(bs[1])<<8 | - uint64(bs[2])<<16 | - uint64(bs[3])<<24 | - uint64(bs[4])<<32 | - uint64(bs[5])<<40 | - uint64(bs[6])<<48 | - uint64(bs[7])<<56 - - if num > maxInt64 { - return 0, fmt.Errorf("number is too big: %d > %d", num, maxInt64) - } - - return int64(num), err -} - -func expectString(r io.Reader, expected string) error { - s, err := readString(r) - if err != nil { - if err == io.EOF { - err = io.ErrUnexpectedEOF - } - return err - } - if s != expected { - return fmt.Errorf("expected '%s' got '%s'", expected, s) - } - return nil -} diff --git a/go-nix/nar/serialize_test.go b/go-nix/nar/serialize_test.go deleted file mode 100644 index 2e2fb2f..0000000 --- a/go-nix/nar/serialize_test.go +++ /dev/null @@ -1,19 +0,0 @@ -package nar - -import ( - "bytes" - "testing" - - "github.com/stretchr/testify/assert" -) - -func TestReadLongLong(t *testing.T) { - bs := []byte{13, 0, 0, 0, 0, 0, 0, 0} - r := bytes.NewReader(bs) - - num, err := readLongLong(r) - - assert.NoError(t, err) - assert.Equal(t, num, int64(13)) - -} diff --git a/go.mod b/go.mod index 4394395..3a79c87 100644 --- a/go.mod +++ b/go.mod @@ -4,8 +4,8 @@ go 1.14 require ( cloud.google.com/go/storage v1.15.0 - github.com/aws/aws-sdk-go v1.38.52 - github.com/stretchr/testify v1.6.1 + github.com/aws/aws-sdk-go v1.38.63 + github.com/numtide/go-nix v0.0.0-20210602165731-ae4ac80031a6 github.com/ulikunitz/xz v0.5.10 github.com/urfave/negroni v1.0.0 ) diff --git a/go.sum b/go.sum index b5a7f49..b27da1b 100644 --- a/go.sum +++ b/go.sum @@ -19,6 +19,7 @@ cloud.google.com/go v0.78.0/go.mod h1:QjdrLG0uq+YwhjoVOLsS1t7TW8fs36kLs4XO5R5ECH cloud.google.com/go v0.79.0/go.mod h1:3bzgcEeQlzbuEAYu4mrWhKqWjmpprinYgKJLgKHnbb8= cloud.google.com/go v0.81.0 h1:at8Tk2zUz63cLPR0JPWm5vp77pEZmzxEQBEfRKn1VV8= cloud.google.com/go v0.81.0/go.mod h1:mk/AM35KwGk/Nm2YSeZbxXdrNK3KZOYHmLkOqC2V6E0= +cloud.google.com/go v0.84.0 h1:hVhK90DwCdOAYGME/FJd9vNIZye9HBR6Yy3fu4js3N8= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= @@ -41,8 +42,9 @@ cloud.google.com/go/storage v1.15.0/go.mod h1:mjjQMoxxyGH7Jr8K5qrx6N2O0AHsczI61s dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/aws/aws-sdk-go v1.38.52 h1:7NKcUyTG/CyDX835kq04DDNe8vXaJhbGW8ThemHb18A= -github.com/aws/aws-sdk-go v1.38.52/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro= +github.com/aws/aws-sdk-go v1.33.13/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= +github.com/aws/aws-sdk-go v1.38.63 h1:BqPxe0sujTRTbir6OWj0f1VmeJcAIv7ZhTCAhaU1zmE= +github.com/aws/aws-sdk-go v1.38.63/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= @@ -63,6 +65,7 @@ github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7 github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -106,12 +109,9 @@ github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/martian v2.1.0+incompatible h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPgecwXBIDzw5no= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= -github.com/google/martian/v3 v3.1.0 h1:wCKgOCHuUEVfsaQLpPSJb7VdYCdTVZQAuOdYm1yc/60= github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= @@ -133,19 +133,18 @@ github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/jmespath/go-jmespath v0.3.0/go.mod h1:9QtRXoHjLGCJ5IBSaohpXITPlowMeeYCZ7fLUTSywik= github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= -github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8= github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= -github.com/jstemmer/go-junit-report v0.9.1 h1:6QPYqodiu3GuPL+7mfx+NwDdp2eTkp9IfEUpgAwUN0o= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/numtide/go-nix v0.0.0-20210602165731-ae4ac80031a6 h1:00WVtnSmfhygVdmN98AUXJeJEY7Bm/eSc0z4Q/V2l4A= +github.com/numtide/go-nix v0.0.0-20210602165731-ae4ac80031a6/go.mod h1:QdjLlYQnNqfJRhTF9YJTfIt902z6yufXmI1xy+PwGMg= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= @@ -199,7 +198,6 @@ golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHl golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5 h1:2M3HP5CCK1Si9FQhwnzYhXdG6DXeebvUHFpre8QvbyI= golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= @@ -210,7 +208,6 @@ golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzB golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.1 h1:Kvvh58BN8Y9/lBi7hTekvtMpm07eUZ0ck5pRHpsMWrY= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -364,12 +361,10 @@ golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.1.0 h1:po9/4sTYwZU9lPhi1tOrb4hCv3qrhiQ77LZfGa2OjwY= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= @@ -400,7 +395,6 @@ google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7 google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= @@ -478,11 +472,9 @@ google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp0 google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/go-nix/libstore/binary_cache.go b/libstore/binary_cache.go similarity index 100% rename from go-nix/libstore/binary_cache.go rename to libstore/binary_cache.go diff --git a/go-nix/libstore/doc.go b/libstore/doc.go similarity index 100% rename from go-nix/libstore/doc.go rename to libstore/doc.go diff --git a/go-nix/libstore/file_binary_cache_store.go b/libstore/file_binary_cache_store.go similarity index 100% rename from go-nix/libstore/file_binary_cache_store.go rename to libstore/file_binary_cache_store.go diff --git a/go-nix/libstore/gcs_binary_cache_store.go b/libstore/gcs_binary_cache_store.go similarity index 100% rename from go-nix/libstore/gcs_binary_cache_store.go rename to libstore/gcs_binary_cache_store.go diff --git a/go-nix/libstore/http_binary_cache_store.go b/libstore/http_binary_cache_store.go similarity index 100% rename from go-nix/libstore/http_binary_cache_store.go rename to libstore/http_binary_cache_store.go diff --git a/go-nix/libstore/nar_info.go b/libstore/nar_info.go similarity index 100% rename from go-nix/libstore/nar_info.go rename to libstore/nar_info.go diff --git a/go-nix/libstore/nar_info_test.go b/libstore/nar_info_test.go similarity index 100% rename from go-nix/libstore/nar_info_test.go rename to libstore/nar_info_test.go diff --git a/go-nix/libstore/s3_binary_cache_store.go b/libstore/s3_binary_cache_store.go similarity index 100% rename from go-nix/libstore/s3_binary_cache_store.go rename to libstore/s3_binary_cache_store.go