From 906b1a0bc4b8cb04e9eb879c26a4a5e3a7297fc9 Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 12 Sep 2022 12:29:57 -0400 Subject: ci: allow powershell variables assigned in env scripts to persist Load env scripts with `.` sourcing instead of `Invoke-Expression`. This allows powershell variables to persist, much like bash. Leave helper script loading unchanged, as those scripts may set powershell variables that we do not want to persist. --- .gitlab/ci/env.ps1 | 2 +- .gitlab/ci/env_windows_vs2022_x64_ninja.ps1 | 2 +- .gitlab/ci/env_windows_vs2022_x64_ninja_multi.ps1 | 2 +- .gitlab/os-windows.yml | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.gitlab/ci/env.ps1 b/.gitlab/ci/env.ps1 index e24bc37..aa7753f 100755 --- a/.gitlab/ci/env.ps1 +++ b/.gitlab/ci/env.ps1 @@ -1,3 +1,3 @@ if (Test-Path -Path ".gitlab/ci/env_$env:CMAKE_CONFIGURATION.ps1" -PathType Leaf) { - Invoke-Expression ".gitlab/ci/env_$env:CMAKE_CONFIGURATION.ps1" + . ".gitlab/ci/env_$env:CMAKE_CONFIGURATION.ps1" } diff --git a/.gitlab/ci/env_windows_vs2022_x64_ninja.ps1 b/.gitlab/ci/env_windows_vs2022_x64_ninja.ps1 index f8a86c4..a96658d 100755 --- a/.gitlab/ci/env_windows_vs2022_x64_ninja.ps1 +++ b/.gitlab/ci/env_windows_vs2022_x64_ninja.ps1 @@ -1,3 +1,3 @@ if ("$env:CMAKE_CI_NIGHTLY" -eq "true") { - Invoke-Expression ".gitlab/ci/ispc-env.ps1" + . ".gitlab/ci/ispc-env.ps1" } diff --git a/.gitlab/ci/env_windows_vs2022_x64_ninja_multi.ps1 b/.gitlab/ci/env_windows_vs2022_x64_ninja_multi.ps1 index e8d242c..f245319 100755 --- a/.gitlab/ci/env_windows_vs2022_x64_ninja_multi.ps1 +++ b/.gitlab/ci/env_windows_vs2022_x64_ninja_multi.ps1 @@ -1,5 +1,5 @@ if ("$env:CMAKE_CI_NIGHTLY" -eq "true") { - Invoke-Expression -Command ".gitlab/ci/ispc-env.ps1" + . ".gitlab/ci/ispc-env.ps1" } $pwdpath = $pwd.Path diff --git a/.gitlab/os-windows.yml b/.gitlab/os-windows.yml index 282cf1e..92538a1 100644 --- a/.gitlab/os-windows.yml +++ b/.gitlab/os-windows.yml @@ -293,7 +293,7 @@ ## Windows-specific scripts .before_script_windows: &before_script_windows - - Invoke-Expression -Command .gitlab/ci/env.ps1 + - . .gitlab/ci/env.ps1 - $pwdpath = $pwd.Path - powershell -File ".gitlab/ci/wix.ps1" - Set-Item -Force -Path "env:WIX" -Value "$pwdpath\.gitlab\wix" @@ -352,7 +352,7 @@ stage: test-ext script: - - Invoke-Expression -Command .gitlab/ci/env.ps1 + - . .gitlab/ci/env.ps1 - build/install/bin/ctest --output-on-failure -V -S .gitlab/ci/ctest_standalone.cmake interruptible: true -- cgit v0.12