Skip to content

Commit

Permalink
chore(deps): updates
Browse files Browse the repository at this point in the history
  • Loading branch information
morlay committed Jan 9, 2024
1 parent 4e1f03b commit db51ebd
Show file tree
Hide file tree
Showing 14 changed files with 134 additions and 116 deletions.
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ require (
)

require (
cuelabs.dev/go/oci/ociregistry v0.0.0-20231205091233-3bb0ee105e4a // indirect
cuelabs.dev/go/oci/ociregistry v0.0.0-20231217163254-6feb86eb6e06 // indirect
github.com/cockroachdb/apd/v3 v3.2.1 // indirect
github.com/emicklei/proto v1.13.0 // indirect
github.com/go-logr/logr v1.3.0 // indirect
github.com/go-logr/logr v1.4.1 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/google/gofuzz v1.2.0 // indirect
Expand Down
4 changes: 4 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
cuelabs.dev/go/oci/ociregistry v0.0.0-20231205091233-3bb0ee105e4a h1:A56kS+m+WAytLYx0MIkFJ/rEA+yI/0LZyIB8SVHOhYA=
cuelabs.dev/go/oci/ociregistry v0.0.0-20231205091233-3bb0ee105e4a/go.mod h1:XGKYSMtsJWfqQYPwq51ZygxAPqpEUj/9bdg16iDPTAA=
cuelabs.dev/go/oci/ociregistry v0.0.0-20231217163254-6feb86eb6e06 h1:X2H+7Jw/dJ5omjq/92asjuszALGZWuGx6LwyBKXF+48=
cuelabs.dev/go/oci/ociregistry v0.0.0-20231217163254-6feb86eb6e06/go.mod h1:ApHceQLLwcOkCEXM1+DyCXTHEJhNGDpJ2kmV6axsx24=
cuelang.org/go v0.7.0 h1:gMztinxuKfJwMIxtboFsNc6s8AxwJGgsJV+3CuLffHI=
cuelang.org/go v0.7.0/go.mod h1:ix+3dM/bSpdG9xg6qpCgnJnpeLtciZu+O/rDbywoMII=
github.com/cockroachdb/apd/v3 v3.2.1 h1:U+8j7t0axsIgvQUqthuNm82HIrYXodOV2iWLWtEaIwg=
Expand All @@ -14,6 +16,8 @@ github.com/go-courier/logr v0.3.0 h1:0VEQB1b53EmYQ+ZehrIgD8l2IO+WX7TY+CqzlykIFmo
github.com/go-courier/logr v0.3.0/go.mod h1:OI7f/JCFZ1ZMD5qG3bIJr5WMNnGzd24+II1D9D9w5x4=
github.com/go-logr/logr v1.3.0 h1:2y3SDp0ZXuc6/cjLSZ+Q3ir+QB9T/iG5yYRXqsagWSY=
github.com/go-logr/logr v1.3.0/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ=
github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-quicktest/qt v1.101.0 h1:O1K29Txy5P2OK0dGo59b7b0LR6wKfIhttaAhHUyn7eI=
github.com/go-quicktest/qt v1.101.0/go.mod h1:14Bz/f7NwaXPtdYEgzsx46kqSxVwTbzVZsDC26tQJow=
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI=
Expand Down
38 changes: 28 additions & 10 deletions internal/cmd/go/internals/cfg/cfg.go
Original file line number Diff line number Diff line change
Expand Up @@ -490,25 +490,43 @@ func findGOROOT(env string) string {
// depend on the executable's location.
return def
}

// canonical returns a directory path that represents
// the same directory as dir,
// preferring the spelling in def if the two are the same.
canonical := func(dir string) string {
if isSameDir(def, dir) {
return def
}
return dir
}

exe, err := os.Executable()
if err == nil {
exe, err = filepath.Abs(exe)
if err == nil {
// cmd/go may be installed in GOROOT/bin or GOROOT/bin/GOOS_GOARCH,
// depending on whether it was cross-compiled with a different
// GOHOSTOS (see https://go.dev/issue/62119). Try both.
if dir := filepath.Join(exe, "../.."); isGOROOT(dir) {
// If def (runtime.GOROOT()) and dir are the same
// directory, prefer the spelling used in def.
if isSameDir(def, dir) {
return def
}
return dir
return canonical(dir)
}
if dir := filepath.Join(exe, "../../.."); isGOROOT(dir) {
return canonical(dir)
}

// Depending on what was passed on the command line, it is possible
// that os.Executable is a symlink (like /usr/local/bin/go) referring
// to a binary installed in a real GOROOT elsewhere
// (like /usr/lib/go/bin/go).
// Try to find that GOROOT by resolving the symlinks.
exe, err = filepath.EvalSymlinks(exe)
if err == nil {
if dir := filepath.Join(exe, "../.."); isGOROOT(dir) {
if isSameDir(def, dir) {
return def
}
return dir
return canonical(dir)
}
if dir := filepath.Join(exe, "../../.."); isGOROOT(dir) {
return canonical(dir)
}
}
}
Expand Down
7 changes: 7 additions & 0 deletions internal/cmd/go/internals/gover/toolchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ import (
// FromToolchain("go1.2.3-bigcorp") == "1.2.3"
// FromToolchain("invalid") == ""
func FromToolchain(name string) string {
if strings.ContainsAny(name, "\\/") {
// The suffix must not include a path separator, since that would cause
// exec.LookPath to resolve it from a relative directory instead of from
// $PATH.
return ""
}

var v string
if strings.HasPrefix(name, "go") {
v = name[2:]
Expand Down
9 changes: 2 additions & 7 deletions internal/cmd/go/internals/modfetch/codehost/codehost.go
Original file line number Diff line number Diff line change
Expand Up @@ -380,13 +380,8 @@ func RunWithStdin(ctx context.Context, dir string, stdin io.Reader, cmdline ...a
c.Stdin = stdin
c.Stderr = &stderr
c.Stdout = &stdout

// only set when dir under GOMODCACHE
if strings.HasPrefix(c.Dir, cfg.GOMODCACHE) {
// For Git commands, manually supply GIT_DIR so Git works with safe.bareRepository=explicit set. Noop for other commands.
c.Env = append(c.Environ(), "GIT_DIR="+dir)
}

// For Git commands, manually supply GIT_DIR so Git works with safe.bareRepository=explicit set. Noop for other commands.
c.Env = append(c.Environ(), "GIT_DIR="+dir)
err := c.Run()
if err != nil {
err = &RunError{Cmd: strings.Join(cmd, " ") + " in " + dir, Stderr: stderr.Bytes(), Err: err}
Expand Down
25 changes: 19 additions & 6 deletions internal/cmd/go/internals/vcs/vcs.go
Original file line number Diff line number Diff line change
Expand Up @@ -1204,18 +1204,31 @@ func repoRootFromVCSPaths(importPath string, security web.SecurityMode, vcsPaths
var ok bool
repoURL, ok = interceptVCSTest(repo, vcs, security)
if !ok {
scheme := vcs.Scheme[0] // default to first scheme
if vcs.PingCmd != "" {
// If we know how to test schemes, scan to find one.
scheme, err := func() (string, error) {
for _, s := range vcs.Scheme {
if security == web.SecureOnly && !vcs.isSecureScheme(s) {
continue
}
if vcs.Ping(s, repo) == nil {
scheme = s
break

// If we know how to ping URL schemes for this VCS,
// check that this repo works.
// Otherwise, default to the first scheme
// that meets the requested security level.
if vcs.PingCmd == "" {
return s, nil
}
if err := vcs.Ping(s, repo); err == nil {
return s, nil
}
}
securityFrag := ""
if security == web.SecureOnly {
securityFrag = "secure "
}
return "", fmt.Errorf("no %sprotocol found for repository", securityFrag)
}()
if err != nil {
return nil, err
}
repoURL = scheme + "://" + repo
}
Expand Down
20 changes: 13 additions & 7 deletions internal/cmd/go/internals/web/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,16 +212,22 @@ func get(security SecurityMode, url *urlpkg.URL) (*Response, error) {
}
}

if res == nil || res.Body == nil {
if err != nil {
// Per the docs for [net/http.Client.Do], “On error, any Response can be
// ignored. A non-nil Response with a non-nil error only occurs when
// CheckRedirect fails, and even then the returned Response.Body is
// already closed.”
release()
} else {
body := res.Body
res.Body = hookCloser{
ReadCloser: body,
afterClose: release,
}
return nil, nil, err
}

// “If the returned error is nil, the Response will contain a non-nil Body
// which the user is expected to close.”
body := res.Body
res.Body = hookCloser{
ReadCloser: body,
afterClose: release,
}
return url, res, err
}

Expand Down
2 changes: 1 addition & 1 deletion internal/internals/buildcfg/zbootstrap.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions internal/internals/godebugs/table.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ var All = []Info{
{Name: "panicnil", Package: "runtime", Changed: 21, Old: "1"},
{Name: "randautoseed", Package: "math/rand"},
{Name: "tarinsecurepath", Package: "archive/tar"},
{Name: "tlsmaxrsasize", Package: "crypto/tls"},
{Name: "x509sha1", Package: "crypto/x509"},
{Name: "x509usefallbackroots", Package: "crypto/x509"},
{Name: "zipinsecurepath", Package: "archive/zip"},
Expand Down
1 change: 1 addition & 0 deletions internal/internals/syscall/windows/reparse_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
const (
FSCTL_SET_REPARSE_POINT = 0x000900A4
IO_REPARSE_TAG_MOUNT_POINT = 0xA0000003
IO_REPARSE_TAG_DEDUP = 0x80000013

SYMLINK_FLAG_RELATIVE = 1
)
Expand Down
22 changes: 1 addition & 21 deletions internal/internals/syscall/windows/syscall_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -373,27 +373,7 @@ func ErrorLoadingGetTempPath2() error {
//sys DestroyEnvironmentBlock(block *uint16) (err error) = userenv.DestroyEnvironmentBlock
//sys CreateEvent(eventAttrs *SecurityAttributes, manualReset uint32, initialState uint32, name *uint16) (handle syscall.Handle, err error) = kernel32.CreateEventW

//sys RtlGenRandom(buf []byte) (err error) = advapi32.SystemFunction036

type FILE_ID_BOTH_DIR_INFO struct {
NextEntryOffset uint32
FileIndex uint32
CreationTime syscall.Filetime
LastAccessTime syscall.Filetime
LastWriteTime syscall.Filetime
ChangeTime syscall.Filetime
EndOfFile uint64
AllocationSize uint64
FileAttributes uint32
FileNameLength uint32
EaSize uint32
ShortNameLength uint32
ShortName [12]uint16
FileID uint64
FileName [1]uint16
}

//sys GetVolumeInformationByHandle(file syscall.Handle, volumeNameBuffer *uint16, volumeNameSize uint32, volumeNameSerialNumber *uint32, maximumComponentLength *uint32, fileSystemFlags *uint32, fileSystemNameBuffer *uint16, fileSystemNameSize uint32) (err error) = GetVolumeInformationByHandleW
//sys ProcessPrng(buf []byte) (err error) = bcryptprimitives.ProcessPrng

//sys RtlLookupFunctionEntry(pc uintptr, baseAddress *uintptr, table *byte) (ret uintptr) = kernel32.RtlLookupFunctionEntry
//sys RtlVirtualUnwind(handlerType uint32, baseAddress uintptr, pc uintptr, entry uintptr, ctxt uintptr, data *uintptr, frame *uintptr, ctxptrs *byte) (ret uintptr) = kernel32.RtlVirtualUnwind
102 changes: 47 additions & 55 deletions internal/internals/syscall/windows/zsyscall_windows.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions internal/version/version.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package version

var (
version = "v0.0.0"
)
var version string

func Version() string {
return version
Expand Down
Loading

0 comments on commit db51ebd

Please sign in to comment.