]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-112301: Add argument aliases and tee compiler output for check warnings (GH-122465)
authorNate Ohlson <nohlson@purdue.edu>
Tue, 30 Jul 2024 19:49:15 +0000 (14:49 -0500)
committerGitHub <noreply@github.com>
Tue, 30 Jul 2024 19:49:15 +0000 (14:49 -0500)
Also remove superfluous shebang from the warning check script

.github/workflows/reusable-ubuntu.yml
Tools/build/check_warnings.py

index c6289a74e9a5f6c84a2257517782f5f251333d7c..8dd5f559585368170d64e3f103e626e67de3c819 100644 (file)
@@ -75,7 +75,7 @@ jobs:
         ${{ fromJSON(inputs.free-threading) && '--disable-gil' || '' }}
     - name: Build CPython out-of-tree
       working-directory: ${{ env.CPYTHON_BUILDDIR }}
-      run: make -j4 &> compiler_output.txt
+      run: set -o pipefail; make -j4 2>&1 | tee compiler_output.txt
     - name: Display build info
       working-directory: ${{ env.CPYTHON_BUILDDIR }}
       run: make pythoninfo
index f0c0067f4ab2553a4e89480bb3a76a5e48029a54..af9f7f169ad943e8d24d64eb474c46be908ce9b3 100644 (file)
@@ -1,4 +1,3 @@
-#!/usr/bin/env python3
 """
 Parses compiler output with -fdiagnostics-format=json and checks that warnings
 exist only in files that are expected to have warnings.
@@ -114,24 +113,28 @@ def get_unexpected_improvements(
 def main(argv: list[str] | None = None) -> int:
     parser = argparse.ArgumentParser()
     parser.add_argument(
+        "-c",
         "--compiler-output-file-path",
         type=str,
         required=True,
         help="Path to the compiler output file",
     )
     parser.add_argument(
+        "-i",
         "--warning-ignore-file-path",
         type=str,
         required=True,
         help="Path to the warning ignore file",
     )
     parser.add_argument(
+        "-x",
         "--fail-on-regression",
         action="store_true",
         default=False,
         help="Flag to fail if new warnings are found",
     )
     parser.add_argument(
+        "-X",
         "--fail-on-improvement",
         action="store_true",
         default=False,