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

149 Коммитов

Автор SHA1 Сообщение Дата
Hiroshi SHIBATA f24a86d83f util/rubocop -A --only Layout/EmptyLineAfterMagicComment 2023-03-23 17:18:49 +09:00
Hiroshi SHIBATA 2e3cd1dc3e [rubygems/rubygems] Enabled Style/RedundantReturn cop
https://github.com/rubygems/rubygems/commit/05cc97bdf8
2023-03-23 17:18:49 +09:00
Hiroshi SHIBATA 0eef33e113 [rubygems/rubygems] util/rubocop -A --only Style/Next
https://github.com/rubygems/rubygems/commit/e5868e92f7
2023-03-23 17:18:49 +09:00
Hiroshi SHIBATA 5211900d37 util/rubocop -A --only Style/SymbolProc 2023-03-17 18:50:55 +09:00
Hiroshi SHIBATA ee7475734f [rubygems/rubygems] util/rubocop -A --only Style/BarePercentLiterals
https://github.com/rubygems/rubygems/commit/02d8147243
2023-03-17 18:50:55 +09:00
Hiroshi SHIBATA 66bd2c1a1c [rubygems/rubygems] util/rubocop -A --only Style/CommentAnnotation
https://github.com/rubygems/rubygems/commit/4e77a1d1d5
2023-03-17 18:50:55 +09:00
Hiroshi SHIBATA 567db6064b [rubygems/rubygems] util/rubocop -A --only Style/NestedParenthesizedCalls
https://github.com/rubygems/rubygems/commit/a875fdb535
2023-03-17 18:50:55 +09:00
Hiroshi SHIBATA 4bb5ce8188 [rubygems/rubygems] util/rubocop -A --only Style/StringLiteralsInInterpolation
https://github.com/rubygems/rubygems/commit/cb554f6eb7
2023-03-17 18:50:55 +09:00
Hiroshi SHIBATA f70b46dbc7
More debug for 75829f4d37 2023-03-06 13:01:54 +09:00
Hiroshi SHIBATA d9fd048351 [rubygems/rubygems] blade is hosted under ruby-lang.org now
https://github.com/rubygems/rubygems/commit/00fdef8a41
2023-01-23 05:55:46 +00:00
David Rodríguez 24fd2f73d0 Resync Bundler & RubyGems 2022-09-08 11:25:03 +09:00
Hiroshi SHIBATA 44264b4fee Merge rubygems/bundler HEAD.
Pick from dfbb5a3811
2022-08-09 12:05:19 +09:00
David Rodríguez 542040fb83 [rubygems/rubygems] Warn dangling symlinks
https://github.com/rubygems/rubygems/commit/425b78637f
2022-08-04 13:36:45 +09:00
Hiroshi SHIBATA 71794a75db Merge rubygems/bundler HEAD
Pick from 8331e63263
2022-08-03 13:14:10 +09:00
Takuya Noguchi d7ffd3fea4
RubyGems: Enable Style/StringLiterals cop
Signed-off-by: Takuya Noguchi <takninnovationresearch@gmail.com>
2022-07-22 12:07:23 +09:00
Hiroshi SHIBATA 437a5ae9d6 Merge RubyGems and Bundler master 2022-07-13 14:11:55 +09:00
Hiroshi SHIBATA aeea88174d
Merge RubyGems and Bundler HEAD
125415593e
2022-05-20 17:32:19 +09:00
David Rodríguez 9a20bcd5c8 [rubygems/rubygems] I don't think this is necessary
https://github.com/rubygems/rubygems/commit/836f3e5aa5
2022-04-16 22:58:34 +09:00
David Rodríguez 7d42b442bb [rubygems/rubygems] Support binstubs with `--enable-load-relative` prolog
https://github.com/rubygems/rubygems/commit/32a5e9057a
2022-01-15 00:00:11 +09:00
David Rodríguez 044b0ae8e0 [rubygems/rubygems] Extract a bit of common logic to methods
https://github.com/rubygems/rubygems/commit/9a1b891435
2022-01-15 00:00:10 +09:00
David Rodríguez 810516ca31 [rubygems/rubygems] Fix method documentation to be more correct English
https://github.com/rubygems/rubygems/commit/bcffd92c48
2022-01-15 00:00:09 +09:00
David Rodríguez 1976b38f7a [rubygems/rubygems] Add support in binstubs for trampolining bundler
If `bundler _<version>_` is given, I guess the most reasonable approach
is to completely skip version switching, because the user is technically
opting out of it. But since binstubs completely remove this argument
from `ARGV` after processing it, we have no way of detecting that it was
actually passed in the first place in order to skip the feature. So we
set `BUNDLER_VERSION` explicitly in this case.

https://github.com/rubygems/rubygems/commit/e0f360d6d7
2021-12-20 07:42:53 +09:00
David Rodríguez 7fd88da935 [rubygems/rubygems] Fix race condition when reading & writing gemspecs concurrently
When bundler parallel installer installs gems concurrently, one can get
confusing warnings like the following:

```
"[/home/runner/work/rubygems/rubygems/bundler/tmp/2/gems/system/specifications/zeitwerk-2.4.2.gemspec] isn't a Gem::Specification (NilClass instead).
```

I've got these warnings several times in the past, but I never managed
to reproduce them, and never look deeply into the root cause, but this
time a got a cause that reproduced quite frequently, so I looked into
it.

The problem is one thread reading a gemspec while another thread is
writing it. The write of the gemspec was not protected, so
`Gem::Specification.load` could end up seeing a truncated gemspec and
thus throw this warning.

The fix involve two changes:

* Change the methods that write gemspecs to use `Gem.binary_write` which
  is protected by a lock.

* Fix `Gem.binary_write` to create the file lock at file creation time,
  not when the file already exists after.

The realworld user problem caused by this issue happens in bundler, but
I'm fixing it in rubygems first, and then I'll backport to bundler
whatever needs backporting to fix the issue on the bundler side.

https://github.com/rubygems/rubygems/commit/a672e7555c
2021-11-30 20:54:05 +09:00
David Rodríguez d7f6cb0f78 [rubygems/rubygems] Revert "Remove spec file before building"
This reverts commit af604436d8141c34cb2e1e645b9b0d47bfd55a55.

The issue that led to introducing it was never reproduced. I tried to
repro with this patch and it still works just fine. Since this removal
is getting in the middle for some race conditions I'm facing, I'm
reverting the patch.

https://github.com/rubygems/rubygems/commit/2dd267f0e4
2021-11-30 20:54:05 +09:00
David Rodríguez 8bdb56fcaf [rubygems/rubygems] Protect specs access at a finer level
https://github.com/rubygems/rubygems/commit/c8cc053bde
2021-11-18 04:37:28 +09:00
Hiroshi SHIBATA f3bda8987e
Merge the master branch of rubygems repo
Picked from 4b498709a0
2021-11-16 20:19:13 +09:00
David Rodríguez 54ae3f587e [rubygems/rubygems] Prefer `require_relative` to `require` for internal requires
https://github.com/rubygems/rubygems/commit/c74fc58695
2021-08-31 19:06:14 +09:00
David Rodríguez 553ee573d4 [rubygems/rubygems] Don't use gemdeps on bundler binstub
https://github.com/rubygems/rubygems/commit/320fdc1513
2021-08-31 19:06:14 +09:00
David Rodríguez 87dfb55c16 [rubygems/rubygems] Use `Gem.use_gemdeps` only from binstubs
The previous behavior was to automatically require `bundler/setup`
everytime `rubygems` was required, which I think was too much.

https://github.com/rubygems/rubygems/commit/b25379a295
2021-08-31 19:06:14 +09:00
Hiroshi SHIBATA c082c6eb7c Sync RubyGems and Bundler with upstream 2021-07-07 15:31:52 +09:00
David Rodríguez 6e2240a2f9 Sync latest bundler & rubygems development version 2021-07-07 13:30:20 +09:00
Hiroshi SHIBATA 96741765d8 Merge the master branch of RubyGems 2021-04-15 15:36:15 +09:00
Hiroshi SHIBATA 339227363c Merge RubyGems 3.2.3 and Bundler 2.2.3 2020-12-23 10:17:41 +09:00
Hiroshi SHIBATA 4aca77edde Merge prepare version of RubyGems 3.2.0 2020-12-08 17:30:02 +09:00
Hiroshi SHIBATA b717f73402
Revert "Manually merged from https://github.com/rubygems/rubygems/pull/2636"
31a6eaabc1 is obsoleted with
  https://github.com/rubygems/rubygems/pull/3820
2020-09-23 22:01:44 +09:00
Hiroshi SHIBATA 31a6eaabc1
Manually merged from https://github.com/rubygems/rubygems/pull/2636
Enable Style/EmptyLinesAroundClassBody rubocop cop.
2020-09-23 21:02:56 +09:00
Nobuyoshi Nakada ebf008b9ae [rubygems/rubygems] Install plugins to user directory
Fixes the `Gem::FilePermissionError` without the privilege.
Initialize `@plugins_dir` to the user gem directory, when
installing with `--user` option.

https://github.com/rubygems/rubygems/commit/21a71ac769
2020-07-31 21:07:19 +09:00
David Rodríguez 985309ac38 [rubygems/rubygems] Support PATH's using `File::ALT_SEPARATOR` in `Gem::Installer`
Co-authored-by: MSP-Greg <MSP-Greg@users.noreply.github.com>

https://github.com/rubygems/rubygems/commit/710b969b60
2020-07-31 21:07:19 +09:00
David Rodríguez 04d3e0727a [rubygems/rubygems] Move traling `if` to the same line for readablity
https://github.com/rubygems/rubygems/commit/d722b8b578
2020-07-31 21:07:19 +09:00
David Rodríguez c090c64b4f [rubygems/rubygems] Prefer the standard separator on Windows
It seems like the most common case since it requires no tricks on our
CI environment.

Co-authored-by: MSP-Greg <MSP-Greg@users.noreply.github.com>

https://github.com/rubygems/rubygems/commit/751c475574
2020-07-31 21:07:19 +09:00
David Rodríguez a89665b7b1 Enforce no empty lines around class body in rubygems
To normalize the code style with `bundler`.
2020-07-31 21:07:19 +09:00
David Rodríguez 955f1837a1 Use space inside block braces everywhere
To make rubygems code style consistent with bundler.
2020-06-15 21:20:37 +09:00
Olle Jonsson 5eacf4e72c Enable rubocop-performance StartWith cop
- this would keep the could-be-a-string-method matches few
2020-06-05 07:32:42 +09:00
Nobuyoshi Nakada ef13558fcd
Revert a commit miss in "Fixed potential memory leak"
This reverts an unintentional change in commit
79d9528ddc.
2020-05-22 21:24:51 +09:00
Nobuyoshi Nakada 79d9528ddc
Fixed potential memory leak
Create a wrapper object first, then buffer allocation which can
fail.
2020-05-22 06:50:29 +09:00
David Rodríguez 0d7e0eb2fa [rubygems/rubygems] Prefer `tr` to `gsub` when replacing path separators
This is not detected by the `Performance/StringReplacement` cop, I guess
because of using constants. But still seems like a good change.

Co-authored-by: MSP-Greg <MSP-Greg@users.noreply.github.com>

https://github.com/rubygems/rubygems/commit/f862103133
2020-05-08 14:13:29 +09:00
David Rodríguez de57d3895e [rubygems/rubygems] Shortcuit method earlier
If the class variable is set, we can skip the whole thing from the
beginning.

Co-authored-by: MSP-Greg <MSP-Greg@users.noreply.github.com>

https://github.com/rubygems/rubygems/commit/83abf3a3d4
2020-05-08 14:13:29 +09:00
David Rodríguez 3315ce6904 [rubygems/rubygems] Fix race condition on bundler's parallel installer
When installing in parallel, bundler creates several `Gem::Installer`
instances that run in parallel. These installers access the `@@all` class
variable of `Gem::Specification` concurrently.

If a concurrent thread calls `Gem::Specification.reset` (resetting
`@all` to `nil`) while another thread is running
`Gem::Specification._all` or another method that expects `@@all` to be
loaded and not `nil`, that can result in `Enumerable` methods being
called on `nil`, resulting in crashes.

I fix it by protecting the other concurrent access to the `@all`
variable.

https://github.com/rubygems/rubygems/commit/58b343c530
2020-05-08 14:13:29 +09:00
bronzdoc 7db538a7c9 [rubygems/rubygems] Rename version horizon deprecation methods
https://github.com/rubygems/rubygems/commit/6afd914fda
2020-05-08 07:38:50 +09:00
bronzdoc ff37dd7e9e [rubygems/rubygems] Modify files to use new version horizon deprecations
https://github.com/rubygems/rubygems/commit/4fe5bb5bf3
2020-05-08 07:38:50 +09:00