Fix(core-ruffle): resolve standalone Ruffle path inside .app bundle on macOS#516
Open
mark-henry wants to merge 1 commit into
Open
Conversation
…n macOS On macOS the Ruffle standalone release ships as a Ruffle.app bundle, so the binary lives at <version>/Ruffle.app/Contents/MacOS/ruffle. The previous flat path (<version>/ruffle) never exists on macOS, so existsSync() always failed and forced a re-download via getGithubReleaseAsset(..., 'latest'), which requests /releases/tags/latest -> 404 and rejects unhandled, crashing the launcher backend when using 'Run with Ruffle'. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Member
|
No. If you took the time to read Mac installation guide https://flashpointarchive.org/datahub/Mac_Support#Installing_Flashpoint it tells you to download a static copy of Flashpoint. It's just that Ruffle was NOT included in the release. So actually, this PR doesn't solve anything. if the user were to download Ruffle binary and drop it into (Note, apple is not my expertise, just basing of my existing knowledge and I do not have access to a Mac to test with) |
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
On macOS, launching any Flash game via Play ▾ → Run with Ruffle crashes the launcher backend (
Flashpoint Helper) with an unhandled promise rejection:This happens even though a working standalone Ruffle is already bundled at
Data/Ruffle/standalone/latest/.Root cause
In
extensions/core-ruffle/src/middleware/standalone.ts, the standalone executable path is resolved as a flat file:On macOS the standalone release (
*-macos-universal.tar.gz) extracts to aRuffle.appbundle, so the actual binary lives at<version>/Ruffle.app/Contents/MacOS/ruffle, not<version>/ruffle. As a resultfs.existsSync(execPath)is always false on macOS, which forces the download branch:With the default
version: 'latest',getGithubReleaseAssetrequestshttps://api.github.com/repos/ruffle-rs/ruffle/releases/tags/latest, which 404s (there is no tag literally namedlatest). That rejection is thrown out of an async path with no.catch, taking down the backend.Fix
Resolve
execPathinside the.appbundle ondarwin. This matches both the bundled Ruffle and a freshly-extractedmacos-universal.tar.gz, soexistsSyncsucceeds and the download is correctly skipped. The existingchmod(execPath, 0o775)andgameLaunchInfo.launchInfo.gamePath = execPathwork unchanged with this path.Testing
Verified on macOS 15 (Apple Silicon, Flashpoint 14.0.3, build
a7b78478) by applying the equivalent change to the built extension (dist/extension.js):Windows/Linux paths are unchanged.
Related (out of scope, noted for awareness)
Even when a download is needed,
version: 'latest'is passed straight intoreleases/tags/${version}→/releases/tags/latest(404). A literallatestshould resolve via/releases/latest(or the releases list). Not fixed here to keep this PR focused on the crash; happy to follow up if desired.