mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 23:30:53 +01:00
[PR #1871] scripts/build_llvm_mc.ps1: validate Version, normalize -Temp, harden VS/tool fallback and literal install #1883
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#1883
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/1871
Author: @kirigayakazima
Created: 11/25/2026
Status: 🔄 Open
Base:
main← Head:fix/build-llvm-mc-safety📝 Commits (1)
74e9e80Harden build_llvm_mc.ps1 Version/Temp resolution, VS/tool fallback, and literal copy📊 Changes
2 files changed (+191 additions, -7 deletions)
View changed files
📝
scripts/build_llvm_mc.ps1(+19 -7)➕
tests/test_build_llvm_mc_prereqs.py(+172 -0)📄 Description
Claimed in the coordination issue as: BUILD-LLVM-MC-REL-TEMP-VS-AND-TOOL-FALLBACK-SAFETY (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7164207060)
What and why
-Versionup front inscripts/build_llvm_mc.ps1so empty strings, whitespace, control characters, or%fail before cloning or running prerequisites.$Temp = $fullTempafter resolving via PowerShell provider paths so_build.cmd,$src,$out, and[System.IO.File]::WriteAllTextnever drift to[Environment]::CurrentDirectorywhen a relative-Tempis passed.vswhere.exeand missingvcvars64.batwith explicit actionable errors (Test-Path -LiteralPath ... -PathType Leaf) instead ofCommandNotFoundExceptionor opaquecallfailures.PATHcmake/ninjaindependently so one tool from Visual Studio can pair cleanly with the other onPATH.[System.Text.UTF8Encoding]::new($false)explicitly when writingprobe.txt, and switchCopy-Itemto-LiteralPath ... -Destination $finalso bracketed paths work reliably. Preserve CRLF line endings (PS1_CRLF=177, PS1_LF_ONLY=0).tests/test_build_llvm_mc_prereqs.pywithout disturbing any anchors sliced by the existing 5build_llvm_mctests.Tested
python -I tests/test_build_llvm_mc_prereqs.py -v->Ran 5 tests in 3.172s(OK)python -I tests/test_build_llvm_mc_batch.py -v->Ran 1 test in 0.933s(OK)python -I tests/test_build_llvm_mc_cleanup.py -v->Ran 1 test in 0.310s(OK)python -I tests/test_llvm_install_destination.py -v->Ran 1 test in 1.470s(OK)python -I tests/test_llvm_install_path.py -v->Ran 3 tests in 1.578s(OK)python -I tests/test_llvm_source_version.py -v->Ran 6 tests in 5.677s(OK)upstream/main5e95fa2fwithtests/test_build_llvm_mc_prereqs.pycopied into detached worktree):Ran 5 tests in 3.120s(FAILED (failures=8, errors=1)).PS1_CRLF=177 PS1_LF_ONLY=0,python -I tests/test_ci_registration.py(Ran 16 tests in 5.989s,OK),python -I tests/test_text_write_line_endings.py(Ran 3 tests in 14.043s,OK),python -I scripts/check_no_game_data.py(exit 0),python -I -m compileall -q(exit 0),git diff --check(exit 0).GPUs tested: n/a (PowerShell prerequisite validation, relative-path normalization, tool fallback, and literal install tests)
AI-assisted: yes
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.