From 049195e2318ae3f9482f907668aad5e852e1be36 Mon Sep 17 00:00:00 2001 From: Yuta Saito Date: Wed, 21 Aug 2024 04:51:46 +0000 Subject: [PATCH] Use the head version of Ruby as buildruby --- .github/workflows/build.yml | 8 +++---- bin/setup | 22 ------------------- .../ruby-3.2-wasm-wasi/.gitignore | 2 ++ .../ruby-3.2-wasm-wasi/Gemfile.lock | 2 +- .../ruby-3.3-wasm-wasi/.gitignore | 2 ++ .../ruby-3.3-wasm-wasi/Gemfile.lock | 2 +- .../ruby-head-wasm-wasi/Gemfile.lock | 2 +- 7 files changed, 11 insertions(+), 29 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 12668e464..b9cc39090 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -31,7 +31,7 @@ jobs: fetch-depth: 0 - uses: ruby/setup-ruby@v1 with: - ruby-version: "3.3" + ruby-version: "head" bundler-cache: true - run: ./bin/setup - run: bundle exec rake check:type @@ -77,7 +77,7 @@ jobs: - uses: actions/checkout@v4 - uses: ruby/setup-ruby@v1 with: - ruby-version: "3.3" + ruby-version: "head" bundler-cache: true - run: ./bin/setup - run: rake ci:pin_build_manifest @@ -150,7 +150,7 @@ jobs: - uses: ruby/setup-ruby@v1 if: ${{ matrix.entry.test != '' }} with: - ruby-version: "3.3" + ruby-version: "head" bundler-cache: false - name: rake ${{ matrix.entry.test }} run: | @@ -176,7 +176,7 @@ jobs: registry-url: https://registry.npmjs.org/ - uses: ruby/setup-ruby@v1 with: - ruby-version: "3.3" + ruby-version: "head" bundler-cache: true - run: ./bin/setup - run: echo "PREREL_NAME=${{ inputs.prerel_name }}" >> $GITHUB_ENV diff --git a/bin/setup b/bin/setup index 8fdd6f73a..cf8463825 100755 --- a/bin/setup +++ b/bin/setup @@ -6,28 +6,6 @@ set -vx root="$(cd "$(dirname "$0")/.." && pwd)" env BUNDLE_GEMFILE="$root/Gemfile" bundle install -for gemfile in $root/packages/npm-packages/*/Gemfile; do - # Skip ruby-head-wasm-wasi's Gemfile because it does not need to be installed here - if [[ "$gemfile" == *"/ruby-head-wasm-wasi/Gemfile" ]]; then - continue - fi - - # FIXME: This is a workaround for the following issue: - # 1. `bundle install` does not support auto-self-upgrade for pre-release bundler versions suffixed with ".dev" - # 2. ruby-head-wasm-wasi's component build depends on 2.6.0.dev, which added --target-rbconfig support - # 3. If the "bundle" command here is earlier than 2.6.0.dev, "bundle install" does *not* self-upgrade to - # the specified pre-release version, and it overwrites the Gemfile.lock with the earlier command version. - # 4. Overwritten Gemfile.lock with the earlier bundler version causes auto-self-downgrade when running - # "bundle install --target-rbconfig" inside "rbwasm build" command, then it fails because the earlier - # bundler version does not support --target-rbconfig. - # - # Thus, we temporarily discard the Gemfile.lock changes here to prevent the auto-self-downgrade issue. - # This workaround should be removed once we drop static Ruby builds from ruby-head-wasm-wasi or - # a stable bundler version is released with --target-rbconfig support. - cp "$gemfile.lock" "$gemfile.lock.orig" - env BUNDLE_GEMFILE="$gemfile" bundle install - mv "$gemfile.lock.orig" "$gemfile.lock" -done # Build vendored jco if Rust toolchain is available and submodule is checked out if command -v rustc && [ -f vendor/jco/package.json ]; then diff --git a/packages/npm-packages/ruby-3.2-wasm-wasi/.gitignore b/packages/npm-packages/ruby-3.2-wasm-wasi/.gitignore index fad2dcd07..cbb80a5cd 100644 --- a/packages/npm-packages/ruby-3.2-wasm-wasi/.gitignore +++ b/packages/npm-packages/ruby-3.2-wasm-wasi/.gitignore @@ -1,2 +1,4 @@ *.tgz +/tmp /bundle +/vendor diff --git a/packages/npm-packages/ruby-3.2-wasm-wasi/Gemfile.lock b/packages/npm-packages/ruby-3.2-wasm-wasi/Gemfile.lock index 5addb36ca..16c73025e 100644 --- a/packages/npm-packages/ruby-3.2-wasm-wasi/Gemfile.lock +++ b/packages/npm-packages/ruby-3.2-wasm-wasi/Gemfile.lock @@ -26,4 +26,4 @@ DEPENDENCIES test-unit BUNDLED WITH - 2.5.9 + 2.6.0.dev diff --git a/packages/npm-packages/ruby-3.3-wasm-wasi/.gitignore b/packages/npm-packages/ruby-3.3-wasm-wasi/.gitignore index fad2dcd07..cbb80a5cd 100644 --- a/packages/npm-packages/ruby-3.3-wasm-wasi/.gitignore +++ b/packages/npm-packages/ruby-3.3-wasm-wasi/.gitignore @@ -1,2 +1,4 @@ *.tgz +/tmp /bundle +/vendor diff --git a/packages/npm-packages/ruby-3.3-wasm-wasi/Gemfile.lock b/packages/npm-packages/ruby-3.3-wasm-wasi/Gemfile.lock index 5addb36ca..16c73025e 100644 --- a/packages/npm-packages/ruby-3.3-wasm-wasi/Gemfile.lock +++ b/packages/npm-packages/ruby-3.3-wasm-wasi/Gemfile.lock @@ -26,4 +26,4 @@ DEPENDENCIES test-unit BUNDLED WITH - 2.5.9 + 2.6.0.dev diff --git a/packages/npm-packages/ruby-head-wasm-wasi/Gemfile.lock b/packages/npm-packages/ruby-head-wasm-wasi/Gemfile.lock index 97198a4c0..f5bf0d995 100644 --- a/packages/npm-packages/ruby-head-wasm-wasi/Gemfile.lock +++ b/packages/npm-packages/ruby-head-wasm-wasi/Gemfile.lock @@ -13,7 +13,7 @@ GEM PLATFORMS ruby - wasm32-wasi + x86_64-linux DEPENDENCIES js (= 2.6.2.dev)