test(build): give the CPM discovery check's toolchain stand-in find and need #561
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/renderer
area/saves
area/upscaling
beanstalk: approved @ 1697603
beanstalk: approved @ 2c5a62e
beanstalk: approved @ 4fd82b7
beanstalk: approved @ 64d6d09
beanstalk: approved @ 6f91fae
beanstalk: approved @ 70a78f9
beanstalk: approved @ 8d361dc
beanstalk: approved @ 9d8356e
beanstalk: approved @ abf2227
beanstalk: approved @ d82f202
beanstalk: approved @ e5f1e40
beanstalk: approved @ ee8ab5f
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
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
testing wanted
ci: approved
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!561
Loading…
Reference in a new issue
No description provided.
Delete branch "zeldaootr/Longshot:cpm-discovery-test-toolchain-find"
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?
Type: test · Risk: low · Tested on: Linux, no GPU (game-free check); Windows 11 (a reviewer's run of the check) · Needs: none
Why
tests/test_cpm_discovery.pyhas failed onmainsince #524 merged, and still fails onmainaa95d35f:nx2/build.pynow askstoolchain.find("clang")when it is imported, and the check's stand-in fortoolchainhas nofind, so all six tests that import the build stop with anAttributeErrorbefore checking anything.How to reproduce
Seen on: Linux (Ubuntu 24.04), no GPU; Windows 11 (the reviewer's run)
Settings and switches: none
Steps: on
mainaa95d35f, runpython -I -B tests/test_cpm_discovery.pyExpected: 7 tests, OK (one skipped where there are no system Vulkan or SPIR-V headers)
Actual:
FAILED (errors=6, skipped=1):AttributeError: 'types.SimpleNamespace' object has no attribute 'find'at_CLANG = toolchain.find("clang")innx2/build.pyWhat changed
Test-only: the check's stand-in for
toolchaingets thefindandneedthatnx2/build.pynow calls at import, so the check runs again and checks the same package discovery as before. No product file changes.tests/test_cpm_discovery.py, thetoolchainstand-in inbuild()gainsfindandneed, behaving as the real ones inthird_party/a64-kit/tools/toolchain.pydo on a PC without clang:findreturns a path that is not a file, andneedstops on a missing file. With no clang file, #524's-march=nativequery is skipped at import, so the check still runs no compiler and no process (thesubprocessguards are unchanged).toolchain, whosefindalways returns a path; the check's stub predates it (the two changes crossed).Measurements
Verdict: passes: the check fails on
main(6 errors) and passes on this branch, in two interleaved rounds on Linux; a reviewer saw the same on Windows 11.Hardware: Linux x86-64 PC (Ubuntu 24.04), no GPU used; Python 3.15
Scene: no game: the game-free check
Method:
python3 -I -B tests/test_cpm_discovery.pyonmainand on this branch, twice each, alternating (nx2/build.pyis the same in both); its unittest result per runHow to reproduce:
python -I -B tests/test_cpm_discovery.pyon each commitaa95d35f8bc176f7tests/test_cpm_discovery.py, round 1tests/test_cpm_discovery.py, round 2The skip is
test_system_usr_without_cpm(no system Vulkan or SPIR-V headers on this PC), skipped on both.Flags and settings
None
Testing
Tested: Linux, game-free: the check fails on
mainaa95d35fand passes on this branch (8bc176f7, rebased ontoaa95d35f), twice each, alternating; it passes at the tip undertests/run_all.pywith g++ 13.3 and with clang 23.1.5 asCXX(the check runs no compiler). Before the rebase (7d9e4d69on main7ff5256e) it did the same, and the other checks that importnx2/build.pywith a stand-intoolchainor read the native-CPU code passed:test_cpu_target,test_appimage_player_build,test_linux_tools,test_kept_translation,test_missing_nup,test_mark_groups,test_msvc_oldnames,test_build_log,test_link_path_comma. Windows: futondestroyer reviewed the diff at7d9e4d69and ran the check natively on Windows 11 with Python 3.14.7 (python -I -B tests/test_cpm_discovery.py -v): on main5d3ecc78six import errors (toolchain.findmissing) and one system-header skip; at7d9e4d69six passed, the same skip; and this PR's fixture against that newer main's build module, six passed, the same skip (#561, the approving review).Not tested: nothing the check depends on; the game is not involved.
Must be tested: None
Risks
What could break: only this check.
Turning it off: revert the commit
Compatibility: Nothing changes
Checklist
Everyone
type(scope): description) of the status line's type.main. Onto mainaa95d35f, no conflict; the commit is the same change as7d9e4d69(git patch-id).python -I -B tests/run_all.pypasses (any failure that also fails onmainis named). The full suite on mainaa95d35f(Linux, g++ 13.3, the Vulkan headers set): 528 passed, 15 failed, 50 skipped,tests/test_cpm_discovery.pyamong the 15; this PR changes only that check, which passes here. The other 14 fail on main alike:test_appimage_player_build,test_bake_portability,test_crash_dialog,test_env_on,test_lift_cache,test_lift_cleanup_error,test_make_game_cache,test_mods_size_table,test_options_budget_once,test_pipeline_tour,test_readback_late,test_vk_pgo,test_walk_keyandnx2/test_texture_init_barrier.py.third_party/untouched (a new folder with aPROVENANCE.mdinstead).When it applies
Assisted-by:/Co-Authored-By:trailers.test_cpm_discovery'stoolchainstand-infindandneedzeldaootr referenced this pull request2026-11-14 19:30:57 +00:00
zeldaootr referenced this pull request2026-11-14 19:30:59 +00:00
zeldaootr referenced this pull request2026-11-14 19:31:01 +00:00
zeldaootr referenced this pull request2026-11-14 19:31:04 +00:00
zeldaootr referenced this pull request2026-11-14 19:31:06 +00:00
zeldaootr referenced this pull request2026-11-14 19:31:10 +00:00
zeldaootr referenced this pull request2026-11-14 19:31:13 +00:00
zeldaootr referenced this pull request2026-11-14 19:31:16 +00:00
zeldaootr referenced this pull request2026-11-14 19:31:19 +00:00
zeldaootr referenced this pull request2026-11-14 20:33:38 +00:00
Reviewed the complete one-file diff at
7d9e4d69fdand checked the stand-in against the real toolchain.find/need contract. The nonexistent compiler path correctly skips the import-time CPU query; the existing subprocess guards and package-discovery assertions remain intact. No production changes or blocking findings.Independent native Windows 11 / Python 3.14.7 verification, using
python -I -B tests/test_cpm_discovery.py -v:5d3ecc7854: six import errors (toolchain.findmissing), one existing system-header skip.This independently covers the Windows gap in the description. I did not repeat the full suite or run the game for this fixture-only change; the author's full-suite results and limitations remain as documented.
zeldaootr referenced this pull request2026-11-15 00:55:49 +00:00
zeldaootr referenced this pull request2026-11-15 00:56:00 +00:00
Rebased onto
mainaa95d35f(8bc176f7, the same change as7d9e4d69, no conflict) and the description moved to the current template, with futondestroyer's Windows 11 run from the review in Testing (thank you). The check still fails onmainaa95d35f(6 errors) and passes here, two interleaved rounds, so the numbers are measured again on the new base rather than carried over.7d9e4d69fd8bc176f7de