Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
b43844c
[ruby/rubygems] Respect Gemfile bundler setting in `Bundler.setup`
godfat Sep 2, 2021
6337aba
[ruby/rubygems] Fix test to verify Bundler.setup respects custom gemf…
hsbt Mar 24, 2026
e733916
[ruby/rubygems] Bundler: ignore patchlevel kwarg in ruby DSL
tnir Oct 27, 2022
f9bfba4
[ruby/rubygems] Fix patchlevel test failures in platform_spec
hsbt Mar 24, 2026
4eab86e
[ruby/rubygems] Fix patchlevel tests for bundle outdated
hsbt Mar 24, 2026
c02e068
Use build-mode: none for CodeQL C/C++ scanning
hsbt Mar 24, 2026
c98103e
Added example step for filtering false-positive detection and fix com…
hsbt Mar 25, 2026
7ebfb75
Fix dependabot skip condition: remove unnecessary event_name check
hsbt Mar 25, 2026
b6fe69f
Skip YJIT/ZJIT/Rust workflows for dependabot PRs unless Cargo update
hsbt Mar 25, 2026
c69834c
Skip Windows workflows for dependabot PRs unless Vcpkg update
hsbt Mar 25, 2026
0bebc77
Retry IO.select with a longer timeout on flaky platforms (#16542)
k0kubun Mar 25, 2026
48f86bf
[ruby/resolv] Increase DNS resolver timeouts in
k0kubun Mar 25, 2026
336172c
[ruby/rubygems] Workaround a memory corruption issue on Windows Ruby …
Edouard-chin Mar 23, 2026
f90fa18
[ruby/rubygems] feat: default_cli_command for config what command bun…
jonbarlo Jul 29, 2025
eff429b
[ruby/rubygems] code refactor: addresing peer comments
jonbarlo Aug 18, 2025
9c71454
[ruby/rubygems] Fix default_cli_command validation test to accept nil…
hsbt Mar 25, 2026
f045c1a
Bump taiki-e/install-action
dependabot[bot] Mar 25, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/annocheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
|| contains(github.event.head_commit.message, '[DOC]')
|| contains(github.event.pull_request.title, '[DOC]')
|| contains(github.event.pull_request.labels.*.name, 'Documentation')
|| (github.event_name == 'push' && github.event.pull_request.user.login == 'dependabot[bot]')
|| (github.event.pull_request.user.login == 'dependabot[bot]')
)}}

env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/baseruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
|| contains(github.event.head_commit.message, '[DOC]')
|| contains(github.event.pull_request.title, '[DOC]')
|| contains(github.event.pull_request.labels.*.name, 'Documentation')
|| (github.event_name == 'push' && github.event.pull_request.user.login == 'dependabot[bot]')
|| (github.event.pull_request.user.login == 'dependabot[bot]')
)}}

strategy:
Expand Down
38 changes: 14 additions & 24 deletions .github/workflows/check_sast.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,19 +54,16 @@ jobs:
permissions:
actions: read # for github/codeql-action/init to get workflow details
contents: read # for actions/checkout to fetch code
security-events: write # for github/codeql-action/autobuild to send a status report
security-events: write # for github/codeql-action/upload-sarif to send a status report
# CodeQL fails to run pull requests from dependabot due to missing write access to upload results.
if: >-
${{!(false
|| contains(github.event.head_commit.message, '[DOC]')
|| contains(github.event.pull_request.title, '[DOC]')
|| contains(github.event.pull_request.labels.*.name, 'Documentation')
|| (github.event_name == 'push' && github.event.pull_request.user.login == 'dependabot[bot]')
|| (github.event.pull_request.user.login == 'dependabot[bot]')
)}}

env:
enable_install_doc: no

strategy:
fail-fast: false
matrix:
Expand All @@ -80,29 +77,11 @@ jobs:
with:
persist-credentials: false

- name: Install libraries
if: ${{ contains(matrix.os, 'macos') }}
uses: ./.github/actions/setup/macos

- name: Install libraries
if : ${{ matrix.os == 'ubuntu-latest' }}
uses: ./.github/actions/setup/ubuntu

- uses: ./.github/actions/setup/directories

- name: Remove an obsolete rubygems vendored file
if: ${{ matrix.os == 'ubuntu-latest' }}
run: sudo rm /usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb

- name: Initialize CodeQL
uses: github/codeql-action/init@38697555549f1db7851b81482ff19f1fa5c4fedc # v4.34.1
with:
languages: ${{ matrix.language }}
trap-caching: false
debug: true

- name: Autobuild
uses: github/codeql-action/autobuild@38697555549f1db7851b81482ff19f1fa5c4fedc # v4.34.1
build-mode: none

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@38697555549f1db7851b81482ff19f1fa5c4fedc # v4.34.1
Expand Down Expand Up @@ -134,6 +113,17 @@ jobs:
if: ${{ matrix.language == 'ruby' }}
continue-on-error: true

- name: filter-sarif
uses: advanced-security/filter-sarif@2da736ff05ef065cb2894ac6892e47b5eac2c3c0 # v1.1.0.1.1
with:
patterns: |
+**/*.c
+**/*.h
input: sarif-results/${{ matrix.language }}.sarif
output: sarif-results/${{ matrix.language }}.sarif
if: ${{ matrix.language == 'cpp' }}
continue-on-error: true

- name: Upload SARIF
uses: github/codeql-action/upload-sarif@38697555549f1db7851b81482ff19f1fa5c4fedc # v4.34.1
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/compilers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
|| contains(github.event.head_commit.message, '[DOC]')
|| contains(github.event.pull_request.title, '[DOC]')
|| contains(github.event.pull_request.labels.*.name, 'Documentation')
|| (github.event_name == 'push' && github.event.pull_request.user.login == 'dependabot[bot]')
|| (github.event.pull_request.user.login == 'dependabot[bot]')
)}}
steps:
- run: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cygwin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
|| contains(github.event.head_commit.message, '[DOC]')
|| contains(github.event.pull_request.title, '[DOC]')
|| contains(github.event.pull_request.labels.*.name, 'Documentation')
|| (github.event_name == 'push' && github.event.pull_request.user.login == 'dependabot[bot]')
|| (github.event.pull_request.user.login == 'dependabot[bot]')
)}}

steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
|| contains(github.event.head_commit.message, '[DOC]')
|| contains(github.event.pull_request.title, '[DOC]')
|| contains(github.event.pull_request.labels.*.name, 'Documentation')
|| (github.event_name == 'push' && github.event.pull_request.user.login == 'dependabot[bot]')
|| (github.event.pull_request.user.login == 'dependabot[bot]')
)}}

steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/mingw.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ jobs:
|| contains(github.event.head_commit.message, '[DOC]')
|| contains(github.event.pull_request.title, '[DOC]')
|| contains(github.event.pull_request.labels.*.name, 'Documentation')
|| (github.event_name == 'push' && github.event.pull_request.user.login == 'dependabot[bot]')
|| (github.event.pull_request.user.login == 'dependabot[bot]' && !startsWith(github.head_ref, 'dependabot/vcpkg'))
)}}

steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/modgc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
|| contains(github.event.head_commit.message, '[DOC]')
|| contains(github.event.pull_request.title, '[DOC]')
|| contains(github.event.pull_request.labels.*.name, 'Documentation')
|| (github.event_name == 'push' && github.event.pull_request.user.login == 'dependabot[bot]')
|| (github.event.pull_request.user.login == 'dependabot[bot]')
)}}

steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/parse_y.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
|| contains(github.event.head_commit.message, '[DOC]')
|| contains(github.event.pull_request.title, '[DOC]')
|| contains(github.event.pull_request.labels.*.name, 'Documentation')
|| (github.event_name == 'push' && github.event.pull_request.user.login == 'dependabot[bot]')
|| (github.event.pull_request.user.login == 'dependabot[bot]')
)}}

steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/rust-warnings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
|| contains(github.event.head_commit.message, '[DOC]')
|| contains(github.event.pull_request.title, '[DOC]')
|| contains(github.event.pull_request.labels.*.name, 'Documentation')
|| (github.event_name == 'push' && github.event.pull_request.user.login == 'dependabot[bot]')
|| (github.event.pull_request.user.login == 'dependabot[bot]' && !startsWith(github.head_ref, 'dependabot/cargo'))
)}}

steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/spec_guards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
|| contains(github.event.head_commit.message, '[DOC]')
|| contains(github.event.pull_request.title, '[DOC]')
|| contains(github.event.pull_request.labels.*.name, 'Documentation')
|| (github.event_name == 'push' && github.event.pull_request.user.login == 'dependabot[bot]')
|| (github.event.pull_request.user.login == 'dependabot[bot]')
)}}

strategy:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
|| contains(github.event.head_commit.message, '[DOC]')
|| contains(github.event.pull_request.title, '[DOC]')
|| contains(github.event.pull_request.labels.*.name, 'Documentation')
|| (github.event_name == 'push' && github.event.pull_request.user.login == 'dependabot[bot]')
|| (github.event.pull_request.user.login == 'dependabot[bot]')
)}}

steps: &make-steps
Expand Down Expand Up @@ -198,7 +198,7 @@ jobs:
|| contains(github.event.head_commit.message, '[DOC]')
|| contains(github.event.pull_request.title, '[DOC]')
|| contains(github.event.pull_request.labels.*.name, 'Documentation')
|| (github.event_name == 'push' && github.event.pull_request.user.login == 'dependabot[bot]')
|| (github.event.pull_request.user.login == 'dependabot[bot]')
)}}

steps: *make-steps
Expand All @@ -218,7 +218,7 @@ jobs:
|| contains(github.event.head_commit.message, '[DOC]')
|| contains(github.event.pull_request.title, '[DOC]')
|| contains(github.event.pull_request.labels.*.name, 'Documentation')
|| (github.event_name == 'push' && github.event.pull_request.user.login == 'dependabot[bot]')
|| (github.event.pull_request.user.login == 'dependabot[bot]')
)}}

steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/wasm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
|| contains(github.event.head_commit.message, '[DOC]')
|| contains(github.event.pull_request.title, '[DOC]')
|| contains(github.event.pull_request.labels.*.name, 'Documentation')
|| (github.event_name == 'push' && github.event.pull_request.user.login == 'dependabot[bot]')
|| (github.event.pull_request.user.login == 'dependabot[bot]')
)}}

steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
|| contains(github.event.head_commit.message, '[DOC]')
|| contains(github.event.pull_request.title, '[DOC]')
|| contains(github.event.pull_request.labels.*.name, 'Documentation')
|| (github.event_name == 'push' && github.event.pull_request.user.login == 'dependabot[bot]')
|| (github.event.pull_request.user.login == 'dependabot[bot]' && !startsWith(github.head_ref, 'dependabot/vcpkg'))
)}}

name: Windows ${{ matrix.os }}/Visual C++ ${{ matrix.vc }} (${{ matrix.test_task }})
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/wsl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
|| contains(github.event.head_commit.message, '[DOC]')
|| contains(github.event.pull_request.title, '[DOC]')
|| contains(github.event.pull_request.labels.*.name, 'Documentation')
|| (github.event_name == 'push' && github.event.pull_request.user.login == 'dependabot[bot]')
|| (github.event.pull_request.user.login == 'dependabot[bot]')
)}}

steps:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/yjit-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
|| contains(github.event.head_commit.message, '[DOC]')
|| contains(github.event.pull_request.title, '[DOC]')
|| contains(github.event.pull_request.labels.*.name, 'Documentation')
|| (github.event_name == 'push' && github.event.pull_request.user.login == 'dependabot[bot]')
|| (github.event.pull_request.user.login == 'dependabot[bot]' && !startsWith(github.head_ref, 'dependabot/cargo'))
)}}

steps:
Expand Down Expand Up @@ -81,7 +81,7 @@ jobs:
|| contains(github.event.head_commit.message, '[DOC]')
|| contains(github.event.pull_request.title, '[DOC]')
|| contains(github.event.pull_request.labels.*.name, 'Documentation')
|| (github.event_name == 'push' && github.event.pull_request.user.login == 'dependabot[bot]')
|| (github.event.pull_request.user.login == 'dependabot[bot]' && !startsWith(github.head_ref, 'dependabot/cargo'))
)}}

steps:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/yjit-ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
|| contains(github.event.head_commit.message, '[DOC]')
|| contains(github.event.pull_request.title, '[DOC]')
|| contains(github.event.pull_request.labels.*.name, 'Documentation')
|| (github.event_name == 'push' && github.event.pull_request.user.login == 'dependabot[bot]')
|| (github.event.pull_request.user.login == 'dependabot[bot]' && !startsWith(github.head_ref, 'dependabot/cargo'))
)}}

steps:
Expand Down Expand Up @@ -66,7 +66,7 @@ jobs:
|| contains(github.event.head_commit.message, '[DOC]')
|| contains(github.event.pull_request.title, '[DOC]')
|| contains(github.event.pull_request.labels.*.name, 'Documentation')
|| (github.event_name == 'push' && github.event.pull_request.user.login == 'dependabot[bot]')
|| (github.event.pull_request.user.login == 'dependabot[bot]' && !startsWith(github.head_ref, 'dependabot/cargo'))
)}}

steps:
Expand Down Expand Up @@ -121,7 +121,7 @@ jobs:
|| contains(github.event.head_commit.message, '[DOC]')
|| contains(github.event.pull_request.title, '[DOC]')
|| contains(github.event.pull_request.labels.*.name, 'Documentation')
|| (github.event_name == 'push' && github.event.pull_request.user.login == 'dependabot[bot]')
|| (github.event.pull_request.user.login == 'dependabot[bot]' && !startsWith(github.head_ref, 'dependabot/cargo'))
)}}

steps:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/zjit-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
|| contains(github.event.head_commit.message, '[DOC]')
|| contains(github.event.pull_request.title, '[DOC]')
|| contains(github.event.pull_request.labels.*.name, 'Documentation')
|| (github.event_name == 'push' && github.event.pull_request.user.login == 'dependabot[bot]')
|| (github.event.pull_request.user.login == 'dependabot[bot]' && !startsWith(github.head_ref, 'dependabot/cargo'))
)}}

steps:
Expand Down Expand Up @@ -93,7 +93,7 @@ jobs:
rustup install ${{ matrix.rust_version }} --profile minimal
rustup default ${{ matrix.rust_version }}

- uses: taiki-e/install-action@0d865d5cc6d507df4765f1f866bfae8bab4e2a73 # v2.69.7
- uses: taiki-e/install-action@328a871ad8f62ecac78390391f463ccabc974b72 # v2.69.9
with:
tool: nextest@0.9
if: ${{ matrix.test_task == 'zjit-check' }}
Expand Down Expand Up @@ -188,7 +188,7 @@ jobs:
|| contains(github.event.head_commit.message, '[DOC]')
|| contains(github.event.pull_request.title, '[DOC]')
|| contains(github.event.pull_request.labels.*.name, 'Documentation')
|| (github.event_name == 'push' && github.event.pull_request.user.login == 'dependabot[bot]')
|| (github.event.pull_request.user.login == 'dependabot[bot]' && !startsWith(github.head_ref, 'dependabot/cargo'))
)}}

steps:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/zjit-ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
|| contains(github.event.head_commit.message, '[DOC]')
|| contains(github.event.pull_request.title, '[DOC]')
|| contains(github.event.pull_request.labels.*.name, 'Documentation')
|| (github.event_name == 'push' && github.event.pull_request.user.login == 'dependabot[bot]')
|| (github.event.pull_request.user.login == 'dependabot[bot]' && !startsWith(github.head_ref, 'dependabot/cargo'))
)}}

steps:
Expand Down Expand Up @@ -102,7 +102,7 @@ jobs:
|| contains(github.event.head_commit.message, '[DOC]')
|| contains(github.event.pull_request.title, '[DOC]')
|| contains(github.event.pull_request.labels.*.name, 'Documentation')
|| (github.event_name == 'push' && github.event.pull_request.user.login == 'dependabot[bot]')
|| (github.event.pull_request.user.login == 'dependabot[bot]' && !startsWith(github.head_ref, 'dependabot/cargo'))
)}}

steps:
Expand All @@ -119,7 +119,7 @@ jobs:
ruby-version: '3.1'
bundler: none

- uses: taiki-e/install-action@0d865d5cc6d507df4765f1f866bfae8bab4e2a73 # v2.69.7
- uses: taiki-e/install-action@328a871ad8f62ecac78390391f463ccabc974b72 # v2.69.9
with:
tool: nextest@0.9
if: ${{ matrix.test_task == 'zjit-check' }}
Expand Down Expand Up @@ -246,7 +246,7 @@ jobs:
|| contains(github.event.head_commit.message, '[DOC]')
|| contains(github.event.pull_request.title, '[DOC]')
|| contains(github.event.pull_request.labels.*.name, 'Documentation')
|| (github.event_name == 'push' && github.event.pull_request.user.login == 'dependabot[bot]')
|| (github.event.pull_request.user.login == 'dependabot[bot]' && !startsWith(github.head_ref, 'dependabot/cargo'))
)}}

steps:
Expand Down
10 changes: 10 additions & 0 deletions lib/bundler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ def setup(*groups)
# Return if all groups are already loaded
return @setup if defined?(@setup) && @setup

configure_custom_gemfile
definition.validate_runtime!

SharedHelpers.print_major_deprecations!
Expand Down Expand Up @@ -586,6 +587,15 @@ def configure_gem_home_and_path(path = bundle_path)
Bundler.rubygems.clear_paths
end

def configure_custom_gemfile(custom_gemfile = nil)
custom_gemfile ||= Bundler.settings[:gemfile]

if custom_gemfile && !custom_gemfile.empty?
Bundler::SharedHelpers.set_env "BUNDLE_GEMFILE", File.expand_path(custom_gemfile)
reset_settings_and_root!
end
end

def self_manager
@self_manager ||= begin
require_relative "bundler/self_manager"
Expand Down
6 changes: 1 addition & 5 deletions lib/bundler/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,7 @@ def initialize(*args)

current_cmd = args.last[:current_command].name

custom_gemfile = options[:gemfile] || Bundler.settings[:gemfile]
if custom_gemfile && !custom_gemfile.empty?
Bundler::SharedHelpers.set_env "BUNDLE_GEMFILE", File.expand_path(custom_gemfile)
reset_settings = true
end
Bundler.configure_custom_gemfile(options[:gemfile])

# lock --lockfile works differently than install --lockfile
unless current_cmd == "lock"
Expand Down
6 changes: 0 additions & 6 deletions lib/bundler/definition.rb
Original file line number Diff line number Diff line change
Expand Up @@ -487,12 +487,6 @@ def validate_ruby!
"Your Ruby version is #{actual}, but your Gemfile specified #{expected}"
when :engine_version
"Your #{Bundler::RubyVersion.system.engine} version is #{actual}, but your Gemfile specified #{ruby_version.engine} #{expected}"
when :patchlevel
if !expected.is_a?(String)
"The Ruby patchlevel in your Gemfile must be a string"
else
"Your Ruby patchlevel is #{actual}, but your Gemfile specified #{expected}"
end
end

raise RubyVersionMismatch, msg
Expand Down
3 changes: 1 addition & 2 deletions lib/bundler/injector.rb
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,10 @@ def remove(gemfile_path, lockfile_path)
def conservative_version(spec)
version = spec.version
return ">= 0" if version.nil?
segments = version.segments
seg_end_index = version >= Gem::Version.new("1.0") ? 1 : 2

prerelease_suffix = version.to_s.delete_prefix(version.release.to_s) if version.prerelease?
"#{version_prefix}#{segments[0..seg_end_index].join(".")}#{prerelease_suffix}"
"#{version_prefix}#{version.segments[0..seg_end_index].join(".")}#{prerelease_suffix}"
end

def version_prefix
Expand Down
2 changes: 0 additions & 2 deletions lib/bundler/ruby_version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,6 @@ def diff(other)
[:version, versions_string(versions), versions_string(other.versions)]
elsif @input_engine && !matches?(engine_versions, other.engine_gem_version)
[:engine_version, versions_string(engine_versions), versions_string(other.engine_versions)]
elsif patchlevel && (!patchlevel.is_a?(String) || !other.patchlevel.is_a?(String) || !matches?(patchlevel, other.patchlevel))
[:patchlevel, patchlevel, other.patchlevel]
end
end

Expand Down
Loading