fix: only detect real .app bundle paths in pathToFuseFile#123
Merged
Conversation
pathToFuseFile() and the ad-hoc codesign reset in flipFuses() used
pathToElectron.includes('.app') to decide whether the Electron binary
lives inside a macOS .app bundle. That substring check false-positives
when an ancestor directory merely contains '.app' (e.g. '/home/user/.app/'
or 'my.app.win'), wrongly routing into the macOS bundle path on Linux
and Windows and producing ENOENT errors.
Replace both substring checks with regexes that match the real bundle
layout: '.app/Contents/MacOS/' for the inner-binary resolution, and an
anchored path-segment match ('<name>.app' bounded by separators) for the
codesign reset. Export pathToFuseFile so the path-resolution logic can be
unit-tested without downloading Electron binaries.
Closes #118
Closes #95
MarshallOfSound
marked this pull request as ready for review
June 28, 2026 16:26
MarshallOfSound
approved these changes
Jun 28, 2026
ckerr
approved these changes
Jun 29, 2026
|
🎉 This PR is included in version 2.1.3 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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.
Requested by Samuel Attard · Slack thread
Before
pathToFuseFile()(and the ad-hoc codesign reset inflipFuses()) decided whether the Electron binary lives inside a macOS.appbundle usingpathToElectron.includes('.app'). That bare substring check false-positives whenever any ancestor directory merely contains.appin its name. For example, building from a project under/home/user/.app/electron-app/(or a Windows folder likemy.app.win) made the resolver believe it was on macOS and route into the bundle path, producing errors such as:After
Only genuine macOS
.appbundle paths are treated as bundles. Building from a directory whose name happens to contain.appon Linux/Windows resolves the Electron binary path unchanged, as expected.How
Both
.includes('.app')call sites are replaced with regexes that match the real bundle layout instead of an arbitrary substring:pathToFuseFile(), the inner-binary branch now matches\.app[\\/]Contents[\\/]MacOS[\\/]— i.e. the actualSomething.app/Contents/MacOS/…structure that precedes the../../Frameworks/…resolution.flipFuses(), theresetAdHocDarwinSignaturecodesign reset now matches an anchored path segment —(^|[\\/])[^\\/]+\.app([\\/]|$)— so a<name>.appdirectory is detected as a bundle while names like.appormy.app.winare not.pathToFuseFileis now exported so the path-resolution logic can be unit-tested directly without downloading Electron binaries.Tests
Adds
test/path-resolution.spec.tswith regression coverage:.appbundle path and its innerContents/MacOS/Electronbinary path are still resolved to the framework binary (positive cases)..app-named ancestor (#118) and a Windows path undermy.app.win(#95) are returned unchanged and not treated as macOS bundles.Closes #118
Closes #95
#95 is the same root cause (
.includes('.app')false-positive at both call sites) and is fixed here.🤖 Generated with Claude Code
https://claude.ai/code/session_019E2Tyh4thR7TKQqfLcVUXh
Generated by Claude Code