Skip to content

Commit 899fb60

Browse files
Try to fix Gemfile.lock auto-self-downgrade issue
1 parent 2c29240 commit 899fb60

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

bin/setup

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,21 @@ root="$(cd "$(dirname "$0")/.." && pwd)"
77

88
env BUNDLE_GEMFILE="$root/Gemfile" bundle install
99
for gemfile in $root/packages/npm-packages/*/Gemfile; do
10+
# FIXME: This is a workaround for the following issue:
11+
# 1. `bundle install` does not support auto-self-upgrade for pre-release bundler versions suffixed with ".dev"
12+
# 2. ruby-head-wasm-wasi's component build depends on 2.6.0.dev, which added --target-rbconfig support
13+
# 3. If the "bundle" command here is earlier than 2.6.0.dev, "bundle install" does *not* self-upgrade to
14+
# the specified pre-release version, and it overwrites the Gemfile.lock with the earlier command version.
15+
# 4. Overwritten Gemfile.lock with the earlier bundler version causes auto-self-downgrade when running
16+
# "bundle install --target-rbconfig" inside "rbwasm build" command, then it fails because the earlier
17+
# bundler version does not support --target-rbconfig.
18+
#
19+
# Thus, we temporarily discard the Gemfile.lock changes here to prevent the auto-self-downgrade issue.
20+
# This workaround should be removed once we drop static Ruby builds from ruby-head-wasm-wasi or
21+
# a stable bundler version is released with --target-rbconfig support.
22+
cp "$gemfile.lock" "$gemfile.lock.orig"
1023
env BUNDLE_GEMFILE="$gemfile" bundle install
24+
mv "$gemfile.lock.orig" "$gemfile.lock"
1125
done
1226

1327
# Build vendored jco if Rust toolchain is available and submodule is checked out

0 commit comments

Comments
 (0)