Skip to content
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

cmd/go/internal/lockedfile: os.Chmod call in openFile ignores overlays #44700

Open
fhs opened this issue Mar 1, 2021 · 2 comments
Open

cmd/go/internal/lockedfile: os.Chmod call in openFile ignores overlays #44700

fhs opened this issue Mar 1, 2021 · 2 comments
Assignees
Labels
Milestone

Comments

@fhs
Copy link
Contributor

@fhs fhs commented Mar 1, 2021

What version of Go are you using (go version)?

$ go version
go version devel +master Sun Feb 28 22:38:43 EST 2021 plan9/386

What did you do?

cd src/cmd/go
go test -run TestScript/mod_overlay

What did you expect to see?

Test pass

What did you see instead?

go test proxy running at GOPROXY=http://127.0.0.1:65174/mod
--- FAIL: TestScript (0.02s)
    --- FAIL: TestScript/mod_overlay (0.24s)
        script_test.go:213: 
            # Test overlays that affect go.mod files
            # The go.mod file can exist only in the overlay. (0.012s)
            > cd $WORK/gopath/src/no-go-mod
            $WORK/gopath/src/no-go-mod
            > go list -overlay overlay.json .
            [stderr]
            go: chmod $WORK/gopath/src/no-go-mod/go.mod: stat $WORK/gopath/src/no-go-mod/go.mod: '.../tmpdir4282295690/script-mod_overlay/gopath/src/no-go-mod/go.mod' does not exist
            [exit status: 'go 1689: 1']
            FAIL: testdata/script/mod_overlay.txt:5: unexpected command failure
            
FAIL
exit status: 'go.test 1537: 1'
FAIL	cmd/go	7.377s

The error is from os.Chmod in lockedfile package, which of course couldn't find the overlayed go.mod file. There is no Chmod function in cmd/go/internal/fsys, so either that can be added or have some other workaround.

@gopherbot NeedsFix, OS-Plan9

@bcmills
Copy link
Member

@bcmills bcmills commented Mar 1, 2021

@bcmills bcmills added this to the Go1.17 milestone Mar 1, 2021
@bcmills bcmills changed the title cmd/go: TestScript/mod_overlay failing on Plan 9 cmd/go/internal/lockedfile: os.Stat call in openFile ignores overlays Mar 1, 2021
@bcmills bcmills removed the OS-Plan9 label Mar 1, 2021
@oiooj oiooj self-assigned this Mar 2, 2021
@oiooj oiooj changed the title cmd/go/internal/lockedfile: os.Stat call in openFile ignores overlays cmd/go/internal/lockedfile: os.Chmod call in openFile ignores overlays Mar 5, 2021
@gopherbot
Copy link

@gopherbot gopherbot commented Mar 5, 2021

Change https://golang.org/cl/299029 mentions this issue: cmd/go: add fsys.Chmod function in fsys package

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants