Skip to content

Instantly share code, notes, and snippets.

@barrbrain
Created May 13, 2025 14:47
Show Gist options
  • Select an option

  • Save barrbrain/b6e627af129ef25d8567eb97845fe214 to your computer and use it in GitHub Desktop.

Select an option

Save barrbrain/b6e627af129ef25d8567eb97845fe214 to your computer and use it in GitHub Desktop.
Paste over siso/nativelink connection issues
diff --git a/go/src/infra/build/siso/auth/cred/credhelper.go b/go/src/infra/build/siso/auth/cred/credhelper.go
index 16d173e978..2b6179de21 100644
--- a/go/src/infra/build/siso/auth/cred/credhelper.go
+++ b/go/src/infra/build/siso/auth/cred/credhelper.go
@@ -158,7 +158,7 @@ func (h *credHelper) token(endpoint string) (*oauth2.Token, error) {
}
auth := prc.headers["authorization"]
if auth == "" {
- return nil, fmt.Errorf("no Authorization in resp from helper %s: %w\nstdout: %s", h.path, err, string(prc.stdout))
+ auth = "Bearer "
}
token := strings.TrimSpace(strings.TrimPrefix(auth, "Bearer "))
t := &oauth2.Token{
diff --git a/go/src/infra/build/siso/reapi/reapi.go b/go/src/infra/build/siso/reapi/reapi.go
index 4c2e339aea..e408a3769c 100644
--- a/go/src/infra/build/siso/reapi/reapi.go
+++ b/go/src/infra/build/siso/reapi/reapi.go
@@ -92,7 +92,7 @@ func (o *Option) RegisterFlags(fs *flag.FlagSet, envs map[string]string) {
// UpdateProjectID updates the Option for projID and returns cloud project ID to use.
func (o *Option) UpdateProjectID(projID string) string {
- if projID != "" && !strings.HasPrefix(o.Instance, "projects/") {
+ if projID != "" && !strings.HasPrefix(o.Instance, "projects/") && o.Instance != "intentionally_left_blank" {
o.Instance = path.Join("projects", projID, "instances", o.Instance)
}
if projID == "" && strings.HasPrefix(o.Instance, "projects/") {
@@ -209,6 +209,9 @@ func New(ctx context.Context, cred cred.Cred, opt Option) (*Client, error) {
if opt.Instance == "" {
return nil, errors.New("no reapi instance")
}
+ if opt.Instance == "intentionally_left_blank" {
+ opt.Instance = ""
+ }
clog.Infof(ctx, "address: %q instance: %q", opt.Address, opt.Instance)
conn, err := newConn(ctx, opt.Address, cred, opt)
if err != nil {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment