Commit graph

21 commits

Author SHA1 Message Date
David Rodríguez
ee2c7bcae5 [rubygems/rubygems] Allow noop bundle install to work on read-only or protected folders
As long as there's nothing new to install and gems are already there.

If not, give a meaningful error about what happened.

This was how things already worked until
345ec45f5a, so this commit partially
reverts that change.

794b0ecb39
2025-02-21 11:31:49 +09:00
David Rodríguez
e59c90118e
[rubygems/rubygems] Raise error when lockfile is missing deps in frozen mode
And avoid installing any gems.

c12700c7e4
2025-02-14 16:13:27 +09:00
David Rodríguez
54f6b787e3 [rubygems/rubygems] Automatically fix lockfile when the API reveals missing deps
92196ccfdb
2024-11-06 13:16:57 +00:00
David Rodríguez
89eba5074e [rubygems/rubygems] Only raise DSLError during Gemfile parsing when it's actually useful
DSLError prints the specific line in a Gemfile where the error was
raised. That's helpful when the error was explicitly raised by the
Gemfile DSL or, in the case it's implicitly raised, when the offending
code lives right in the Gemfile.

If it's an internal error, or something buried dowm in user code called
from the Gemfile, `DSLError` is not helpful since it hides the actual
culprit.

This commit tries to only raise `DSLError` in the cases mentioned above
and otherwise let the original error be raised.

b30ff5a682
2024-09-11 11:28:12 +00:00
David Rodríguez
b00b0d5f8f [rubygems/rubygems] Improve insecure gem overwrite message
7c71dac22e
2024-09-02 14:01:14 +00:00
David Rodriguez
899568cce9 [rubygems/rubygems] Fix error when Bundler installation is corrupted
If one upgrades the default copy of Bundler through `gem update
--system`, and then reinstalls Ruby without removing the previous copy.
Then the new installation will have a correct default bundler gemspec,
but a higher copy installed in site_dir.

This causes a crash when running Bundler and prints the bug report
template.

This could probably be fixed in Ruby install script, by removing any
previous Bundler default copies, but if the problem is already there, I
think it's best to print a proper user error.

ada6de765d
2024-05-13 09:19:45 +00:00
Martin Emde
7f4b271a61 [rubygems/rubygems] Store Checksum::Store indexed by spec.lock_name
34d6c6c72f
2023-12-13 20:28:37 +00:00
David Rodríguez
a131ea39b7
[rubygems/rubygems] Better error when having an insecure install folder
e41156e272
2023-11-08 09:04:28 +09:00
Martin Emde
c667de72ff
[rubygems/rubygems] Improve errors and register checksums reliably
Improve error reporting for checksums, raises a new error class.

Solve for multi-source checksum errors.

Add CHECKSUMS to tool/bundler/(dev|standard|rubocop)26_gems.rb

26ceee0e76

Co-authored-by: Samuel Giddins <segiddins@segiddins.me>
2023-10-23 13:59:01 +09:00
Hiroshi SHIBATA
0a9d51ee9d Migrate our resolver engine to PubGrub
https://github.com/rubygems/rubygems/pull/5960

  Co-authored-by: David Rodríguez <deivid.rodriguez@riseup.net>
2022-11-12 07:40:31 +09:00
Hiroshi SHIBATA
3eca1e438d Merge 16c3535413 2022-09-05 14:37:12 +09:00
David Rodríguez
12a5fa408b Sync RubyGems & Bundler with upstream repo 2022-06-24 10:52:02 +09:00
David Rodríguez
6778d321a7 [rubygems/rubygems] Show better error when previous installation fails to be removed
Instead of guessing on the culprit.

We actually have a helper, `Bundler.rm_rf`, with exactly the behavior
that we want:

* Allow the passed folder to not exist.
* No exception swallowing other than that.

5fa3e6f04a
2022-05-27 17:26:22 +09:00
David Rodriguez
b4a43e4f57
[rubygems/rubygems] Show proper error when previous installation of gem can't be deleted
Instead of showing the bug report template with an error at a random
place.

882ad3ab57
2021-10-25 20:48:51 +09:00
David Rodriguez
00412be204
[rubygems/rubygems] Show a proper error if gem path is not writable
Instead of showing the bug report place with an error at a randome
place.

241854ce73
2021-10-25 20:48:51 +09:00
Tim Sutton
d7c734a27e [rubygems/rubygems] typos in UI messages: fix a couple missing spaces between sentence breaks
5cdda53382
2021-08-31 19:06:14 +09:00
Hiroshi SHIBATA
0e60b59d58 Update the bundler version with master branch 2020-05-13 07:54:37 +09:00
hsbt
59c8d50653 Added bundler as default gems. Revisit [Feature #12733]
* bin/*, lib/bundler/*, lib/bundler.rb, spec/bundler, man/*:
    Merge from latest stable branch of bundler/bundler repository and
    added workaround patches. I will backport them into upstream.
  * common.mk, defs/gmake.mk: Added `test-bundler` task for test suite
    of bundler.
  * tool/sync_default_gems.rb: Added sync task for bundler.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65509 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-02 23:07:56 +00:00
hsbt
7825e8363d Postponing the Bundler merge.
I faced a big issue about Bundler with ruby core.
  I have no time to resolve it issue before 2.5 final release.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61416 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-22 23:08:05 +00:00
hsbt
be7b592912 Update bundled bundler to 1.16.0.
* lib/bundler, spec/bundler: Merge bundler-1.16.0.
  * common.mk: rspec examples of bundler-1.16.0 needs require option.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60603 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-01 23:29:38 +00:00
hsbt
8598f8c2dc Merge bundler to standard libraries.
rubygems 2.7.x depends bundler-1.15.x. This is preparation for
  rubygems and bundler migration.

  * lib/bundler.rb, lib/bundler/*: files of bundler-1.15.4
  * spec/bundler/*: rspec examples of bundler-1.15.4. I applied patches.
    * https://github.com/bundler/bundler/pull/6007
    * Exclude not working examples on ruby repository.
    * Fake ruby interpriter instead of installed ruby.
  * Makefile.in: Added test task named `test-bundler`. This task is only
    working macOS/linux yet. I'm going to support Windows environment later.
  * tool/sync_default_gems.rb: Added sync task for bundler.

  [Feature #12733][ruby-core:77172]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59779 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-09-08 08:45:41 +00:00