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

x/build: make sure builders always set $HOME and $USER #24884

Open
bradfitz opened this issue Apr 16, 2018 · 3 comments
Open

x/build: make sure builders always set $HOME and $USER #24884

bradfitz opened this issue Apr 16, 2018 · 3 comments
Labels
Builders x/build issues (builders, bots, dashboards)
Milestone

Comments

@bradfitz
Copy link
Contributor

The builders don't always set $HOME and $USER.

Fix that, and revert the os/user testing hacks from https://go-review.googlesource.com/c/go/+/107300

@gopherbot gopherbot added this to the Unreleased milestone Apr 16, 2018
@gopherbot gopherbot added the Builders x/build issues (builders, bots, dashboards) label Apr 16, 2018
@kardianos
Copy link
Contributor

For all builders? or all non-windows builder?

@bradfitz
Copy link
Contributor Author

$HOME/$USER or equivalent for windows/plan9. But we happen to be fine already for Windows & Plan 9, so this is really only about the Unix builders.

@gopherbot
Copy link

Change https://golang.org/cl/134218 mentions this issue: os/user: retrieve username from /etc/passwd instead of $USER

gopherbot pushed a commit that referenced this issue Sep 9, 2018
Per #27524 there are situations where the username for the
uid does not match the value in the $USER environment variable and it
seems sensible to choose the value in /etc/passwd when they disagree.

This may make the Current() call slightly more expensive, since we
read /etc/passwd with cgo disabled instead of just checking the
environment. However, we cache the result of Current() calls, so we
only invoke this cost once in the lifetime of the process.

Fixes #14626.
Fixes #27524.
Updates #24884.

Change-Id: I0dcd224cf7f61dd5292f3fcc363aa2e9656a2cb1
Reviewed-on: https://go-review.googlesource.com/134218
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
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)
Projects
None yet
Development

No branches or pull requests

3 participants