Commit graph

70 commits

Author SHA1 Message Date
David Rodríguez
63c4223775 [rubygems/rubygems] Don't create an empty bundled_app when setting up deps
Running everything in `bundled_app` by default causes the `bundled_app`
helper to be used everytime, and that will create a scoped bundled_app
folder if it does not exist. That causes `bin/rake spec:deps` to create
an empty `tmp/2.1/bundled_app` folder which is a bit weird.

This commit changes specs to not switch to a (possibly empty)
bundled_app directory when not necessary (for example, when running
`gem` commands in order to setup test dependencies).

4bf89c0705
2025-07-25 11:10:36 +09:00
David Rodríguez
e95adbfa68 [rubygems/rubygems] Remove unnecessary nesting from standalone specs
Originally, all the specs in this file were put inside a shared examples
block, and since then all specs were run only changing the cwd (either
from root, or a subdirectory).

This was in d7291700d0, to cover a fix in
the `bundler_path` method.

However, reverting that fix does not make any of the specs in either of
the main blocks fail! Only an unrelated spec of `bundle install
--standalone --local` fails.

The reason is that all specs set `path` to an absolute path, making the
fix essentially uncovered.

In order to simplify the file structure and improve runtime, I
completely removed the shared examples block, and only run main specs
for the root directory. Then I added a couple of extra specs to cover
the original bug fix.

This cuts runtime of this spec file in half, from 1m30s to 45s on my
laptop.

cc506f17e0
2025-07-07 11:53:05 +09:00
David Rodríguez
81da38b308 Sync RubyGems 2025-07-03 13:43:00 +09:00
David Rodríguez
b5ef0114cd
[rubygems/rubygems] Migrate all remaining specs to run offline
Also removed the helper to install real gems during specs to avoid the
temptation of introducing network stuff again.

a1ab5e319a
2025-07-02 10:34:18 +09:00
David Rodríguez
5386b6568f
[rubygems/rubygems] Verify specs still using realworld gems still pass with latest versions
9da44ade24
2025-07-02 10:34:18 +09:00
David Rodríguez
41c44ff8e6
[rubygems/rubygems] Realworld optparse gem should be no longer necessary
Optparse was vendored a while ago.

d7afd43756
2025-07-02 10:34:18 +09:00
David Rodríguez
2fd1f4e6d9
[rubygems/rubygems] Logger realworld gem is no longer necessary
6e6288a496
2025-07-02 10:34:18 +09:00
David Rodríguez
669813a48d
[rubygems/rubygems] Realworld tsort gem should be no longer necessary
93d9b97182
2025-07-02 10:34:18 +09:00
David Rodríguez
d8cf0013ef
[rubygems/rubygems] These specs need stringio only for old versions
a44cdf4c21
2025-07-02 10:34:18 +09:00
David Rodríguez
9e566141cd [rubygems/rubygems] Remove "double CI" for testing Bundler 4 mode
Since now every functionality that changes in Bundler 4 is under a
setting, we can enable that setting to test the new functionality,
without having to run our full CI twice.

This can actually be seen as increasing coverage, because Bundler 4
functionality will now be tested on Windows, MacOS, or any other
environment where previously "Bundler 4 mode" was not running.

1cb3e009fc
2025-06-30 12:56:50 +09:00
David Rodríguez
f3ea6c35cc
[rubygems/rubygems] Normalize Bundler version spec filters
28b6a7cf5e
2025-06-19 10:23:36 +09:00
David Rodríguez
459f265b56
[rubygems/rubygems] Cleanup dead code, RubyGems 3.3 is no longer supported
945a29a477
2025-06-17 15:09:34 +09:00
David Rodríguez
ab4a25e48e [rubygems/rubygems] Follow up to removal of rubyinstaller2 workaround
5b312fd040
2025-04-09 08:11:10 +09:00
David Rodríguez
710bf4a472 [rubygems/rubygems] Rubyinstaller2 fixed this
08b3c48f41
2025-04-04 08:54:47 +09:00
David Rodríguez
3fdf0e7e6d [rubygems/rubygems] Fix specs with missing extensions getting activated
c80998a22a
2024-10-10 14:51:32 +00:00
Samuel Giddins
db6e6155d6 [rubygems/rubygems] Remove outdated conditionals from tests
Signed-off-by: Samuel Giddins <segiddins@segiddins.me>

06eec6d855
2024-10-04 20:01:51 +00:00
David Rodríguez
c9d2343f5c [rubygems/rubygems] Fix incorrect standalone script when default gems with extensions are used
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.

72301a2e3b
2024-07-18 18:07:08 +00:00
David Rodríguez
ba6ffaf2e0 [rubygems/rubygems] Use latest shellwords for standalone test
fcd04daf68
2024-07-18 18:07:08 +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.

4121a32408
2024-07-18 09:25:17 +00:00
David Rodríguez
ad6b2e8985 [rubygems/rubygems] Test using latest rubies
6d6646b8bc
2024-07-09 11:26:10 +00:00
David Rodríguez
98c923ff4b
Synchronize Bundler & RubyGems (#11071) 2024-06-28 10:12:29 -04:00
David Rodríguez
1572322e17
Sync with upstream rubygems (#9206) 2023-12-12 11:49:25 -08:00
Martin Emde
3b9ea6648f
[rubygems/rubygems] Use StringIO 3.1.0 in tests to work with ruby 3.3.0
8a936d733d
2023-12-12 10:04:57 +09:00
David Rodríguez
2755cb1b2f [rubygems/rubygems] Use modern hashes consistently
bb66253f2c
2023-12-07 22:29:33 +00:00
David Rodríguez
50482cd1e5 [rubygems/rubygems] Drop support for Ruby 2.6 and Ruby 2.7 in Bundler
93619c97ff
2023-11-13 11:06:10 +09:00
Daniel Colson
accda74cbe [rubygems/rubygems] Prevent gem activation in standalone mode
As discussed in https://github.com/rubygems/rubygems/issues/6273#issuecomment-1449176658

The `gem` method behaves awkwardly in standalone mode. Assuming bundler
isn't loaded at all, a call to gem might activate a gem that is not part
of the bundle (because it's the gem method defined in
lib/rubygems/core_ext/kernel_gem.rb and not
lib/bundler/rubygems_integration.rb). And when running with
`--disable-gems`, the gem method won't be defined at all so we'll get a
NoMethodError.

Calls to `gem` can appear in dependencies outside an application's
control. To work around this at GitHub we defined our own `Kernel#gem`
that no-ops.

I agree with https://github.com/rubygems/rubygems/issues/6273#issuecomment-1440755882

> people using standalone mode don't want to activate gems like Kernel.gem

This commit redefines `Kernel#gem` in the standalone script to no-op.

bea17b55f1
2023-10-03 17:16:19 +00:00
Hiroshi SHIBATA
38fa8eb4cb Merge rubygems/bundler master
Pick from e9304aed7e
2023-02-21 19:28:12 +09:00
Hiroshi SHIBATA
a43f1d90c2 Merge RubyGems and Bundler master
from 0635c1423d
2023-01-10 15:53:07 +09:00
David Rodríguez
6bc6c8d031 [rubygems/rubygems] Remove no longer needed fiddle hacks
RubyInstaller has released patch versions backporting their changes to
not load `fiddle` on boot, so all these are no longer necessary.

05a307deb2
2022-09-05 21:21:15 +09:00
David Rodríguez
030050cdfa [rubygems/rubygems] Make --standalone play nice with --local
I'm not sure if using relative paths in the generated script is best for
this case, since it makes the script not movable, but that can be
improved later.

7f5bdbb842
2022-07-30 04:24:25 +09:00
David Rodríguez
a782d76fbe [rubygems/rubygems] Fix pending Bundler specs
When testing under the ruby/ruby setup, mkmf.rb needs to the `$extout`
global variable set properly.

This is because, in this particular case, the `ruby.h` header needed to
compile extensions is constructed from
`$(extout)/include($arch)/ruby/config.h` but `$extout` is not set by
default.

I tried to fix this in mkmf.rb itself but I couldn't figure it. But
setting it externally to workaround the issue fixes the specs, so I'll
start with that. Also setting it externally causes issues when running
specs upstream against Ruby 2.3 (I guess because of some difference with
Ruby 2.3 mkmf.rb implementation). So I'm avoiding doing it on Ruby 2.3 to
woraround that.

d782984585
2022-06-26 11:16:11 +09:00
David Rodríguez
6f229da2c0 [rubygems/rubygems] Fix standalone script generation for statically linked dev ruby
4d0d7b3c97
2022-06-23 18:17:37 +09:00
citrusmoose
8d689294d0 [rubygems/rubygems] Fix extension paths in generated standalone script
The paths for extensions of gems would contain the hardcoded ruby
version on which the extension was built. This will replace it with
runtime ruby version like the parent version directory. It will make the
standalone script compatible between different ruby version installations.

a9dae93d5d
2022-06-20 16:04:47 +09:00
David Rodríguez
0a6b9924bd [rubygems/rubygems] Fix generated standalone script for default gems
The installer is actually rewriting the spec's full gem path to be the
one of the newly installed gem, however the accessor was not properly
working for `StubSpecification` instances, and default gems are always
of this type, because they are always present locally.

Fix the accessor to properly update the underlying full specification.

efa41babfa
2022-06-01 17:07:35 +09:00
Hiroshi SHIBATA
1056489ea3 Merge 3f7d0352e8 2022-04-28 19:08:49 +09:00
Hiroshi SHIBATA
678d58c850 Merge rubygems master 1e4eda741d732ca1bd7031aef0a16c7348adf7a5 2022-04-28 19:08:49 +09:00
Hiroshi SHIBATA
ff3d7b720e Merge RubyGems and Bundler master 2022-02-28 11:39:20 +09:00
David Rodríguez
517d7c3221 Sync latest Bundler & RubyGems 2022-02-01 08:09:23 +09:00
Hiroshi SHIBATA
fb1ab27f53 Merge RubyGems-3.3.1 and Bundler-2.3.1 2021-12-23 09:44:45 +09:00
Hiroshi SHIBATA
7e084ed707 Merge RubyGems and Bundler master
Merge from 793ad95ecb
2021-12-15 18:05:18 +09:00
Josef Šimánek
0029e0948a
[rubygems/rubygems] Install stringio for standalone spec.
- previously it was required already by net/http, but it is not anymore using ruby-trunk
- 996d18a43f
- 364044e090 (diff-a1d29a94def02829fd4f9ba591199acf079e028f5a2002a77c363eb01212e112)

be1779655a
2021-10-29 18:00:46 +09:00
David Rodríguez
f1c0729128 [rubygems/rubygems] Fix standalone generated script to deal with path sources
In the case of path sources, the path the source is pointing to should
be added directly to the `$LOAD_PATH` without any modifications.

d3bba936f0

Co-authored-by: Daniel Niknam <mhmd.niknam@gmail.com>
2021-08-31 19:06:14 +09:00
David Rodríguez
7465b94f8a [rubygems/rubygems] Remove unnecessary ruby_version local variable
Under some case, this variable might not end up being used, in which
case running the script would print unused variable warnings.

bf96030362
2021-08-31 19:06:14 +09:00
David Rodríguez
3aa087d533 [rubygems/rubygems] Remove unnecessary ruby_engine local variable
Under some case, this variable might not end up being used, in which
case running the script would print unused variable warnings.

a2d6392ada
2021-08-31 19:06:14 +09:00
David Rodríguez
1d6551a02d [rubygems/rubygems] Remove unnecessary path local variable
We can use `__dir__` directly.

0e6083ca94
2021-08-31 19:06:14 +09:00
David Rodríguez
c2f376bcc0 [rubygems/rubygems] Fix standalone install of default gems
Rubygems source replacement was broken.

3549c122f6
2021-08-31 19:06:14 +09:00
Daniel Niknam
2f9e0cf181
[rubygems/rubygems] Explicitly define a global source for tests
This is in preparation for deprecating source-less gemfiles.

d6493fa3e2
2021-07-27 09:25:57 +09:00
David Rodríguez
53468cc111 Sync latest development version of bundler & rubygems 2021-03-08 13:47:35 +09:00
Hiroshi SHIBATA
69ed64949b Track Bundler master(2.3.0.dev) branch at 55634a8af18a52df86c4275d70fa1179118bcc20 2021-01-04 13:14:43 +09:00