Repository navigation
Move the build log into a BuildLog store (#387) - #456
Merged
Merged
Conversation
Merged
4 of 6 tasks
This was referenced Nov 1, 2026
v0lumehi
force-pushed
the
v0lumehi/build-log-store
branch
from
November 2, 2026 12:47
09bb981 to
5add68a
Compare
This was referenced Nov 2, 2026
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.
Fix or feature
This is a refactor with no change in behavior, so neither box fits. Part of #387, step 3.
What and why
Step 3 of #387:
BuildLogcomes out ofBuildModel.logTailwas@Publishedon the model that every launcher view observes, so each chunk the build script wrote invalidated the whole launcher, game cards included.BuildLogin theNXModeltarget. It is an@MainActorObservableObjectthat owns the log text, the tail trimming (past 12000 characters it keeps the last 9000) and the line buffer.feed()splits a chunk into lines and holds back a partial last line.flush(),append()andclear()do the rest.BuildModelholds it in alet logand does not publish it.logTailstays on it as a plain computed property overlog.text, for the failure classifier, the diagnostics report, the onboarding driver and the tests. Nothing observes it.BuildLogViewinNXLauncher. It is the only view that observesBuildLog. The scroll text and the scroll to the end moved there unchanged.BuildModelis not@MainActoryet, so it reaches the log throughBuildLog.onMain, which isMainActor.assumeIsolatedfor macOS 13. All callers already run on the main queue. It goes whenBuildModelbecomes@MainActor.ingest()is no longer private, so the performance test can feed lines the way the pipe does.ContentView.swiftshrinks from 3749 to 3730 lines andSourceSizeTestsis lowered.frontend/ARCHITECTURE.mdsays where things stand."\r\n"is one Character in Swift, so it never matches"\n"and a CRLF line is not split. The script writes plain"\n", so I left it.This is a step of the split. Each step is its own PR. @LNPANDY, this one changes how the launcher is built, not how it works or looks.
Checked
cd frontend && swift test, 707 tests, 0 failures, 17 skipped as before. The first full run had 2 failures. Both were my own newtestCarriageReturnsAreDropped, which expected"\r\n"to split (see the quirk above). I fixed the test. Two full runs after that were clean, so I saw no flaky test. After merging main I ran the new tests,SourceSizeTests,LauncherPerformanceTestsand the build failure tests again, 55 tests, 0 failures.BuildLogTestsrun without SwiftUI: append, tail trimming, line buffering across chunk boundaries, flush, clear, and that only a change of the text publishes.LauncherPerformanceTestshas a new step, "1000 log lines in a build". It feeds 1000 lines throughingest(), one per run loop turn, while the library is shown. Its budget is 0 game cards. Result on my Mac, three runs: 0 cards, 0 fonts, 0 Info.plist reads, busy 118, 164 and 136 ms (budget 1500). I did not run the step against the old code, so I did not see it fail there.Screenshots
None, no visible change.
Scope
dm/,scripts/,docs/,ref/) is added to the repository