Skip to content

x/build/cmd/gitmirror: fails if global git config has safe.bareRepository set to 'explicit' #66202

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
bcmills opened this issue Mar 8, 2024 · 3 comments
Assignees
Labels
Builders x/build issues (builders, bots, dashboards) FixPending Issues that have a fix which has not yet been reviewed or submitted. NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@bcmills
Copy link
Contributor

bcmills commented Mar 8, 2024

Go version

go version devel go1.23-58052fe8 Thu Mar 7 05:27:04 2024 +0000 linux/amd64

Output of go env in your module/workspace:

GO111MODULE=''
GOARCH='amd64'
GOBIN=''
GOCACHE='/usr/local/google/home/bcmills/.cache/go-build'
GOENV='/usr/local/google/home/bcmills/.config/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='amd64'
GOHOSTOS='linux'
GOINSECURE=''
GOMODCACHE='/usr/local/google/home/bcmills/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='linux'
GOPATH='/usr/local/google/home/bcmills'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/usr/local/google/home/bcmills/sdk/gotip'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='local'
GOTOOLDIR='/usr/local/google/home/bcmills/sdk/gotip/pkg/tool/linux_amd64'
GOVCS=''
GOVERSION='devel go1.23-58052fe8 Thu Mar 7 05:27:04 2024 +0000'
GODEBUG=''
GCCGO='/usr/bin/gccgo'
GOAMD64='v1'
AR='ar'
CC='gcc'
CXX='c++'
CGO_ENABLED='1'
GOMOD='/usr/local/google/home/bcmills/x/build/go.mod'
GOWORK=''
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build1970418467=/tmp/go-build -gno-record-gcc-switches'

What did you do?

~/x/build$ go test ./cmd/gitmirror -v

What did you see happen?

~/x/build$ go test ./cmd/gitmirror -v
=== RUN   TestHomepage
    gitmirror_test.go:161: git config user.name Gopher: exit status 128
        fatal: not in a git directory
--- FAIL: TestHomepage (0.04s)
=== RUN   TestDebugWatcher
    gitmirror_test.go:161: git config user.name Gopher: exit status 128
        fatal: not in a git directory
--- FAIL: TestDebugWatcher (0.04s)
=== RUN   TestArchive
    gitmirror_test.go:161: git config user.name Gopher: exit status 128
        fatal: not in a git directory
--- FAIL: TestArchive (0.04s)
=== RUN   TestMirror
    gitmirror_test.go:161: git config user.name Gopher: exit status 128
        fatal: not in a git directory
--- FAIL: TestMirror (0.04s)
=== RUN   TestMirrorInitiallyEmpty
    gitmirror_test.go:161: git config user.name Gopher: exit status 128
        fatal: not in a git directory
--- FAIL: TestMirrorInitiallyEmpty (0.04s)
FAIL
FAIL    golang.org/x/build/cmd/gitmirror        0.257s
FAIL

What did you expect to see?

All tests passing.

@gopherbot gopherbot added the Builders x/build issues (builders, bots, dashboards) label Mar 8, 2024
@gopherbot gopherbot added this to the Unreleased milestone Mar 8, 2024
@bcmills
Copy link
Contributor Author

bcmills commented Mar 8, 2024

I believe that Google's build of git has a different default for the safe.bareRepository setting, which may require setting GIT_DIR explicitly for certain commands. (Compare https://go.dev/cl/489915.)

@mknyszek mknyszek added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Mar 9, 2024
@mknyszek
Copy link
Contributor

mknyszek commented Mar 9, 2024

CC @dmitshur maybe? (When he gets back.)

@dmitshur dmitshur self-assigned this Apr 23, 2024
@dmitshur dmitshur added NeedsFix The path to resolution is known, but the work has not been done. and removed NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Apr 23, 2024
@dmitshur dmitshur changed the title x/build/cmd/gitmirror: tests consistently failing on Googler workstation x/build/cmd/gitmirror: fails if global git config has safe.bareRepository set to 'explicit' Apr 23, 2024
@dmitshur dmitshur moved this to Planned in Go Release Apr 23, 2024
@dmitshur dmitshur moved this from Planned to In Progress in Go Release May 18, 2024
@dmitshur dmitshur added the FixPending Issues that have a fix which has not yet been reviewed or submitted. label Aug 15, 2024
@gopherbot
Copy link
Contributor

Change https://go.dev/cl/605976 mentions this issue: cmd/gitmirror: explicitly specify GIT_DIR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Builders x/build issues (builders, bots, dashboards) FixPending Issues that have a fix which has not yet been reviewed or submitted. NeedsFix The path to resolution is known, but the work has not been done.
Projects
Archived in project
Development

No branches or pull requests

4 participants