Fix install.ps1 aborting on conda/pip warnings in Windows PowerShell 5.1

install.ps1 runs with $ErrorActionPreference = 'Stop' and captures conda
and pip output with 2>&1. Windows PowerShell 5.1 turns every stderr line
of a native command into an error record, so the first warning (a conda
FutureWarning, pip's "[notice] A new release of pip is available") ends
the script even though the command succeeded.

Use 'Continue' inside Invoke-Conda and Invoke-Pip so only the exit code
decides. Real failures still throw and stop the script.

Fixes #2757
This commit is contained in:
b84330808 2026-11-13 13:37:49 +09:00
parent 6d51ffceaf
commit 57cbf941c8

View File

@ -52,6 +52,9 @@ function Invoke-Conda {
[string[]]$Args
)
# Windows PowerShell 5.1 turns stderr lines into errors, so under 'Stop' a mere warning
# would end the script. The exit code below decides success.
$ErrorActionPreference = 'Continue'
$output = & conda install -y -q -c conda-forge @Args 2>&1
$exitCode = $LASTEXITCODE
@ -79,6 +82,9 @@ function Invoke-Pip {
[string[]]$Args
)
# Windows PowerShell 5.1 turns stderr lines into errors, so under 'Stop' a mere warning
# would end the script. The exit code below decides success.
$ErrorActionPreference = 'Continue'
$output = & pip install @Args 2>&1
$exitCode = $LASTEXITCODE