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/cmd/relui: pkgbuild produces an installer that installs to /usr/local/go/bin/go, no longer in PATH on os X mojave #28901

Closed
b5 opened this issue Nov 20, 2018 · 7 comments
Labels
Builders x/build issues (builders, bots, dashboards) NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. OS-Darwin WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Milestone

Comments

@b5
Copy link

b5 commented Nov 20, 2018

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

go 1.11.2 darwin/amd64

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

darwin/amd64

go env Output
$ go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/b5/Library/Caches/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/b5/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/go"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/6p/sjn8bct92397mbgwmwwvcb4h0000gn/T/go-build195699704=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

Ran the go .pkg installer downloaded from golang.org. Installer completes successfully. I then moved over to the command line & ran:

$ which go
go not found

What did you expect to see?

I was hoping to see /usr/local/go/bin/go, or for some magic created by pkgbuild/productbuild to symlink /usr/local/go/bin/go -> /usr/local/bin/go. but alas, nope. This problem only seems to exist on os x Mojave (as far as I can tell).

What did you see instead?

go not found

My guess is the fix will land here

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

See https://golang.org/doc/install#macos.

You have to restart any existing Terminal sessions for the $PATH changes to take effect. Have you done that ?

@agnivade agnivade added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Nov 21, 2018
@b5
Copy link
Author

b5 commented Nov 27, 2018

Apologies for the delay, yes I have / did create a new session at the time. $PATH changes are present, the issue is the go tool itself isn't available.

@agnivade
Copy link
Contributor

If the $PATH changes are present, I fail to see how the go tool isn't available. Can you dump the output of $PATH variable ?

@b5
Copy link
Author

b5 commented Nov 27, 2018

relevant components of my $PATH:

$ echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/b5/go/bin

@agnivade
Copy link
Contributor

/cc @ianlancetaylor @bradfitz

@agnivade agnivade added NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. and removed WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. labels Nov 28, 2018
@dmitshur dmitshur changed the title x/build/DIR: pkgbuild produces an installer that installs to /usr/local/go/bin/go, no longer in PATH on os X mojave x/build/cmd/relui: pkgbuild produces an installer that installs to /usr/local/go/bin/go, no longer in PATH on os X mojave May 15, 2023
@dmitshur
Copy link
Contributor

dmitshur commented Jun 5, 2023

I spotted this issue only recently, and wanted to follow up here. Also CC @golang/release. (I realize it's from 2018 so it might not be relevant to you or not something you can easily verify now.)

@b5 The macOS Go installer does have a mechanism to make /usr/local/go/bin/go available in $PATH: it writes to a special directory /etc/paths.d a file with the content /usr/local/go/bin (see buildrelease.go:371). If that file (named "go") is present in your /etc/paths.d directory, that means the installer worked as expected. If it's there but which go still doesn't find /usr/local/go/bin/go, it'd be useful to also know what terminal + shell you're using and if its configuration does something that might override path_helper picking up /etc/paths.d entries. Thanks.

You also mentioned this is only happening on macOS Mojave (10.14). If it's not a problem on newer macOS versions, then this problem won't apply after that macOS version stops being supported.

@dmitshur dmitshur added WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. OS-Darwin labels Jun 5, 2023
@gopherbot
Copy link

Timed out in state WaitingForInfo. Closing.

(I am just a bot, though. Please speak up if this is a mistake or you have the requested information.)

@gopherbot gopherbot closed this as not planned Won't fix, can't repro, duplicate, stale Jul 5, 2023
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) NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. OS-Darwin WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
Archived in project
Development

No branches or pull requests

4 participants