WIP: fix(builder): the release's builder links its C++ runtime in again: longshot_builder.py build's flags are whole #2824
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
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!2824
Loading…
Reference in a new issue
No description provided.
Delete branch "llun/Longshot:fix/mod-api-builder-flags"
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
For #2822 (into
mod-api).scripts/longshot_builder.py build, which makes the release's builder, adds glslang's C++ runtime to rustc's flags withflags += " -C link-arg=-l:libc++.a -C link-arg=-l:libc++abi.a"(Windows) andflags += " -C link-arg=-l:libstdc++.a"(Linux).flagsis a list since #2732, so the string goes in one character at a time:CARGO_ENCODED_RUSTFLAGSholds" ","-","C"," ","l", ... and the link-args never reach rustc as flags. This adds them as list items, like the rest of the function's flags.Read first:
cmd_buildinscripts/longshot_builder.py.Testing
Tested: Windows 11,
mise run test -- test_longshot_builder. The check now looks for the C++ runtime's link-args, each one whole, and asks that no flag is a single character. It fails onmod-api@eaf4a48b(['-C', 'link-arg=-l:libc++.a'] not found in [... [' ', '-'], ['-', 'C'] ...], the same on the Linux side with-l:libstdc++.a) and passes here.mise run lintpasses.Still to test:
scripts/longshot_builder.py build, expecting it to link with glslang's C++ runtime static and passcheck(by hand, a maintainer: it needs the pinned toolchain's download)Measurements
Verdict: fixed. The release's C++ runtime link-args reach rustc whole: the check fails on
mod-apiand passes here.Baseline:
mod-api(#2822's head), the branch this PR goes into: the bug is there, not onmain.Setup: Windows 11,
mise run test -- test_longshot_builder(its Windows and Linux cases, withlongshot_builder.py build's cargo run stood in). The game and a build's speed are not affected: only the flags change.eaf4a48b3628cf9atests/test_longshot_builder.py['-C', 'link-arg=-l:libc++.a'] not found(the flags' ','-','C', ... one character each)Risks
The sandbox: not touched. This is the release's build script for the builder: it links the builder's own C++ runtime in. What the builder confines, grants and serves to the game is the same code.
Only the release's
longshot_builder.py buildchanges: its C++ runtime flags now reach rustc. A revert is enough. Players notice nothing.Checklist
Ready for review
mod-api(#2822's head); the title is a Conventional Commit.mise run testpasses (any failure that also fails onmainis named). (This check passes. The whole suite onmod-apihas Windows-only failures, which another PR intomod-apifixes.)main, or Measurements says why there is nothing to measure.third_party/untouched; nothing GPL-incompatible.When it applies
mainand passes here. (It fails onmod-api, where the bug is.)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
Measurements: the check's result before (mod-api @
9e6b9c57, fails) and after (50a0a697, passes), with a Baseline line, as standards.md's Measurements asks of a fix.50a0a6971777ec30c293Rebased onto mod-api's new squash
eaf4a48b(the same tree as9e6b9c57, which this branch was on): the diff is this PR's own commits again. The checks and runs above hold as they are (the tree under them is unchanged); the description's commits are the new ones.Risks now says how this change stands with the sandbox (what it touches, and why the confined game reaches nothing more).
77ec30c293d30e8cdd29Rebased onto mod-api's newest (
4cc50ca1: main's newest merged in), with no conflict; this PR's own checks were run again on the rebased head and pass as before. The merge touched none of this PR's files (#2827: only a comment in host/hos_main.c, far from its change), so the measurements and runs above hold; the After commit is the rebased head.d30e8cdd29d58044ad26Rebased onto
mod-api@816d2354(#2837, headless shots of the mods' UI), nowd58044ad. No conflict, and the diff is the same as before (samegit patch-id). #2837 touches none of this PR's files.d58044ad26daf95b29efdaf95b29ef3628cf9a97Rebased onto
mod-api@c5e5b676: it was re-squashed onto main @46291934(#2833) twice today (cdbb8551, thenc5e5b676), which made this PR show main's and the whole mod API's diff. Now3628cf9a, the same diff as before (samegit patch-id), no conflict. The changes underneath touch none of this PR's files, so its checks still hold.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.