Skip to content

Set executable bit on installed binary#7

Merged
ChiragAgg5k merged 1 commit intomainfrom
fix/binary-exec-bit
Apr 28, 2026
Merged

Set executable bit on installed binary#7
ChiragAgg5k merged 1 commit intomainfrom
fix/binary-exec-bit

Conversation

@ChiragAgg5k
Copy link
Copy Markdown
Member

Summary

brew install appwrite/appwrite/appwrite fails 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.install preserves the source permissions, so the rename to bin/appwrite carries the missing +x. As soon as anything tries to exec it — currently generate_completions_from_executable inside def install — Homebrew aborts.

Fix

Defensively chmod 0755 after 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-cli publish workflow should also chmod +x each binary before uploading so future releases are correct at the source. Tracking that separately.

Test plan

  • Local: brew uninstall appwrite && brew install appwrite/appwrite/appwrite — installs cleanly and shell completions register
  • CI: test-bot must pass on macos-latest and ubuntu-latest

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-apps
Copy link
Copy Markdown

greptile-apps Bot commented Apr 28, 2026

Greptile Summary

This PR adds a single chmod 0755 call after the binary install step to defensively ensure the executable bit is always set on bin/appwrite, working around upstream release artifacts being uploaded with 0644 permissions. The fix correctly covers both the build.head? and stable-release install branches, and uses Ruby's proper octal literal syntax.

Confidence Score: 5/5

Safe 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

Filename Overview
Formula/appwrite.rb Adds chmod 0755 on the installed binary after both install branches to fix EACCES on exec when upstream artifacts are uploaded with 0644 permissions.

Reviews (1): Last reviewed commit: "Set executable bit on installed binary" | Re-trigger Greptile

@ChiragAgg5k ChiragAgg5k merged commit 91c114c into main Apr 28, 2026
3 checks passed
@ChiragAgg5k ChiragAgg5k deleted the fix/binary-exec-bit branch April 28, 2026 11:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant