Skip to content

cmd/go: builds fail when GOPATH=/dev/null #31100

Closed
@josharian

Description

@josharian

When run with GOPATH=/dev/null, go build fails:

$ GOPATH=/dev/null go test -run=TestLldbPython -v -count=1 runtime
=== RUN   TestLldbPython
--- FAIL: TestLldbPython (0.21s)
    runtime-lldb_test.go:169: building source exit status 1
        go: failed to create cache directory /dev/null/pkg/mod/cache: mkdir /dev/null: not a directory
FAIL
FAIL	runtime	0.220s

That seems fine. Who would run with GOPATH=/dev/null‽ It's not even a directory.

But it's not fine, because run.bash sets GOPATH=/dev/null. Why? The comment says: The $GOPATH value doesn't need to point to an actual directory, it just needs to pass the semantic checks performed by Go.

I don't know who is wrong here, but I do want all.bash to pass. I have a workaround I can mail just for TestLldbPython (set GOPATH=). Or we can fix this mess...somewhere else.

Opinions?

@bcmills @jayconrod @bradfitz

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeGoCommandcmd/goNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions