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

1379 Коммитов

Автор SHA1 Сообщение Дата
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
Durable Programming Team 675529b9c6 [rubygems/rubygems] standardize pretty-print output for Gem::Source and subclasses
https://github.com/rubygems/rubygems/commit/6d5fbf82f1
2024-09-03 17:40:12 +00:00
David Rodríguez e66e3cf1b9
Change automatiek to properly vendor securerandom
Co-authored-by: Jean Boussier <jean.boussier@gmail.com>
2024-09-03 10:49:13 +09:00
David Rodríguez 053caa313b
Fix `gem exec rails new foo` failing on Ruby 3.2
The default version of securerandom (0.2.2) gets activated by RubyGems,
but does not match Rails requirements (>= 0.3), leading to an error like
this:

```
$ gem exec rails new repro
/Users/deivid/Code/rubygems/rubygems/lib/rubygems/specification.rb:2246:in `raise_if_conflicts': Unable to activate activesupport-7.2.1, because securerandom-0.2.2 conflicts with securerandom (>= 0.3) (Gem::ConflictError)
	from /Users/deivid/Code/rubygems/rubygems/lib/rubygems/specification.rb:1383:in `activate'
	from /Users/deivid/Code/rubygems/rubygems/lib/rubygems/specification.rb:1421:in `block in activate_dependencies'
	from /Users/deivid/Code/rubygems/rubygems/lib/rubygems/specification.rb:1403:in `each'
	from /Users/deivid/Code/rubygems/rubygems/lib/rubygems/specification.rb:1403:in `activate_dependencies'
	from /Users/deivid/Code/rubygems/rubygems/lib/rubygems/specification.rb:1385:in `activate'
	from /Users/deivid/Code/rubygems/rubygems/lib/rubygems/core_ext/kernel_gem.rb:62:in `block in gem'
	from /Users/deivid/Code/rubygems/rubygems/lib/rubygems/core_ext/kernel_gem.rb:62:in `synchronize'
	from /Users/deivid/Code/rubygems/rubygems/lib/rubygems/core_ext/kernel_gem.rb:62:in `gem'
	from /Users/deivid/Code/rubygems/rubygems/lib/rubygems/commands/exec_command.rb:193:in `activate!'
	from /Users/deivid/Code/rubygems/rubygems/lib/rubygems/commands/exec_command.rb:73:in `execute'
	from /Users/deivid/Code/rubygems/rubygems/lib/rubygems/command.rb:326:in `invoke_with_build_args'
	from /Users/deivid/Code/rubygems/rubygems/lib/rubygems/command_manager.rb:255:in `invoke_command'
	from /Users/deivid/Code/rubygems/rubygems/lib/rubygems/command_manager.rb:194:in `process_args'
	from /Users/deivid/Code/rubygems/rubygems/lib/rubygems/command_manager.rb:152:in `run'
	from /Users/deivid/Code/rubygems/rubygems/lib/rubygems/gem_runner.rb:56:in `run'
	from /Users/deivid/code/rubygems/rubygems/exe/gem:12:in `<main>'
```

Vendoring our own securerandom fixes the issue since that way we avoid
activating the gem internally.
2024-09-03 10:49:13 +09:00
David Rodríguez 24c51e1cbb
Let automatiek convert requires that are indented to require_relative as well 2024-09-03 10:49:13 +09:00
Hiroshi SHIBATA 4aa3491bd2 Skip RDoc related feature if Gem::RDoc is not available 2024-09-01 20:00:13 +09:00
Durable Programming Team d6fc8f3d57 [rubygems/rubygems] fix `@license` typo preventing licenses from being correctly unmarshalled
https://github.com/rubygems/rubygems/commit/d6ba7ef79f
2024-08-31 18:30:25 +00:00
David Rodríguez 419d3221fb [rubygems/rubygems] Fix `gem uninstall <name>:<version>` failing on shadowed default gems
https://github.com/rubygems/rubygems/commit/29357a5dd6
2024-08-21 12:07:10 +00:00
David Rodríguez 1164b6a7ba [rubygems/rubygems] Fix `gem list` regression when a regular gem shadows a default one
Previously, if you have bundler installed both as a regular gem and a
default gem, the default gem would be displayed by `gem list`.

https://github.com/rubygems/rubygems/commit/10a6b1736e
2024-07-30 14:01:43 +00:00
David Rodríguez 3d248b2eb3 [rubygems/rubygems] Always leave default gem executables around
https://github.com/rubygems/rubygems/commit/775c35e197
2024-07-30 14:01:32 +00:00
David Rodríguez 30eba40f9c [rubygems/rubygems] Remove `to_yaml_properties`
This is an old syck thing, no longer used anywhere.

https://github.com/rubygems/rubygems/commit/6f72d02bac
2024-07-24 19:55:04 +00:00
Samuel Giddins 83b48022c1 [rubygems/rubygems] Explicitly encode Gem::Dependency to yaml
This ensures that instance variable ordering cannot cause non-determinism in serialized gems

https://github.com/rubygems/rubygems/commit/0e912704f7
2024-07-23 20:14:59 +00:00
alpha0x00 3222c67262 [rubygems/rubygems] Fix line comment issue for map
https://github.com/rubygems/rubygems/commit/7ca06e139b
2024-07-19 03:03:16 +00:00