| Age | Commit message (Collapse) | Author |
|
I stumbled across a bundler bug that had me scratching my head for
awhile, because I hadn't experienced it before.
In some cases when changing the source in a gemfile from a
`Source::Gemspec` to either a `Source::Path` or `Source::Git` only the
parent gem will have it's gem replaced and updated and the child
components will retain the original version. This only happens if the gem
version of the `Source::Gemspec` and `Source::Git` are the same. It also
requires another gem to share a dependency with the one being updated.
For example if I have the following gemfile:
```
gem "rails", "~> 8.1.1"
gem "propshaft"
```
Rails has a component called `actionpack` which `propshaft` depends on.
If I change `rails` to point at a git source (or path source), only the
path for `rails` gets updated:
```
gem "rails", github: "rails/rails", branch: "8-1-stable"
gem "propshaft"
```
Because `actionpack` is a dependency of `propshaft`, it will remain in
the rubygems source in the lock file WHILE the other gems are correctly
pointing to the git source.
Gemfile.lock:
```
GIT
remote: https://github.com/rails/rails.git
revision: https://github.com/ruby/rubygems/commit/9439f463e0ef
branch: 8-1-stable
specs:
actioncable (8.1.1)
...
actionmailbox (8.1.1)
...
actionmailer (8.1.1)
...
actiontext (8.1.1)
...
activejob (8.1.1)
...
activemodel (8.1.1)
...
activerecord (8.1.1)
...
activestorage (8.1.1)
...
rails (8.1.1)
...
railties (8.1.1)
...
GEM
remote: https://rubygems.org/
specs:
action_text-trix (2.1.15)
railties
actionpack (8.1.1) <===== incorrectly left in Rubygems source
...
```
The gemfile will contain `actionpack` in the rubygems source, but will
be missing in the git source so the path will be incorrect. A bundle
show on Rails will point to the correct place:
```
$ bundle show rails
/Users/eileencodes/.gem/ruby/3.4.4/bundler/gems/rails-9439f463e0ef
```
but a bundle show on actionpack will be incorrect:
```
$ bundle show actionpack
/Users/eileencodes/.gem/ruby/3.4.4/gems/actionpack-8.1.1
```
This bug requires the following to reproduce:
1) A gem like Rails that contains components that are released as their
own standalone gem is added to the gemfile pointing to rubygems
2) A second gem is added that depends on one of the gems in the first
gem (like propshaft does on actionpack)
3) The Rails gem is updated to use a git source, pointing to the same
version that is being used by rubygems (ie 8.1.1)
4) `bundle` will only update the path for Rails component gems if no
other gem depends on it.
This incorrectly leaves Rails (or any gem like it) using two different
codepaths / gem source code.
https://github.com/ruby/rubygems/commit/dff76ba4f6
|
|
|
|
This is a first pass to improve the way errors are handled and raised in
bundler's tests. The goal is to clean up tests and modernize them -
these were some obvious areas that could be cleaned up.
- Instead of raising "ZOMG" in the load error tests, it now tests for
the actual error and gem raising.
- Improve error messages where applicable.
- All errors raise a specific error class, rather than falling back to a
default and just setting a message.
- Removed arguments and `bundle_dir` option from `TheBundle` class as it wasn't
actually used so therefore we don't need to raise an error for extra
arguments.
- Removed error from `BundlerBuilder`, as it won't work if it's not
`bundler`, also it never uses `name`. The only reaon `name` is passed
in is because of metaprogramming on loading the right builder. I
think that should eventually be refactored.
- Replaced and removed `update_repo3` and `update_repo4` in favor of
just `build_repo3` and `build_repo4`. Rather than tell someone writing
tests to use a different method, automatically use the right method.
https://github.com/ruby/rubygems/commit/68c39c8451
|
|
https://github.com/ruby/rubygems/commit/d3baf4110e
|
|
https://github.com/ruby/rubygems/commit/9b169c700f
|
|
https://github.com/ruby/rubygems/commit/33c7a9a565
|
|
https://github.com/rubygems/rubygems/commit/29a12c3d46
|
|
https://github.com/rubygems/rubygems/commit/b9960f2c6a
Co-authored-by: David Rodríguez <2887858+deivid-rodriguez@users.noreply.github.com>
|
|
And make it a standard setting.
https://github.com/rubygems/rubygems/commit/17e356fa94
|
|
If using a gem with precompiled versions having different dependencies
than the generic version from a path source, and with a lockfile
including a precompiled version, we would materialize the
generic version, but end up using dependencies for the precompiled
version. That will result in the parallel installer missing the
specifications for the extra dependencies of the generic version,
causing a crash.
If we are materializing for installation, make sure we use the
materialized specification when traversing dependencies.
https://github.com/rubygems/rubygems/commit/5f75d75de7
|
|
https://github.com/rubygems/rubygems/commit/8f9d6c54a1
|
|
https://github.com/rubygems/rubygems/commit/573ffad3ea
|
|
https://github.com/rubygems/rubygems/commit/05199ae0c1
|
|
To save some unnecessary `bundle install` commands.
https://github.com/rubygems/rubygems/commit/61e7d9d09a
|
|
Since the lowest supported version is now 3.4.1.
https://github.com/rubygems/rubygems/commit/d00e03c52e
|
|
there's no lockfile
The generic Ruby platform was getting unconditionally added in
truffleruby, preventing resolution in situations where there's no
generic ruby version (sorbet-static). Instead, the generic platform
should be considered per dependency, not globally.
https://github.com/rubygems/rubygems/commit/a96afc5351
|
|
When we need to reset system gems during specs, there's no need to
rebuild bundler, we can copy over the original gem home.
https://github.com/rubygems/rubygems/commit/7b4f80747b
|
|
Since now every functionality that changes in Bundler 4 is under a
setting, we can enable that setting to test the new functionality,
without having to run our full CI twice.
This can actually be seen as increasing coverage, because Bundler 4
functionality will now be tested on Windows, MacOS, or any other
environment where previously "Bundler 4 mode" was not running.
https://github.com/rubygems/rubygems/commit/1cb3e009fc
|
|
These specs load artifice before Bundler boots because of their global
rubygems source. Artifice in turn loads `rack`, `rack-test`, and
`tmpdir` which in turn load `fileutils`.
Because of this, a missing `require` of `fileutils` in RubyGems would
not be caught by specs.
Loading artifice is not necessary for most of these specs, so remove the
global source to avoid it.
https://github.com/rubygems/rubygems/commit/aad871c997
|
|
expectations
https://github.com/rubygems/rubygems/commit/2eaada3508
|
|
|
|
https://github.com/rubygems/rubygems/commit/28b6a7cf5e
|
|
The "ignore" attribute is a RubyGems thing to mark when a installed gem
should be ignored for activation because its extensions are not properly
compiled.
In the case of gems from path sources, the warning is not accurate
because extensions are compiled into the local lib path, which is not
where RubyGems leaves its sentinel `gem.build_complete` file.
Also, there's a single version of each gem in the path source available
to Bundler, so we always certainly want to consider that for activation
and never makes sense to ignore it.
https://github.com/rubygems/rubygems/commit/ec5d33695e
|
|
https://github.com/rubygems/rubygems/commit/bb13f4e702
|
|
Rails
If you have
```
gem "rails", git: "https://github.com/rails/rails"
```
and then explicitly pin to an older ref, like
```
gem "rails", git: "https://github.com/rails/rails", ref: "https://github.com/rubygems/rubygems/commit/99bacb5aa8e5"
```
Then `bundle install` fails, because locked sources fail to be updated
to use the new source.
This commit fixes the problem by making sure get their source properly
replaced.
https://github.com/rubygems/rubygems/commit/5de8c2e0cf
|
|
x64-mingw-ucrt (platforms)
- the x64-mingw32 platform has been superseded by x64-mingw-ucrt
- the mingw-ucrt platform is present as of Windows 10, which was released 10 years ago in 2015 and all versions prior to 10 are end-of-life and 10 will be by mid October 2025
- newer rubies use the mingw-ucrt platform instead of the mingw32 platform, meaning using the deprecated platform can cause issues during gem installation
https://github.com/rubygems/rubygems/commit/b9d871022e
|
|
have changed
Since we will now add it back if the final resolution is compatible, we
can also get this kind of edge case (`bundle add`) working.
https://github.com/rubygems/rubygems/commit/cdc5ebec77
|
|
This reverts commit eb91c664dc0b4d69db09ae913f2d7a5ef3490d74.
Notes:
Merged: https://github.com/ruby/ruby/pull/12968
|
|
missing
https://github.com/rubygems/rubygems/commit/054a0cd76c
Notes:
Merged: https://github.com/ruby/ruby/pull/12968
|
|
https://github.com/rubygems/rubygems/commit/e891be9197
Notes:
Merged: https://github.com/ruby/ruby/pull/12968
|
|
* Increase timeout to fix flaky tests?
* Fix bundler test - wording changed.
expect "fatal: Remote branch deadbeef not found in upstream origin" to
include "Revision deadbeef does not exist in the repository"
Notes:
Merged-By: ioquatix <samuel@codeotaku.com>
|
|
Because it does not swallow errors if it fails to remove the given
folders, making issues easier to debug.
https://github.com/rubygems/rubygems/commit/0db12d7afc
|
|
This has the following benefits:
* Avoid duplicated work in some specs that first build a repo, and then
overwrite it with a completely different set of gems.
* Reduce RSpec nesting and improve readability.
* The change also made surfaces several specs that were incorrect since
they were unintentionally not testing the right thing.
https://github.com/rubygems/rubygems/commit/ed430883e0
|
|
https://github.com/rubygems/rubygems/commit/ffabab65f2
|
|
https://github.com/rubygems/rubygems/commit/aee52d2874
Co-authored-by: johnnyshields <27655+johnnyshields@users.noreply.github.com>
|
|
https://github.com/rubygems/rubygems/commit/96496e3f53
Co-authored-by: Johnny Shields <johnny.shields@gmail.com>
|
|
I think they add unnecessary indirection and inconsistency to the specs.
https://github.com/rubygems/rubygems/commit/609924d985
|
|
https://github.com/rubygems/rubygems/commit/d24c0c20e3
|
|
https://github.com/rubygems/rubygems/commit/faaa594a4a
|
|
lockfile unless necessary
Even if they don't match the current Ruby version, they could still work
in other rubies. So it's better to keep them.
https://github.com/rubygems/rubygems/commit/9a3e583b0c
Notes:
Merged: https://github.com/ruby/ruby/pull/12568
|
|
https://github.com/rubygems/rubygems/commit/bc2537de71
|
|
https://github.com/rubygems/rubygems/commit/f68a2c30bb
|
|
platform
Using an old bundler version was necessary at the beginning because we
checked the version of Bundler being run in order to enable the new
behavior. But we removed that a long time ago and now we only look at
whether the lockfile only includes "ruby" as a platform or not.
https://github.com/rubygems/rubygems/commit/8fc3d38ff3
|
|
https://github.com/rubygems/rubygems/commit/99b4ac4548
|
|
"ruby" platform
https://github.com/rubygems/rubygems/commit/4168a7f488
|
|
Ruby's -w flag
When using the `bundler/setup` entrypoint, Bundler prints the following
warnings in JRuby in `-w` is passed to Ruby.
```
/path/to/bundler/shared_helpers.rb:10: warning: constant Bundler::WINDOWS is deprecated
/path/to/bundler/shared_helpers.rb:11: warning: constant Bundler::FREEBSD is deprecated
/path/to/bundler/lib/bundler/shared_helpers.rb:12: warning: constant Bundler::NULL is deprecated
```
This does not happen in CRuby.
This seems like a JRuby bug but we can skip it by autoloading the
constants.
https://github.com/rubygems/rubygems/commit/761ca29fa2
|
|
Signed-off-by: Samuel Giddins <segiddins@segiddins.me>
https://github.com/rubygems/rubygems/commit/06eec6d855
|
|
Turns out we were not running specs on JRuby, so we introduced a
failure. Seems fine to skip.
https://github.com/rubygems/rubygems/commit/4e2d6affb3
|
|
using local overrides
https://github.com/rubygems/rubygems/commit/0a6c1c53ce
|
|
git sources
`version` is actually an attribute of the dependency, not of the git
source. Sometimes it's passed to the git source to be able to fake a
gemspec in case there's no gemspec in the source, but it should not be
used for source comparison.
https://github.com/rubygems/rubygems/commit/d936fbd78e
|