Repository navigation
Move the engine selection, the engine sync and the engine failure into EngineSyncStore (#387) - #467
Merged
Merged
Conversation
This was referenced Nov 2, 2026
fayh77
pushed a commit
to fayh77/NX2Apple
that referenced
this pull request
Nov 2, 2026
The app was compiled by Xcode 26.6 on macos-latest while the tests ran with 27.2. A closure that 27.2 accepts failed only in the build job (LNPANDY#467). Both now use the same Xcode.
v0lumehi
force-pushed
the
v0lumehi/engine-sync-store
branch
from
November 2, 2026 12:47
31ebd4e to
2f7305f
Compare
v0lumehi
force-pushed
the
v0lumehi/engine-sync-store
branch
from
November 2, 2026 16:00
ee35f10 to
89cee41
Compare
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.
Stacked on #466 (stack #459), retarget to main after the ones below merge.
Part of #387, step 7 (engine sync).
Fix or feature
It is a step of the plan @LNPANDY and I agreed in #387. No change of behavior.
What and why
BuildModelstill owned the engine: the selection of channel and engine, the sync of a checkout'sengine/, the engine failure row and the engine switch of the release app. This PR moves them intoEngineSyncStoreinNXModel, the third store afterAppUpdateStoreandRepoStore, and follows the pattern infrontend/ARCHITECTURE.md.EngineSyncStoreis@MainActorand owns its@Publishedstate:selection,busy,status,available,confirmingChannel,syncingandfailure. It takes theLocalizer, aProcessRunner, the repository as aRepoLocation, the interpreter as aPythonLocation, the engine store, the network (EngineTransport) andUserDefaultsthroughinit.PythonLocationis a new narrow protocol withpythonPath.BuildModelprovides it today and the dependency store takes it over.syncEngine,retrySync) keeps its rules: calls during a run wait and one more run follows, a currentengine/runs nothing and clears the row. The release app's work (prepareEngine,checkForUpdate,installAvailable, the channel switch, an engine that waits for the running build) moved as it was. The methods that start work return theirTask, so a test awaits it.RepoStore.didMovenow starts the store's sync.NXCoregets what the store needs: the stale check, the stamp key and the sync run ofEngineLayout(fromEngine.swift),EngineUpdater.swift(EngineChannel,EngineSelection,EngineUpdate,EngineInstaller,EngineTransport),EngineLayout.shaderChain(the body ofBuildFolder.currentChain, which now calls it) andBuildFailureKindwithBuildFailure(the failure row). The classifier stays in the app target.BuildModel.Engine.swift(95 lines),EngineUpdateModel.swift(151) andEngineUpdater.swift(362, now 374 inNXCorewithpackageaccess).ContentView.swiftis 2228 lines (was 2265), and its limit inSourceSizeTestsis lowered.LauncherView.swiftis 967, as before.EngineSyncStoreTests(15 tests, no SwiftUI) cover the sync with a fake runner and the release app's rules.FakeProcessRunnercan now stream lines.EngineLayoutTestsstill runs a real script through the model.BuildFailureKind.swifttoo, because the kinds moved there.What stays in
BuildModeland whyBuildModelforwards the store'sobjectWillChangeto its own, as it does forRepoStore.canBuildand the build views read the engine's paths through the model, so they redraw as before. Goes with the build store.startBuildwaits for the sync andDiagnosticsreads the selection, both throughMainActor.assumeIsolated. They go with the build store.pythonPathand the dependency list stay until the dependency store.BuildModelis not@MainActor, so it reaches the store throughMainActor.assumeIsolated.tools/engine.pystill namesEngine.swiftin a docstring. I did not touchtools/in this PR.All of this is in
frontend/ARCHITECTURE.md.Checked
cd frontend && swift test, four full runs (three by hand, one by the pre-push hook), 803 tests per run over the three bundles (NXModelTests 68, NXCoreTests 98, NX2AppleTests 637, 17 skipped as before), 0 failures. The step before had 791. The 12 more are the new store tests less the model tests that moved. No flaky test seen. The frontend-qt tests pass too.Screenshots
None, no visible change.
Scope
dm/,scripts/,docs/,ref/) is added to the repository: a change there is a patch inpatches/(a commit inengine/, thentools/engine.py export, andtools/engine.py checkpasses), with itsUpstream-Statusforwarded seedds/nxnative#..., orpendinguntil that PR is open