Skip to content

Honor $BUNDLE_JOBS for bundle install - #957

Merged
eregon merged 1 commit into
ruby:masterfrom
NopeCharon:honor-bundle-jobs
Nov 17, 2026
Merged

eregon merged 1 commit into
ruby:masterfrom
NopeCharon:honor-bundle-jobs

Conversation

@NopeCharon

Copy link
Copy Markdown
Contributor

bundle install is always run with an explicit --jobs N (the number of available processors, up to 8).
Bundler stores command-line options as temporary settings, which take precedence over all other configuration sources, so this silently overrides any BUNDLE_JOBS set by the user, and there is currently no way to e.g. disable parallel installation.

This PR only passes --jobs when $BUNDLE_JOBS is not set, so it can be configured like other Bundler settings through BUNDLE_* environment variables, as recommended in the README. The default behavior is unchanged.
I also documented the default number of jobs and how to change it in the bundle config section of the README.

I checked it by running the action locally (in an ubuntu:24.04 container, Ruby 3.4.12, bundler-cache: true):

  • without BUNDLE_JOBS: bundle install --jobs 8 (unchanged)
  • with BUNDLE_JOBS=1: bundle install, so Bundler uses jobs: 1 from the environment (before this change it was still bundle install --jobs 8)

@eregon eregon left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks!

@eregon
eregon enabled auto-merge (rebase) November 17, 2026 19:54
bundle install was always invoked with an explicit `--jobs N` (the number
of available processors, capped at 8). Since Bundler stores command-line
options as temporary settings, which take precedence over every other
configuration source, this silently overrode any `BUNDLE_JOBS` set by the
user, making it impossible to e.g. disable parallel installation.

Only pass `--jobs` when `BUNDLE_JOBS` is not set, so that the `BUNDLE_*`
environment variables recommended in the README for configuring Bundler
also work for the number of jobs.

Fixes ruby#673
@eregon
eregon merged commit 1bb4f9b into ruby:master Nov 17, 2026
236 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bundle install should honor BUNDLE_JOBS configuration

2 participants