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: 'go generate' fails to update PWD variable #43862

Closed
bcmills opened this issue Jan 22, 2021 · 2 comments
Closed

cmd/go: 'go generate' fails to update PWD variable #43862

bcmills opened this issue Jan 22, 2021 · 2 comments
Milestone

Comments

@bcmills
Copy link
Member

@bcmills bcmills commented Jan 22, 2021

Most subprocess invocations in the go command use base.AppendPWD to append an accurate value of PWD to the command's environment, which can speed up calls like os.Getwd and also help to provide less-confusing output from scripts.

As noted in #43724 (comment) (CC @dylan-bourque), go generate currently fails to do so when invoking the generator command:

cmd.Env = str.StringList(cfg.OrigEnv, g.env)

It should be updated to do so.

(CC @matloob @jayconrod)

@bcmills bcmills added this to the Backlog milestone Jan 22, 2021
@robpike
Copy link
Contributor

@robpike robpike commented Jan 22, 2021

Oh, the cursed PWD variable. An apparently simple idea with offensively wide-ranging ramifications. An object lesson in three letters for anyone paying attention.

qingyunha added a commit to qingyunha/go that referenced this issue Jan 27, 2021
Most subprocess invocations in the go command use base.AppendPWD to
append an accurate value of PWD to the command's environment, which can
speed up calls like os.Getwd and also help to provide less-confusing
output from scripts. Update `go generate` to do so.

Fixes golang#43862

Change-Id: I3b756f1532b2d922f7d74fd86414d5567a0122c0
@gopherbot
Copy link

@gopherbot gopherbot commented Jan 27, 2021

Change https://golang.org/cl/287152 mentions this issue: cmd/go: update PWD variable for 'go generate'

qingyunha added a commit to qingyunha/go that referenced this issue Jan 28, 2021
Most subprocess invocations in the go command use base.AppendPWD to
append an accurate value of PWD to the command's environment, which can
speed up calls like os.Getwd and also help to provide less-confusing
output from scripts. Update `go generate` to do so.

Fixes golang#43862

Change-Id: I3b756f1532b2d922f7d74fd86414d5567a0122c0
@dmitshur dmitshur modified the milestones: Backlog, Go1.17 Feb 3, 2021
qingyunha added a commit to qingyunha/go that referenced this issue Mar 5, 2021
Most subprocess invocations in the go command use base.AppendPWD to
append an accurate value of PWD to the command's environment, which can
speed up calls like os.Getwd and also help to provide less-confusing
output from scripts. Update `go generate` to do so.

Fixes golang#43862

Change-Id: I3b756f1532b2d922f7d74fd86414d5567a0122c0
qingyunha added a commit to qingyunha/go that referenced this issue Mar 5, 2021
Most subprocess invocations in the go command use base.AppendPWD to
append an accurate value of PWD to the command's environment, which can
speed up calls like os.Getwd and also help to provide less-confusing
output from scripts. Update `go generate` to do so.

Fixes golang#43862

Change-Id: I3b756f1532b2d922f7d74fd86414d5567a0122c0
qingyunha added a commit to qingyunha/go that referenced this issue Mar 5, 2021
Most subprocess invocations in the go command use base.AppendPWD to
append an accurate value of PWD to the command's environment, which can
speed up calls like os.Getwd and also help to provide less-confusing
output from scripts. Update `go generate` to do so.

Fixes golang#43862

Change-Id: I3b756f1532b2d922f7d74fd86414d5567a0122c0
@gopherbot gopherbot closed this in f0b6d37 Mar 5, 2021
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.

4 participants