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

1391 Коммитов

Автор SHA1 Сообщение Дата
Ellen Marie Dash 5549dd2c12 [rubygems/rubygems] [SpecFetcher] Change < to <= like it should be.
https://github.com/rubygems/rubygems/commit/3d5135e69b
2024-10-24 00:55:30 +00:00
Ellen Marie Dash 60d8435418 [rubygems/rubygems] [SpecFetcher] Avoid unneeded string allocation.
https://github.com/rubygems/rubygems/commit/1024505d8e
2024-10-23 20:03:15 +00:00
Ellen Marie Dash ab7c800ea8 [rubygems/rubygems] [SpecFetcher] Bail before calling available_specs()
https://github.com/rubygems/rubygems/commit/0719921af4
2024-10-23 20:03:15 +00:00
Ellen Marie Dash 0f5941a5dd [rubygems/rubygems] Replace .map{...}.compact with .filter_map {...}
https://github.com/rubygems/rubygems/commit/18c4ea7d00
2024-10-23 20:03:15 +00:00
Ellen Marie Dash 65fd8606a9 [rubygems/rubygems] Add another bail-early condition to suggest_gems_from_name(), with test.
https://github.com/rubygems/rubygems/commit/7bb7c0ac2d
2024-10-23 20:03:14 +00:00
Ellen Marie Dash ff749d9956 [rubygems/rubygems] Optimize when suggest_gems_from_name finds an exact match.
https://github.com/rubygems/rubygems/commit/6c67298584
2024-10-23 20:03:14 +00:00
Ellen Marie Dash fe66eee1a0 [rubygems/rubygems] Document suggest_gems_from_name()
https://github.com/rubygems/rubygems/commit/8f9983cc21
2024-10-23 20:03:13 +00:00
Ellen Marie Dash 35f0b7c83f [rubygems/rubygems] [suggest_gems_from_name] Bail early if the value is guaranteed to be rejected.
https://github.com/rubygems/rubygems/commit/56262a9384
2024-10-23 20:03:13 +00:00
Leo Arnold e9e66f74e3 [rubygems/rubygems] Add missing comma in documentation
https://github.com/rubygems/rubygems/commit/fe9999f2cf
2024-10-16 21:56:56 +00:00
David Rodríguez 8240fe88f3 [rubygems/rubygems] Prevent some test suite warnings about missing extensions
We fixed some issues recently where Bundler would try to activate a
pysch spec with missing extensions and crash. However, as a side effect,
we started printing warnings about missing extensions in situations
where we did not warn before.

It may be interesting to warn on these new situations too, but in order
to minimize changes for now, I'm reverting to printing warnings in the
same situations as before.

https://github.com/rubygems/rubygems/commit/51ebff6982
2024-10-14 19:43:39 +00:00
David Rodríguez 48fdb9faa0 [rubygems/rubygems] Fix `gem contents` for default gems
A default gem does not always live in the same place. For example,
Bundler may be installed to `site_dir` when RubyGems have been upgraded.

A more reliable way seems to actually activate the default gem, so that
we can know for sure where it lives.

https://github.com/rubygems/rubygems/commit/c69f6dfb18
2024-10-14 17:51:24 +00:00
David Rodríguez 57404e4369 [rubygems/rubygems] Fix duplicated specs when they have been previously activated
https://github.com/rubygems/rubygems/commit/b44bf2ac74
2024-10-14 14:51:20 +00:00
David Rodríguez 1ad990a366 [rubygems/rubygems] Only pristine executables for default gems
https://github.com/rubygems/rubygems/commit/1cfc1d626c
2024-10-10 19:46:44 +00:00
David Rodríguez d12c8cbf14 [rubygems/rubygems] Fix `gem pristine etc` resetting gem twice sometimes
If a default version and a regular version of etc are present at the
same time, RubyGems will end up duplicating work and running pristine
twice.

The `etc` gem is special because it's loaded by RubyGems by default.
When doing this, RubyGems will activate the regularly installed version.
The when `gem pristine` runs, it will find to installed specifications
but materialize both to the already activated specification.

Before:

```
$ gem pristine etc --version 1.4.3
Restoring gems to pristine condition...
Building native extensions. This could take a while...
Restored etc-1.4.3
Building native extensions. This could take a while...
Restored etc-1.4.3
```

After:

```
$ gem pristine etc --version 1.4.3
Restoring gems to pristine condition...
Skipped etc-1.4.3, it is a default gem
Building native extensions. This could take a while...
Restored etc-1.4.3
```

https://github.com/rubygems/rubygems/commit/5c279ac56b
2024-10-10 14:54:04 +00:00
David Rodríguez 3fdf0e7e6d [rubygems/rubygems] Fix specs with missing extensions getting activated
https://github.com/rubygems/rubygems/commit/c80998a22a
2024-10-10 14:51:32 +00:00
Samuel Giddins a392ee1437
Update vendored net-http
Signed-off-by: Samuel Giddins <segiddins@segiddins.me>
2024-10-10 10:03:34 +09:00
David Rodríguez d10e09b7e3 [rubygems/rubygems] Add `Gem::Specification#gem_dir` back
If old Bundler versions that unconditionally try to remove this method
are run with RubyGems versions _without_ this method, Bundler crashes
because it tries to remove a method that does not exist.

We need to wait until RubyGems cannot install any Bundler versions that
unconditionally remove this method.

https://github.com/rubygems/rubygems/commit/98804d261d
2024-10-09 12:18:05 +00:00
David Rodríguez 48410af53c [rubygems/rubygems] Fix a `gem install` crash during "done installing" hooks
It would happen when the gem is already installed to multiple GEM_PATHS.
RubyGems was removing duplicate specs without considering the
potentially different `base_dir`. That was causing the gem to be
misidentified as not already installed, and a nil specification getting
returned from the installer as a result, causing the crash.

Solve it by making sure `Gem::Specification.all` really iterates through
all the different specifications in all GEM_PATHs.

https://github.com/rubygems/rubygems/commit/0d8c208f65
2024-10-09 10:07:11 +00:00
David Rodríguez 9f812522f5 [rubygems/rubygems] Allow `gem pristine` to reset default gems too
https://github.com/rubygems/rubygems/commit/c9e665eb8a
2024-10-09 06:21:30 +00:00
David Rodríguez 73834f11fa [rubygems/rubygems] Fix `Gem::Specification#gem_dir` losing custom source for some reason
https://github.com/rubygems/rubygems/commit/f8f589b1b8
2024-10-09 05:54:14 +00:00
David Rodríguez 83456d1e9a [rubygems/rubygems] Fix plugin command loading
The `LoadError` needs to be ignored because command may have been
defined and registered from a rubygems_plugin.rb file.

https://github.com/rubygems/rubygems/commit/31f13d449b
2024-10-09 05:26:27 +00:00
Samuel Giddins bdc3363d0f [rubygems/rubygems] Update required_ruby_version to 3.1
3.0 has been EOL since march, drop support for it before the 3.4 release is cut

Signed-off-by: Samuel Giddins <segiddins@segiddins.me>

https://github.com/rubygems/rubygems/commit/fc1f03b06a
2024-10-04 20:01:51 +00:00
David Rodríguez acbdb30941 [rubygems/rubygems] Fix error in one source when fetching dependency APIs clearing results from all sources
https://github.com/rubygems/rubygems/commit/0549ddbcc5
2024-10-02 10:37:26 +00:00
David Rodríguez 49483904d8
[rubygems/rubygems] Make sure MissingSpecVersionError#to_s prints exception message
Gem command loading errors rely on `#to_s` on the raised exception, but
in the case of `MissingSpecVersionError` that was only the exception
name, making it printed twice and no message at all.

Before:

```
ERROR:  Loading command: install (Gem::MissingSpecVersionError)
 	Gem::MissingSpecVersionError
```

After:

```
ERROR:  Loading command: install (Gem::MissingSpecVersionError)
	Could not find 'io-wait' (>= 0.a) - did find: [io-wait-0.3.0-java]
  Checked in 'GEM_PATH=/Users/deivid/Code/rubygems/rubygems/bundler/tmp/1.1/gems/system' , execute `gem env` for more information
```

https://github.com/rubygems/rubygems/commit/d06944bb2f
2024-10-02 14:34:55 +09:00
David Rodríguez 02d50d9cb1
[rubygems/rubygems] Simplify command loading
https://github.com/rubygems/rubygems/commit/95f60f0e60
2024-10-02 14:34:54 +09:00
David Rodríguez 82f250af45 [rubygems/rubygems] `gem cleanup` no longer needs to reset paths
Since `Gem::Uninstaller` no longer changes paths either.

https://github.com/rubygems/rubygems/commit/427059d45f
2024-09-30 05:07:58 +00:00
David Rodríguez d4ac5c573b [rubygems/rubygems] Don't add duplicated specs to unresolved specs
This could happen when a regular gem shadows a default gem.

https://github.com/rubygems/rubygems/commit/9ef70dd1f7
2024-09-30 05:07:57 +00:00
David Rodríguez 73d60df6e0 [rubygems/rubygems] Don't list duplicated version in `Gem::Specification.reset` warning
https://github.com/rubygems/rubygems/commit/e6e3db821f
2024-09-30 05:07:57 +00:00
Ellen Marie Dash 47a3482a41 [rubygems/rubygems] Remove code that makes suggest_gems_from_name give worse results.
https://github.com/rubygems/rubygems/commit/09ec67ffdf
2024-09-28 21:12:25 +00:00
David Rodríguez d1324170b6 [rubygems/rubygems] Warning about PATH in `--user-install` mode is only necessary for gems with executables
https://github.com/rubygems/rubygems/commit/2fe0f452a2
2024-09-27 16:49:32 +00:00
David Rodríguez 5228d349d9
[rubygems/rubygems] Restore `gem_dir` as an instance variable accessor
I suspect someone could be setting this instance variable, and the
previous changes made that no longer effective.

Also I implemented a previous TOOD in `full_gem_path` the other way
around:

> # TODO: This is a heavily used method by gems, so we'll need
> # to aleast just alias it to #gem_dir rather than remove it.

I made `gem_dir` an alias of `full_gem_path` rather than the opposite.

This alternative change keeps both methods symmetric without deprecating
either of them for now.

https://github.com/rubygems/rubygems/commit/28983973a3
2024-09-24 15:33:31 +09:00
David Rodríguez 5f47f0f759
[rubygems/rubygems] Remove TODO I can't make much sense of
https://github.com/rubygems/rubygems/commit/6d627e0671
2024-09-24 15:33:31 +09:00
Samuel Giddins 43e3416b70 [rubygems/rubygems] Unconditionally set installed_by_version
It has been supported since RubyGems 2.2.0 via https://github.com/rubygems/rubygems/commit/4525e45a4d45

Signed-off-by: Samuel Giddins <segiddins@segiddins.me>

https://github.com/rubygems/rubygems/commit/bf39c583e8
2024-09-20 14:26:13 +00:00
David Rodríguez 461c48960d [rubygems/rubygems] Add a note about when hack can be removed
https://github.com/rubygems/rubygems/commit/058b29fe98
2024-09-18 16:42:14 +00:00
David Rodríguez ae214be9d6 [rubygems/rubygems] Fix TODO
https://github.com/rubygems/rubygems/commit/2cd13005f6
2024-09-18 16:42:14 +00:00
David Rodríguez 47db8bc01c [rubygems/rubygems] Stop fighting with ourselves
https://github.com/rubygems/rubygems/commit/7cf2fdcfa1
2024-09-18 16:42:13 +00:00
David Rodríguez b203e667c9 [rubygems/rubygems] Fix spelling, it's "cannot" rather than "can not"
https://github.com/rubygems/rubygems/commit/3434f094a2
2024-09-17 20:09:07 +00:00
David Rodríguez fab01b15e9 [rubygems/rubygems] Remove temporary `.lock` files left around by gem installer
https://github.com/rubygems/rubygems/commit/edbb2e3475
2024-09-16 11:37:58 +00:00
David Rodríguez e52d4d462f [rubygems/rubygems] Fix `bundle exec rake install` failing when local gem has extensions and `gemspec` DSL is being used
In a `bundle exec` context, the local specification will actually be
part of the known specifications, so RubyGems will assume it has already
been installed, which is not actually true.

This will cause `RequestSet` to rebuild extensions for a gem that's not
actually installed, causing errors.

The fix is to make sure detection of installed activation requests
considers not only that there's a known spec with the same full name as
the one being installed, but also that this spec is installed in the
same gem_home were pretend to install the new gem.

https://github.com/rubygems/rubygems/commit/a8ef1286a6
2024-09-11 11:28:35 +00:00
David Rodríguez 155989415b [rubygems/rubygems] Avoid now unnecessary reset
https://github.com/rubygems/rubygems/commit/511c7b211b
2024-09-09 08:46:02 +00:00
David Rodríguez 72e80c8f29 [rubygems/rubygems] Make `gem exec` use the standard GEM_HOME
https://github.com/rubygems/rubygems/commit/032b3c518a
2024-09-09 08:46:01 +00:00
David Rodríguez a304fe00f3 [rubygems/rubygems] Fix `gem fetch` always exiting with zero status code
https://github.com/rubygems/rubygems/commit/5887e6dfa1
2024-09-09 08:44:27 +00:00
David Rodríguez b0adae7fb2 [rubygems/rubygems] Remove unnecessary "./" when appending string to uri
https://github.com/rubygems/rubygems/commit/732679306d
2024-09-06 18:44:38 +00:00
David Rodríguez fe1bace43c [rubygems/rubygems] Fix `gem install does-not-exist` being super slow
Every time a gem is not found in the Compact Index API, RubyGems will
fallback to the full index, which is very slow. This is unnecessary
because both indexes should be providing the same gems, so if a gem
can't be found in the Compact Index API, it won't be found in the full
index.

We _do_ want a fallback to the full index, whenever the Compact Index
API is not implemented. To detect that, we check that the API responds
to the "/versions" endpoint, just like Bundler does.

Before:

```
$ time gem install fooasdsfafs
ERROR:  Could not find a valid gem 'fooasdsfafs' (>= 0) in any repository
gem  20,77s user 0,59s system 96% cpu 22,017 total
```

After:

```
$ time gem install fooasdsfafs
ERROR:  Could not find a valid gem 'fooasdsfafs' (>= 0) in any repository
gem  5,02s user 0,09s system 91% cpu 5,568 total
```

https://github.com/rubygems/rubygems/commit/c0d6b9eea7
2024-09-06 18:44:37 +00:00
David Rodríguez 2a17b4f022 [rubygems/rubygems] Deprecate constant that has been unused for a long time
https://github.com/rubygems/rubygems/commit/282dbb3d62
2024-09-06 18:44:37 +00:00
David Rodríguez 4478ca3113 [rubygems/rubygems] Remove incorrect documentation
This exception has not been raised for a long time.

https://github.com/rubygems/rubygems/commit/a6271a0b21
2024-09-06 18:44:36 +00:00
David Rodríguez 53f784178a [rubygems/rubygems] Remove unreachable code
Nothing is actually raising this at the moment.

https://github.com/rubygems/rubygems/commit/3b824ca7a6
2024-09-06 18:44:36 +00:00
Nobuyoshi Nakada 30176e3f23 [rubygems/rubygems] Ensure that the lock file will be removed
https://github.com/rubygems/rubygems/commit/2706acb271
2024-09-06 14:46:43 +00:00
Nobuyoshi Nakada 5afee4d795 [rubygems/rubygems] Remove the lock file for binstubs
https://github.com/rubygems/rubygems/pull/7806#issuecomment-2241662488

https://github.com/rubygems/rubygems/commit/4f06ee234a
2024-09-06 14:46:42 +00:00
Hiroshi SHIBATA 56817865d6 [rubygems/rubygems] Removed unused stringio
Fixed https://github.com/rubygems/rubygems/pull/7996

https://github.com/rubygems/rubygems/commit/16bfcac883
2024-09-04 08:57:17 +00:00