summaryrefslogtreecommitdiff
path: root/lib/bundler
AgeCommit message (Collapse)Author
2023-09-15[rubygems/rubygems] Stop allocating the same settings keys repeatedlySamuel Giddins
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 https://github.com/rubygems/rubygems/commit/e64debb6ae
2023-09-14[rubygems/rubygems] Gemfile ruby file: covers more version formatsMartin Emde
Increase test coverage and be explicit about what is and is not supported. https://github.com/rubygems/rubygems/commit/a096397a00
2023-09-12[rubygems/rubygems] Unify LockfileParser loading of SPECS sectionMartin Emde
Ensure unrecognized SPECS types are ignored https://github.com/rubygems/rubygems/commit/5b33e91075
2023-09-07[rubygems/rubygems] Reduce excess index creation and mergingMartin Emde
When @allow_cached is true, @allow_local is always true, therefore, the #installed_specs will always be merged after #cached_specs is called. This makes starting with installed_specs.dup redundant. When #cached_specs is called because @allow_remote is true and @allow_cached is false, then installed_specs will be added after cached_specs based on @allow_local. We never need to add installed_specs here, so don't. https://github.com/rubygems/rubygems/commit/49b38f9750
2023-09-07[rubygems/rubygems] Improve efficiency of Index#use and #search_allMartin Emde
Rename Index#use(override = true) to #merge! Rename Index @all_specs to @duplicates, it is not actually all specs. @duplicates only holds specs that would have been overridden during a call to Index#use or Index#merge! Reduced dupes in @duplicates by not double adding the new spec to the index and the @duplicates during #merge! Reduce Array creation by using specialized methods when the one result or no results are needed from the search. https://github.com/rubygems/rubygems/commit/47e91125db
2023-09-07[rubygems/rubygems] Source::Rubygems#fetch_names is only called with ↵Martin Emde
override = false https://github.com/rubygems/rubygems/commit/790202691d
2023-08-30[rubygems/rubygems] Update bundler/lib/bundler/settings.rbJosh Nichols
https://github.com/rubygems/rubygems/commit/75ffa8ef76 Co-authored-by: Martin Emde <martinemde@users.noreply.github.com>
2023-08-30[rubygems/rubygems] (Further) Improve Bundler::Settings#[] performance and ↵Josh Nichols
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. https://github.com/rubygems/rubygems/commit/b913cfc87b
2023-08-29[rubygems/rubygems] Fix bundle update --redownloadSamuel Giddins
It now does the redownloading/installing just like bundle install --redownload https://github.com/rubygems/rubygems/commit/3b058e5eca
2023-08-29[rubygems/rubygems] rubocop -aHiroshi SHIBATA
https://github.com/rubygems/rubygems/commit/f240bfad2a
2023-08-28[rubygems/rubygems] Fixed malformed lockfile version on installingImir Kiyamov
https://github.com/rubygems/rubygems/commit/c969a192bf
2023-08-28[rubygems/rubygems] Don't check for circular deps on full index sourcesDavid Rodríguez
https://github.com/rubygems/rubygems/commit/d275cdccb1
2023-08-28[rubygems/rubygems] Remove redundant checksDavid Rodríguez
https://github.com/rubygems/rubygems/commit/d66815633b
2023-08-28[rubygems/rubygems] Fix standalone install crashing when using legacy multi ↵David Rodríguez
remote gemfiles If a legacy multi remote Gemfile depends transitively on a default gem, then in standalone mode we'd fail to fetch the proper version from the source that includes it, since we were adding it to `specs` (instead of `remote_specs`), which was already including the default version of the gem, and thus preventing the remote version from "overwriting that" and being added to the index. We should add it to the `remote_specs` index directly instead. https://github.com/rubygems/rubygems/commit/05f4f9dfc0
2023-08-28[rubygems/rubygems] Refactor Fetcher#api_fetcher? and fetcher loading logicMartin Emde
https://github.com/rubygems/rubygems/commit/f664d60114
2023-08-25[rubygems/rubygems] Don't use full indexes unnecessarily on legacy GemfilesDavid Rodríguez
On legacy Gemfiles with multiple remote sources, where all of them support the compact index API, we were still falling back to full indexes. Fixing this also allows to simplifying the code. https://github.com/rubygems/rubygems/commit/b1357c8e72
2023-08-25Suggest to add bundled gems into gemspec if 3rd party gem try to load gem ↵Hiroshi SHIBATA
from Gem::BUNDLED_GEMS::SINCE [Feature #19846]
2023-08-21[rubygems/rubygems] Support `ruby file: ".tool-versions"` in GemfileGaurav Khanna
(https://github.com/rubygems/rubygems/pull/6898) Supports .tool-versions (ASDF) by checking for a line starting with "ruby" before falling back to reading the entire file, as in .ruby-version. https://github.com/rubygems/rubygems/commit/6c0a3e793a
2023-08-20[rubygems/rubygems] fix lintJosh Nichols
https://github.com/rubygems/rubygems/commit/75c0f27b7e
2023-08-20[rubygems/rubygems] use a one-linerJosh Nichols
https://github.com/rubygems/rubygems/commit/46745885e8
2023-08-20[rubygems/rubygems] handle removing `BUNDLE_`, since using start_with? would ↵Josh Nichols
still include that https://github.com/rubygems/rubygems/commit/235d9b38d8
2023-08-20[rubygems/rubygems] Don't rely on globals when not matching regexp for "local."Martin Emde
https://github.com/rubygems/rubygems/commit/e79ccdafd8
2023-08-20[rubygems/rubygems] Use ! methods once we have a new copy of the string. Use ↵Josh Nichols
.prepend to avoid allocating a new string. https://github.com/rubygems/rubygems/commit/2ac35a661f
2023-08-20[rubygems/rubygems] call key.to_s once instead of multiple times to save ↵Josh Nichols
when it's a symbol https://github.com/rubygems/rubygems/commit/535feb817c
2023-08-20[rubygems/rubygems] Use value.match? only on Strings, which avoids ↵Josh Nichols
allocating a matchdata, which is not used https://github.com/rubygems/rubygems/commit/cbf9ac93d7
2023-08-20[rubygems/rubygems] Use .to_s once in the beginning to save allocations if ↵Josh Nichols
it's a symbol. https://github.com/rubygems/rubygems/commit/f8167db8a2
2023-08-20[rubygems/rubygems] name is often a symbol, so only to_s once to avoid ↵Josh Nichols
allocating it multiple times https://github.com/rubygems/rubygems/commit/8eac49c429
2023-08-20[rubygems/rubygems] String#start_with? is faster than regex with beginning ↵Josh Nichols
boundaries https://github.com/rubygems/rubygems/commit/d7cde68034
2023-08-20[rubygems/rubygems] Use ! methods on the array, since it is brand new. The ↵Josh Nichols
individual keys are also new, so we can use ! methods on each individual one as well. https://github.com/rubygems/rubygems/commit/f2e912b9bb
2023-08-20[rubygems/rubygems] Use Array#union to join these, instead of with | ↵Josh Nichols
multiple times. This saves allocating 2 arrays https://github.com/rubygems/rubygems/commit/48c03b33b7
2023-08-20[rubygems/rubygems] config is a new Hash, and config.values is a new Array. ↵Josh Nichols
that means we can use bang methods to avoid allocating new copies https://github.com/rubygems/rubygems/commit/8bc13fa55f
2023-08-20[rubygems/rubygems] ENV.to_h returns a new hash, so we can `select!` it to ↵Josh Nichols
avoid allocating another hash. `String#start_with?` is faster than regex that is bound to the start of a string. https://github.com/rubygems/rubygems/commit/9b2006ef09
2023-08-18[rubygems/rubygems] Resolve ruby version file relative to bundle rootNgan Pham
This is a follow up to https://github.com/rubygems/rubygems/issues/6742. This change makes it so that the version file is resolved relative to the Bundle root instead of the working directory. Why is this useful? If you run a commnad (eg `rails`) from the `app/` directory, your bundle would fail to load. https://github.com/rubygems/rubygems/commit/6d47ee98b9
2023-08-17[rubygems/rubygems] Add `file` option to `ruby` method in GemfileNgan Pham
https://github.com/rubygems/rubygems/commit/fb9354b7bf
2023-08-17[rubygems/rubygems] Clarify that `bundle info` takes a gem nameManu
https://github.com/rubygems/rubygems/commit/09ef74ef73
2023-08-16[rubygems/rubygems] Show better error when PAT can't authenticate to a ↵David Rodríguez
private server Before: ``` Fetching gem metadata from https://rubygems.org/........ Fetching source index from https://rubygems.pkg.github.com/my-org/ Bad username or password for https://x-access-token@rubygems.pkg.github.com/my-org/. Please double-check your credentials and correct them. ``` After: ``` Fetching gem metadata from https://rubygems.org/........ Fetching source index from https://rubygems.pkg.github.com/my-org/ Access token could not be authenticated for https://x-access-token@rubygems.pkg.github.com/my-org/. Make sure it's valid and has the necessary scopes configured. ``` https://github.com/rubygems/rubygems/commit/2ae69c964a
2023-08-16[rubygems/rubygems] Bad auth should not fallback eitherDavid Rodríguez
https://github.com/rubygems/rubygems/commit/ba3ea27869
2023-08-16[rubygems/rubygems] Fix git source conservativenessDavid Rodríguez
https://github.com/rubygems/rubygems/commit/9a0e0dfd5b
2023-08-16[rubygems/rubygems] Extract s.name to a variableDavid Rodríguez
https://github.com/rubygems/rubygems/commit/689c39b42f
2023-08-16[rubygems/rubygems] Remove unneeded stuffDavid Rodríguez
This should be only for path sources, and unrelated to git. https://github.com/rubygems/rubygems/commit/0d8f31eeed
2023-08-16[rubygems/rubygems] Don't update locked sources when not necessaryDavid Rodríguez
https://github.com/rubygems/rubygems/commit/cfc82b592a
2023-08-16[rubygems/rubygems] Extract a `default_source` methodDavid Rodríguez
https://github.com/rubygems/rubygems/commit/784e08348e
2023-08-16[rubygems/rubygems] Move `lockfile_source` variable out of condition branchDavid Rodríguez
https://github.com/rubygems/rubygems/commit/efebc64250
2023-08-16[rubygems/rubygems] Refactor locked dep filtering moreDavid Rodríguez
We only need to check whether the spec if for a direct dependency once. https://github.com/rubygems/rubygems/commit/65b455a5cb
2023-08-16[rubygems/rubygems] Avoid unnecessary loop through dependenciesDavid Rodríguez
https://github.com/rubygems/rubygems/commit/2ab63bb94d
2023-08-04Display call location with bundled gems warningHiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/8172
2023-08-04Fixed worng key of bundled_gems listHiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/8172
2023-08-04Also decorate warning message with future tense for bundlerHiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/8172
2023-08-02[rubygems/rubygems] Replaced remained local to lockfileHiroshi SHIBATA
https://github.com/rubygems/rubygems/commit/6ed69223d4
2023-08-01[rubygems/rubygems] Use Kernel.singleton_classHiroshi SHIBATA
https://github.com/rubygems/rubygems/commit/9be984f281