Skip to content

Commit 8b87925

Browse files
authored
Merge pull request #2880 from rspec/fix-build
Remove outdated`bundle install --binstubs` command
2 parents f16a163 + 3f622bb commit 8b87925

File tree

6 files changed

+47
-36
lines changed

6 files changed

+47
-36
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ jobs:
2525
with:
2626
ruby-version: '3.3'
2727
- run: script/update_rubygems_and_install_bundler
28-
- run: bundle install --standalone
29-
- run: bundle binstubs --all
28+
- run: script/bundle
3029
- run: script/run_rubocop
3130

3231
test:
@@ -43,9 +42,6 @@ jobs:
4342
- ruby: 3.3
4443
env:
4544
RAILS_VERSION: 'main'
46-
- ruby: 3.2
47-
env:
48-
RAILS_VERSION: 'main'
4945

5046
# Rails 8.1 builds >= 3.2
5147
- ruby: 3.4
@@ -88,6 +84,6 @@ jobs:
8884
ruby-version: ${{ matrix.ruby }}
8985
- run: script/update_rubygems_and_install_bundler
9086
- run: script/clone_all_rspec_repos
91-
- run: bundle install --binstubs
87+
- run: script/bundle
9288
- run: script/run_build
9389
continue-on-error: ${{ matrix.allow_failure || false }}

example_app_generator/ci_retry_bundle_install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ set -e
44
source FUNCTIONS_SCRIPT_FILE
55

66
echo "Starting bundle install using shared bundle path"
7-
ci_retry eval "RUBYOPT=$RUBYOPT:' --enable rubygems' bundle install --gemfile ./Gemfile --path REPLACE_BUNDLE_PATH --retry=3 --jobs=3"
7+
ci_retry eval "bundle config set path REPLACE_BUNDLE_PATH; bundle install --gemfile ./Gemfile --retry=3 --jobs=3"

script/bundle

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
set -e
2+
3+
ROOT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd )"
4+
SCRIPT_DIR="${ROOT_DIR}/script"
5+
source $SCRIPT_DIR/functions.sh
6+
7+
echo "Set bundle path to .bundle/gems"
8+
bundle config set --local path '.bundle/gems'
9+
10+
# We don't run standalone because rails will break
11+
12+
echo "bundle install"
13+
bundle install
14+
15+
echo "bundle binstubs --all"
16+
bundle binstubs --all

script/functions.sh

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,21 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
22
SPECS_HAVE_RUN_FILE=specs.out
33
MAINTENANCE_BRANCH=`cat maintenance-branch`
44

5-
# Don't allow rubygems to pollute what's loaded. Also, things boot faster
6-
# without the extra load time of rubygems. Only works on MRI Ruby 1.9+
7-
export RUBYOPT="--disable=gem"
5+
function is_ruby_3_2_plus {
6+
if ruby -e "exit(RUBY_VERSION.to_f >= 3.2)"; then
7+
return 0
8+
else
9+
return 1
10+
fi
11+
}
12+
13+
function is_ruby_3_3_plus {
14+
if ruby -e "exit(RUBY_VERSION.to_f >= 3.3)"; then
15+
return 0
16+
else
17+
return 1
18+
fi
19+
}
820

921
ci_retry() {
1022
local result=0
@@ -112,13 +124,13 @@ function check_binstubs {
112124
echo "Install missing binstubs using one of the following:"
113125
echo
114126
echo " # Create the missing binstubs"
115-
echo " $ bundle binstubs$gems"
127+
echo " $ bundle binstubs $gems"
116128
echo
117129
echo " # To binstub all gems"
118-
echo " $ bundle install --binstubs"
130+
echo " $ bundle binstubs --all"
119131
echo
120132
echo " # To binstub all gems and avoid loading bundler"
121-
echo " $ bundle install --binstubs --standalone"
133+
echo " $ bundle binstubs --all"
122134
fi
123135

124136
return $success

script/run_build

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ fold "specs" run_specs_and_record_done
1010

1111
fold "acceptance" bin/rake acceptance --trace
1212

13-
fold "snippets" script/run_snippets.sh
13+
if is_ruby_3_2_plus; then
14+
fold "snippets" script/run_snippets.sh
15+
fi
1416

1517
if documentation_enforced; then
1618
fold "doc check" check_documentation_coverage

script/update_rubygems_and_install_bundler

Lines changed: 7 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,16 @@
22
# This file is manually managed unlike the rest of core rspec gems because it is independent.
33

44
set -e
5+
source script/functions.sh
56

6-
function is_ruby_3_plus {
7-
if ruby -e "exit(RUBY_VERSION.to_f >= 3.0)"; then
8-
return 0
9-
else
10-
return 1
11-
fi
12-
}
13-
14-
function is_ruby_3_1_plus {
15-
if ruby -e "exit(RUBY_VERSION.to_f >= 3.1)"; then
16-
return 0
17-
else
18-
return 1
19-
fi
20-
}
21-
22-
23-
if is_ruby_3_1_plus; then
7+
if is_ruby_3_2_plus; then
248
gem update --no-document --system
259
gem install --no-document bundler
26-
elif is_ruby_3_plus; then
27-
gem update --no-document --system '3.5.23'
28-
gem install --no-document bundler
2910
else
3011
gem update --no-document --system '3.4.22'
31-
gem install --no-document bundler
12+
gem install --no-document bundler -v '2.6.9'
13+
14+
# Bring this default gem up to last supported manually
15+
gem uninstall error_highlight -v 0.3.0
16+
gem install error_highlight -v 0.7.0
3217
fi

0 commit comments

Comments
 (0)