From 1cd809ba635863ea5909e8d52c1331fffe9e7644 Mon Sep 17 00:00:00 2001 From: Alejandro R Mosteo Date: Wed, 22 Feb 2023 11:47:39 +0100 Subject: [PATCH] Replace uses of GNAT CE with latest FSF from Alire (#1330) * Replace uses of GNAT CE with latest FSF from Alire * Set up alr path in run.py * Remove caching already done by alr-install --- .github/workflows/ci-docker.yml | 10 +++++----- .github/workflows/ci-linux.yml | 6 +++--- .github/workflows/ci-macos.yml | 8 ++++---- .github/workflows/ci-toolchain.yml | 23 ++++------------------- .github/workflows/ci-unsupported.yml | 6 +++--- .github/workflows/ci-windows.yml | 6 +++--- .github/workflows/nightly.yml | 15 ++++----------- .github/workflows/spellcheck.yml | 4 +--- testsuite/run.py | 4 ++++ 9 files changed, 31 insertions(+), 51 deletions(-) diff --git a/.github/workflows/ci-docker.yml b/.github/workflows/ci-docker.yml index 79e1cbe9..2ceaacfd 100644 --- a/.github/workflows/ci-docker.yml +++ b/.github/workflows/ci-docker.yml @@ -18,11 +18,11 @@ jobs: strategy: matrix: tag: # Those are our dockerhub alire/gnat:tag machines - - centos-latest-community-latest # Test unsupported package manager - - debian-stable # Test current stable Debian compiler - - fedora-latest # Test current Fedora compiler - - ubuntu-lts # Test current LTS Ubuntu compiler - - arch-rolling # Test Arch compiler (closest to FSF?) + - centos-stream-fsf-latest # Test unsupported package manager + - debian-stable # Test current stable Debian compiler + - fedora-latest # Test current Fedora compiler + - ubuntu-lts # Test current LTS Ubuntu compiler + - arch-rolling # Test Arch compiler (closest to FSF?) steps: - name: Check out repository diff --git a/.github/workflows/ci-linux.yml b/.github/workflows/ci-linux.yml index a967f1f7..76e4e37d 100644 --- a/.github/workflows/ci-linux.yml +++ b/.github/workflows/ci-linux.yml @@ -29,10 +29,10 @@ jobs: with: submodules: true - - name: Install toolchain - uses: ada-actions/toolchain@ce2021 + - name: Install FSF toolchain + uses: alire-project/alr-install@v1 with: - distrib: community + crates: gnat_native gprbuild - name: Install Python 3.x (required for the testsuite) uses: actions/setup-python@v2 diff --git a/.github/workflows/ci-macos.yml b/.github/workflows/ci-macos.yml index ca43c0a2..db919969 100644 --- a/.github/workflows/ci-macos.yml +++ b/.github/workflows/ci-macos.yml @@ -15,7 +15,7 @@ jobs: build: name: CI on macOS - runs-on: macos-10.15 + runs-on: macos-latest steps: - name: Check out repository @@ -23,10 +23,10 @@ jobs: with: submodules: true - - name: Install toolchain - uses: ada-actions/toolchain@ce2020 + - name: Install FSF toolchain + uses: alire-project/alr-install@v1 with: - distrib: community + crates: gnat_native gprbuild - name: Install Python 3.x (required for the testsuite) uses: actions/setup-python@v2 diff --git a/.github/workflows/ci-toolchain.yml b/.github/workflows/ci-toolchain.yml index deaf58e3..4ff78500 100644 --- a/.github/workflows/ci-toolchain.yml +++ b/.github/workflows/ci-toolchain.yml @@ -21,7 +21,7 @@ jobs: strategy: matrix: os: - - macos-10.15 + - macos-latest - ubuntu-latest - windows-latest @@ -33,25 +33,10 @@ jobs: # Use a stock alr to make the latest toolchain available - - uses: alire-project/setup-alire@v2 + - name: Install FSF toolchain + uses: alire-project/alr-install@v1 with: - toolchain: --disable-assistant - version: nightly - - - name: Install latest toolchain - run: | - alr install gprbuild gnat_native --prefix=tools - - - name: Add toolchain to path (!Windows) - if: matrix.os != 'windows-latest' - run: | - echo "$PWD/tools/bin" >> $GITHUB_PATH - - - name: Add toolchain to path (Windows) - if: matrix.os == 'windows-latest' - run: | - $Target = Join-Path (Get-Location) "\tools\bin" - Add-Content $env:GITHUB_PATH $Target + crates: gnat_native gprbuild - name: Build alr with default toolchain shell: bash diff --git a/.github/workflows/ci-unsupported.yml b/.github/workflows/ci-unsupported.yml index ab2889dd..5d19dc27 100644 --- a/.github/workflows/ci-unsupported.yml +++ b/.github/workflows/ci-unsupported.yml @@ -24,10 +24,10 @@ jobs: with: submodules: true - - name: Install toolchain - uses: ada-actions/toolchain@ce2021 + - name: Install FSF toolchain + uses: alire-project/alr-install@v1 with: - distrib: community + crates: gnat_native gprbuild - name: Install Python 3.x (required for the testsuite) uses: actions/setup-python@v2 diff --git a/.github/workflows/ci-windows.yml b/.github/workflows/ci-windows.yml index f10be93b..cce908fa 100644 --- a/.github/workflows/ci-windows.yml +++ b/.github/workflows/ci-windows.yml @@ -26,10 +26,10 @@ jobs: with: submodules: true - - name: Install toolchain - uses: ada-actions/toolchain@ce2021 + - name: Install FSF toolchain + uses: alire-project/alr-install@v1 with: - distrib: community + crates: gnat_native gprbuild - name: Build alr run: gprbuild -j0 -p -P alr_env diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index cbd4a9f1..46c9dfb5 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -20,7 +20,7 @@ jobs: fail-fast: false # Attempt to generate as many of them as possible matrix: os: - - macos-10.15 + - macos-latest - ubuntu-latest - windows-latest @@ -30,17 +30,10 @@ jobs: with: submodules: true - # We build with the same compiler in all platforms. - # TODO: in the near future we must replace the CE compiler with a FSF one. - - uses: actions/cache@v2 + - name: Install FSF toolchain + uses: alire-project/alr-install with: - path: ./cache/gnat-ce-2020 - key: ${{ runner.os }}-gnat-ce-2020 - - - name: Install toolchain - uses: ada-actions/toolchain@ce2020 - with: - distrib: community + crates: gnat_native gprbuild - name: Install Python 3.x (required for the testsuite) uses: actions/setup-python@v2 diff --git a/.github/workflows/spellcheck.yml b/.github/workflows/spellcheck.yml index 3a376f48..f9208695 100644 --- a/.github/workflows/spellcheck.yml +++ b/.github/workflows/spellcheck.yml @@ -15,6 +15,4 @@ jobs: github_token: ${{ secrets.github_token }} reporter: github-pr-review locale: "US" -# exclude: '*.lock' -# It seems exclusion is not working: -# https://github.com/reviewdog/action-hadolint/issues/35 + exclude: '*.lock' \ No newline at end of file diff --git a/testsuite/run.py b/testsuite/run.py index 1a978d6b..64bb6ce1 100755 --- a/testsuite/run.py +++ b/testsuite/run.py @@ -34,6 +34,10 @@ class Testsuite(e3.testsuite.Testsuite): def set_up(self): super().set_up() os.environ['ALR_PATH'] = self.main.args.alr_path + # Some alr commands spawn another `alr` which must be found in path. + # This way we ensure the same alr being tested is used. + os.environ["PATH"] = \ + f"{os.path.dirname(self.main.args.alr_path)}{os.pathsep}{os.environ['PATH']}" # Some tests rely on an initially empty GPR_PROJECT_PATH variable os.environ.pop('GPR_PROJECT_PATH', None) -- 2.39.5