upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/scripts/build_runtime.ps1
diff options
context:
space:
mode:
authorlines9686-rgb <282495677+lines9686-rgb@users.noreply.github.com>2026-11-23 18:51:13 +0300
committerlines9686-rgb <282495677+lines9686-rgb@users.noreply.github.com>2026-11-24 07:09:02 +0300
commit5dbd92b92d147cdc5c365fffd8a3f83c6d6ac5f9 (patch)
tree1d3a240c61df04b351c20292bb65be2fb93b6531 /scripts/build_runtime.ps1
parentece4ba5b31ebc6f345c8e29eae1261f2f780057a (diff)
build scripts: refuse a folder with % in its path up front
cmd.exe expands %...% on every line of the generated _build.cmd (twice on a CALL line), and cl.exe rejects a % in the path-valued /D definitions of the runtime's test targets (D8038) however it is quoted, so a checkout with % in its path failed in configure, or a few hundred Ninja steps in once the batch was escaped (@ezbyDev's measurements in the original repository). build_runtime.ps1 now stops before looking for Visual Studio when the checkout path has a %, and build_llvm_mc.ps1 when -Temp has one, each naming the folder; docs/testing.md gets a Known-problems row. tests/test_build_percent_path.py runs both scripts with such a path, with git, python and vswhere hidden so that a missing check can't start a real build. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'scripts/build_runtime.ps1')
-rw-r--r--scripts/build_runtime.ps15
1 files changed, 5 insertions, 0 deletions
diff --git a/scripts/build_runtime.ps1 b/scripts/build_runtime.ps1
index 8bd74d1cf..63acb7ce3 100644
--- a/scripts/build_runtime.ps1
+++ b/scripts/build_runtime.ps1
@@ -35,6 +35,11 @@ function Find-BuildTool([string]$Preferred, [string]$CommandName, [scriptblock]$
35} 35}
36 36
37$root = Split-Path $PSScriptRoot -Parent 37$root = Split-Path $PSScriptRoot -Parent
38# A % in the checkout path cannot build: cmd.exe expands %...% in _build.cmd, and cl.exe rejects a % in the
39# path-valued /D definitions of the test targets (D8038) however it is quoted. Say so before anything starts.
40if ($root.Contains('%')) {
41 throw "The checkout path '$root' contains '%', and the runtime can't be built from there (cmd.exe and cl.exe treat % specially). Move or clone the checkout to a folder without % in its path (docs/testing.md, Known problems)."
42}
38$installer = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer" 43$installer = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer"
39$vs = & "$installer\vswhere.exe" -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath 44$vs = & "$installer\vswhere.exe" -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath
40if (-not $vs) { throw "Visual Studio with the C++ x64 tools wasn't found." } 45if (-not $vs) { throw "Visual Studio with the C++ x64 tools wasn't found." }