Repository navigation
Install and self-update on Macs without developer tools or Apple's services - #1329
Open
tolgaergin wants to merge 5 commits into
Open
tolgaergin wants to merge 5 commits into
tolgaergin wants to merge 5 commits into
Conversation
…ervices lpm self-update in 0.76.0 to 0.88.0 runs /usr/bin/stapler, an xcrun shim that needs Xcode, so standalone installs on Macs without Xcode refuse every update, and install.sh fails the same way without any developer tools. The installer and the standalone updater now check a macOS release only with tools that ship with every Mac, and ask no Apple service: codesign verifies the signature against LPM's pinned Developer ID requirement, which includes `notarized` and is satisfied by the stapled ticket offline; the entitlements and the provisioning profile are checked as before, the profile decoded in process (or with openssl) instead of with `security cms`, which needs a default keychain. Gatekeeper's spctl assessment and the stapler check move to the release side only, where release.yml keeps running them. Validation tools run with a cleared environment. A refused standalone update on macOS or Linux now names the installer command for its channel, in the terminal and in --json next_steps, so a refusal never leaves anyone without a way forward. A new workflow removes Xcode and the Command Line Tools from hosted macOS runners, and on the oldest and newest macOS also blocks Apple's services, then installs, upgrades an affected v0.85.0 install with its settings kept, and self-updates this build to the latest stable and nightly releases. It runs on pull requests that touch these paths and daily. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…vices as a dropping firewall does A refused standalone update named the installer for every refusal, including provenance and integrity failures. On Linux without cosign the installer can't tell who published a release's checksums, so it could install what the updater refused. Now: - a release that fails verification gets an installer command that requires its Sigstore signature on Linux (install cosign first), and a plain one on macOS, where the installer checks LPM's Developer ID signature; - a verified release or macOS layout this updater doesn't accept gets the plain command; - location and permission refusals, staged files that changed and failed replacements get none, since reinstalling doesn't fix them. Every command names its channel. The variant carries its own recovery text. install.sh decodes the provisioning profile with OPENSSL_CONF unset and requires output: with an OpenSSL 3 configuration there, macOS's openssl writes nothing yet exits 0, which failed genuine installs without a word. The Apple-services block records a reachable baseline first, pins each Apple host to the addresses DNS gives it, drops all of them and Apple's networks, probes one address per host and family, and counts only failed connections as blocked. The oldest blocked runner moves to macos-15, since GitHub no longer offers macos-14. The cache key is per runner, the path filter covers the inputs these checks depend on, the install and update steps have a time limit, and the canary reads --json. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ntries on their own Staging now reports whether the release failed verification or something local failed: only the manifest, its signature, a missing entry or asset and the digest are release-verification refusals; a staged file replaced while being sealed, an unsupported platform and client errors name no installer. The version probe only runs the binary; the staged-file checks around it name no installer either. Reasons no longer end with "Install manually" beside a hint, and the general refusal help points at the reason instead of claiming verification failed. The Apple-services block judges a probe by curl's connect time, so a service that accepts and then stalls still counts as reachable; drops addresses inside Apple's networks only through the network entries, so probing them shows those entries work; pins a host to a dropped placeholder for an address family DNS gave none in; covers certs.apple.com and www.apple.com; and uses one pf table. The canary keeps stderr out of the JSON it parses, and the path filter covers the channel and JSON contract modules. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ed assets as the release's A staged asset that changed while it was probed (Linux) or staged (macOS) could fail that check first and name the installer. Both now run through check_staged_asset, which checks the file before and after and lets a changed file win, so only a failed check of the verified file names one. The download helper reports an asset larger than this updater accepts separately from download and staging failures, and staging treats it as the release's: a future release that outgrows the cap still names the installer. Tests pin the digest mismatch and size caps as release verification failures, and local staging failures as local, against the real signed v0.84.0 release. The Apple-services probe goes by curl's count of connections opened, with proxies and ~/.curlrc ignored: macOS's curl can report no connect time for a service that accepts and stalls in the TLS handshake. The fake firewall honours the table only through the block rule, and the IPv4 placeholder is tested. The missing-manifest reason no longer guesses at its cause, and the canary greps its two output files directly. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…the validated one A macOS bundle changed after validation, by another process or security software, could fail the version probe and still name the installer. A failed probe now validates the bundle again and names the installer only if its fingerprint is unchanged; a real-release test covers both outcomes. The size-cap mapping is its own function with a test of both arms. The two staging tests that use the v0.84.0 release run only where it ships an asset (not Windows on ARM64 or musl ARM64), and assert the exact failure they name. The fake curl answers only with -q and --noproxy '*', and the main firewall case asserts the block rule itself. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
Problem
Standalone
lpm self-updatein 0.76.0 to 0.88.0 runs/usr/bin/stapler. That is anxcrunshim that works only with Xcode, so on a Mac without Xcode, including one with only the Command Line Tools, every update is refused:install.shrunsxcrun staplerand fails the same way on a Mac without any developer tools. CI never saw it, because every hosted macOS runner has Xcode.This replaces #1325. That PR checked the ticket against Apple's ticket service directly, which kept the updater dependent on an undocumented Apple web API. Every installed copy would carry that dependency forever. If Apple changed the API, or a network blocked it, every installed copy would refuse updates again, and its shell parser already answered differently on macOS 15 and macOS 27.
Change
Client checks in
install.shandlpm self-updateuse only tools that ship with every Mac and call no Apple service:codesign --verify --strict -Rwith LPM's pinned requirement. It requires a Developer ID Application signature from team 823S8YKMRW ondev.lpm.cli, andnotarized, which the stapled ticket satisfies offline.CMSDecoder) or withopenssl smime, instead of withsecurity cms, which needs a default keychain.stapler/xcrun,spctland Apple's ticket service. Validation tools run with a cleared environment.Touch ID prompts and LPM Vault access depend on the bundle's signature, entitlement and profile. All of these are still checked, so they are unaffected.
Refused standalone updates name the way forward where the installer can take over (macOS and Linux; Windows has no standalone installer):
curl -fsSL https://cli.lpm.dev/install | LPM_INSTALL_CHANNEL=<channel> sh, since the installer checks LPM's Developer ID signature. Linux: the same command plusLPM_INSTALL_REQUIRE_SIGSTORE=1, and the hint says to install cosign first, because without cosign the installer can't tell who published the checksums.--jsonoutput puts the command innext_steps[0].command, anderror_codestaysself_update. The macOS layout refusal no longer links a GitHub page instead of a command.New workflow: macOS without developer tools. It runs on PRs that touch these paths, and daily. It covers three runners:
macos-15macos-26macos-15-intelApple's services are blocked before anything on the runner checks a release, the way a firewall that silently drops their traffic does:
api.apple-cloudkit.com,ocsp,ocsp2,crl,valid,certs,www.apple.com) to the addresses DNS gives it. That includes Akamai addresses outside Apple's networks, and a dropped placeholder for any address family DNS gave none in.~/.curlrcignored.GitHub no longer offers
macos-14, somacos-15is the oldest runner. Install and update steps have a 5-minute limit, so a stall fails fast.Each runner then does five things:
install.sh.scripts/ci/test-macos-apple-services.shtests the blocking script with fakes in the lint job. The release candidate smoke installs with developer tools removed.release.ymlstill runsstapler validateandspctlon every release.What this gives up
The client no longer asks Apple during install whether a release's notarization, or LPM's Developer ID certificate, was revoked after publication.
spctlchecked both. This was agreed before the change. Before installing anything, the client still requires release-workflow provenance (Sigstore), LPM's Developer ID, andcodesign'snotarized. Checking for revocation moves to the release side, in the next PR in this stack: a daily check withstaplerandspctlthat Apple still vouches for the current releases' tickets and certificate, and a gate that the previous stable's updater takes each candidate.CI evidence
On the first push,
macos-26with no developer tools and Apple's services blocked passed every path:Each step took 2 to 9 seconds.
macos-15-intelwith only the Command Line Tools passed the same paths.On the second push (804298a), both
macos-15andmacos-26ran with no developer tools and Apple's traffic silently dropped rather than refused. Every path passed again, in 2 to 10 seconds per step, and all six required checks passed.macOS 11 to 14, which LPM supports, can't run on GitHub's runners, so that remains a residual risk. Apple's published Security source registers a stapled ticket offline from macOS 10.15 on.
Tests
macos_bundle_validation_runs_only_local_programs_that_ship_with_macosfailed onspctlbefore its removal. The requirement parses and matchesinstall.sh's.signed_macos_release*pass locally with v0.88.0 and v0.87.0.dashon Linux. New cases cover:OPENSSL_CONFsays. With an OpenSSL 3 config, macOS'sopensslexits 0 without writing. That's reproduced with the real profile. Mutation-checked: re-addingspctl, dropping-R, droppingnotarizedand skipping the staged-copy check each fail it.cargo clippy --workspace --all-targets -D warnings: clean.cargo fmt --check: clean.GIT_CONFIG_*variables.Recovery for affected installs
0.76.0 to 0.88.0 standalone installs on Macs without Xcode rerun the installer once. See
npm/release/upgrade-recovery.md. The docs update in rust-client-docs merges with the release.🤖 Generated with Claude Code