Commit graph

80 commits

Author SHA1 Message Date
David Rodríguez
95fdaa5c3b
(Temporarily?) delay path changes and global cache changes
There are several issues with these which I'm not sure I'll have time to
address properly. I prefer to keep our default branch in a releasable
state just in case. Once they are fixed, this can be reverted.
2025-07-28 10:01:58 +09:00
David Rodríguez
6a5808965b [rubygems/rubygems] Stop allowing calling #gem on random objects
4b8570ae15
2025-07-07 11:53:12 +09:00
David Rodríguez
cd3389e5c2 [rubygems/rubygems] Cancel path_relative_to_cwd change
It only affected the `--path` flag which is actually getting removed, so
I don't think it makes sense to make such change. The current behavior
is reasonable and I tried to codify it with a few more specs.

6f520eb146
2025-07-07 11:53:11 +09:00
David Rodríguez
9918ca1671 [rubygems/rubygems] Remove default_install_uses_path setting
The previous default can already be configured with `bundle config
path.system true`.

cb483b79db
2025-07-07 11:53:00 +09:00
David Rodríguez
fef0051926 [rubygems/rubygems] Remove auto_clean_without_path setting
There already different ways of toggling off this behavior, like setting
`bundle config clean false`, or configuring Bundler to install to system
gems with `bundle config path.system true`.

6daa09f60a
2025-07-07 11:52:58 +09:00
David Rodríguez
7f057e13e0
[rubygems/rubygems] Add a verbose setting to enable verbose output for all commands
0aa1be946f
2025-07-02 10:34:19 +09:00
David Rodríguez
cac7644bdb
[rubygems/rubygems] Document the simulate_version setting
1ffd83f6c2
2025-07-02 10:34:18 +09:00
David Rodríguez
daedebd64a
[rubygems/rubygems] Remove print_only_version_number setting
I don't think it makes sense to make this tiny behavior change
configurable. If someone wants to parse version output, and we have a
public setting, they are going to need to accommodate their regexps to
both values of the setting.

In addition to this, I plan to enhance version output with a note about
"simulated version", and in that case, "print_only_version_number" would
no longer hold, since what we print will be more than that anyways.

So, I'd like to remove the setting and change the output in Bundler 4
with no way to opt out.

d84e9dcf09
2025-07-02 10:34:18 +09:00
Hiroshi SHIBATA
949f125f0f [rubygems/rubygems] Use Bundler.settings[gem.bundle]
b16511598e
2025-06-30 12:56:50 +09:00
David Rodríguez
db0c7be642 [rubygems/rubygems] Add a lockfile_checksums configuration to include checksums in fresh lockfiles
50b9ef8589
2024-11-11 19:24:42 +00:00
David Rodríguez
cc29d737ef [rubygems/rubygems] Consistently use :create action when creating directories
It gives better errors.

bedae080ef
2024-10-23 08:53:18 +00:00
David Rodríguez
0fb73a8eda [rubygems/rubygems] Avoid appending a final "/" when fallback_timeout is used in config
a0af1baa2b
2024-06-06 18:53:31 +00:00
David Rodríguez
765d61593a [rubygems/rubygems] Remove per uri options constant
I don't think we should add more of these.

9eee9948cc
2024-06-06 18:53:30 +00:00
David Rodríguez
82b68bc358 [rubygems/rubygems] Move Bundler settings specific logic to Bundler
7d1e8be2ce
2024-06-06 18:53:29 +00:00
David Rodríguez
da10d1ddea [rubygems/rubygems] Avoid is_a? check before using normalize_uri
31cb15d03f
2024-06-06 18:53:28 +00:00
David Rodríguez
60620509f4 [rubygems/rubygems] Remove unnecessary .to_s
The `normalize_uri` method always gives back a String.

246953010c
2024-06-06 18:53:27 +00:00
David Rodríguez
61a80bd10d [rubygems/rubygems] Truly ignore commented out settings
e31df2d6ef
2024-06-06 18:53:25 +00:00
David Rodríguez
4f160ad9cf [rubygems/rubygems] Don't let bundle config report a path without a Gemfile as "local app"
6aa2ac337f
2024-05-30 18:23:36 +00:00
David Rodriguez
bc652d7568
[rubygems/rubygems] Never write credentials to lockfiles
e8a363713e
2024-04-18 11:07:09 +09:00
David Rodriguez
dc06375c4f [rubygems/rubygems] Ignore commented out keys in config file
c4a8d2a930
2024-03-17 22:55:16 +00:00
David Rodríguez
f3123f8af2 [rubygems/rubygems] Use rubygems vendored uri from Bundler when available
5d6a8f2fb4
2024-01-29 12:15:10 +09:00
David Rodríguez
2755cb1b2f [rubygems/rubygems] Use modern hashes consistently
bb66253f2c
2023-12-07 22:29:33 +00:00
David Rodríguez
794c879d19 [rubygems/rubygems] Don't remember --jobs flag
9ab1136036
2023-11-27 15:04:40 +09:00
David Rodríguez
a4d80eee17 [rubygems/rubygems] Let RuboCop target Ruby 3.0
70243b1d72
2023-11-13 11:06:10 +09:00
Samuel Giddins
c423d6e0e4 [rubygems/rubygems] Stop allocating the same settings keys repeatedly
Running `bundle update --bundler` on a rails app locally:

```
==> memprof.after.txt <==
Total allocated: 301.90 kB (3794 objects)
Total retained:  73.24 kB (698 objects)

==> memprof.before.txt <==
Total allocated: 14.47 MB (196378 objects)
Total retained:  25.93 kB (202 objects)
```

So for a slight increase in retained memory (all keys are now retained),
we go from about 200k allocations in the settings file to under 4k

e64debb6ae
2023-09-15 17:54:01 +00:00
Josh Nichols
e747e2c36b [rubygems/rubygems] Update bundler/lib/bundler/settings.rb
75ffa8ef76

Co-authored-by: Martin Emde <martinemde@users.noreply.github.com>
2023-08-30 00:36:38 +00:00
Josh Nichols
6a876a61d7 [rubygems/rubygems] (Further) Improve Bundler::Settings#[] performance and memory usage
I previously identified and improved this method over in https://github.com/rubygems/rubygems/pull/6884
but while reviewing another memory_profiler profile, I realized another
gain we can eek out.

This method keeps comes up in part because `configs` is allocating a new
Hash every time. My last change took advantage of that by using `map!`
on it. `configs` is called quite often, including in this `[]` method,
so there's a benefit to memoizing it.

Back in `[]`, logically we are trying to find the first Hash in `configs`
that has a value for the given key. Currently, we end up `map` and
`compact` to just get that value.

Instead, we can use a loop over `configs`, and break when we find the
value for the key.

b913cfc87b
2023-08-30 00:36:38 +00:00
Josh Nichols
3544200513 [rubygems/rubygems] fix lint
75c0f27b7e
2023-08-20 09:07:11 +00:00
Josh Nichols
7c4431e61c [rubygems/rubygems] use a one-liner
46745885e8
2023-08-20 09:07:05 +00:00
Josh Nichols
e5efa01c7d [rubygems/rubygems] handle removing BUNDLE_, since using start_with? would still include that
235d9b38d8
2023-08-20 09:07:00 +00:00
Martin Emde
f0bf9391dc [rubygems/rubygems] Don't rely on globals when not matching regexp for "local."
e79ccdafd8
2023-08-20 09:06:54 +00:00
Josh Nichols
b5a0630cd0 [rubygems/rubygems] Use ! methods once we have a new copy of the string. Use .prepend to avoid allocating a new string.
2ac35a661f
2023-08-20 09:06:48 +00:00
Josh Nichols
29aab66e6b [rubygems/rubygems] call key.to_s once instead of multiple times to save when it's a symbol
535feb817c
2023-08-20 09:06:43 +00:00
Josh Nichols
239e35254b [rubygems/rubygems] Use value.match? only on Strings, which avoids allocating a matchdata, which is not used
cbf9ac93d7
2023-08-20 09:06:36 +00:00
Josh Nichols
598048e3dd [rubygems/rubygems] Use .to_s once in the beginning to save allocations if it's a symbol.
f8167db8a2
2023-08-20 09:06:31 +00:00
Josh Nichols
e921efa476 [rubygems/rubygems] name is often a symbol, so only to_s once to avoid allocating it multiple times
8eac49c429
2023-08-20 09:06:25 +00:00
Josh Nichols
7cb6cbee95 [rubygems/rubygems] String#start_with? is faster than regex with beginning boundaries
d7cde68034
2023-08-20 09:06:19 +00:00
Josh Nichols
b97e45d01a [rubygems/rubygems] Use ! methods on the array, since it is brand new. The individual keys are also new, so we can use ! methods on each individual one as well.
f2e912b9bb
2023-08-20 09:06:12 +00:00
Josh Nichols
2a61e1dccc [rubygems/rubygems] Use Array#union to join these, instead of with | multiple times. This saves allocating 2 arrays
48c03b33b7
2023-08-20 09:06:07 +00:00
Josh Nichols
79b187a45e [rubygems/rubygems] config is a new Hash, and config.values is a new Array. that means we can use bang methods to avoid allocating new copies
8bc13fa55f
2023-08-20 09:06:01 +00:00
Josh Nichols
921c2bba4e [rubygems/rubygems] ENV.to_h returns a new hash, so we can select! it to avoid allocating another hash.
`String#start_with?` is faster than regex that is bound to the start of
a string.

9b2006ef09
2023-08-20 09:05:56 +00:00
Hiroshi SHIBATA
dd1af4b22d
[rubygems/rubygems] Rename local to lockfile and global to system
456fd05d3a
2023-07-24 15:04:24 +09:00
David Rodríguez
0b0df03b0d
[rubygems/rubygems] Avoid printing using messages when version has not changed
9635a2fd74
2023-07-24 15:03:15 +09:00
Hiroshi SHIBATA
f16c880f77
[rubygems/rubygems] Introduce bundle config set version feature
c431a1df52
2023-07-13 11:36:03 +09:00
David Rodríguez
03246719cc [rubygems/rubygems] Fix path vs deployment precedence when path set through ENV
The `deployment` setting sets `path` to `vendor/bundle` implicitly, but
that should only apply if `path` is not set explicitly, at any level.

3552c064c1
2023-06-06 10:52:57 +09:00
Hiroshi SHIBATA
d1c42da7a1 [rubygems/rubygems] To use Gem::YAMLSerializer in Bundler
5351e01b32
2023-04-19 06:56:24 +00:00
Hiroshi SHIBATA
7b959f6288 [rubygems/rubygems] Move all changes only in RubyGems
d842e2092f
2023-04-19 06:56:20 +00:00
Hiroshi SHIBATA
bf8d8ce1ee [rubygems/rubygems] Keep compatiblity of Bundler specs
b211eeacba
2023-04-19 06:56:18 +00:00
David Rodríguez
ddc4fd5644 Normalize git sources
Just like gem sources, a "style-only" change, like adding a trailing
slash, should not expire them.
2023-03-17 18:50:55 +09:00
Hiroshi SHIBATA
3eca1e438d Merge 16c3535413 2022-09-05 14:37:12 +09:00