Prepare Skillwalker for Homebrew installs - #17
Merged
Merged
Conversation
scripts/build.ts defines SKILLWALKER_VERSION from packages/cli/package.json, so the compiled binary prints it instead of yargs' "unknown".
…box scripts A Homebrew install keeps the binary in a versioned Cellar folder, so the scripts folder mounted into the sandbox would change on every upgrade. The override lets an installer point at a folder whose path stays the same.
…in errors A Homebrew install has no ./build folder, so the retry hints pointed at a path that does not exist.
bun build --compile appends its bundle after the linker signs the file, so codesign --verify rejected both binaries. Strip the stale signature, sign ad hoc, and verify, then smoke test the result on macOS.
Cover running through a bin symlink into libexec from another directory, and reading the sandbox scripts from SKILLWALKER_SCRIPTS_DIR.
Pushing a v* tag checks it against packages/cli/package.json, builds and smoke tests arm64 and x86_64 binaries, and attaches the tarballs and their checksums to a draft GitHub Release. CI also smoke tests the binaries on macOS, where the codesign check runs.
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.
Prepares Skillwalker to be installed with Homebrew. The formula and the
testdouble/homebrew-taprepo come later. This PR makes the in-repo changes a formula needs, following the investigation.What changes
--versionreports a real version.scripts/build.tspassespackages/cli/package.json's version into the compiled binary. Running from source reportsdev. Before this change, the binary printedunknown.bun build --compileleaves a signature thatcodesign --verifyrejects, and recent macOS releases kill such binaries on launch. The build now strips the stale signature, signs ad hoc, and verifies. It fails if any step fails.SKILLWALKER_SCRIPTS_DIRpoints the CLI at the sandbox scripts.sandbox createmounts the scripts folder into the sandbox. A Homebrew install's own folder changes with every version, so without this setting eachbrew upgradewould forcesandbox updateand a new Claude login. If the folder is missing a script, startup fails with an error that names the variable.skillwalker, not./build/skillwalker. Five sandbox retry hints pointed at a path that won't exist after a Homebrew install.v*tag fails unless the tag matches the CLI package version. It then builds and smoke tests on arm64 and x86_64 macOS, and attachesskillwalker-<version>-darwin-<arch>.tar.gzplus.sha256files to a draft GitHub Release.macos-15, where the signature check runs.One change from the investigation plan
The plan read the version from a
SKILLWALKER_VERSIONenvironment variable, falling back topackage.json. This PR reads it only frompackages/cli/package.json, and the release workflow checks the tag against it. That leaves one source for the version.Tests
devversion fallbackresolveSandboxScriptswith the variable unset, set, relative, and missing a scriptmake build && bun run test:smoke):--versionbinsymlink into alibexeccopy from another directorySKILLWALKER_SCRIPTS_DIR, both valid and emptycodesign --verifyon macOSThe symlink and scripts-folder smoke tests passed on their first run, because the behavior already existed. I broke the layout on purpose (left
duckdb.nodeout of the copy) to confirm the symlink test goes red.Local results on macOS 26.5.1, arm64 (first run on Bun 1.3.11, re-run on 1.4.2):
make test: 83 files, 1080 tests passedbun run test:smoke: 8 passedbun run typecheckandbun run format:check: passbun run lint: 263 warnings, the same count asmainBefore merging or tagging
macos-15-intelis a valid GitHub-hosted runner label.oven-sh/setup-bun@v2acceptsbun-version-file: package.json(it should read thepackageManagerpin, Bun 1.4.2).make test1080 passed,bun run test:smoke8 passed, typecheck passed. On 1.4.2, a plainbun build --compileof the CLI already passescodesign --verify, so the re-sign step now only protects against a Bun downgrade or regression. The smoke test would catch either of those on its own.Not in this PR
testdouble/homebrew-taprepo.HOMEBREW_TAP_TOKENsecret).brew install, which wait until the tap exists.