]> granicus.if.org Git - graphviz/commitdiff
CI: redirect stderr→stdout on Windows during build
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Thu, 10 Feb 2022 11:37:45 +0000 (22:37 +1100)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Mon, 14 Feb 2022 12:01:31 +0000 (23:01 +1100)
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

ci/build_windows.py

index 49dae7ef3f12e31233ffdf1dadad130160ec68a9..b4a2428111443e20c8a315e56f67156894a9201d 100644 (file)
@@ -12,7 +12,7 @@ from typing import List
 
 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