fix(builder): from-source compiles the third-party objects with dev compile, and a failure there says what the builder said #2774
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/mods
area/renderer
area/saves
area/tooling
area/upscaling
beanstalk: approved
beanstalk: failed
beanstalk: needs approval
beanstalk: running
beanstalk: tested
ci: approved
good first issue
gpu/amd
gpu/igpu
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/macos
platform/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
regression
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!2774
Loading…
Reference in a new issue
No description provided.
Delete branch "llun/Longshot:fix/from-source-dev-compile"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Building a pull request (or Main) from the Longshot Launcher stops at "The third-party objects could not be compiled
from the source (exit code: 1):", with nothing after the colon.
Cause. #2762 made
compilea developer's command (longshot-builder dev compile), and #2769 moved the packager'scalls over. But
from-sourcestill starts its nested builder withcompile --third-party-objects …. The launcherinstalls the newest nightly builder as
Longshot.exeto runfrom-source. Under that play name,play::wantedtreatsany first word missing from play's
COMMANDSas game arguments.compileleft that list in #2762. So the nested builderplays: it runs the fast check and starts a game build instead of compiling the objects. Then it fails without an
errorevent.third_party_objectsonly kept that event's text, so the message ended at the colon.On main: run any release builder renamed
Longshot.exe(as the launcher has it) withfrom-source --commit <sha> --out <dir> --name x --output json. Or run the line it gives its child,Longshot.exe compile --work … --third-party-objects … --output json, by hand. The child printsfast check: not built yet,play_plan,build_planand no compile.Changes
from_source::third_party_args: the nested builder's command line, nowdev compile ….devis in play'sCOMMANDS, so it runs under any program name.from_source::not_compiled: after theerrorevent's text (when there is one), the failure adds "The end of whatthe builder said:" and the builder's last 20 lines: its stderr, its log events, and any line that isn't an event.
Cargo's failures already do the same ("The end of what cargo said:"). The launcher shows the builder's error text as
it is, so the launcher needs no change.
from_source::drainandTail(review): both pipes are read byeach_line, which reads raw lines (at most 1 MiB at atime) and decodes them lossily, so a byte that isn't UTF-8 stops neither pipe. Only the end is kept while the builder
speaks: the last 20 non-blank lines, each cut to 1 KiB, 8 KiB in all, with a log event's lines split.
docs/dev/reference/build.md: the from-source step namesdev compile.Read first:
third_party_objects,third_party_args,drain,Tailandnot_compiledinbuilder/crates/longshot-builder/src/from_source/mod.rs.It came in as a player's report from the launcher: a PR build (nightly launcher, a
.nupon a path without spaces)stopped there with no output. #2731 and #2732 (from-source's rustc and cc flags) did not cause it.
Testing
Tested: Windows 11, this PC, the builder from this branch (debug).
cargo test -p longshot-builder):tests::from_source_s_third_party_compile_is_a_command_this_builder_runs: on main,play::wanted("/v/Longshot.exe", line)isSome(…)(played).from_source::tests::a_failed_third_party_compile_says_the_end_of_what_the_builder_said: on main, the message endsat
(exit code: 1):.the_builder_s_output_is_read_to_its_end_on_both_pipes: with the old.lines()reader, the error event after aninvalid byte is lost (
left: "").the_end_kept_is_bounded_while_the_builder_speaks: without the bound, all 5000 lines are kept.Longshot.exeand run with from-source's child line, in an emptytemp folder. It played (fast check,
build_plan) and ended with exit 121, no compile.Longshot.exe, thenfrom-source --commit 4a266e78e --out … --name main-4a266e78 --output json, with a tempLONGSHOT_CACHE. It got the source, Rust and the tools, then compiled the 322 third-party objects through the nesteddev compile(36.5 s). It made the pack, compiled the builder (66 s) and ended withdonein 176 s. The builder it made answers--versionaslongshot-builder main-4a266e78 (source …).git archiveoff80bef20, since the fork's archive isn't public) throughfrom-source --archive … --commit …, run by the fixed builder asLongshot.exe. It finished in 67 s (the third-party objects 10.9 s, from the cache). Its builder (pr-fix-f80bef20) then ranbuild --profile <temp> --game <the .nup> --upscaler fsr4, andplaystarted the game: RTX 5080, NVIDIA 621.40, Windows 11. The game ran at 1920×1080 and presented 5520 frames, with no fatal, panic or device-lost line in its log, until I closed it.89f81ff0as agit archive:4a266e78, fetched withlongshot-builder fetch nightly --platform linux-x64), asLongshot.x86_64, fails its from-source with the player's error:The third-party objects could not be compiled from the source (exit status: 120):(120 is play's "never built");Longshot.x86_64: the same from-sourcecompiled the 322 third-party objects (20.4 s), compiled the builder and ended with
donein 82 s; the builder itmade answers
--versionaslongshot-builder pr-fix-linux (source …);from_source::testsand the command-line test pass there.cargo test -p longshot-builder: 6 tests fail on this PC on main and here alike (Windows environment; none touchfrom-source):
doctor::tests::no_gpu_reads_as_the_game_s_header_does,dev::site_hooks::tests::every_form_answers_as_its_hook_runs,tests::mod_calls_the_hook_with_a_context_and_its_status,tests::recomplauncher_s_build_step_is_a_command_line_it_takes,play::tests::a_first_run_writes_the_profile_from_the_copy_given_or_chosen,tests::a_build_for_a_profile_writes_profile_json_and_its_settings.cargo clippy -p longshot-builder -- -D warningswith this PC's Rust 1.100.1 stops on an unusedExitCodeatafter.rs:398andplay.rs:669. Both are on main and untouched here.tests/run_all.py --strict --changed: on Windows,test_dev_packs,byte_compile_tracked,test_recomplauncher_jsonand
test_no_release_lookuppass.test_dev_build,test_builder_channel,test_longshot_exitandtest_prompt_font_bindfail here and on main alike (no gcc, Linux cases). All 4 pass in WSL Ubuntu 24.04.Still to test:
say) from the launcher's Pull request channel, expecting it past "Building the tools from source" (by hand).
Measurements
Nothing to measure: from-source's command line and an error message. The game isn't changed.
Risks
dev compiletakes the same flagscompiletook before #2762 (--work,--root,--store,--jobs,--cache,--output,--third-party-objects). The new test parses the whole line throughparse.from-source. Until then,every Pull request and Main build from the launcher fails at this step. The prebuilt channels (Stable, Release
candidate, Nightly) are not affected.
Checklist
Ready for review
main; the title is a Conventional Commit.mise run testpasses (any failure that also fails onmainis named). (This PC has no gcc. The checks that readthe changed files are named above and pass in WSL; the builder's 6 pre-existing failures are named.)
main, or Measurements says why there is nothing to measure.third_party/untouched; nothing GPL-incompatible.When it applies
mainand passes here.tests/that reads changed source is updated, not weakened. (Those readingmain.rsandfrom_source/mod.rsneeded no change and pass as they are; no switch is added:LONGSHOT_CACHEis only in thenew test's assertion.)
Assisted-by:/Co-Authored-By:trailers.Ready to merge
main, measured again or a comment says why the numbers still hold.🤖 Generated with Claude Code
dev compile, and a failure there says what the builder saidTested in game: Windows 11, RTX 5080, NVIDIA 621.40. A pull request's whole path: this branch's head built with from-source by the fixed builder named Longshot.exe (as the launcher has it). It got past the third-party objects (322 compiled) and finished. Its builder then built the game from the .nup with FSR 4, and play started it: 1920x1080, 5520 frames presented, no fatal, panic or device-lost line in the log. On main the same step plays instead of compiling and fails with an empty message.
WIP: fix(builder): from-source compiles the third-party objects withto fix(builder): from-source compiles the third-party objects withdev compile, and a failure there says what the builder saiddev compile, and a failure there says what the builder said@review
Recommendation: Approve. The code is ready: only testing is left. The command fix restored the reported Windows build path, including an end-to-end game build and launch. Linux verification and the running CI checks are still outstanding. Recommend approval; not approved on the forge.
From-source now invokes the third-party compile as a developer command and includes recent builder output in failure messages. The change is small and keeps the existing compile options; it also retains diagnostic output in memory until the child exits.
Testing before merging (1) (runs on the systems it can change; it doesn't hold the recommendation)
builder/crates/longshot-builder/src/from_source/mod.rs:466: The launcher-style from-source build has not yet been verified on Linux. (more on the line) Do: Run the branch's builder as Longshot.x86_64 on Linux through from-source and confirm that the third-party objects and resulting builder complete.Checks: Still running: 7 checks.
More: does it help, other systems, switches, what was read
Does it help: Yes. The author reproduced the wrong play dispatch on main and reports that the fixed Windows builder compiled 322 third-party objects, finished from-source, and built and launched the game. Linux has not yet been exercised end to end.
Other systems: The command runs on Windows and Linux and is independent of GPU vendor. The Windows launcher-style path was tested; the Linux launcher-style path remains untested. The change does not alter game runtime code.
Switches: None added, changed or removed. The existing LONGSHOT_CACHE option is passed to the child as before.
Reviewed:
f80bef20e3against4a266e78ee: Read the repository rules, contribution standards, PR template, complete diff and commit messages; examined the changed builder functions, their dispatch, parser, reporter and compile callers, and the new tests. Skimmed the rest of main.rs, the build reference and unrelated surrounding implementation. The referenced Tooling AGENTS.md was not present in the checkout; docs/review-checklist.md was absent.; nothing run (a code review).Checked and fine:
Testing: No commands from the project or tests were run during review. The author reports Windows tests and an end-to-end build; CI is still running.
Overlaps and merge order: Not checked; network access was unavailable.
Automated code review by BeanBot (gpt-6.1-terra), asked for by llun. Nothing was run; a maintainer decides.
@ -474,3 +466,1 @@.arg(cache).arg("--third-party-objects").arg(&set)c.args(third_party_args(src, fs, cache, jobs, &set))L1 (should fix): The launcher-style from-source build has not yet been verified on Linux.
When: A Linux player building Main or a pull request relies on the same nested command and Linux toolchain path; the reported successful end-to-end run is on Windows.
Do: Run the branch's builder as Longshot.x86_64 on Linux through from-source and confirm that the third-party objects and resulting builder complete.
Recommendation: Request changes. The Windows evidence supports the command fix. Bound the diagnostic capture while the child runs.
The nested builder now enters
dev compileunder both Launcher executable names. The parser still receives the same work, source, store, cache, jobs, JSON output, and third-party set arguments. Stdout and stderr are drained concurrently, and the child is waited on by the spawning thread.Blocking
builder/crates/longshot-builder/src/from_source/mod.rs:483–484keeps every stderr, plain stdout, and structured log line in a growing vector on successful and failed runs. On failure it joins the entire vector before taking the last 20 nonblank lines. A noisy compiler can make the parent retain and then copy a large log while compilation is already competing for memory. Keep only the recent nonblank lines while draining the pipes and cap retained text by bytes as well. Cover mixed stdout/stderr and multiline log events through the actual collector so the test checks retention as well as the displayed string.Diagnostic coverage
Evidence
f80bef20e3eed4a921008d0b212297e161ca3e4cagainst4a266e78ee803824cff449d3df419c5cd1e4368d, all four changed files and the relevant play, CLI and compile callers. No switches changed. This was a code review.@ -490,2 +480,4 @@let (stdout, stderr) = (child.stdout.take(), child.stderr.take());let mut why = String::new();// (what the builder said, its stderr and its log's text as they came: the end of it is in the error)let said = std::sync::Mutex::new(Vec::<String>::new());[P2] Bound the retained diagnostic tail during capture. Every qualifying line is currently stored even on successful builds, then a failure joins the full log before discarding all but the last 20 lines. Keep the last 20 nonblank lines under a byte limit while both pipes continue to drain. Test the collector with multiline and mixed-stream output.
@ -494,3 +487,4 @@use std::io::BufRead;for line in std::io::BufReader::new(stderr.expect("piped")).lines().map_while(std::result::Result::ok) {r.trace(|| tracing::info!(source = "tool", tool = "builder", stream = "stderr", "{line}"));say(&line);The existing UTF-8 line iterator stops at an invalid byte sequence. A tool diagnostic using a legacy Windows encoding can leave the actual failure later in stderr unread. Consider reading raw lines and decoding lossily, and exercise that path with the collector.
Pushed
89f81ff0for the reviews:futondestroyer (request changes):
drain()now, with aTailthat keeps only the end while the builder speaks:the last 20 non-blank lines, each cut to 1 KiB, 8 KiB in all. Nothing is joined at the end any more. A log event's
text of several lines goes in as separate lines.
each_line(): raw lines (at most 1 MiB at a time), decoded lossily, so aninvalid byte stops neither pipe.
the_builder_s_output_is_read_to_its_end_on_both_pipescovers mixed stdout and stderr, a multi-line log event, aline that is no event, and invalid bytes on both pipes, with the error event after them.
the_end_kept_is_bounded_while_the_builder_speakscovers 5000 stderr lines, 30 lines of 8000 bytes, and a30-line event.
.lines()reader loses the error event (left: ""); without thebound, every line is kept.
BeanBot L1 (Linux): run in WSL Ubuntu 24.04 on this head.
Longshot.x86_64, fails from-source with the player's error,(exit status: 120):and nothing after it.Longshot.x86_64, compiled the 322 third-party objects, compiled the builder and finished(82 s). The builder it made runs.
On the first signed nightly after the merge: it's in Still to test, as a launcher PR build (#2765) on Windows and Linux.
@review
Recommendation: Approve. The command fix completed launcher-style from-source builds on Windows and Linux, and the diagnostic collector now retains a bounded tail. The remaining launcher checks and CI are still pending. Nothing blocking is left. Recommend approval; not approved on the forge.
From-source builds now invoke the third-party compiler correctly under the launcher’s executable name, and failures include recent builder output. The collector adds bounded diagnostic handling without changing the game.
Since the last review (on
f80bef20e3)Resolved: L1 (The launcher-style from-source build has not yet been verified on Linux.)
Checks: Still running: 7 checks.
Also noticed (2; not asked for, not blocking)
More: does it help, other systems, switches, what was read
Does it help: Yes. The author reports that the unfixed Linux nightly failed with exit status 120, while this head compiled 322 third-party objects and completed from-source in 82 seconds; the Windows launcher-style build also completed.
Other systems: The changed path runs on Windows and Linux. The author reports successful launcher-style builds on both, plus a Windows game build and launch; actual Launcher checks against the first signed nightly remain planned.
Switches: None.
Reviewed:
89f81ff081against4a266e78ee: Read the repository review rules and pull request template, the changed collector and its tests, the cargo helper, the command-line diff and dispatch references. Skimmed the recorded runs and documentation change; the complete main.rs and other referenced modules were not read in full.; nothing run (a code review).Checked and fine:
Testing: The author reports passing collector and command-line tests and successful Windows and Linux from-source runs. No commands that build or run project code were executed for this review.
Overlaps and merge order: None identified.
Automated code review by BeanBot (gpt-6.1-terra), asked for by llun. Nothing was run; a maintainer decides.
Recommendation: Wait for the remaining CI and Launcher verification. I retire the diagnostic-capture blocker from my previous review on
89f81ff08193795f958f364eca5bb870221f37ceagainst4a266e78. I found no new code blocker.Both pipes still drain concurrently. Each read is limited to a 1 MiB chunk, and lossy decoding lets later diagnostics through after invalid UTF-8. The retained tail now holds up to 20 nonblank lines and 8 KiB of text, with a UTF-8-safe cutoff for individual entries. The formatter joins only retained lines. The new tests exercise the collector with both streams, bad bytes, a multiline event, 5,000 lines, and long multibyte text. As additional coverage, a single physical line over 1 MiB followed by a structured error would exercise the chunk boundary directly.
The author's exact-head WSL run reproduced exit 120 with signed nightly-909, then completed the fixed from-source run in 82 seconds after compiling 322 third-party objects. The collector and argument tests passed there. The earlier Windows debug-Builder run at
f80bef20covers dispatch through the archive build and game launch. The first signed nightly containing the fix still needs the actual Windows and Linux Launcher Pull request channel check with #2765. That is the packaging and delivery check before relying on it for the Radeon test. CIValidation finished after the PR merged as
2a146054. The run below used the exact PR head as its outer Builder.Independent Windows validation of
89f81ff08193795f958f364eca5bb870221f37ceagainst #2765 at7d4deb299fcc0d4d7e218ede718133e9ca4b9a4a.I built the candidate Builder from source and ran it as
Longshot.exe, the name the Launcher uses, with a pinned source archive and disposable cache and destination. The nested command compiled 322 of 322 third-party objects with zero failures in 59.4 s. The full game-freefrom-sourcecommand exited 0 in 243.3 s. It produceddonefor the selected commit, itssource.jsonnames that commit withsigned: false, and the generated Builder returnedlongshot-builder pr-2765-7d4deb29 (source f2226edd735d4f2e)from--version. The local developer Builder lacked an archiver for the optional RenHDrum step and reported that warning. This covers source packaging and the name-sensitive dispatch regression. The Windows and Linux Launcher Pull request channel smoke remains for the first signed nightly containing the fix. The author's exact-head Linux WSL run already covers the game-free path on Linux.The current Rust CI log reports passing Clippy and Rust tests, including the new command and diagnostic collector tests. The workspace rustfmt complaint is in unchanged
host_sources_tests.rs. The synthetic end-to-end test still expectsimage.binat the game-folder root, while the merge base and this head both writedata/image.bin. The same end-to-end failure appeared on the earlier #2765 run. Neither failure comes from the from-source patch.Jiro113 referenced this pull request2026-11-29 04:04:45 +00:00