-
Notifications
You must be signed in to change notification settings - Fork 6.8k
build: ensure no permission errors thrown in packages-dist script #17566
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
build: ensure no permission errors thrown in packages-dist script #17566
Conversation
scripts/build-packages-dist.sh
Outdated
# Make all directories in the previous package output writable. Bazel by default | ||
# makes tree artifacts and file outputs readonly. This causes permission errors | ||
# when deleting the folder. To avoid these errors, we make all files writable. | ||
chmod -R u+w ${pkg_dir} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know that this also makes files writable, but it would make things unnecessarily more platform dependent if we rely on find
to filter out directories. Nothing wrong with also making the files writable before deletion.
Technically files don't need to be writable for deletion since we have the x
bit set in the folder permissions.
db947b3
to
462f3ae
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Bazel by default makes output files or tree artifacts readonly. This means that the packages-dist script fails in case release output has been built previously. This has only an effect in non-windows environments. We can reasonably fix this by making the folder/files writable before trying to delete them. This is similar to what Bazel internally does when deleting outputs of previous builds. see: https://github.com/bazelbuild/bazel/blob/07924e8260a447b69b18e8248203e1089b46962a/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeActionExecutor.java#L1251
462f3ae
to
2e6eb22
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Bazel by default makes output files or tree artifacts readonly. This
means that the packages-dist script fails in case release output
has been built previously. This has only an effect in non-windows
environments.
We can reasonably fix this by making the folder/files writable
before trying to delete them. This is similar to what Bazel
internally does when deleting outputs of previous builds.
see:
https://github.com/bazelbuild/bazel/blob/07924e8260a447b69b18e8248203e1089b46962a/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeActionExecutor.java#L1251