Repository navigation
feat: add debug-only FORGE_RUNTIME_BINARY runtime override - #44
Merged
Merged
Conversation
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.
Summary
Add a debug-only escape hatch (
FORGE_RUNTIME_BINARY) so developers can point the macOS menu bar app at a locally builtforge3instead of the managed runtime store, and make the app runnable unbundled by skipping Sparkle when there is no.appbundle.Changes
DeveloperRuntimeOverride, which resolvesFORGE_RUNTIME_BINARYinto anInstalledRuntimeinDEBUGbuilds onlyDeveloperOverrideRuntimeInstaller, aRuntimeInstallingwrapper that short-circuits download, staging, and store validation when an override is activeAppDelegateruntime setup viawrapIfOverridden.appbundle that declaresSUFeedURL; hide the "Check for Updates" menu item and log a warning on manual checks otherwisemacos/README.mdKey Implementation Details
resolveis guarded by#if DEBUGand returnsnilunconditionally in release builds, so a shipped app cannot be redirected to an arbitrary binary through the environment.ForgeCoreError.missingExecutableso typos fail loudly instead of silently falling back to the downloaded runtime.wrapIfOverriddenlogs that error and returns the base installer.0.0.0so it never sorts as an upgrade, and the existing launch-boundary checks inRuntimePinnedExecutablestill apply to the overridden path.NSAlertfaults inside ImageIO; packaged builds keep the previous behaviour.Testing
Run the tests added in
macos/Tests/ForgeMenuCoreTests/CoreBehaviorTests.swift, which cover override resolution underDEBUG, the release-buildnilresult, empty/unset variables, and rejection of relative, missing, directory, and non-executable paths. Manually verify withFORGE_RUNTIME_BINARY=/path/to/forge3 .build/debug/ForgeMenuBarand confirm the unbundled debug binary launches without an updater menu item.