Skip to content

wezterm@nightly: fix install on case-insensitive filesystems#276451

Open
1995parham wants to merge 1 commit into
Homebrew:mainfrom
1995parham:wezterm-nightly-case-insensitive-glob
Open

wezterm@nightly: fix install on case-insensitive filesystems#276451
1995parham wants to merge 1 commit into
Homebrew:mainfrom
1995parham:wezterm-nightly-case-insensitive-glob

Conversation

@1995parham

Copy link
Copy Markdown

Supersedes #276450, which became un-reopenable after its head branch was momentarily deleted during fork initialisation (GitHub returns HTTP 422 on reopen, so the auto-reopen workflow cannot recover it). Re-filed here with the complete template.

Problem

brew install --cask wezterm@nightly fails on case-insensitive filesystems (the macOS default, e.g. non-case-sensitive APFS):

Error: install step source glob must match exactly one path:
/opt/homebrew/Caskroom/wezterm@nightly/latest/{WezTerm-*,wezterm-*}/WezTerm.app

Cause

#0e23e31ac ("wezterm@nightly: migrate flight removals") replaced the previous duplicate-tolerant preflight do … .glob([...]).first with a move step:

move "{WezTerm-*,wezterm-*}/WezTerm.app", ".", source_glob: true

The move step resolves its source with Pathname.glob and requires exactly one match (Cask::Artifactinstall_steps.rb#resolve_step_source). The nightly zip extracts to a single folder, WezTerm-macos-<date>/. On a case-insensitive filesystem both brace alternatives match that one folder:

  • WezTerm-*/WezTerm.app → matches
  • wezterm-*/WezTerm.app → also matches the same folder (case-insensitive)

so the glob returns the path twice (length 21) and the step aborts. The old .first form silently tolerated the duplicate; the strict move form does not.

Fix

The macOS nightly artifact is always named WezTerm-macos-* (capitalised), so one glob alternative matches exactly once on both case-insensitive and case-sensitive filesystems; the lowercase wezterm-* alternative was redundant.

Testing

  • brew style — no offenses.
  • HOMEBREW_NO_INSTALL_FROM_API=1 brew install --cask wezterm@nightly (via a local tap carrying this change) installs cleanly on non-case-sensitive APFS; wezterm --version20260716-195552-76b606ec; all four binaries link.
  • brew audit --cask --online still reports No binaries in App + an index 0 outside of array bounds exception, but this is pre-existing and unrelated to this change: brew audit's extract_artifacts unpacks the zip without running preflight_steps, so it looks for WezTerm.app at the staged root while the app is still inside WezTerm-macos-*/. I reproduced the identical audit failure against the unchanged main content (brace-glob version), so this PR neither introduces nor is able to fix it.

After making any changes to a cask, existing or new, verify:

Additionally, if adding a new cask:

  • Named the cask according to the token reference.
  • Checked the cask was not already refused (add your cask's name to the end of the search field).
  • brew audit --cask --new <cask> worked successfully.
  • HOMEBREW_NO_INSTALL_FROM_API=1 brew install --cask <cask> worked successfully.
  • brew uninstall --cask <cask> worked successfully.

  • AI was used to generate or assist with generating this PR. Please specify below how you used AI to help you, and what steps you have taken to manually verify the changes, including zap stanza paths.

AI usage: Claude (Claude Code) diagnosed the root cause and drafted the one-line change. Every claim was verified manually by me:

  • Confirmed the filesystem is non-case-sensitive APFS and that each brace alternative matches the single WezTerm-macos-* folder (so Pathname.glob returns two identical paths → the move step's "exactly one path" check fails).
  • Ran brew style (clean) and installed from a local tap with the change; wezterm --version runs and all binaries link.
  • Verified the brew audit errors are pre-existing by reproducing them against the unchanged main content.
  • zap stanza: the app's CFBundleIdentifier is com.github.wez.wezterm, so the existing ~/Library/Saved Application State/com.github.wez.wezterm.savedState path is correct (the zap stanza is unchanged by this PR).

@1995parham

Copy link
Copy Markdown
Author

CI summary for maintainers:

  • test wezterm@nightly (macos-15-intel) — full run passed, including brew audit, brew install, brew uninstall, and the zap-path check.
  • test wezterm@nightly (macos-26, arm) — brew install --cask (step 17), brew uninstall --cask (step 19) and the missing-zap-paths check (step 18) all passed — i.e. the install bug this PR fixes is resolved.
  • ❌ The only failure is the arm brew audit --cask step (step 11): No binaries in App + exception … index 0 outside of array bounds: 0...0.

That audit failure is pre-existing and unrelated to this one-line change: Cask::Audit#extract_artifacts unpacks the archive but does not run preflight_steps, so it looks for WezTerm.app at the staged root while the app is still inside WezTerm-macos-*/; files.fetch(0) on the empty result then raises. It reproduces against the unchanged main content, and the intel runner passing the same audit shows it's environment-dependent rather than a cask defect. Any cask that relocates its app via preflight/preflight_steps hits this. A cask-side workaround isn't viable — pointing app at WezTerm-*/WezTerm.app breaks the install step (app does not glob-expand its source).

Happy to adjust if you'd prefer a different approach.

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