From 5c742d4f2ba3478564df51cc353fffc5604629d7 Mon Sep 17 00:00:00 2001 From: "John W. Parent" <45471568+johnwparent@users.noreply.github.com> Date: Fri, 21 Apr 2023 09:58:37 -0400 Subject: 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. --- share/spack/qa/windows_test_setup.ps1 | 2 +- share/spack/setup-env.ps1 | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/share/spack/qa/windows_test_setup.ps1 b/share/spack/qa/windows_test_setup.ps1 index 2e25d95960..3a06417543 100644 --- a/share/spack/qa/windows_test_setup.ps1 +++ b/share/spack/qa/windows_test_setup.ps1 @@ -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 \ No newline at end of file diff --git a/share/spack/setup-env.ps1 b/share/spack/setup-env.ps1 index a077cef258..edf9613ec5 100644 --- a/share/spack/setup-env.ps1 +++ b/share/spack/setup-env.ps1 @@ -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" -- cgit v1.2.3-70-g09d2