Hraden Spack's powershell interface (#37079)

Paths with spaces are an issue on Windows and our current powershell
scripts are not sufficiently hardended against their use.
This PR removes promlematic commandlets that do not work well with paths
with spaces and adds escape quotes in other areas where this could be an
issue.
This commit is contained in:
John W. Parent
2023-04-21 09:58:37 -04:00
committed by GitHub
parent c64ca97877
commit 5c742d4f2b
2 changed files with 2 additions and 3 deletions

View File

@@ -1,5 +1,5 @@
$ErrorActionPreference = "SilentlyContinue"
Write-Output F|xcopy .\share\spack\qa\configuration\windows_config.yaml $env:USERPROFILE\.spack\windows\config.yaml
Write-Output F|xcopy .\share\spack\qa\configuration\windows_config.yaml "$env:USERPROFILE\.spack\windows\config.yaml"
# The line below prevents the _spack_root symlink from causing issues with cyclic symlinks on Windows
(Get-Item '.\lib\spack\docs\_spack_root').Delete()
./share/spack/setup-env.ps1

View File

@@ -37,8 +37,7 @@ if (!$null -eq $py_path)
if (!$null -eq $py_exe)
{
Invoke-Expression "$py_exe $Env:SPACK_ROOT\bin\haspywin.py"
Invoke-Expression "$py_exe $Env:SPACK_ROOT\bin\spack external find python" | Out-Null
& "$py_exe" "$Env:SPACK_ROOT\bin\haspywin.py"
}
$Env:Path = "$Env:SPACK_ROOT\bin;$Env:Path"