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/release: go1.13beta1 contains read-only files #33537

dsnet opened this issue Aug 8, 2019 · 3 comments

x/build/cmd/release: go1.13beta1 contains read-only files #33537

dsnet opened this issue Aug 8, 2019 · 3 comments


Copy link

@dsnet dsnet commented Aug 8, 2019

Compare the following:

$ tar -ztvf go1.12.7.linux-amd64.tar.gz | head -n 2
drwxr-xr-x root/root         0 2019-07-08 14:29 go/
-rw-r--r-- root/root     55358 2019-07-08 14:29 go/AUTHORS
$ tar -ztvf go1.13beta1.linux-amd64.tar.gz | head -n 2
dr-xr-xr-x root/root         0 2019-06-26 09:39 go/
-r--r--r-- root/root     55389 2019-06-26 09:39 go/AUTHORS

Notice how the u+w bit is missing from the later archive? This makes extracting in a way that preserves the modes as specified in the archive more challenging since writing the AUTHORS file will fail since the parent directory is marked as read-only.

\cc @dmitshur

@gopherbot gopherbot added this to the Unreleased milestone Aug 8, 2019
@gopherbot gopherbot added the Builders label Aug 8, 2019
@dsnet dsnet modified the milestones: Unreleased, Go1.13 Aug 8, 2019
Copy link
Member Author

@dsnet dsnet commented Aug 8, 2019

Interesting. This issue only seems to affect linux, since darwin is packed properly (i.e., the u+w bit is present):

$ tar -ztvf go1.13beta1.darwin-amd64.tar.gz | head -n 2
drwxr-xr-x gopher/staff      0 2019-06-26 09:38 go/
-rw-r--r-- gopher/staff  55389 2019-06-26 09:38 go/AUTHORS
@dsnet dsnet added the OS-Linux label Aug 8, 2019
Copy link

@FiloSottile FiloSottile commented Aug 8, 2019

This is due to 02d24fc, which made GOROOT unwritable during tests on linux-* builders. On the builders where we run all.bash (that is, not MakeOnly), we package the result after the tests have run, so they affect the release.

This is bad in a number of ways. @dmitshur will work on the fix.

Copy link

@gopherbot gopherbot commented Aug 8, 2019

Change mentions this issue: cmd/release: create release after make.bash and before all.bash

codebien added a commit to codebien/build that referenced this issue Nov 13, 2019
Binary releases need to build Go and include binaries such as bin/go,
bin/gofmt, and others. Previously, this was accomplished by running
all.bash script for some GOOS/GOARCH pairs, and make.bash for others
where it wasn't viable to run tests as part of the release process.

This change makes the release process more consistent by always
packaging the release archive file after running make.bash. We still
run all.bash in situations where it was previously run, but we do so
after the release file has already been created. This avoids the
risk of any changes to GOROOT that may occur as part of all.bash
(including changing file permissions to be read-only) being included
in the final release file.

Add a step to check that files in the buildlet's $WORKDIR/go and
$WORKDIR/go/bin directories have expected permissions before
creating the release file.

Fixes golang/go#33537
Updates golang/go#30316

Change-Id: I7d40716dba656a8aca711377f2995df4880166c5
Reviewed-by: Andrew Bonventre <>
@golang golang locked and limited conversation to collaborators Aug 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

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