In CI, the Windows environments run ci/build_windows.py to orchestrate
compilation. This is run under PowerShell, which has the surprising behavior of
(1) hiding stderr and (2) considering any output to stderr a signal to abort the
running program. The combined effect of this is that benign CMake logging
statements like:
message(WARNING "hello world")
abruptly terminate compilation with the baffling output:
python : CMake Warning at cmake/FindGD.cmake:52 (message):
At line:1 char:1
+ python ci/build_windows.py --build-system $env:build_system --platfor ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (CMake Warning a...e:52
(message)::String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError
This behavior appears to be configurable, but it seems simpler to work around
this by avoiding any stderr output. The exit status of any build commands is
sufficient to signal failure.
Gitlab: #2097
def run(args: List[str], cwd: Path): #pylint: disable=C0116
print(f"+ {' '.join(str(x) for x in args)}")
- subprocess.check_call(args, cwd=cwd)
+ subprocess.check_call(args, stderr=subprocess.STDOUT, cwd=cwd)
def main(args: List[str]) -> int: #pylint: disable=C0116