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

Closed
dsnet opened this issue Aug 8, 2019 · 3 comments
Closed

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

dsnet opened this issue Aug 8, 2019 · 3 comments
Labels
Builders x/build issues (builders, bots, dashboards) FrozenDueToAge OS-Linux release-blocker
Milestone

Comments

@dsnet
Copy link
Member

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 x/build issues (builders, bots, dashboards) label Aug 8, 2019
@dsnet dsnet modified the milestones: Unreleased, Go1.13 Aug 8, 2019
@dsnet
Copy link
Member Author

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
@FiloSottile
Copy link
Contributor

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.

@gopherbot
Copy link

Change https://golang.org/cl/189537 mentions this issue: cmd/release: create release after make.bash and before all.bash

codebien pushed 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-on: https://go-review.googlesource.com/c/build/+/189537
Reviewed-by: Andrew Bonventre <andybons@golang.org>
@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.
Labels
Builders x/build issues (builders, bots, dashboards) FrozenDueToAge OS-Linux release-blocker
Projects
None yet
Development

No branches or pull requests

4 participants