Skip to content

Commit 4015e55

Browse files
Merge pull request #4340 from rubygems/release/bundler_2.2.8_rubygems_3.2.8
Prepare rubygems 3.2.8 and bundler 2.2.8
2 parents 7bc7ecb + 0e52622 commit 4015e55

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+545
-244
lines changed

.github/workflows/ubuntu-rubygems.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ jobs:
2424
- { name: "3.0", value: 3.0.0 }
2525
- { name: jruby-9.2, value: jruby-9.2.14.0 }
2626
- { name: truffleruby-20.3, value: truffleruby-20.3.0 }
27-
env:
28-
TRUFFLERUBYOPT: "--experimental-options --testing-rubygems"
2927
steps:
3028
- uses: actions/checkout@v2
3129
- name: Setup ruby
@@ -37,4 +35,12 @@ jobs:
3735
run: rake setup
3836
- name: Run Test
3937
run: rake test
38+
if: "!startsWith(matrix.ruby.name, 'truffleruby') && !startsWith(matrix.ruby.name, 'jruby')"
39+
- name: Run Test (JRuby)
40+
run: JRUBY_OPTS=--debug rake test
41+
if: startsWith(matrix.ruby.name, 'jruby')
42+
- name: Run Test (Truffleruby)
43+
run: TRUFFLERUBYOPT="--experimental-options --testing-rubygems" rake test
44+
if: startsWith(matrix.ruby.name, 'truffleruby')
45+
4046
timeout-minutes: 60

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
# 3.2.8 / 2021-02-02
2+
3+
## Bug fixes:
4+
5+
* Fix `gem install` crashing on gemspec with nil required_ruby_version.
6+
Pull request #4334 by pbernays
7+
18
# 3.2.7 / 2021-01-26
29

310
## Bug fixes:

Manifest.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ bundler/lib/bundler/templates/Executable.bundler
189189
bundler/lib/bundler/templates/Executable.standalone
190190
bundler/lib/bundler/templates/Gemfile
191191
bundler/lib/bundler/templates/gems.rb
192+
bundler/lib/bundler/templates/newgem/CHANGELOG.md.tt
192193
bundler/lib/bundler/templates/newgem/CODE_OF_CONDUCT.md.tt
193194
bundler/lib/bundler/templates/newgem/Gemfile.tt
194195
bundler/lib/bundler/templates/newgem/LICENSE.txt.tt
@@ -511,6 +512,7 @@ test/rubygems/child_key.pem
511512
test/rubygems/client.pem
512513
test/rubygems/data/gem-private_key.pem
513514
test/rubygems/data/gem-public_cert.pem
515+
test/rubygems/data/null-required-ruby-version.gemspec.rz
514516
test/rubygems/data/null-required-rubygems-version.gemspec.rz
515517
test/rubygems/data/null-type.gemspec.rz
516518
test/rubygems/encrypted_private_key.pem

Rakefile

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -52,20 +52,16 @@ RDoc::Task.new :rdoc => 'docs', :clobber_rdoc => 'clobber_docs' do |doc|
5252
doc.rdoc_dir = 'doc'
5353
end
5454

55-
begin
56-
require "automatiek"
57-
58-
Automatiek::RakeTask.new("molinillo") do |lib|
59-
lib.version = "0.7.0"
60-
lib.download = { :github => "https://github.com/CocoaPods/Molinillo" }
61-
lib.namespace = "Molinillo"
62-
lib.prefix = "Gem::Resolver"
63-
lib.vendor_lib = "lib/rubygems/resolver/molinillo"
64-
end
65-
rescue LoadError
66-
namespace :vendor do
67-
task(:molinillo) { abort "Install the automatiek gem to be able to vendor gems." }
68-
end
55+
load "util/automatiek.rake"
56+
57+
# We currently ship Molinillo master branch as of
58+
# https://github.com/CocoaPods/Molinillo/commit/7cc27a355e861bdf593e2cde7bf1bca3daae4303
59+
Automatiek::RakeTask.new("molinillo") do |lib|
60+
lib.version = "master"
61+
lib.download = { :github => "https://github.com/CocoaPods/Molinillo" }
62+
lib.namespace = "Molinillo"
63+
lib.prefix = "Gem::Resolver"
64+
lib.vendor_lib = "lib/rubygems/resolver/molinillo"
6965
end
7066

7167
namespace :rubocop do

bundler/CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
# 2.2.8 (February 2, 2021)
2+
3+
## Enhancements:
4+
5+
- Add a CHANGELOG.md file to gems generated by `bundle gem` [#4093](https://github.com/rubygems/rubygems/pull/4093)
6+
- Support gemified `set` [#4297](https://github.com/rubygems/rubygems/pull/4297)
7+
8+
## Bug fixes:
9+
10+
- Fix standalone Kernel.require visibility [#4337](https://github.com/rubygems/rubygems/pull/4337)
11+
12+
## Performance:
13+
14+
- Fix resolver edge cases and speed up bundler [#4277](https://github.com/rubygems/rubygems/pull/4277)
15+
116
# 2.2.7 (January 26, 2021)
217

318
## Enhancements:

bundler/Rakefile

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -153,13 +153,10 @@ namespace :man do
153153
end
154154
end
155155

156-
load "task/automatiek.rake"
156+
load "../util/automatiek.rake"
157157

158158
# We currently ship Molinillo master branch as of
159-
# https://github.com/CocoaPods/Molinillo/commit/0f3d33d004214f5e3a426c3382c4af37bc3f27e5,
160-
# plus the following changes:
161-
# * Properly print requirements (https://github.com/CocoaPods/Molinillo/pull/149).
162-
# * Allow custom comparison of dependencies (https://github.com/CocoaPods/Molinillo/pull/150).
159+
# https://github.com/CocoaPods/Molinillo/commit/7cc27a355e861bdf593e2cde7bf1bca3daae4303
163160
desc "Vendor a specific version of molinillo"
164161
Automatiek::RakeTask.new("molinillo") do |lib|
165162
lib.version = "master"
@@ -171,7 +168,7 @@ end
171168

172169
desc "Vendor a specific version of thor"
173170
Automatiek::RakeTask.new("thor") do |lib|
174-
lib.version = "v1.0.1"
171+
lib.version = "v1.1.0"
175172
lib.download = { :github => "https://github.com/erikhuda/thor" }
176173
lib.namespace = "Thor"
177174
lib.prefix = "Bundler"

bundler/lib/bundler/cli.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -586,6 +586,7 @@ def viz
586586
method_option :git, :type => :boolean, :default => true, :desc => "Initialize a git repo inside your library."
587587
method_option :mit, :type => :boolean, :desc => "Generate an MIT license file. Set a default with `bundle config set --global gem.mit true`."
588588
method_option :rubocop, :type => :boolean, :desc => "Add rubocop to the generated Rakefile and gemspec. Set a default with `bundle config set --global gem.rubocop true`."
589+
method_option :changelog, :type => :boolean, :desc => "Generate changelog file. Set a default with `bundle config set --global gem.changelog true`."
589590
method_option :test, :type => :string, :lazy_default => Bundler.settings["gem.test"] || "", :aliases => "-t", :banner => "Use the specified test framework for your library",
590591
:desc => "Generate a test directory for your library, either rspec, minitest or test-unit. Set a default with `bundle config set --global gem.test (rspec|minitest|test-unit)`."
591592
method_option :ci, :type => :string, :lazy_default => Bundler.settings["gem.ci"] || "",

bundler/lib/bundler/cli/gem.rb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,18 @@ def run
142142
templates.merge!("CODE_OF_CONDUCT.md.tt" => "CODE_OF_CONDUCT.md")
143143
end
144144

145+
if ask_and_set(:changelog, "Do you want to include a changelog?",
146+
"A changelog is a file which contains a curated, chronologically ordered list of notable " \
147+
"changes for each version of a project. To make it easier for users and contributors to" \
148+
" see precisely what notable changes have been made between each release (or version) of" \
149+
" the project. Whether consumers or developers, the end users of software are" \
150+
" human beings who care about what's in the software. When the software changes, people " \
151+
"want to know why and how. see https://keepachangelog.com")
152+
config[:changelog] = true
153+
Bundler.ui.info "Changelog enabled in config"
154+
templates.merge!("CHANGELOG.md.tt" => "CHANGELOG.md")
155+
end
156+
145157
if ask_and_set(:rubocop, "Do you want to add rubocop as a dependency for gems you generate?",
146158
"RuboCop is a static code analyzer that has out-of-the-box rules for many " \
147159
"of the guidelines in the community style guide. " \

bundler/lib/bundler/definition.rb

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# frozen_string_literal: true
22

33
require_relative "lockfile_parser"
4-
require "set"
54

65
module Bundler
76
class Definition
@@ -259,23 +258,18 @@ def dependencies_for(groups)
259258
def resolve
260259
@resolve ||= begin
261260
last_resolve = converge_locked_specs
262-
resolve =
263-
if Bundler.frozen_bundle?
264-
Bundler.ui.debug "Frozen, using resolution from the lockfile"
265-
last_resolve
266-
elsif !unlocking? && nothing_changed?
267-
Bundler.ui.debug("Found no changes, using resolution from the lockfile")
268-
last_resolve
269-
else
270-
# Run a resolve against the locally available gems
271-
Bundler.ui.debug("Found changes from the lockfile, re-resolving dependencies because #{change_reason}")
272-
expanded_dependencies = expand_dependencies(dependencies + metadata_dependencies, @remote)
273-
last_resolve.merge Resolver.resolve(expanded_dependencies, index, source_requirements, last_resolve, gem_version_promoter, additional_base_requirements_for_resolve, platforms)
274-
end
275-
276-
# filter out gems that _can_ be installed on multiple platforms, but don't need
277-
# to be
278-
resolve.for(expand_dependencies(dependencies, true), [], false, false, false)
261+
if Bundler.frozen_bundle?
262+
Bundler.ui.debug "Frozen, using resolution from the lockfile"
263+
last_resolve
264+
elsif !unlocking? && nothing_changed?
265+
Bundler.ui.debug("Found no changes, using resolution from the lockfile")
266+
last_resolve
267+
else
268+
# Run a resolve against the locally available gems
269+
Bundler.ui.debug("Found changes from the lockfile, re-resolving dependencies because #{change_reason}")
270+
expanded_dependencies = expand_dependencies(dependencies + metadata_dependencies, @remote)
271+
Resolver.resolve(expanded_dependencies, index, source_requirements, last_resolve, gem_version_promoter, additional_base_requirements_for_resolve, platforms)
272+
end
279273
end
280274
end
281275

@@ -604,7 +598,7 @@ def dependencies_for_source_changed?(source, locked_source = source)
604598
deps_for_source = @dependencies.select {|s| s.source == source }
605599
locked_deps_for_source = @locked_deps.values.select {|dep| dep.source == locked_source }
606600

607-
Set.new(deps_for_source) != Set.new(locked_deps_for_source)
601+
deps_for_source.sort != locked_deps_for_source.sort
608602
end
609603

610604
def specs_for_source_changed?(source)
@@ -884,7 +878,7 @@ def expand_dependencies(dependencies, remote = false)
884878
dependencies.each do |dep|
885879
dep = Dependency.new(dep, ">= 0") unless dep.respond_to?(:name)
886880
next unless remote || dep.current_platform?
887-
target_platforms = dep.gem_platforms(remote ? Resolver.sort_platforms(@platforms) : [generic_local_platform])
881+
target_platforms = dep.gem_platforms(remote ? @platforms : [generic_local_platform])
888882
deps += expand_dependency_with_platforms(dep, target_platforms)
889883
end
890884
deps

bundler/lib/bundler/index.rb

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# frozen_string_literal: true
22

3-
require "set"
4-
53
module Bundler
64
class Index
75
include Enumerable
@@ -65,11 +63,14 @@ def search(query, base = nil)
6563
def unsorted_search(query, base)
6664
results = local_search(query, base)
6765

68-
seen = results.map(&:full_name).to_set unless @sources.empty?
66+
seen = results.map(&:full_name).uniq unless @sources.empty?
6967

7068
@sources.each do |source|
7169
source.unsorted_search(query, base).each do |spec|
72-
results << spec if seen.add?(spec.full_name)
70+
next if seen.include?(spec.full_name)
71+
72+
seen << spec.full_name
73+
results << spec
7374
end
7475
end
7576

@@ -170,7 +171,7 @@ def ==(other)
170171
def dependencies_eql?(spec, other_spec)
171172
deps = spec.dependencies.select {|d| d.type != :development }
172173
other_deps = other_spec.dependencies.select {|d| d.type != :development }
173-
Set.new(deps) == Set.new(other_deps)
174+
deps.sort == other_deps.sort
174175
end
175176

176177
def add_source(index)

0 commit comments

Comments
 (0)