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

bradfitz opened this issue Apr 16, 2018 · 3 comments

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

bradfitz opened this issue Apr 16, 2018 · 3 comments


Copy link

@bradfitz bradfitz commented Apr 16, 2018

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

Fix that, and revert the os/user testing hacks from

@gopherbot gopherbot added this to the Unreleased milestone Apr 16, 2018
@gopherbot gopherbot added the Builders label Apr 16, 2018
Copy link

@kardianos kardianos commented Apr 16, 2018

For all builders? or all non-windows builder?

Copy link
Contributor Author

@bradfitz bradfitz commented Apr 16, 2018

$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.

Copy link

@gopherbot gopherbot commented Sep 8, 2018

Change 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-by: Ian Lance Taylor <>
Run-TryBot: Ian Lance Taylor <>
TryBot-Result: Gobot Gobot <>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.