fix: set standard file permissions on Nix-built release binaries#7255
Merged
Conversation
Files copied from the Nix store inherit its read-only permissions
(555 for executables, 444 for regular files). This differs from the
Earthly build which produced standard 755/644 permissions.
The read-only permissions inside crank.tar.gz cause install.sh to
fail at `rm "${BIN}.sha256"` (line 92) because rm prompts for
confirmation on write-protected files, which fails in non-interactive
CI environments.
Reset permissions to 755 (binaries) and 644 (.sha256 files) after
copying from the Nix store, matching the previous Earthly behavior.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Adam Kasztenny <adam.kasztenny@elastic.co>
Avoid globs that could accidentally change permissions on unexpected files if the build changes later. Use the known binary names with the correct platform-specific extension instead. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Adam Kasztenny <adam.kasztenny@elastic.co>
7316ce4 to
7f9487a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
r-xr-xr-x/ 555 for executables,r--r--r--/ 444 for regular files), unlike the previous Earthly build which produced standardrwxr-xr-x/ 755 andrw-r--r--/ 644 permissions.crank.tar.gzcauseinstall.shto fail atrm "${BIN}.sha256"(line 92) becausermprompts for confirmation on write-protected files, which fails in non-interactive CI environments (withset -e).chmod 755/chmod 644after copying from the Nix store in bothcrankBundleand thereleasefunction, restoring the permissions that the Earthly build produced.Testing
Current (Nix-built) vs previous (Earthly-built) tarball permissions:
Reproducing the failure (non-root user, TTY attached — as in some CI runners):
After applying the fix (
chmod 755/644before tar):End-to-end install.sh simulation (non-root, TTY,
set -eu):I have:
Run(Nix not available locally; relying on CI)./nix.sh flake checkto ensure this PR is ready for review.Added or updated unit tests.(No unit tests for build scripts; verified manually above)Added or updated e2e tests.(Not applicable — build system change only)Linked a PR or a docs tracking issue to document this change.(No user-facing docs change needed)Added(Should be backported tobackport release-x.ylabels to auto-backport this PR.release-2.2— maintainer to decide)Followed the API promotion workflow if this PR introduces, removes, or promotes an API.(Not applicable)🤖 Generated with Claude Code