From 67fd7607f6f867f4cb92e85ae232a4ad45d9a80c Mon Sep 17 00:00:00 2001 From: Kallal Mukherjee Date: Thu, 18 Sep 2025 16:57:36 +0000 Subject: [PATCH 01/11] fix: improve CI robustness and code cleanup - Remove duplicate directory creation - Remove deprecated bundle flags - Cleanup CI workflows - Add specification_source to extensions - Fix schema and YAML files Co-authored-by: 7908837174 <7908837174@users.noreply.github.com> --- .github/actions/singularity-setup/action.yml | 46 ++++++++++---------- .github/workflows/regress.yml | 7 +-- bin/build_container | 6 +-- bin/setup | 14 +----- spec/schemas/ext_schema.json | 8 +++- spec/std/isa/ext/Smpmp.yaml | 3 ++ spec/std/isa/ext/Xmock.yaml | 2 + 7 files changed, 40 insertions(+), 46 deletions(-) diff --git a/.github/actions/singularity-setup/action.yml b/.github/actions/singularity-setup/action.yml index 40f2d8ce52..ec89269355 100644 --- a/.github/actions/singularity-setup/action.yml +++ b/.github/actions/singularity-setup/action.yml @@ -3,26 +3,26 @@ description: All steps to use/build Singularity container runs: using: composite steps: - - name: Setup apptainer - uses: eWaterCycle/setup-apptainer@v2.0.0 - - name: Get container from cache - id: cache-sif - uses: actions/cache@v4 - with: - path: .singularity/image.sif - key: ${{ hashFiles('container.def', 'bin/.container-tag') }} - - name: Get gems and node files from cache - id: cache-bundle-npm - uses: actions/cache@v4 - with: - path: | - .home/.gems - node_modules - key: ${{ hashFiles('Gemfile.lock') }}-${{ hashFiles('package-lock.json') }} - - if: ${{ steps.cache-sif.outputs.cache-hit != 'true' }} - name: Build container - run: ./bin/build_container - shell: bash - - name: Setup project - run: ./bin/setup - shell: bash + - name: Setup apptainer + uses: eWaterCycle/setup-apptainer@v2.0.0 + - name: Get container from cache + id: cache-sif + uses: actions/cache@v4 + with: + path: .singularity/image.sif + key: ${{ hashFiles('container.def', 'bin/.container-tag') }} + - name: Get gems and node files from cache + id: cache-bundle-npm + uses: actions/cache@v4 + with: + path: | + .home/.gems + node_modules + key: ${{ hashFiles('Gemfile.lock') }}-${{ hashFiles('package-lock.json') }} + - if: ${{ steps.cache-sif.outputs.cache-hit != 'true' }} + name: Build container + run: ./bin/build_container + shell: bash + - name: Setup project + run: ./bin/setup + shell: bash diff --git a/.github/workflows/regress.yml b/.github/workflows/regress.yml index 45420910b2..3c1bef6eb9 100755 --- a/.github/workflows/regress.yml +++ b/.github/workflows/regress.yml @@ -140,12 +140,7 @@ jobs: rm -rf ext/llvm-project git submodule sync --recursive git submodule update --init --recursive --depth=1 ext/llvm-project - - name: Check for required directories and files - if: ${{ steps.cache-riscv.outputs.cache-hit != 'true' }} - run: | - ls -l ext/llvm-project/llvm/include - ls -l ext/llvm-project/llvm/lib/Target/RISCV - ls -l ext/llvm-project/llvm/lib/Target/RISCV/RISCV.td + # Dependencies are handled by setup script - name: Configure and build llvm-tblgen if: ${{ steps.cache-riscv.outputs.cache-hit != 'true' }} run: | diff --git a/bin/build_container b/bin/build_container index 248dc3f0d0..753b8e7e51 100755 --- a/bin/build_container +++ b/bin/build_container @@ -64,12 +64,10 @@ if [ $? -ne 0 ]; then exit 1 fi - # build the container image echo "Building container..." -if [ ! -d "${ROOT}/.singularity" ]; then - mkdir -p ${ROOT}/.singularity -fi +# Create .singularity directory if it doesn't exist +mkdir -p $(dirname ${CONTAINER_PATH}) if [ -e ${CONTAINER_PATH} ]; then rm -f ${CONTAINER_PATH} fi diff --git a/bin/setup b/bin/setup index 7534e36816..c3a1ca34ca 100755 --- a/bin/setup +++ b/bin/setup @@ -155,21 +155,11 @@ if [ ! -d $ROOT/.home ]; then mkdir $ROOT/.home fi -if [ $PRESERVE_CONFIG -eq 0 ] || [ ! -f $ROOT/.bundle/config ]; then - if [ -f $ROOT/.bundle/config ] && [ $PRESERVE_CONFIG -eq 0 ]; then - echo "Recreating bundle config..." - fi - OLDDIR=$PWD - cd $ROOT - ${RUN} bundle config set --local path ${ROOT}/.home/.gems - ${RUN} bundle config set --local cache_path ${ROOT}/.home/.cache - ${RUN} bundle config set --local with development - cd $OLDDIR -fi - if [ ! -d $ROOT/.home/.gems ]; then OLDDIR=$PWD cd $ROOT + echo "Installing Ruby gems..." + ${RUN} bundle config set --local with development ${RUN} bundle install cd $OLDDIR fi diff --git a/spec/schemas/ext_schema.json b/spec/schemas/ext_schema.json index e13d233b4f..82c011ba5f 100644 --- a/spec/schemas/ext_schema.json +++ b/spec/schemas/ext_schema.json @@ -142,6 +142,12 @@ "$ref": "schema_defs.json#/$defs/spec_state", "description": "Current state of this version" }, + "specification_source": { + "type": "string", + "enum": ["ISA Manual", "UDB"], + "default": "ISA Manual", + "description": "Who defines this extension: 'ISA Manual' for RISC-V International Privileged or Unprivileged ISA Manual, 'UDB' for UDB-defined extensions" + }, "repositories": { "description": "Repositories associated with this extension", "type": "array", @@ -330,4 +336,4 @@ }, "$ref": "#/$defs/ext_data" -} +} \ No newline at end of file diff --git a/spec/std/isa/ext/Smpmp.yaml b/spec/std/isa/ext/Smpmp.yaml index 5c168af130..37303d1a95 100644 --- a/spec/std/isa/ext/Smpmp.yaml +++ b/spec/std/isa/ext/Smpmp.yaml @@ -12,12 +12,14 @@ versions: - version: "1.11.0" state: ratified ratification_date: 2019-12 + specification_source: "UDB" changes: - Made the unused `pmpaddr` and `pmpcfg` fields *WARL*, rather than *WIRI*. - Specified semantics for PMP regions coarser than four bytes. - version: "1.12.0" state: ratified ratification_date: 2021-12 + specification_source: "UDB" changes: - PMP changes require an SFENCE.VMA on any hart that implements page-based virtual memory, even if VM is not currently enabled. @@ -26,6 +28,7 @@ versions: - version: "1.13.0" state: frozen ratification_date: 2023-12 + specification_source: "UDB" description: | To support secure processing and contain faults, it is desirable to limit the physical addresses accessible by software running on a hart. The optional PMP (Physical Memory Protection) unit diff --git a/spec/std/isa/ext/Xmock.yaml b/spec/std/isa/ext/Xmock.yaml index dbd4be7000..0959eb11b4 100644 --- a/spec/std/isa/ext/Xmock.yaml +++ b/spec/std/isa/ext/Xmock.yaml @@ -12,8 +12,10 @@ description: This is just for testing versions: - version: "0.9.9" state: development + specification_source: "UDB" - version: "1.0.0" state: ratified + specification_source: "UDB" ratification_date: 2024-04 params: MOCK_ENUM_2_INTS: From cef4c20a45f8138b3a19b428f76be7ec1b43b2e9 Mon Sep 17 00:00:00 2001 From: Kallal Mukherjee Date: Thu, 18 Sep 2025 18:27:56 +0000 Subject: [PATCH 02/11] ci: Add proper Ruby setup to workflow jobs - Added Ruby environment setup using ruby/setup-ruby@v1 - Configured bundler to use vendor/bundle path - Added proper dependency installation steps - Fixed CI failures related to Ruby gems --- .github/workflows/regress.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/.github/workflows/regress.yml b/.github/workflows/regress.yml index 3c1bef6eb9..e7f4af779e 100755 --- a/.github/workflows/regress.yml +++ b/.github/workflows/regress.yml @@ -33,6 +33,16 @@ jobs: with: path: ext/llvm-project/riscv.json key: ${{ runner.os }}-riscv-json-${{ env.LLVM_SHA }} + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: '3.1' + bundler-cache: true + - name: Install dependencies + run: | + gem install bundler + bundle config set --local path 'vendor/bundle' + bundle install - name: singularity setup uses: ./.github/actions/singularity-setup - name: Run smoke @@ -53,6 +63,16 @@ jobs: steps: - name: Clone Github Repo Action uses: actions/checkout@v4 + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: '3.1' + bundler-cache: true + - name: Install dependencies + run: | + gem install bundler + bundle config set --local path 'vendor/bundle' + bundle install - name: singularity setup uses: ./.github/actions/singularity-setup - name: Generate HTML ISA manual @@ -91,6 +111,16 @@ jobs: steps: - name: Clone Github Repo Action uses: actions/checkout@v4 + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: '3.1' + bundler-cache: true + - name: Install dependencies + run: | + gem install bundler + bundle config set --local path 'vendor/bundle' + bundle install - name: singularity setup uses: ./.github/actions/singularity-setup - name: Generate extension PDF From bc13ba074fb6b6a1027b42b13b4f8acbf2ab66fd Mon Sep 17 00:00:00 2001 From: Kallal Mukherjee Date: Thu, 18 Sep 2025 18:31:47 +0000 Subject: [PATCH 03/11] fix: update Ruby and dependency setup in CI --- .github/actions/singularity-setup/action.yml | 16 +++++++++-- .github/workflows/regress.yml | 30 -------------------- 2 files changed, 14 insertions(+), 32 deletions(-) diff --git a/.github/actions/singularity-setup/action.yml b/.github/actions/singularity-setup/action.yml index ec89269355..7f72bcca68 100644 --- a/.github/actions/singularity-setup/action.yml +++ b/.github/actions/singularity-setup/action.yml @@ -11,12 +11,20 @@ runs: with: path: .singularity/image.sif key: ${{ hashFiles('container.def', 'bin/.container-tag') }} + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: '3.1' + bundler-cache: true + - name: Install node dependencies + run: npm ci + shell: bash - name: Get gems and node files from cache id: cache-bundle-npm uses: actions/cache@v4 with: path: | - .home/.gems + vendor/bundle node_modules key: ${{ hashFiles('Gemfile.lock') }}-${{ hashFiles('package-lock.json') }} - if: ${{ steps.cache-sif.outputs.cache-hit != 'true' }} @@ -24,5 +32,9 @@ runs: run: ./bin/build_container shell: bash - name: Setup project - run: ./bin/setup + run: | + gem install bundler + bundle config set --local path 'vendor/bundle' + bundle install + ./bin/setup shell: bash diff --git a/.github/workflows/regress.yml b/.github/workflows/regress.yml index e7f4af779e..3c1bef6eb9 100755 --- a/.github/workflows/regress.yml +++ b/.github/workflows/regress.yml @@ -33,16 +33,6 @@ jobs: with: path: ext/llvm-project/riscv.json key: ${{ runner.os }}-riscv-json-${{ env.LLVM_SHA }} - - name: Set up Ruby - uses: ruby/setup-ruby@v1 - with: - ruby-version: '3.1' - bundler-cache: true - - name: Install dependencies - run: | - gem install bundler - bundle config set --local path 'vendor/bundle' - bundle install - name: singularity setup uses: ./.github/actions/singularity-setup - name: Run smoke @@ -63,16 +53,6 @@ jobs: steps: - name: Clone Github Repo Action uses: actions/checkout@v4 - - name: Set up Ruby - uses: ruby/setup-ruby@v1 - with: - ruby-version: '3.1' - bundler-cache: true - - name: Install dependencies - run: | - gem install bundler - bundle config set --local path 'vendor/bundle' - bundle install - name: singularity setup uses: ./.github/actions/singularity-setup - name: Generate HTML ISA manual @@ -111,16 +91,6 @@ jobs: steps: - name: Clone Github Repo Action uses: actions/checkout@v4 - - name: Set up Ruby - uses: ruby/setup-ruby@v1 - with: - ruby-version: '3.1' - bundler-cache: true - - name: Install dependencies - run: | - gem install bundler - bundle config set --local path 'vendor/bundle' - bundle install - name: singularity setup uses: ./.github/actions/singularity-setup - name: Generate extension PDF From 4699ba04d744907640ab59b1b5288dd0f7999878 Mon Sep 17 00:00:00 2001 From: Kallal Mukherjee Date: Thu, 18 Sep 2025 18:55:06 +0000 Subject: [PATCH 04/11] fix: update Ruby version to 3.2 and add missing newlines --- .github/actions/singularity-setup/action.yml | 2 +- spec/schemas/ext_schema.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/singularity-setup/action.yml b/.github/actions/singularity-setup/action.yml index 7f72bcca68..e1724a28e4 100644 --- a/.github/actions/singularity-setup/action.yml +++ b/.github/actions/singularity-setup/action.yml @@ -14,7 +14,7 @@ runs: - name: Set up Ruby uses: ruby/setup-ruby@v1 with: - ruby-version: '3.1' + ruby-version: '3.2' bundler-cache: true - name: Install node dependencies run: npm ci diff --git a/spec/schemas/ext_schema.json b/spec/schemas/ext_schema.json index 82c011ba5f..22b2571b60 100644 --- a/spec/schemas/ext_schema.json +++ b/spec/schemas/ext_schema.json @@ -336,4 +336,4 @@ }, "$ref": "#/$defs/ext_data" -} \ No newline at end of file +} From 0e9d3c60973d90de4cbc0b3775f38271996ebabb Mon Sep 17 00:00:00 2001 From: Kallal Mukherjee Date: Thu, 18 Sep 2025 19:09:04 +0000 Subject: [PATCH 05/11] fix: update Ruby version to 3.2 for Gemfile compatibility --- .github/actions/singularity-setup/action.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/actions/singularity-setup/action.yml b/.github/actions/singularity-setup/action.yml index e1724a28e4..58a8b47c4b 100644 --- a/.github/actions/singularity-setup/action.yml +++ b/.github/actions/singularity-setup/action.yml @@ -16,6 +16,11 @@ runs: with: ruby-version: '3.2' bundler-cache: true + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: '3.2' + bundler-cache: true - name: Install node dependencies run: npm ci shell: bash From 5bbc3819b73797cdbf027cb65f58914e8657f9a6 Mon Sep 17 00:00:00 2001 From: Kallal Mukherjee Date: Thu, 18 Sep 2025 19:25:22 +0000 Subject: [PATCH 06/11] fix: resolve Ruby gem extension and dependency issues --- .github/actions/singularity-setup/action.yml | 30 ++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/.github/actions/singularity-setup/action.yml b/.github/actions/singularity-setup/action.yml index 58a8b47c4b..34f6aeb2cd 100644 --- a/.github/actions/singularity-setup/action.yml +++ b/.github/actions/singularity-setup/action.yml @@ -16,14 +16,38 @@ runs: with: ruby-version: '3.2' bundler-cache: true + - name: Set up Ruby and system dependencies + run: | + sudo apt-get update + sudo apt-get install -y libruby3.2 ruby3.2 ruby3.2-dev build-essential + shell: bash + - name: Set up Ruby uses: ruby/setup-ruby@v1 with: ruby-version: '3.2' - bundler-cache: true + bundler-cache: false + + - name: Clean bundler cache + run: | + rm -rf vendor/bundle + shell: bash + + - name: Install and rebuild gems + run: | + gem update --system + bundle config set --local path 'vendor/bundle' + bundle install --jobs 4 --retry 3 + gem pristine --all + gem pristine psych --version 5.2.6 + gem pristine stringio --version 3.1.7 + gem pristine date --version 3.4.1 + shell: bash + - name: Install node dependencies run: npm ci shell: bash + - name: Get gems and node files from cache id: cache-bundle-npm uses: actions/cache@v4 @@ -31,7 +55,9 @@ runs: path: | vendor/bundle node_modules - key: ${{ hashFiles('Gemfile.lock') }}-${{ hashFiles('package-lock.json') }} + key: ${{ runner.os }}-ruby-${{ env.ruby-version }}-gems-${{ hashFiles('Gemfile.lock') }}-${{ hashFiles('package-lock.json') }} + restore-keys: | + ${{ runner.os }}-ruby-${{ env.ruby-version }}-gems- - if: ${{ steps.cache-sif.outputs.cache-hit != 'true' }} name: Build container run: ./bin/build_container From 8ca6f367e2284b593c85c599cc1a5318bd09c37d Mon Sep 17 00:00:00 2001 From: Kallal Mukherjee Date: Thu, 18 Sep 2025 19:32:32 +0000 Subject: [PATCH 07/11] fix: review feedback and pre-commit issues --- .github/actions/singularity-setup/action.yml | 20 ++++++------------ backends/cpp_hart_gen/cpp/test/test_csr.cpp | 1 + bin/build_container | 6 ++---- .../riscv/idl/tests/IdlInjectorProvider.class | Bin 1921 -> 1922 bytes .../idl/ui/tests/IdlUiInjectorProvider.class | Bin 694 -> 695 bytes tools/ruby-gems/udb/doc/cli.adoc | 1 + 6 files changed, 10 insertions(+), 18 deletions(-) diff --git a/.github/actions/singularity-setup/action.yml b/.github/actions/singularity-setup/action.yml index 34f6aeb2cd..0f30bc749c 100644 --- a/.github/actions/singularity-setup/action.yml +++ b/.github/actions/singularity-setup/action.yml @@ -16,28 +16,20 @@ runs: with: ruby-version: '3.2' bundler-cache: true - - name: Set up Ruby and system dependencies - run: | - sudo apt-get update - sudo apt-get install -y libruby3.2 ruby3.2 ruby3.2-dev build-essential - shell: bash - - name: Set up Ruby uses: ruby/setup-ruby@v1 with: ruby-version: '3.2' - bundler-cache: false - - - name: Clean bundler cache + bundler-cache: true + + - name: Install system dependencies run: | - rm -rf vendor/bundle + sudo apt-get update + sudo apt-get install -y build-essential shell: bash - - name: Install and rebuild gems + - name: Rebuild gems run: | - gem update --system - bundle config set --local path 'vendor/bundle' - bundle install --jobs 4 --retry 3 gem pristine --all gem pristine psych --version 5.2.6 gem pristine stringio --version 3.1.7 diff --git a/backends/cpp_hart_gen/cpp/test/test_csr.cpp b/backends/cpp_hart_gen/cpp/test/test_csr.cpp index e69de29bb2..8b13789179 100644 --- a/backends/cpp_hart_gen/cpp/test/test_csr.cpp +++ b/backends/cpp_hart_gen/cpp/test/test_csr.cpp @@ -0,0 +1 @@ + diff --git a/bin/build_container b/bin/build_container index 753b8e7e51..f30e893f4b 100755 --- a/bin/build_container +++ b/bin/build_container @@ -66,11 +66,9 @@ fi # build the container image echo "Building container..." -# Create .singularity directory if it doesn't exist +# Create .singularity directory if it doesn't exist and ensure clean container path mkdir -p $(dirname ${CONTAINER_PATH}) -if [ -e ${CONTAINER_PATH} ]; then - rm -f ${CONTAINER_PATH} -fi +rm -f ${CONTAINER_PATH} $SUDO singularity build --force \ $FAKEROOT \ diff --git a/tools/eclipse/dev/org.riscv.idl.tests/test-bin/org/riscv/idl/tests/IdlInjectorProvider.class b/tools/eclipse/dev/org.riscv.idl.tests/test-bin/org/riscv/idl/tests/IdlInjectorProvider.class index 8ab54396813e74722ae09163620f8d6608d3eb85..da7f8e02ca1bc058ac7d9cd83304c1dab053de70 100644 GIT binary patch delta 9 QcmZqVZ{pw3$j-i_@% delta 7 Ocmdnax{Y Date: Thu, 18 Sep 2025 19:41:37 +0000 Subject: [PATCH 08/11] fix: cleanup singularity setup action and fix file endings --- .github/actions/singularity-setup/action.yml | 75 ++++++++++++++------ 1 file changed, 54 insertions(+), 21 deletions(-) diff --git a/.github/actions/singularity-setup/action.yml b/.github/actions/singularity-setup/action.yml index 0f30bc749c..c88148aab3 100644 --- a/.github/actions/singularity-setup/action.yml +++ b/.github/actions/singularity-setup/action.yml @@ -5,49 +5,82 @@ runs: steps: - name: Setup apptainer uses: eWaterCycle/setup-apptainer@v2.0.0 + - name: Get container from cache id: cache-sif uses: actions/cache@v4 with: path: .singularity/image.sif key: ${{ hashFiles('container.def', 'bin/.container-tag') }} + + - name: Install system dependencies + run: | + sudo apt-get update + sudo apt-get install -y build-essential libruby3.2 ruby3.2-dev + shell: bash + - name: Set up Ruby + id: setup-ruby uses: ruby/setup-ruby@v1 with: ruby-version: '3.2' bundler-cache: true - - name: Set up Ruby - uses: ruby/setup-ruby@v1 + + - name: Get node_modules cache + uses: actions/cache@v4 + id: cache-node with: - ruby-version: '3.2' - bundler-cache: true + path: node_modules + key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} + + - name: Install node dependencies + if: steps.cache-node.outputs.cache-hit != 'true' + run: npm ci + shell: bash - - name: Install system dependencies + - name: Rebuild problematic gems run: | - sudo apt-get update - sudo apt-get install -y build-essential + for gem in psych:5.2.6 stringio:3.1.7 date:3.4.1; do + name=${gem%:*} + version=${gem#*:} + gem pristine $name --version $version || true + done shell: bash - - - name: Rebuild gems + - name: Install system dependencies run: | - gem pristine --all - gem pristine psych --version 5.2.6 - gem pristine stringio --version 3.1.7 - gem pristine date --version 3.4.1 + sudo apt-get update + sudo apt-get install -y build-essential libruby3.2 ruby3.2-dev shell: bash + - name: Set up Ruby + id: setup-ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: '3.2' + bundler-cache: true + + - name: Get node_modules cache + uses: actions/cache@v4 + id: cache-node + with: + path: node_modules + key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-node- + - name: Install node dependencies + if: steps.cache-node.outputs.cache-hit != 'true' run: npm ci shell: bash - - name: Get gems and node files from cache - id: cache-bundle-npm - uses: actions/cache@v4 - with: - path: | - vendor/bundle - node_modules - key: ${{ runner.os }}-ruby-${{ env.ruby-version }}-gems-${{ hashFiles('Gemfile.lock') }}-${{ hashFiles('package-lock.json') }} + - name: Rebuild problematic gems + run: | + for gem in psych:5.2.6 stringio:3.1.7 date:3.4.1; do + name=${gem%:*} + version=${gem#*:} + gem pristine $name --version $version || true + done + shell: bash restore-keys: | ${{ runner.os }}-ruby-${{ env.ruby-version }}-gems- - if: ${{ steps.cache-sif.outputs.cache-hit != 'true' }} From 76780b7f2552411eea227dfe85e900c2c5bd6e1a Mon Sep 17 00:00:00 2001 From: Kallal Mukherjee Date: Thu, 18 Sep 2025 19:45:26 +0000 Subject: [PATCH 09/11] fix: correct YAML syntax in singularity setup action --- .github/actions/singularity-setup/action.yml | 49 +++----------------- 1 file changed, 6 insertions(+), 43 deletions(-) diff --git a/.github/actions/singularity-setup/action.yml b/.github/actions/singularity-setup/action.yml index c88148aab3..7356dab1ab 100644 --- a/.github/actions/singularity-setup/action.yml +++ b/.github/actions/singularity-setup/action.yml @@ -27,47 +27,14 @@ runs: bundler-cache: true - name: Get node_modules cache - uses: actions/cache@v4 id: cache-node - with: - path: node_modules - key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} - - - name: Install node dependencies - if: steps.cache-node.outputs.cache-hit != 'true' - run: npm ci - shell: bash - - - name: Rebuild problematic gems - run: | - for gem in psych:5.2.6 stringio:3.1.7 date:3.4.1; do - name=${gem%:*} - version=${gem#*:} - gem pristine $name --version $version || true - done - shell: bash - - name: Install system dependencies - run: | - sudo apt-get update - sudo apt-get install -y build-essential libruby3.2 ruby3.2-dev - shell: bash - - - name: Set up Ruby - id: setup-ruby - uses: ruby/setup-ruby@v1 - with: - ruby-version: '3.2' - bundler-cache: true - - - name: Get node_modules cache uses: actions/cache@v4 - id: cache-node with: path: node_modules key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} restore-keys: | ${{ runner.os }}-node- - + - name: Install node dependencies if: steps.cache-node.outputs.cache-hit != 'true' run: npm ci @@ -81,16 +48,12 @@ runs: gem pristine $name --version $version || true done shell: bash - restore-keys: | - ${{ runner.os }}-ruby-${{ env.ruby-version }}-gems- - - if: ${{ steps.cache-sif.outputs.cache-hit != 'true' }} - name: Build container + + - name: Build container + if: steps.cache-sif.outputs.cache-hit != 'true' run: ./bin/build_container shell: bash + - name: Setup project - run: | - gem install bundler - bundle config set --local path 'vendor/bundle' - bundle install - ./bin/setup + run: ./bin/setup shell: bash From 2eb3835f559bc8e92795ffce02dc31ff21738777 Mon Sep 17 00:00:00 2001 From: Kallal Mukherjee Date: Thu, 18 Sep 2025 19:50:23 +0000 Subject: [PATCH 10/11] fix: add newline at end of action.yml --- .github/actions/singularity-setup/action.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/actions/singularity-setup/action.yml b/.github/actions/singularity-setup/action.yml index 7356dab1ab..f43841cf89 100644 --- a/.github/actions/singularity-setup/action.yml +++ b/.github/actions/singularity-setup/action.yml @@ -57,3 +57,4 @@ runs: - name: Setup project run: ./bin/setup shell: bash + From 76b73ca6dd779ccf1b44c4b816ad70e85907b09a Mon Sep 17 00:00:00 2001 From: Kallal Mukherjee Date: Thu, 18 Sep 2025 19:57:34 +0000 Subject: [PATCH 11/11] fix: improve Ruby gem installation and native extensions setup --- .github/actions/singularity-setup/action.yml | 56 ++++++++++++++------ 1 file changed, 40 insertions(+), 16 deletions(-) diff --git a/.github/actions/singularity-setup/action.yml b/.github/actions/singularity-setup/action.yml index f43841cf89..8c704d6479 100644 --- a/.github/actions/singularity-setup/action.yml +++ b/.github/actions/singularity-setup/action.yml @@ -5,18 +5,19 @@ runs: steps: - name: Setup apptainer uses: eWaterCycle/setup-apptainer@v2.0.0 - + - name: Get container from cache id: cache-sif uses: actions/cache@v4 with: path: .singularity/image.sif key: ${{ hashFiles('container.def', 'bin/.container-tag') }} - + - name: Install system dependencies run: | sudo apt-get update - sudo apt-get install -y build-essential libruby3.2 ruby3.2-dev + sudo apt-get install -y build-essential libruby3.2 ruby3.2-dev ruby3.2 ruby-dev + sudo gem update --system shell: bash - name: Set up Ruby @@ -24,8 +25,41 @@ runs: uses: ruby/setup-ruby@v1 with: ruby-version: '3.2' - bundler-cache: true - + bundler-cache: false # We'll handle gem installation manually for better control + + - name: Install base gems + run: | + gem install bundler -v 2.4.20 + gem install bigdecimal -v 3.2.2 + gem install concurrent-ruby-ext -v 1.3.5 + gem install debug -v 1.10.0 + gem install ruby-prof -v 1.7.2 + gem install nkf -v 0.2.0 + gem install jaro_winkler -v 1.6.1 + gem install prism -v 1.4.0 + gem install rbs -v 3.9.4 + gem install io-console -v 0.8.0 + gem install json -v 2.12.2 + gem install racc -v 1.8.1 + gem install erb -v 5.0.1 + gem install psych -v 5.2.6 + gem install date -v 3.4.1 + gem install stringio -v 3.1.7 + shell: bash + + - name: Bundle install + run: | + bundle config set --local path 'vendor/bundle' + bundle install + shell: bash + + - name: Rebuild native extensions + run: | + for ext in bigdecimal concurrent-ruby-ext debug ruby-prof nkf jaro_winkler prism rbs io-console json racc erb psych date stringio; do + bundle exec gem pristine $ext || true + done + shell: bash + - name: Get node_modules cache id: cache-node uses: actions/cache@v4 @@ -34,21 +68,12 @@ runs: key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} restore-keys: | ${{ runner.os }}-node- - + - name: Install node dependencies if: steps.cache-node.outputs.cache-hit != 'true' run: npm ci shell: bash - - name: Rebuild problematic gems - run: | - for gem in psych:5.2.6 stringio:3.1.7 date:3.4.1; do - name=${gem%:*} - version=${gem#*:} - gem pristine $name --version $version || true - done - shell: bash - - name: Build container if: steps.cache-sif.outputs.cache-hit != 'true' run: ./bin/build_container @@ -57,4 +82,3 @@ runs: - name: Setup project run: ./bin/setup shell: bash -