diff --git a/.github/workflows/linux.yaml b/.github/workflows/linux.yaml index f90ea0bd3115a..58871fcf495bb 100644 --- a/.github/workflows/linux.yaml +++ b/.github/workflows/linux.yaml @@ -3,12 +3,14 @@ on: push: branches: - master + - me/* - releases/gcc-* tags: - releases/gcc-* pull_request: branches: - master + - me/* - releases/gcc-* tags: - releases/gcc-* @@ -21,6 +23,7 @@ jobs: build: name: ${{ matrix.name }}-build runs-on: ubuntu-latest + timeout-minutes: 720 strategy: matrix: include: @@ -36,78 +39,151 @@ jobs: - name: Install dependencies run: | sudo apt-get -qq update - sudo apt install -y gcc-multilib build-essential flex zlib1g-dev gnat gdc + sudo apt install -y gcc-multilib build-essential flex zlib1g-dev gnat gdc expect dejagnu libc-dev libc-devtools texlive findutils binutils autogen gettext autopoint libasprintf-dev libgettextpo-dev mailutils mailutils-mh procmail emacs exim4-base msmtp bsd-mailx - name: Install dependencies for aarch64 if: success() && contains(matrix.target, 'aarch64') run: | sudo apt-get -y install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu binutils-aarch64-linux-gnu + - name: Stamp + if: success() + env: + revision: ${{ github.head_ref }} + run: | + if test -z "${revision}"; then revision=0; fi + { + date + echo "$(TZ=UTC date) (revision ${revision})" + } > LAST_UPDATED + + - name: Cache + id: cache-deps + uses: actions/cache@v3 + env: + cache-name: cache-downloaded-prerequisites + with: + path: ../build + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('LAST_UPDATED') }} + restore-keys: | + ${{ runner.os }}-build-${{ env.cache-name }}- + ${{ runner.os }}-build- + ${{ runner.os }}- + - name: Download prerequisites if: success() run: | - ./contrib/download_prerequisites + ./contrib/download_prerequisites + ls - name: Configure x86_64 if: success() && matrix.target == 'x86_64' run: | - unset ADA_INCLUDE_PATH - unset ADA_OBJECT_PATH + if test -n "${ADA_INCLUDE_PATH}"; then unset ADA_INCLUDE_PATH; fi + if test -n "${ADA_OBJECT_PATH}"; then unset ADA_OBJECT_PATH; fi cd ../ - mkdir build + if test ! -d build; then mkdir build; fi cd build ../gcc/configure \ - --enable-languages=c,c++,go,d,fortran,objc,obj-c++,m2 \ + --enable-languages=c,c++,lto,objc,obj-c++ \ --prefix=/usr \ --with-gcc-major-version-only \ --program-prefix=x86_64-linux-gnu- \ - --enable-shared \ - --enable-linker-build-id \ --libexecdir=/usr/lib \ --without-included-gettext \ --enable-threads=posix \ --libdir=/usr/lib \ - --enable-nls \ - --enable-clocale=gnu \ - --enable-libstdcxx-debug \ - --enable-libstdcxx-time=yes \ - --with-default-libstdcxx-abi=new \ - --enable-gnu-unique-object \ --disable-vtable-verify \ - --enable-plugin \ - --enable-default-pie \ --with-system-zlib \ --with-target-system-zlib=auto \ - --enable-objc-gc=auto \ - --enable-multiarch \ + --disable-bootstrap \ --disable-werror \ - --with-arch-32=i686 \ - --with-abi=m64 \ - --with-multilib-list=m32,m64,mx32 \ - --enable-multilib \ --with-tune=generic \ --without-cuda-driver \ --enable-checking=release \ + --enable-silent-rules \ --build=x86_64-linux-gnu \ --host=x86_64-linux-gnu \ --target=x86_64-linux-gnu - - name: Make bootstrap + - name: Make if: success() run: | cd ../build - make bootstrap -j$(nproc) + if test -x "$(which nproc)"; then echo "nproc says that we can use $(nproc) build jobs"; else echo "error: missing nproc!" >&2 && exit 1; fi + time (make -j"$(nproc)" | tee build.log) + if test -e build.log; then stat build.log && wc -l build.log; fi + + - name: Debug failure + if: failure() + run: | + if test -r build.log; then grep -i "error:" build.log; \ + elif test -r ../build/build.log; then grep -i "error:" ../build/build.log; \ + elif test -e ../build/Makefile; then \ + sudo apt install remake; \ + cd ../build; \ + remake -dpPw --trace=full; \ + elif test -d ../build; then \ + cd ../build && ls; \ + else \ + pwd && ls; \ + fi - - name: Make install + - name: Make docs (post-build) + if: success() + run: | + cd ../build + echo "make info" && (time make info) && find . -name "*.info" -print + echo "make dvi" && (time make dvi) && find . -name "*.dvi" -print + echo "make pdf" && (time make pdf) && find . -name "*.pdf" -print + echo "make html" && (time make html) && find . -name "*.html" -print + + - name: Make install (plus docs) if: success() run: | cd ../build sudo make install + sudo make install-info + sudo make install-dvi + sudo make install-pdf + sudo make install-html + sudo make dir.info - name: Tests if: success() run: | - /usr/bin/x86_64-linux-gnu-gcc --version - /usr/bin/x86_64-linux-gnu-gcc -v + if test -x /usr/bin/x86_64-linux-gnu-gcc; then /usr/bin/x86_64-linux-gnu-gcc --version; elif test -x ../build/gcc/xgcc; then ../build/gcc/xgcc --version; fi + if test -x /usr/bin/x86_64-linux-gnu-gcc; then /usr/bin/x86_64-linux-gnu-gcc -v; elif test -x ../build/gcc/xgcc; then ../build/gcc/xgcc --v; fi cd ../build - make -k check + if test -e build.log; then make warning.log; fi + time (make -k -j"$(nproc)" check RUNTESTFLAGS="compile.exp dg-torture.exp execute.exp old-deja.exp" | tee testsuite_output.log) + if test -e warning.log; then make mail-report-with-warnings.log; else make mail-report.log; fi + if test -x "$(which Mail)"; then \ + if test -x mail-report-with-warnings.log; then \ + echo "attempting to send mail-report-with-warnings.log"; \ + ./mail-report-with-warnings.log; \ + stat mail-report-with-warnings.log; \ + elif test -x mail-report.log; then \ + echo "attempting to send mail-report.log"; \ + ./mail-report.log; \ + stat mail-report.log; \ + elif test -e testsuite_output.log; then \ + echo "TODO: figure out a way to send testsuite_output.log"; \ + else \ + echo "Nothing to send."; \ + fi; \ + else \ + echo "Warning: \"Mail\" program is missing, so skipping emailing of testresults!"; \ + fi + + - name: Upload a Build Artifact + uses: actions/upload-artifact@v3.1.3 + with: + # Artifact name + name: logfiles + # A file, directory or wildcard pattern that describes what to upload + path: | + *.log + build/*.log + path/*.log + testsuite/*.log