Set executable bit on installed binary#7
Conversation
Release artifacts on the `sdk-for-cli` GitHub releases page are uploaded as 0644, so once Homebrew renames the file into `bin/` it still lacks `+x`. The first attempt to exec it — currently `generate_completions_from_executable` during install — fails with EACCES. Defensively chmod 0755 after `bin.install` so installs work regardless of the perms shipped in the release artifact. The upstream upload pipeline should also be fixed to ship `+x` binaries; this commit makes the formula resilient in the meantime.
Greptile SummaryThis PR adds a single Confidence Score: 5/5Safe to merge — minimal, well-scoped fix with no logical or security concerns. The change is two lines that defensively chmod the installed binary. It correctly targets both install branches, uses proper Ruby octal syntax, and directly addresses the documented EACCES failure. No edge cases or regressions are introduced. No files require special attention. Important Files Changed
Reviews (1): Last reviewed commit: "Set executable bit on installed binary" | Re-trigger Greptile |
Summary
brew install appwrite/appwrite/appwritefails on 19.2.0 with:```
brew: exec failed (EACCES): /opt/homebrew/Cellar/appwrite/19.2.0/bin/appwrite
Error: ... `appwrite completion bash` exited with 1
```
Root cause
The four release artifacts on https://github.com/appwrite/sdk-for-cli/releases/tag/19.2.0 are uploaded with
0644:```
$ ls -l /tmp/appwrite-cli-*
-rw-r--r-- /tmp/appwrite-cli-darwin-arm64
-rw-r--r-- /tmp/appwrite-cli-darwin-x64
-rw-r--r-- /tmp/appwrite-cli-linux-arm64
-rw-r--r-- /tmp/appwrite-cli-linux-x64
```
bin.installpreserves the source permissions, so the rename tobin/appwritecarries the missing+x. As soon as anything tries to exec it — currentlygenerate_completions_from_executableinsidedef install— Homebrew aborts.Fix
Defensively
chmod 0755after the install branch. This unblocks installs today regardless of the perms shipped in the release artifact.Follow-up
The upload step in the
sdk-for-clipublish workflow should alsochmod +xeach binary before uploading so future releases are correct at the source. Tracking that separately.Test plan
brew uninstall appwrite && brew install appwrite/appwrite/appwrite— installs cleanly and shell completions registertest-botmust pass onmacos-latestandubuntu-latest