summaryrefslogtreecommitdiff
path: root/lib/rubygems
AgeCommit message (Collapse)Author
2024-10-09[rubygems/rubygems] Allow `gem pristine` to reset default gems tooDavid Rodríguez
https://github.com/rubygems/rubygems/commit/c9e665eb8a
2024-10-09[rubygems/rubygems] Fix `Gem::Specification#gem_dir` losing custom source ↵David Rodríguez
for some reason https://github.com/rubygems/rubygems/commit/f8f589b1b8
2024-10-09[rubygems/rubygems] Fix plugin command loadingDavid Rodríguez
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-04[rubygems/rubygems] Update required_ruby_version to 3.1Samuel Giddins
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-02[rubygems/rubygems] Fix error in one source when fetching dependency APIs ↵David Rodríguez
clearing results from all sources https://github.com/rubygems/rubygems/commit/0549ddbcc5
2024-10-02[rubygems/rubygems] Make sure MissingSpecVersionError#to_s prints exception ↵David Rodríguez
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[rubygems/rubygems] Simplify command loadingDavid Rodríguez
https://github.com/rubygems/rubygems/commit/95f60f0e60
2024-09-30[rubygems/rubygems] `gem cleanup` no longer needs to reset pathsDavid Rodríguez
Since `Gem::Uninstaller` no longer changes paths either. https://github.com/rubygems/rubygems/commit/427059d45f
2024-09-30[rubygems/rubygems] Don't add duplicated specs to unresolved specsDavid Rodríguez
This could happen when a regular gem shadows a default gem. https://github.com/rubygems/rubygems/commit/9ef70dd1f7
2024-09-30[rubygems/rubygems] Don't list duplicated version in ↵David Rodríguez
`Gem::Specification.reset` warning https://github.com/rubygems/rubygems/commit/e6e3db821f
2024-09-28[rubygems/rubygems] Remove code that makes suggest_gems_from_name give worse ↵Ellen Marie Dash
results. https://github.com/rubygems/rubygems/commit/09ec67ffdf
2024-09-27[rubygems/rubygems] Warning about PATH in `--user-install` mode is only ↵David Rodríguez
necessary for gems with executables https://github.com/rubygems/rubygems/commit/2fe0f452a2
2024-09-24[rubygems/rubygems] Restore `gem_dir` as an instance variable accessorDavid Rodríguez
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[rubygems/rubygems] Remove TODO I can't make much sense ofDavid Rodríguez
https://github.com/rubygems/rubygems/commit/6d627e0671
2024-09-20[rubygems/rubygems] Unconditionally set installed_by_versionSamuel Giddins
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-18[rubygems/rubygems] Add a note about when hack can be removedDavid Rodríguez
https://github.com/rubygems/rubygems/commit/058b29fe98
2024-09-18[rubygems/rubygems] Fix TODODavid Rodríguez
https://github.com/rubygems/rubygems/commit/2cd13005f6
2024-09-18[rubygems/rubygems] Stop fighting with ourselvesDavid Rodríguez
https://github.com/rubygems/rubygems/commit/7cf2fdcfa1
2024-09-17[rubygems/rubygems] Fix spelling, it's "cannot" rather than "can not"David Rodríguez
https://github.com/rubygems/rubygems/commit/3434f094a2
2024-09-16[rubygems/rubygems] Remove temporary `.lock` files left around by gem installerDavid Rodríguez
https://github.com/rubygems/rubygems/commit/edbb2e3475
2024-09-11[rubygems/rubygems] Fix `bundle exec rake install` failing when local gem ↵David Rodríguez
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-09[rubygems/rubygems] Avoid now unnecessary resetDavid Rodríguez
https://github.com/rubygems/rubygems/commit/511c7b211b
2024-09-09[rubygems/rubygems] Make `gem exec` use the standard GEM_HOMEDavid Rodríguez
https://github.com/rubygems/rubygems/commit/032b3c518a
2024-09-09[rubygems/rubygems] Fix `gem fetch` always exiting with zero status codeDavid Rodríguez
https://github.com/rubygems/rubygems/commit/5887e6dfa1
2024-09-06[rubygems/rubygems] Remove unnecessary "./" when appending string to uriDavid Rodríguez
https://github.com/rubygems/rubygems/commit/732679306d
2024-09-06[rubygems/rubygems] Fix `gem install does-not-exist` being super slowDavid Rodríguez
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[rubygems/rubygems] Deprecate constant that has been unused for a long timeDavid Rodríguez
https://github.com/rubygems/rubygems/commit/282dbb3d62
2024-09-06[rubygems/rubygems] Remove incorrect documentationDavid Rodríguez
This exception has not been raised for a long time. https://github.com/rubygems/rubygems/commit/a6271a0b21
2024-09-06[rubygems/rubygems] Remove unreachable codeDavid Rodríguez
Nothing is actually raising this at the moment. https://github.com/rubygems/rubygems/commit/3b824ca7a6
2024-09-06[rubygems/rubygems] Ensure that the lock file will be removedNobuyoshi Nakada
https://github.com/rubygems/rubygems/commit/2706acb271
2024-09-06[rubygems/rubygems] Remove the lock file for binstubsNobuyoshi Nakada
https://github.com/rubygems/rubygems/pull/7806#issuecomment-2241662488 https://github.com/rubygems/rubygems/commit/4f06ee234a
2024-09-04[rubygems/rubygems] Removed unused stringioHiroshi SHIBATA
Fixed https://github.com/rubygems/rubygems/pull/7996 https://github.com/rubygems/rubygems/commit/16bfcac883
2024-09-03[rubygems/rubygems] standardize pretty-print output for Gem::Source and ↵Durable Programming Team
subclasses https://github.com/rubygems/rubygems/commit/6d5fbf82f1
2024-09-03Change automatiek to properly vendor securerandomDavid Rodríguez
Co-authored-by: Jean Boussier <jean.boussier@gmail.com>
2024-09-03Fix `gem exec rails new foo` failing on Ruby 3.2David Rodríguez
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-03Let automatiek convert requires that are indented to require_relative as wellDavid Rodríguez
2024-09-01Skip RDoc related feature if Gem::RDoc is not availableHiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/11491
2024-08-31[rubygems/rubygems] fix `@license` typo preventing licenses from being ↵Durable Programming Team
correctly unmarshalled https://github.com/rubygems/rubygems/commit/d6ba7ef79f
2024-08-21[rubygems/rubygems] Fix `gem uninstall <name>:<version>` failing on shadowed ↵David Rodríguez
default gems https://github.com/rubygems/rubygems/commit/29357a5dd6
2024-07-30[rubygems/rubygems] Fix `gem list` regression when a regular gem shadows a ↵David Rodríguez
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[rubygems/rubygems] Always leave default gem executables aroundDavid Rodríguez
https://github.com/rubygems/rubygems/commit/775c35e197
2024-07-24[rubygems/rubygems] Remove `to_yaml_properties`David Rodríguez
This is an old syck thing, no longer used anywhere. https://github.com/rubygems/rubygems/commit/6f72d02bac
2024-07-23[rubygems/rubygems] Explicitly encode Gem::Dependency to yamlSamuel Giddins
This ensures that instance variable ordering cannot cause non-determinism in serialized gems https://github.com/rubygems/rubygems/commit/0e912704f7
2024-07-19[rubygems/rubygems] Fix line comment issue for mapalpha0x00
https://github.com/rubygems/rubygems/commit/7ca06e139b
2024-07-18[rubygems/rubygems] Fix gemspec `require_paths` type validationDavid Rodríguez
It was not properly being detected as an Array attribute, and thus not properly validated. Fixing this allows us to remove a strange `rescue` clause in Bundler. https://github.com/rubygems/rubygems/commit/4121a32408
2024-07-18[rubygems/rubygems] Use `caller_locations` instead of splitting `caller`Nobuyoshi Nakada
Also limit caller ranges https://github.com/rubygems/rubygems/commit/a274b1af78
2024-07-11[rubygems/rubygems] fix s3 source configuration issueDmitriy Ivliev
https://github.com/rubygems/rubygems/commit/356726bd1a
2024-07-08[rubygems/rubygems] Fix another race conditionDavid Rodríguez
We also need to protect prior removal of the binstub, otherwise it can happen that: * Process A removes prior binstub FOO. * Process B removes prior binstub FOO (does nothing actually because Process A already removed it). * Process A writes binstub FOO for gem BAR from the beginning of file. * Process B writes binstub FOO for gem BAZ from the beginning of file. Similarly as before, if binstub FOO for gem BAR is bigger that binstub FOO for gem BAZ, garbage bytes will be left around at the end of the file, corrupting the binstub. The solution is to also protect removal of the previous binstub. To do this, we use a file lock on an explicit `.lock` file. https://github.com/rubygems/rubygems/commit/d99a80e62d
2024-07-08[rubygems/rubygems] Properly protect writing binstubs with a file lockDavid Rodríguez
There's an issue when multiple processes try to write the same binstub. The problem is that our file locking mechanism is incorrect because files are truncated _before_ they are locked. So it can happen that: * Process A truncates binstub FOO. * Process B truncates binstub FOO. * Process A writes binstub FOO for gem BAR from the beginning of file. * Process B writes binstub FOO for gem BAZ from the beginning of file. If binstub FOO for gem BAR is bigger than binstub FOO for gem BAZ, then some bytes will be left around at the end of the binstub, making it corrupt. This was not a problem in our specs until the spec testing binstubs with the same name coming from different gems changed from using gems named "fake" and "rack" to using gems named "fake" and "myrack". Because of the difference in gem name length, the generated binstub for gem "myrack" is now longer, causing the above problem if binstub for gem myrack is written first. The solution is to make sure when using flock to always use modes that DON'T truncate the file when opening it. So, we use `r+` if the file exists previously (it requires the file to exist previously), otherwise we use `a+`. https://github.com/rubygems/rubygems/commit/ce8bcba90f
2024-07-08[rubygems/rubygems] Remove unnecessary FileUtils usageDavid Rodríguez
All other `chmod` usages in the file use `File.chmod`, so keep it consistent. https://github.com/rubygems/rubygems/commit/3dc0cf8703