From e38423a8b3faaf0db3907177f2f8bf63ab6e6ae2 Mon Sep 17 00:00:00 2001 From: Mat Sutcliffe Date: Sun, 14 Jun 2020 18:51:30 +0100 Subject: [PATCH] [CI] Capture build stderr in a log file for later processing --- .github/workflows/build.yml | 16 ++++++++++++++-- scripts/build.py | 19 ++++++++++--------- 2 files changed, 24 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 11ea51f5d..7131465d9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -43,6 +43,7 @@ jobs: - name: Install dependencies run: | sudo apt install doxygen graphviz libglu1-mesa-dev libopus-dev libsodium-dev libpulse-dev libdbus-1-dev libevent-dev + pip3 install tee - name: Checkout repository uses: actions/checkout@v2 with: @@ -52,6 +53,7 @@ jobs: if: ${{ ! env.do_symbols }} run: | python3 -u scripts/build.py -w 64 -t gcc -d -j2 -e $eol_months $BASH_KEY_ARGS + ls -l error.log env: VATSIM_ID: ${{ secrets.VATSIM_ID }} VATSIM_KEY: ${{ secrets.VATSIM_KEY }} @@ -59,6 +61,7 @@ jobs: if: ${{ env.do_symbols }} run: | python3 -u scripts/build.py -w 64 -t gcc -d -j2 -e $eol_months $BASH_KEY_ARGS --upload + ls -l error.log env: VATSIM_ID: ${{ secrets.VATSIM_ID }} VATSIM_KEY: ${{ secrets.VATSIM_KEY }} @@ -100,9 +103,10 @@ jobs: run: | curl.exe --output "$HOME\installbuilder.exe" -L --url https://installbuilder.com/installbuilder-qt-professional-20.4.0-windows-x64-installer.exe &"$HOME\installbuilder.exe" --mode unattended --prefix "$HOME\installbuilder" - - name: Install jom + - name: Install dependencies run: | choco install jom --yes + pip install tee - name: Checkout repository uses: actions/checkout@v2 with: @@ -112,6 +116,7 @@ jobs: if: ${{ ! env.do_symbols }} run: | python.exe -u scripts\build.py -w 64 -t msvc -d -e $env:eol_months ${{ env.PWSH_KEY_ARGS }} + dir error.log env: VATSIM_ID: ${{ secrets.VATSIM_ID }} VATSIM_KEY: ${{ secrets.VATSIM_KEY }} @@ -119,6 +124,7 @@ jobs: if: ${{ env.do_symbols }} run: | python.exe -u scripts\build.py -w 64 -t msvc -d -e $env:eol_months ${{ env.PWSH_KEY_ARGS }} --upload + dir error.log env: VATSIM_ID: ${{ secrets.VATSIM_ID }} VATSIM_KEY: ${{ secrets.VATSIM_KEY }} @@ -161,9 +167,10 @@ jobs: run: | curl.exe --output "$HOME\installbuilder.exe" -L --url https://installbuilder.com/installbuilder-qt-professional-20.4.0-windows-installer.exe &"$HOME\installbuilder.exe" --mode unattended --prefix "$HOME\installbuilder" - - name: Install jom + - name: Install dependencies run: | choco install jom --yes + pip install tee - name: Checkout repository uses: actions/checkout@v2 with: @@ -173,6 +180,7 @@ jobs: if: ${{ ! env.do_symbols }} run: | python.exe -u scripts\build.py -w 32 -t msvc -d -e $env:eol_months ${{ env.PWSH_KEY_ARGS }} + dir error.log env: VATSIM_ID: ${{ secrets.VATSIM_ID }} VATSIM_KEY: ${{ secrets.VATSIM_KEY }} @@ -180,6 +188,7 @@ jobs: if: ${{ env.do_symbols }} run: | python.exe -u scripts\build.py -w 32 -t msvc -d -e $env:eol_months ${{ env.PWSH_KEY_ARGS }} --upload + dir error.log env: VATSIM_ID: ${{ secrets.VATSIM_ID }} VATSIM_KEY: ${{ secrets.VATSIM_KEY }} @@ -230,6 +239,7 @@ jobs: - name: Install dependencies run: | pip3 install requests + pip3 install tee - name: Checkout repository uses: actions/checkout@v2 with: @@ -239,6 +249,7 @@ jobs: if: ${{ ! env.do_symbols }} run: | python3 -u scripts/build.py -w 64 -t clang -d -j2 -e $eol_months $BASH_KEY_ARGS + ls -l error.log env: VATSIM_ID: ${{ secrets.VATSIM_ID }} VATSIM_KEY: ${{ secrets.VATSIM_KEY }} @@ -246,6 +257,7 @@ jobs: if: ${{ env.do_symbols }} run: | python3 -u scripts/build.py -w 64 -t clang -d -j2 -e $eol_months $BASH_KEY_ARGS --upload + ls -l error.log env: VATSIM_ID: ${{ secrets.VATSIM_ID }} VATSIM_KEY: ${{ secrets.VATSIM_KEY }} diff --git a/scripts/build.py b/scripts/build.py index 63268023b..8e3e05b3f 100644 --- a/scripts/build.py +++ b/scripts/build.py @@ -21,6 +21,7 @@ import sys import datastore import tarfile from lib.util import get_vs_env +from tee import StderrTee if sys.version_info < (3, 0): import ConfigParser as configparser @@ -477,15 +478,15 @@ def main(argv): print('Unknown or unsupported tool chain!') sys.exit(2) - builder = builders[platform.system()][tool_chain](config_file, word_size) - - builder.prepare() - builder.build(jobs, qmake_args, dev_build, eolInMonth) - builder.checks() - builder.install() - builder.publish() - builder.package_xswiftbus() - builder.symbols(upload_symbols) + with StderrTee('error.log', buff=-1): + builder = builders[platform.system()][tool_chain](config_file, word_size) + builder.prepare() + builder.build(jobs, qmake_args, dev_build, eolInMonth) + builder.checks() + builder.install() + builder.publish() + builder.package_xswiftbus() + builder.symbols(upload_symbols) # run main if run directly