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

2574 Коммитов

Автор SHA1 Сообщение Дата
Hiroshi SHIBATA e5c06005f1 mustermann depends on URI::RFC2396_PARSER behavior
It's part of dependencies for Sinatra. we should fix mustermann before final release of Ruby 3.4
2024-07-19 12:40:56 +09:00
David Rodríguez d62af8e513 [rubygems/rubygems] Fix another removal issue
I failed to ignore (again) specs only considered for resolution under
some platforms that are not the current one.

https://github.com/rubygems/rubygems/commit/b72deec57e
2024-07-18 18:08:37 +00:00
David Rodríguez b07c77730b [rubygems/rubygems] Simplify spec assertion
All that we expect here is no changes.

https://github.com/rubygems/rubygems/commit/ff984b6133
2024-07-18 18:08:36 +00:00
David Rodríguez c9d2343f5c [rubygems/rubygems] Fix incorrect standalone script when default gems with extensions are used
https://github.com/rubygems/rubygems/commit/55649cd09b
2024-07-18 18:07:09 +00:00
David Rodríguez bb9a9f31ca [rubygems/rubygems] Remove unnecessary `artifice` parameter
It's automatically detected from Gemfile.

https://github.com/rubygems/rubygems/commit/72301a2e3b
2024-07-18 18:07:08 +00:00
David Rodríguez ba6ffaf2e0 [rubygems/rubygems] Use latest shellwords for standalone test
https://github.com/rubygems/rubygems/commit/fcd04daf68
2024-07-18 18:07:08 +00:00
David Rodríguez 99bf4021fb [rubygems/rubygems] Ext is generally not in `require_paths`
https://github.com/rubygems/rubygems/commit/83b417a166
2024-07-18 18:07:07 +00:00
David Rodríguez 86c99a8d14 [rubygems/rubygems] Fix gemspec `require_paths` type validation
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 09:25:17 +00:00
David Rodríguez 95728a8b42 [rubygems/rubygems] Warn non flattened require paths in old RubyGems versions too
https://github.com/rubygems/rubygems/commit/b3cdccc6fb
2024-07-18 09:25:16 +00:00
Nobuyoshi Nakada c032e2c225 [rubygems/rubygems] Use `caller_locations` instead of splitting `caller`
Also limit caller ranges

https://github.com/rubygems/rubygems/commit/a274b1af78
2024-07-18 04:20:07 +00:00
David Rodríguez c639bacd45 [rubygems/rubygems] Fix detection of `gem_repo1` being updated
https://github.com/rubygems/rubygems/commit/9f9493c77c
2024-07-18 04:20:06 +00:00
Hiroshi SHIBATA e0f40dc9b0
Split URI::Parser examples with RFC2396 and RFC3986
Prepare for https://github.com/ruby/uri/pull/107
2024-07-18 12:42:36 +09:00
Nobuyoshi Nakada 278bbd7b45 Revert pending `EVENT_RETURN` tests
* "Allow ambiguosity of `return` line"
  65b991bc85
* "Move to test/.excludes-prism"
  3b4ff810d2
* "Pending `EVENT_RETURN` settracefunc tests with Prism"
  a7f33c99c6
2024-07-17 14:06:11 -04:00
David Rodríguez 3c3cce13c6 [rubygems/rubygems] Fix another case of `bundle lock --add-platform` doing nothing
https://github.com/rubygems/rubygems/commit/0629e27dda
2024-07-17 11:14:53 +00:00
Hiroshi SHIBATA 371055979f Pend some tests because these are not working with macOS 15 beta and Xcode 16 beta 2024-07-12 13:38:22 +09:00
Jean Boussier 3de0e343e2 Do not warn about extra `format` argument when passed as keywords
[Bug #20593]

It's fairly common to use `format` to interpolate a number of values
into a user provided strings.

The arguments not matching are a problem when they are positional,
but when they are named, it's absolutely fine and we shouldn't
emit a warning.
2024-07-11 07:39:50 +02:00
David Rodríguez 133fec4ce9 [rubygems/rubygems] Fix another strange error when running `bundle add` in frozen mode
If there's a lockfile, but it's out of sync with the Gemfile because a
dependency has been deleted, and frozen mode is set, Bundler will print
the following strange error:

```
$ bundle add rake
, but the lockfile can't be updated because frozen mode is set

You have deleted from the Gemfile:
* rake (~> 13.2)

Run `bundle install` elsewhere and add the updated Gemfile to version control.
```

This commit changes the error to:

```
Some dependencies were deleted from your gemfile, but the lockfile can't be updated because frozen mode is set

You have deleted from the Gemfile:
* rake (~> 13.2)

Run `bundle install` elsewhere and add the updated Gemfile to version control.
```

https://github.com/rubygems/rubygems/commit/452da4048d
2024-07-10 08:04:07 +00:00
David Rodríguez 7e612b7414 [rubygems/rubygems] Fix strange error when running `bundle add` with frozen mode set
If Gemfile is empty and there's no lockfile (situation after `bundle init`), and
`frozen` is configured, running `bundle add` will result in an strange
error, like this:

```
$ bundle add rake
, but the lockfile can't be updated because frozen mode is set

You have deleted from the Gemfile:
* rake (~> 13.2)

Run `bundle install` elsewhere and add the updated Gemfile to version control.
```

This commit fixes the problem to instead print

https://github.com/rubygems/rubygems/commit/152331a9dc
2024-07-10 08:04:07 +00:00
David Rodríguez 140d8318db [rubygems/rubygems] Fix generic platform gems getting incorrectly removed when locked for a specific platform
If they are already in the lockfile as the most specific variant for a
platform, we shouldn't change that unless explicitly unlocking.

https://github.com/rubygems/rubygems/commit/a901660498
2024-07-09 16:34:09 +00:00
David Rodríguez dd05191bc3 [rubygems/rubygems] Resolve all platforms directly
Instead of having to do a complete pass after resolve.

To do this, we add to the ruby group all the platform specs with the
same dependencies as the ruby specs.

https://github.com/rubygems/rubygems/commit/e50415f2a6
2024-07-09 16:34:08 +00:00
David Rodríguez 086cde1651 [rubygems/rubygems] Instantiate `Resolver::SpecGroup` with explicit priority
https://github.com/rubygems/rubygems/commit/e2c1bc1b6c
2024-07-09 16:34:07 +00:00
David Rodríguez 5fdfdc30f1 [rubygems/rubygems] Let resolver consider unique specs from the beginning
It results in more consistent error messages.

https://github.com/rubygems/rubygems/commit/a4b34361cc
2024-07-09 16:34:07 +00:00
David Rodríguez a333e867aa [rubygems/rubygems] Fix spec to also pass outside of Linux
https://github.com/rubygems/rubygems/commit/fc8c853345
2024-07-09 16:34:06 +00:00
David Rodríguez 1d97c46b35 [rubygems/rubygems] Minor Bundler spec improvements
While working on something else I noticed:

* Usage of uppercased "RUBY" and "JAVA" as platforms, when those don't
  really exist.
* Usage of some test gems with "1.0" as gemspec version and "1.0.0" as
  actual version.

This commit fixes both inconsistencies to make things more expectable.

https://github.com/rubygems/rubygems/commit/e3ec32e247
2024-07-09 14:43:18 +00:00
David Rodríguez ad6b2e8985 [rubygems/rubygems] Test using latest rubies
https://github.com/rubygems/rubygems/commit/6d6646b8bc
2024-07-09 11:26:10 +00:00
Jean Boussier 9594db0cf2 Implement Hash.new(capacity:)
[Feature #19236]

When building a large hash, pre-allocating it with enough
capacity can save many re-hashes and significantly improve
performance.

```
/opt/rubies/3.3.0/bin/ruby --disable=gems -rrubygems -I./benchmark/lib ./benchmark/benchmark-driver/exe/benchmark-driver \
	            --executables="compare-ruby::../miniruby-master -I.ext/common --disable-gem" \
	            --executables="built-ruby::./miniruby --disable-gem" \
	            --output=markdown --output-compare -v $(find ./benchmark -maxdepth 1 -name 'hash_new' -o -name '*hash_new*.yml' -o -name '*hash_new*.rb' | sort)
compare-ruby: ruby 3.4.0dev (2024-03-25T11:48:11Z master f53209f023) +YJIT dev [arm64-darwin23]
last_commit=[ruby/irb] Cache RDoc::RI::Driver.new (https://github.com/ruby/irb/pull/911)
built-ruby: ruby 3.4.0dev (2024-03-25T15:29:40Z hash-new-rb 77652b08a2) +YJIT dev [arm64-darwin23]
warming up...

|                    |compare-ruby|built-ruby|
|:-------------------|-----------:|---------:|
|new                 |      7.614M|    5.976M|
|                    |       1.27x|         -|
|new_with_capa_1k    |     13.931k|   15.698k|
|                    |           -|     1.13x|
|new_with_capa_100k  |     124.746|   148.283|
|                    |           -|     1.19x|
```
2024-07-08 12:24:33 +02:00
Jeremy Evans 7f1fe5f091 Raise a TypeError for Thread#thread_variable{?,_get} for non-symbol
Previously, a TypeError was not raised if there were no thread
variables, because the conversion to symbol was done after that
check.  Convert to symbol before checking for whether thread
variables are set to make the behavior consistent.

Fixes [Bug #20606]
2024-07-06 12:07:32 +02:00
Jerome Dalbert bbb4da78c7 [rubygems/rubygems] Use preferred add_dependency instead of add_runtime_dependency
https://github.com/rubygems/rubygems/commit/9a08043858
2024-07-05 02:24:53 +00:00
Jerome Dalbert 2830a6ae38 [rubygems/rubygems] Only allow valid values for --test, --ci, and --linter options
https://github.com/rubygems/rubygems/commit/d4360c9032
2024-07-02 19:54:23 +00:00
David Rodríguez cd57c1294d [rubygems/rubygems] Only remove current platform when added right before resolution
If it has been explicitly added by `bundle lock --add-platform`, we
don't want to remove it.

https://github.com/rubygems/rubygems/commit/09cf921dd6
2024-07-02 19:53:54 +00:00
David Rodríguez c36eb10d8b [rubygems/rubygems] Normalize dummy test server name
https://github.com/rubygems/rubygems/commit/18b38ca6b4
2024-07-02 19:53:54 +00:00
Andrew Konchin cee62c6738 Update to ruby/spec@f8987ac 2024-07-02 13:33:48 +02:00
David Rodríguez 98c923ff4b
Synchronize Bundler & RubyGems (#11071) 2024-06-28 10:12:29 -04:00
David Rodriguez 5f8375381b [rubygems/rubygems] Avoid concurrent builds of Bundler when running specs
Instead, build it during setup when in CI.

This should avoid some Windows specific test failures when Bundler
copies the same files from multiple processes and runs into EACESS
errors.

https://github.com/rubygems/rubygems/commit/c194a1d753
2024-06-28 07:33:43 +00:00
David Rodríguez 815b345b41 [rubygems/rubygems] Print a proper error when bin dir does not have writable permission bit
https://github.com/rubygems/rubygems/commit/979cd898f9
2024-06-27 12:53:05 +00:00
David Rodríguez f88bb0e67d [rubygems/rubygems] Reword some specs to disambiguate `chmod -x` from `chmod -w`
https://github.com/rubygems/rubygems/commit/2954ab79a9
2024-06-27 12:53:04 +00:00
Jerome Dalbert c6c817df28 [rubygems/rubygems] Add --no-test, --no-ci, and --no-linter options
https://github.com/rubygems/rubygems/commit/f58660ffcc
2024-06-26 11:24:47 +00:00
Thomas Marshall b88ac94eec [rubygems/rubygems] Only validate resolution info in Bundler
This commit switches out the full gemspec validation for a partial one
which only performs resolution related checks. This will allow gem
authors to run `bundle` commands immediately after creating a new gem
with Bundler, rather than having to fix metadata validation issues in
the default gemspec.

https://github.com/rubygems/rubygems/commit/d5aa9cae9d
2024-06-25 14:32:20 +00:00
Nobuyoshi Nakada 65b991bc85
Allow ambiguosity of `return` line 2024-06-25 16:30:14 +09:00
Nobuyoshi Nakada 250fc1223c [Bug #20457] Do not remove final `return` node
This was an optimization for versions prior to 1.9 that traverse the
AST at runtime.
2024-06-25 11:07:58 +09:00
Jeremy Evans a47a176768 Skip 3 specs when $HOME is not a valid directory
If $HOME isn't a valid directory, these specs fail, but I think it
is better to skip in this case, as it does not indicate a bug.

This fixes specs when run in the OpenBSD port, which sets $HOME
to an invalid directory to ensure that software's build system
is not accidentally relying on it.
2024-06-20 07:54:02 -07:00
David Rodríguez f7acfeb4ce [rubygems/rubygems] Fix credentials being readded when re-resolving without a full unlock
https://github.com/rubygems/rubygems/commit/a8670e43f8
2024-06-20 07:15:06 +00:00
David Rodríguez bf6b8dd6a8 [rubygems/rubygems] Fix `bundle update <gem_name>` edge case
When locked only to RUBY, and some locked spec does not meet locked
dependencies, Bundler would remove the only locked platform and end up
creating a lockfile with empty sections.

We can't rely on our criteria to remove invalid platforms if locked
specs are not valid in the first place.

https://github.com/rubygems/rubygems/commit/1dba05cf53
2024-06-20 07:14:47 +00:00
David Rodríguez f445d54f91 [rubygems/rubygems] Move constant to the proper place
https://github.com/rubygems/rubygems/commit/9f08241d01
2024-06-20 15:22:52 +09:00
David Rodríguez 0610302a8f [rubygems/rubygems] Don't validate local gemspec twice
Calling `remote!` or `cached!` on the source was expiring local specs
for now reason. It's unnecessary to override these methods for path
sources since they only deal with local specifications.

https://github.com/rubygems/rubygems/commit/aa93b196a2
2024-06-20 15:22:13 +09:00
David Rodríguez 758e01d39d [rubygems/rubygems] Make sure to not re-resolve when a not fully specific local platform is locked
https://github.com/rubygems/rubygems/commit/36a02c6128
2024-06-20 15:21:08 +09:00
David Rodríguez c6a28b02c9 [rubygems/rubygems] Always resolve against the local platform
If RUBY is the only platform in the lockfile, we were skipping adding
the local platform to the list of resolution platforms. This generally
works anyways, because we had some code to still add it if the RUBY
platform is not valid for the set of locked gems.

However, sometimes it can happen that "RUBY" is valid for the current
set of locked gems, but when adding a new dependency, it becomes
invalid. For example, when adding sorbet to a Gemfile, that will
introduce `sorbet-static` as an indirect dependency which does not have
a generic "RUBY" variant. This will cause resolution to take a long time
continuously backtracking trying to find solutions that don't introduce
`sorbet-static` as a dependency and will eventually fail.

Instead, we can always add the local platform to the set of resolution
platforms before resolving, and remove it as necessary after resolution
so that we lock the correct set of platforms.

https://github.com/rubygems/rubygems/commit/6ed1fe6050
2024-06-20 15:20:57 +09:00
Martin Emde af304ad952 [rubygems/rubygems] Revert to splitting parser due to performance regression
* The string search parser was more memory efficient but
  in some cases, much slower. Reverting until a better
  solution is found.
* Handle the situation where the line might be blank (Artifactory bug)

https://github.com/rubygems/rubygems/commit/222d38737d
2024-06-20 15:18:56 +09:00
Hiroshi SHIBATA 2ccd5f8cef [rubygems/rubygems] Use get_byte_ranges instead of byte_ranges
https://github.com/rubygems/rubygems/commit/5c2ad44c18
2024-06-19 10:56:58 +00:00
Earlopain b8a592fe6e [rubygems/rubygems] Fix `bundle fund` when the gemfile contains optional groups
`current_dependencies` doesn't return gems in optional groups, while `specs` would

Closes https://github.com/rubygems/rubygems/pull/7757

https://github.com/rubygems/rubygems/commit/c797e95636
2024-06-18 17:53:59 +00:00