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
doc: document how to build a release from source (with race libraries, etc) #22372
Comments
Hi @phemmer it looks to me like there is some problems with your go installation. I suspect that you may have overwritten one install with another, or have GOROOT set and pointing to a version of Go that you didn't build from source. You are correct that the source build does not build the race version by default. Once you've sorted out the permission errors from your current install, you can build the race version with this command
But, please fix the problems with your source install first. |
I neither overwrote one version with another, nor have GOROOT set to a different version. The issue is that |
You said that you installed Go from source. Can you please show exactly how you did this as it is unlikely that installing Go from source would place it in /usr/lib/go
… On 21 Oct 2017, at 13:59, Patrick Hemmer ***@***.***> wrote:
I neither overwrote one version with another, nor have GOROOT set to a different version. The issue is that /usr/lib/go is a system-wide installation. Normal users do not have permissions to write to this path. The reason why go is even trying to write to this path is why this issue is created. If those files were present, go build --race would not be trying to create them.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
|
|
Thank you, that explains how your go install ended up in /usr/lib/go.
The short answer is you should build the race runtime before moving the files as the Go tool expects to be able to write those files.
… On 21 Oct 2017, at 14:28, Patrick Hemmer ***@***.***> wrote:
export GOROOT_FINAL=/usr/lib/go
export GOROOT_BOOTSTRAP=/usr/lib/go
cd go/src
./all.bash
sudo mv /usr/lib/go{,.old}
sudo cp -r ../ /usr/lib/go
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Shouldn't either the documentation explain this, or the |
I can see that argument. From my POV the source install assumes that you continue to have permission to write files to that location in the future.
I wonder if there should be a specific documentation for how to reproduce the binary distro as there are more pieces than the race detector that are not built by all.bash. /cc @broady
… On 21 Oct 2017, at 16:22, Patrick Hemmer ***@***.***> wrote:
Shouldn't either the documentation explain this, or the all.bash build these files?
Some OS distributions follow the build documentation which is how I hit this issue. And then when I went to reproduce by building manually I still hit the issue.
It is confusing to follow the "building from source" documentation and end up with something different than the binary release.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
|
@davecheney Yes, that would be really appreciated. I wouldn't mind other pointers either, for example a link to how official Go binaries are built or which distributions are the closest to your artifacts. (I'm the maintainer of Go in Arch.) |
It may be much better to just suggest that people don't overwrite an existing install. Create a fresh one (move the old one out of the way, etc). We should probably update the docs to make that clear. |
For the record, Arch ships shared and race libraries now. |
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?What did you do?
Tried to build a package with
go build --race
What did you expect to see?
successful build
What did you see instead?
Additional information
It appears this is because the standard source installation (as documented here: https://golang.org/doc/install/source) does not install the race detector enabled versions of several standard lib packages:
However when I download the pre-built release (https://storage.googleapis.com/golang/go1.9.1.linux-amd64.tar.gz from https://golang.org/dl/), the libs are present:
The text was updated successfully, but these errors were encountered: