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


None yet
3 participants
Copy link

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


This comment has been minimized.

Copy link

kardianos commented Apr 16, 2018

For all builders? or all non-windows builder?


This comment has been minimized.

Copy link
Member Author

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.


This comment has been minimized.

Copy link

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

os/user: retrieve Current username from /etc/passwd, not $USER
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
You can’t perform that action at this time.