Граф коммитов

644 Коммитов

Автор SHA1 Сообщение Дата
Hiroshi SHIBATA 04a2550928 [rubygems/rubygems] Don't use full_required_path and extension_dir under the bundler
https://github.com/rubygems/rubygems/commit/72169288ff
2023-03-15 03:35:55 +00:00
Hiroshi SHIBATA 31137dc67f [rubygems/rubygems] Removed test for
https://github.com/rubygems/rubygems/pull/6444, I have no idea to
migrate this test to bundler example
yet

https://github.com/rubygems/rubygems/commit/0d869019bf
2023-03-15 03:35:54 +00:00
Hiroshi SHIBATA 55a0fbfaf8 [rubygems/rubygems] Move build artifact detection logic for root gemspec to bundler from Gem::Specification.
Gem::Specification#missing_extension? is heavily called from RubyGems.
  We should reduce extra method call from this place.

https://github.com/rubygems/rubygems/commit/e24e59d44d
2023-03-15 03:35:54 +00:00
Ian Ker-Seymer dd47ce10db [rubygems/rubygems] Use `RbSys::ExtensionTask` when creating new rust gems
https://github.com/rubygems/rubygems/commit/125f9fece9
2023-03-10 11:50:06 +00:00
Julie Haehn c5296d9396 [rubygems/rubygems] Respect --no-install option for git: sources
Currently, the --no-install option to `bundle package` is totally
ignored for git sources. This can have very strange effects if you have:

- a git-sourced gem,
- with native extensions,
- whose extconf.rb script depends on another gem,
- which is installed from Rubygems in the gemfile.

In that circumstance, `bundle package --no-install --all` will download
the Rubygems dependencies to `vendor/cache` but NOT install them. It
will also check out the git gems to `vendor/cache` (good), and attempt
to build their native extensions (bad!).

The native extension build will fail because the extconf.rb script crashes,
since the dependency it needs is missing.

I implemented a fix for this in `source/git.rb`, since this is analogous
to what's happening in `source/rubygems.rb`. I do admit though the whole
thing is a little strange though - an "install" method that.... proceeds
to look at a global flag to not install anything.

Add test to confirm cache respects the --no-install flag

https://github.com/rubygems/rubygems/commit/5a77d1c397

Co-authored-by: KJ Tsanaktsidis <kj@kjtsanaktsidis.id.au>
2023-03-07 22:36:36 +00:00
David Rodríguez 93f0749a64 [rubygems/rubygems] Fix gemspec file filter
Explicitly match directory separator to not match files in repo root
accidentally.

https://github.com/rubygems/rubygems/commit/b936805ea9

Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
2023-03-07 16:51:36 +09:00
David Rodríguez 72591eb73f [rubygems/rubygems] Better suggestion when `bundler/setup` fails due to missing gems
If the original `BUNDLE_GEMFILE` is different from the default, then the
suggestion wouldn't work as is.

Before:

```
$ util/rubocop
Could not find rubocop-1.30.1 in locally installed gems
Run `bundle install` to install missing gems.

$  rubygems git:(better-cmd-suggestion) ✗ bundle install
Could not locate Gemfile
```

After:

```
$ util/rubocop
Could not find rubocop-1.30.1 in locally installed gems
Run `bundle install --gemfile /path/to/rubygems/bundler/tool/bundler/lint_gems.rb` to install missing gems.

$ bundle install --gemfile /path/to/rubygems/bundler/tool/bundler/lint_gems.rb
Fetching gem metadata from https://rubygems.org/.........
Using ast 2.4.2
Using bundler 2.4.7
Using parser 3.1.2.0
Using rainbow 3.1.1
Using parallel 1.22.1
Using regexp_parser 2.5.0
Using rubocop-ast 1.18.0
Using rexml 3.2.5
Using ruby-progressbar 1.11.0
Using unicode-display_width 2.1.0
Fetching rubocop 1.30.1
Installing rubocop 1.30.1
Using rubocop-performance 1.14.2
Bundle complete! 2 Gemfile dependencies, 12 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.

$ util/rubocop
Inspecting 345 files
.........................................................................................................................................................................................................................................................................................................................................................

345 files inspected, no offenses detected
```

https://github.com/rubygems/rubygems/commit/bf1320d805
2023-03-07 16:51:36 +09:00
Takashi Kokubun 23ec248e48 s/mjit/rjit/ 2023-03-06 23:44:01 -08:00
Johnny Shields f1fe4a4a99 [rubygems/rubygems] Update current_ruby.rb
https://github.com/rubygems/rubygems/commit/8755ca959e
2023-03-03 09:50:30 +00:00
johnnyshields 79ede4ae99 [rubygems/rubygems] Alias CurrentRuby#mswin?, mswin64?, mingw?, x64_mingw? to #windows?. (This is done instead of logging a deprecation warning.)
https://github.com/rubygems/rubygems/commit/b9fcc7c0ab
2023-03-03 09:50:29 +00:00
Orien Madgwick 573522bd84 [rubygems/rubygems] Simplify the gem package file filter in the gemspec template
The regular expression is difficult to understand at a glance.
Let's replace it with a much simpler string comparison.

https://github.com/rubygems/rubygems/commit/a3745aa03f
2023-03-02 17:05:04 +00:00
Tony Hsu 5f3c7ac196 [rubygems/rubygems] Replace lockfile with `.locked`
https://github.com/rubygems/rubygems/commit/203f3e3802
2023-03-02 14:43:27 +00:00
Ellen Marie Dash d2d521b274 [rubygems/rubygems] Regenerate lockfile if spec list is invalid/empty.
https://github.com/rubygems/rubygems/commit/d2c56315e2
2023-03-02 00:50:58 +00:00
Daniel Colson 62b3bcba5e [rubygems/rubygems] Auto-heal on corrupted lockfile with missing deps
Following up on https://github.com/rubygems/rubygems/pull/6355, which
turned a crash into a nicer error message, this commit auto-heals the
corrupt lockfile instead.

In this particular case (a corrupt Gemfile.lock with missing
dependencies) the LazySpecification will not have accurate dependency
information, we have to materialize the SpecSet to determine there are
missing dependencies. We've already got a way to handle this, via
`SpecSet#incomplete_specs`, but it wasn't quite working for this case
because we'd get to `@incomplete_specs += lookup[name]` and
`lookup[name]` would be empty for the dependency.

With this commit we catch it a bit earlier, marking the parent spec
containing the missing dependency as incomplete.

https://github.com/rubygems/rubygems/commit/486ecb8f20
2023-03-01 02:50:40 +00:00
Mercedes Bernard d5994eb436 [rubygems/rubygems] safe marshal gem specs when inflating
https://github.com/rubygems/rubygems/commit/5c5d0c5350
2023-02-23 08:50:02 +00:00
Mercedes Bernard 3d5ec8401f [rubygems/rubygems] safe marshal gem versions when fetching Marshal.specs.4.8.gz
https://github.com/rubygems/rubygems/commit/23880353c1
2023-02-23 08:50:02 +00:00
Hiroshi SHIBATA 38fa8eb4cb Merge rubygems/bundler master
Pick from e9304aed7e
2023-02-21 19:28:12 +09:00
David Rodríguez a47e1328e6 [rubygems/rubygems] Give a better message when Gemfile branch does not exist
https://github.com/rubygems/rubygems/commit/cb4fc41cbc
2023-02-21 19:28:12 +09:00
John Hawthorn 4064e3e776 [rubygems/rubygems] Update pub_grub
* Replaces the wording of "is forbidden" with "cannot be used"
* Fixes the method signature of VersionRange::Empty#eql?

https://github.com/rubygems/rubygems/commit/8c6b3f130b

Co-authored-by: Daniel Colson <danieljamescolson@gmail.com>
2023-02-21 19:28:12 +09:00
David Rodríguez 8038991583 [rubygems/rubygems] Sync with pub_grub main branch
We became a bit out of sync lately.

https://github.com/rubygems/rubygems/commit/6161a2610a
2023-02-21 19:28:12 +09:00
David Rodríguez e7bf85961d [rubygems/rubygems] Restore better error message when locked ref does not exist
https://github.com/rubygems/rubygems/commit/c8e024359f
2023-02-21 19:28:12 +09:00
Daniel Colson 8edd350bda [rubygems/rubygems] Avoid crashing with a corrupted lockfile
I did a bad thing (script that edits the Gemfile.lock directly) and
ended up with a Gemfile.lock that was completely missing some indirect
dependencies. While this is my fault and an error is reasonable, I
noticed that the error got progressively less friendly in recent
versions of bundler.

Something similar came up in https://github.com/rubygems/rubygems/issues/6210,
and this commit would have helped with that case as well
(although we've already handled this a different way with #6219).

Details:
---

Back on Bundler 2.2.23, a corrupt lockfile like this would cause a helpful error:

```
Unable to find a spec satisfying minitest (>= 5.1) in the set. Perhaps the lockfile is corrupted?
```

Bundler 2.3.26 gave a helpful warning:

```
Warning:
Your lockfile was created by an old Bundler that left some things out.
Because of the missing DEPENDENCIES, we can only install gems one at a time,
instead of installing 16 at a time.
You can fix this by adding the missing gems to your Gemfile, running bundle
install, and then removing the gems from your Gemfile.
The missing gems are:
* minitest depended upon by activesupport
```

But then continued on and crashed while trying to report the unmet
dependency:

```
--- ERROR REPORT TEMPLATE -------------------------------------------------------

NoMethodError: undefined method `full_name' for nil:NilClass
lib/bundler/installer/parallel_installer.rb:127:in `block (2 levels) in check_for_unmet_dependencies'

...
```

Bundler 2.4.0 and up crash as above when jobs=1, but crash
even harder when run in parallel:

```
--- ERROR REPORT TEMPLATE -------------------------------------------------------

fatal: No live threads left. Deadlock?
3 threads, 3 sleeps current:0x00007fa6b6704660 main thread:0x00007fa6b6704660
* #<Thread:0x000000010833b130 sleep_forever>
   rb_thread_t:0x00007fa6b6704660 native:0x0000000108985600 int:0

* #<Thread:0x0000000108dea630@Parallel Installer Worker #0 tmp/1/gems/system/gems/bundler-2.5.0.dev/lib/bundler/worker.rb:90 sleep_forever>
   rb_thread_t:0x00007fa6b67f67c0 native:0x0000700009a62000 int:0

* #<Thread:0x0000000108dea4a0@Parallel Installer Worker #1 tmp/1/gems/system/gems/bundler-2.5.0.dev/lib/bundler/worker.rb:90 sleep_forever>
   rb_thread_t:0x00007fa6b67f63c0 native:0x0000700009c65000 int:0

<internal:thread_sync>:18:in `pop'
tmp/1/gems/system/gems/bundler-2.5.0.dev/lib/bundler/worker.rb:42:in `deq'

...
```

Changes
---

This commit fixes the confusing thread deadlock crash by detecting if
dependencies are missing such that we'll never be able to enqueue. When
that happens we treat it as a failure so the install can finish.

That gets us back to the `NoMethodError`, which this commit fixes by
using a different warning in the case where no spec is found.

https://github.com/rubygems/rubygems/commit/d73001a21d
2023-02-09 10:29:50 +00:00
Daniel Colson 728d2f808e [rubygems/rubygems] Improve wording of unmet dependencies warning
`trying to manually editing` doesn't seem quite grammatically
correct. We could change it to `trying to manually edit` (is that a
split infinitive?), but I don't think `trying to` adds much here so
I've removed it instead so `editing` is the verb.

For the list of dependencies, the wording before this commit seemed to
reverse the dependency. "B, depended on A" sounds like B depends on A
(or did in the past but doesn't anymore?), but that's not correct. I
think there's a missing word: "B, depended on by A", but I find "B,
dependency of A" a bit nicer.

https://github.com/rubygems/rubygems/commit/49a31257e3
2023-02-08 22:20:24 +00:00
Daniel Colson fd71a76f55 [rubygems/rubygems] Add Ruby 3.2 and 3.3 platforms to Gemfile DSL
Along the same lines as https://github.com/rubygems/rubygems/pull/5469,
this adds support for Ruby 3.2 and 3.3 platforms: `:ruby_32`, `mri_32`,
etc.

It also includes a spec that should help catch this earlier in the
future, failing if we don't support platforms for the version of Ruby
that is running the tests.

https://github.com/rubygems/rubygems/commit/7cd19d824d
2023-02-07 21:12:18 +00:00
Akira Matsuda cab8c11611 [rubygems/rubygems] Properly exclude gemspec file itself from gem
by comparing the file names with full path.

Follows up https://github.com/rubygems/rubygems/commit/f444478eaccf

https://github.com/rubygems/rubygems/commit/9637a82d2e
2023-02-06 16:19:46 +00:00
Sam Bostock 45a2f1c5c2 [rubygems/rubygems] Replace "prior to" with "immediately after"
Currently, the instructions and placeholder contradict each other.

The commit that introduced this placeholder (42bc4715d920e836c8499883d)
makes it clear that the placeholder should be replaced AFTER publishing
(i.e. once the author successfully claims the gem name on Rubygems), so
the placeholder should match.

https://github.com/rubygems/rubygems/commit/23e2dea828
2023-02-05 01:37:36 +00:00
Hiroshi SHIBATA d3822c9a8a Merge RubyGems/Bundler master.
Pick from 5ace20dbec
2023-01-31 10:49:08 +09:00
Tim Bates 369ed03cd4 [rubygems/rubygems] Fix issue with extensions not compiling properly using inline gemfile
https://github.com/rubygems/rubygems/commit/fa6e6ea95c
2023-01-31 10:49:08 +09:00
Daniel Colson 8429134d0d [rubygems/rubygems] Don't warn on bundler binstubs --standalone --all
Prior to this commit `bundle binstubs --standalone --all` would output a
warning about not being able to generate a standalone binstub for
bundler.

This warning predates the `--all` option, and I don't think it makes
sense in this context. The warning makes good sense when explicitly
trying to generate a bundler standalone binstub with `bundle binstubs
bundler --standalone`, since that command won't do what the user might
have expected. But `--all` is not specifically asking for bundler, and
having it report each time that the bundler binstubs could not be
generated does not seem particularly helpful. The only way to make that
warning go away would be to stop using `--standalone --all`.

This commit skips the warning when running with the `--all` option.

https://github.com/rubygems/rubygems/commit/e6a72e19eb
2023-01-27 21:06:39 +00:00
Josh Nichols 0cc91871a8 [rubygems/rubygems] Update bundle-exec man page for with_unbundled_env
`with_clean_env` has been deprecated in `with_unbundled_env`. It already generates a deprecation warning when it uses, but this man page was still referring to it.
2023-01-20 13:06:58 +00:00
Hiroshi SHIBATA a43f1d90c2 Merge RubyGems and Bundler master
from 0635c1423d
2023-01-10 15:53:07 +09:00
Hiroshi SHIBATA f2fc7519b7
Removed vendored LICENSE file. 2023-01-10 13:13:06 +09:00
David Rodríguez 2e0159c5f2 [rubygems/rubygems] Fix resolver edge case
Let it deal with legacy gems with equivalent version and different
dependencies.

https://github.com/rubygems/rubygems/commit/b430babe97
2023-01-10 12:58:28 +09:00
yoka 799d805e21 [rubygems/rubygems] Raise invalid option when bundle open --path is called without a value
https://github.com/rubygems/rubygems/commit/c242311158
2023-01-04 13:13:19 +00:00
yoka 87c17a141d [rubygems/rubygems] Enhance bundle open with --path option
https://github.com/rubygems/rubygems/commit/3bf8e59304
2023-01-04 13:13:19 +00:00
Mark Doliner a4e9606da4 [rubygems/rubygems] Remove stray word in bundle config man page.
There was an extra word ("with") in this sentence.

https://github.com/rubygems/rubygems/commit/ad3de5126c
2023-01-01 15:04:43 +00:00
Hiroshi SHIBATA b7ad60a794 Merge RubyGems/Bundler master
from 72fd3dd209
2022-12-26 15:09:21 +09:00
David Rodríguez 8f05e4f54b Update Bundler to 2.4.1 & and RubyGems to 3.4.1 2022-12-25 05:55:36 +09:00
Hiroshi SHIBATA f6620037ba Merge RubyGems-3.4.0 and Bundler-2.4.0 2022-12-24 16:57:07 +09:00
Hiroshi SHIBATA 18ba89093a Merge RubyGems/Bundler master
Pick from ba3adad4d8
2022-12-20 13:15:02 +09:00
Mark Burns 870bcc96ba [rubygems/rubygems] fix
https://github.com/rubygems/rubygems/pull/6147 when --parseable and
--groups used
together

https://github.com/rubygems/rubygems/commit/3b0b95c509
2022-12-20 13:15:02 +09:00
Josef Šimánek 8eb6618013 [rubygems/rubygems] Turn `--ext` option into string. Deprecate usage without explicit value.
- this is preparation for onboarding Rust based extension gem generator

https://github.com/rubygems/rubygems/commit/d32801bdbc
2022-12-20 13:15:02 +09:00
Josef Šimánek eaf0157dd1 [rubygems/rubygems] Regenerate bundler man pages for December 2022.
https://github.com/rubygems/rubygems/commit/17037fe32c
2022-12-20 13:15:02 +09:00
Josef Šimánek f270aa3eda [rubygems/rubygems] Use safe Marshal deserialization for dependency API response. - adds Bundler#safe_load_marshal and Bundler::SAFE_MARSHAL_CLASSES listing safe classes to deserialize
https://github.com/rubygems/rubygems/commit/e947c608cc
2022-12-20 13:15:02 +09:00
David Rodríguez efd103f3e5 [rubygems/rubygems] Fix crash when showing some resolution errors
If the conflict explanation includes empty ranges and version unions,
Pub Grub was crashing.

https://github.com/rubygems/rubygems/commit/eb360b77a2
2022-12-20 13:15:02 +09:00
David Rodríguez 1db9bcfeaf [rubygems/rubygems] Fix crash when building resolution errors with OR requirements
https://github.com/rubygems/rubygems/commit/8f287479bc
2022-12-20 13:15:02 +09:00
David Rodríguez 8293489564 [rubygems/rubygems] Slight tweak to error message building
Let Pub Grub decide how the constraint should be displayed.

https://github.com/rubygems/rubygems/commit/4f651b6429
2022-12-20 13:15:02 +09:00
Michael Siegfried beef72965e [rubygems/rubygems] Clarify flag description
Prerelease versions are already considered in a certain circumstance,
and the 'if updating' is redundant in the update case anyway.

https://github.com/rubygems/rubygems/commit/8d68635f8c
2022-12-20 13:15:02 +09:00
Michael Siegfried c436f52fe8 [rubygems/rubygems] Fix tiny typo
https://github.com/rubygems/rubygems/commit/390e3e1ebd
2022-12-20 13:15:02 +09:00
Michael Siegfried 2bc4f1dea5 [rubygems/rubygems] Support for pre flag in `bundle update`
Passing this flag allows bumping to the current version, even if that
version is prerelease. This works in concert with the current flags.

https://github.com/rubygems/rubygems/commit/a6409e3509
2022-12-20 13:15:02 +09:00