Skip to content

Commit

Permalink
Use the head version of Ruby as buildruby
Browse files Browse the repository at this point in the history
  • Loading branch information
kateinoigakukun committed Sep 4, 2024
1 parent 0b66668 commit 049195e
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 29 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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: |
Expand All @@ -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
Expand Down
22 changes: 0 additions & 22 deletions bin/setup
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions packages/npm-packages/ruby-3.2-wasm-wasi/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
*.tgz
/tmp
/bundle
/vendor
2 changes: 1 addition & 1 deletion packages/npm-packages/ruby-3.2-wasm-wasi/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ DEPENDENCIES
test-unit

BUNDLED WITH
2.5.9
2.6.0.dev
2 changes: 2 additions & 0 deletions packages/npm-packages/ruby-3.3-wasm-wasi/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
*.tgz
/tmp
/bundle
/vendor
2 changes: 1 addition & 1 deletion packages/npm-packages/ruby-3.3-wasm-wasi/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ DEPENDENCIES
test-unit

BUNDLED WITH
2.5.9
2.6.0.dev
2 changes: 1 addition & 1 deletion packages/npm-packages/ruby-head-wasm-wasi/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ GEM

PLATFORMS
ruby
wasm32-wasi
x86_64-linux

DEPENDENCIES
js (= 2.6.2.dev)
Expand Down

0 comments on commit 049195e

Please sign in to comment.