diff --git a/.github/workflows/ci-appimage.yml b/.github/workflows/ci-appimage.yml index f7e3ac4e9..15faebc0c 100644 --- a/.github/workflows/ci-appimage.yml +++ b/.github/workflows/ci-appimage.yml @@ -29,6 +29,9 @@ jobs: - name: Install FSF toolchain run: sudo apt-get install -y gnat-10 gprbuild + - name: Check toolchain architecture + uses: mosteo-actions/gnat-toolchain-arch-checker@v1 + - name: Set up gcc on the PATH to be gcc-10 run: | mkdir -p $HOME/.local/bin @@ -98,6 +101,12 @@ jobs: - name: Rename AppImage run: mv alr*AppImage alr.AppImage + - name: Test AppImage without the toolchain installed + run: | + chmod +x ./alr.AppImage + sudo apt-get remove -y gnat-10 gprbuild + which gnat || { echo "Toolchain purged"; ./alr.AppImage version; } + - name: Upload AppImage asset if: (github.event_name == 'release') uses: actions/upload-release-asset@v1 diff --git a/.github/workflows/ci-linux.yml b/.github/workflows/ci-linux.yml index e14e64d9a..61cfe5204 100644 --- a/.github/workflows/ci-linux.yml +++ b/.github/workflows/ci-linux.yml @@ -34,6 +34,10 @@ jobs: uses: alire-project/alr-install@v1 with: crates: gnat_native gprbuild + prefix: alire_prefix + + - name: Check toolchain architecture + uses: mosteo-actions/gnat-toolchain-arch-checker@v1 - name: Install Python 3.x (required for the testsuite) uses: actions/setup-python@v2 @@ -47,6 +51,13 @@ jobs: BRANCH: ${{ github.base_ref }} INDEX: "" + # Ascertain whether alr can run without the toolchain that built it + - name: Check standalone alr + uses: mosteo-actions/alr-standalone-checker@v1 + with: + alr_path: bin + toolchain_path: alire_prefix + - name: Upload binaries uses: actions/upload-artifact@v4 with: diff --git a/.github/workflows/ci-macos.yml b/.github/workflows/ci-macos.yml index e87ea3571..e23940644 100644 --- a/.github/workflows/ci-macos.yml +++ b/.github/workflows/ci-macos.yml @@ -37,6 +37,7 @@ jobs: uses: alire-project/alr-install@v1 with: crates: gnat_native gprbuild + prefix: alire_prefix - name: Install FSF toolchain (AArch64) if: ${{ matrix.os == 'macos-14' }} @@ -49,6 +50,9 @@ jobs: echo $PWD/alire_prefix/bin >> $GITHUB_PATH echo "ARCH=aarch64" >> $GITHUB_ENV + - name: Check toolchain architecture + uses: mosteo-actions/gnat-toolchain-arch-checker@v1 + - name: Install Python 3.x (required for the testsuite) uses: actions/setup-python@v2 with: @@ -61,6 +65,13 @@ jobs: BRANCH: ${{ github.base_ref }} INDEX: "" + # Ascertain whether alr can run without the toolchain that built it + - name: Check standalone alr + uses: mosteo-actions/alr-standalone-checker@v1 + with: + alr_path: bin + toolchain_path: alire_prefix + - name: Upload binaries uses: actions/upload-artifact@v4 with: diff --git a/.github/workflows/ci-windows.yml b/.github/workflows/ci-windows.yml index 1193bbbad..0a4f94e19 100644 --- a/.github/workflows/ci-windows.yml +++ b/.github/workflows/ci-windows.yml @@ -35,6 +35,10 @@ jobs: uses: alire-project/alr-install@v1 with: crates: gnat_native gprbuild + prefix: alire_prefix + + - name: Check toolchain architecture + uses: mosteo-actions/gnat-toolchain-arch-checker@v1 - name: Build alr run: gprbuild -j0 -p -P alr_env @@ -66,6 +70,13 @@ jobs: - name: Install alr run: gprinstall -p -P alr_env --prefix=${{ runner.temp }}/alr_install + # Ascertain whether alr can run without the toolchain that built it + - name: Check standalone alr + uses: mosteo-actions/alr-standalone-checker@v1 + with: + alr_path: bin + toolchain_path: alire_prefix + - name: Install qt-installer-framework in msys2 run: ${{env.PACMAN}} -S mingw64/mingw-w64-x86_64-qt-installer-framework diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index d44685008..a0ee3a930 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -21,14 +21,14 @@ jobs: fail-fast: false # Attempt to generate as many of them as possible matrix: os: - - macos-14 - macos-12 + - macos-14 - ubuntu-20.04 - windows-latest steps: - name: Check out repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: submodules: true @@ -36,19 +36,13 @@ jobs: uses: alire-project/alr-install@v1 with: crates: gnat_native gprbuild + prefix: alire_prefix - - name: Replace toolchain with aarch64 - if: ${{ runner.arch == 'ARM64' }} - run: | - curl -L https://github.com/alire-project/GNAT-FSF-builds/releases/download/gnat-14.1.0-3/gnat-aarch64-darwin-14.1.0-3.tar.gz \ - | tar xzf - --strip-components=1 -C /Users/runner/work/alire/alire/alire_prefix - curl -L https://github.com/alire-project/GNAT-FSF-builds/releases/download/gprbuild-24.0.0-1/gprbuild-aarch64-darwin-24.0.0-1.tar.gz \ - | tar xzf - --strip-components=1 -C /Users/runner/work/alire/alire/alire_prefix - which gcc - gcc -v + - name: Check toolchain architecture + uses: mosteo-actions/gnat-toolchain-arch-checker@v1 - name: Install Python 3.x (required for the testsuite) - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: '3.x' @@ -56,6 +50,13 @@ jobs: run: scripts/ci-github.sh shell: bash + # Ascertain whether alr can run without the toolchain that built it + - name: Check standalone alr + uses: mosteo-actions/alr-standalone-checker@v1 + with: + alr_path: bin + toolchain_path: alire_prefix + - name: Upload logs (if failed) if: failure() uses: actions/upload-artifact@v4 diff --git a/scripts/ci-github.sh b/scripts/ci-github.sh index 0b28b2dcb..f1b49e7ed 100755 --- a/scripts/ci-github.sh +++ b/scripts/ci-github.sh @@ -29,12 +29,19 @@ fi # Patch version scripts/version-patcher.sh +# Use -static-libgcc only on macOS. +ALR_LINKER_ARGS= +if [ "$(get_OS)" == "macos" ]; then + ALR_LINKER_ARGS="-static-libgcc" +fi + # Build alr if no argument is "build=false" if [[ " $* " == *" build=false "* ]]; then echo "Skipping alr build, explicitly disabled via arguments" else export ALIRE_OS=$(get_OS) - gprbuild -j0 -p -P alr_env + echo "Using ALR_LINKER_ARGS=$ALR_LINKER_ARGS" + gprbuild -j0 -p -P alr_env -largs $ALR_LINKER_ARGS fi # Disable distro detection if supported @@ -70,6 +77,12 @@ echo ALR SEARCH: alr -q -d search --list --external echo ............................ +# Exit without testing if some argument is "test=false" +if [[ " $* " == *" test=false "* ]]; then + echo "SKIPPING testsuite, explicitly disabled via arguments" + exit 0 +fi + echo TESTSUITE: # Run e3.testsuite echo