summaryrefslogtreecommitdiff
path: root/lib/bundler
Commit message (Collapse)AuthorAgeFilesLines
* Merge #7580Bundlerbot2020-02-274-20/+13
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 7580: Automultiplatform again r=indirect a=deivid-rodriguez This PR is a reintroduction of #7215, now that I consider the multiplatform feature usable enough. ### What was the end-user problem that led to this PR? The problem was that currently if the gemfile include gems for specific platforms, like the default `gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]` Rails uses, bundler will always print a noisy warning, but I don't think users are doing anything wrong, just running `bundle install` on it. Also, unless they run `bundle lock --add-platform x86-mingw32 x86-mswin32 x64-mingw32 java`, and commit the resulting lockfile, they will continue to get the same warning over and over again. ### What was your diagnosis of the problem? My diagnosis is that the fact that some gems will be unused under some platforms is inherent to the multiplatform feature itself, so we shouldn't warn about it because it's expected. Take the following Gemfile for example (a simplification of the default Gemfile Rails generators create): ```ruby source "https://rubygems.org" gem "rails" gem "tzinfo-data", platforms: "jruby" ``` If I type that Gemfile, it means that I'm explicitly opting into the multiplatform feature. So the behavior I would want as a user when I run `bundle install` on it is: * Resolve and lock the Gemfile for all platforms (`jruby` and whatever platform I'm running). * Install the resolution for the platform that I'm currently running. That way, when the other developers of my team using `jruby` install the `Gemfile`, they install a predictable, deterministic resolution. Currently, the only way to get that behavior is to run: ``` $ bundle install $ bundle lock --add-platform java ``` But there's no way to do it without getting a warning on the first `bundle install`, which annoys people because it makes you think you're doing something wrong. If you only plan to use MRI, you shouldn't specify any jruby-specific gems in your Gemfile and write instead: ```ruby source "https://rubygems.org" gem "rails" ``` If on the other hand you only plan to use jruby, then you should not specify any `platform` option at all and write ```ruby source "https://rubygems.org" gem "rails" gem "tzinfo-data" ``` So, to sum up, I think the range of platforms users expect to support can be guessed implicit from the Gemfile and the running platform. So we should resolve by default for all those platforms and don't warn about behavior that's most likely expected. ### What is your fix for the problem, implemented in this PR? My fix is to do the right thing by default, and not warn users at all. That is: * Resolve the gemfile and lock it for all platforms present in the Gemfile. * Install gems for the current platform if requested. ### Why did you choose this fix out of the possible options? I chose this fix because I think it's better for our users. We currently have a specific setting to avoid this warning, which I guess we added given the complaints. We no longer need that setting, nor the warning, so I removed both. Co-authored-by: David Rodríguez <deivid.rodriguez@riseup.net>
| * Revert "Revert "Remove now unused method""automultiplatform_againDavid Rodríguez2020-02-271-4/+0
| | | | | | | | This reverts commit 13cef81582858af9509726f3a24a817cf029ad9b.
| * Revert "Revert "Remove now meaningless setting""David Rodríguez2020-02-272-2/+1
| | | | | | | | This reverts commit b4cc36deb9749fba603d149e2b8e71b10cb331f1.
| * Revert "Revert "Remove now meaningless warning""David Rodríguez2020-02-271-11/+1
| | | | | | | | This reverts commit e93bce3b206895a46b9fb5889c5f908fd29ad554.
| * Revert "Revert "Add all platforms to lockfile by default""David Rodríguez2020-02-272-3/+11
| | | | | | | | This reverts commit b5766564fb6ad9c74c3b87ad6b2965f3b9095d08.
* | Merge #7590Bundlerbot2020-02-271-1/+1
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 7590: Prepend debug label to resolver's debug message r=deivid-rodriguez a=kou ### What was the end-user problem that led to this PR? The problem was not a end-user problem. This was a developer problem. If we have many debug messages (for example, I added many `pp [...]` to debug #7522), it's difficult to find resolver's debug messages. ### What was your diagnosis of the problem? My diagnosis was no common keywords in resolver's debug message is a problem. If we have a common keyword, we can find resolver's debug messages from many debug messages easily. ### What is your fix for the problem, implemented in this PR? My fix prepends `BUNDLER: ` to all resolver's debug messages. If we have the same label in all resolver's debug messages, we can find resolver's debug message easily. For example, we can use "/BUNDLER:" in less. ### Why did you choose this fix out of the possible options? I chose this fix because `BUNDLER: ` will not conflict. Other candidate is `DEBUG: ` but it may be used by other library. If the keyword conflicts, it's not easy to find resolver's debug messages. `Bundler::Resolver: ` will be more safer but it may be long. Co-authored-by: Sutou Kouhei <kou@clear-code.com>
| * Prepend debug label to resolver's debug messageSutou Kouhei2020-01-201-1/+1
| | | | | | | | | | | | If we have the same label in all resolver's debug messages, we can find resolver's debug message easily. For example, we can use "/BUNDLER:" in less. It's useful when we have many debug messages.
* | Adhere to gemfile name preference also for project skeletonMasha2020-02-272-2/+2
| |
* | Bump rake version to 13.0 everywherebump_rakeDavid Rodríguez2020-02-211-1/+1
| |
* | Update code of conduct tenplate to CC2.0Coraline Ada Ehmke2020-02-161-47/+57
| |
* | Merge #7614Bundlerbot2020-02-021-1/+5
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 7614: Workaround jruby issue r=deivid-rodriguez a=deivid-rodriguez <!-- Thanks so much for the contribution! If you're updating documentation, make sure you run `bin/rake man:build` and squash the result into your changes, so that all documentation formats are updated. To make reviewing this PR a bit easier, please fill out answers to the following questions. --> ### What was the end-user or developer problem that led to this PR? The problem is that if a Gemfile contains `:path` gem with a relative path, the bundler environment no longer works when the app is packaged as a `jar` with [warbler](https://github.com/jruby/warbler). ### What is your fix for the problem, implemented in this PR? <!-- Explain the fix being implemented. Include any diagnosis you run to determine the cause of the issue and your conclusions. If you considered other alternatives, explain why you end up choosing the current implementation --> Issue was introduced https://github.com/rubygems/bundler/commit/c7532ced89bbc8ddc7296c56391c1c3cc981c54a, since when `jruby` deals with urls of the form "uri:classloader", it has a weird inconsistency where `Pathname#expand_path` with an argument always returns `uri:classloader://` (double slash) as the canonical version of the path, while `Pathname#expand_path` without an argument always returns `uri:classloader/` (single slash) as the canonical version of it. ``` Pathname.new("uri:classloader://foo/bar").expand_path # => <Pathname:uri:classloader:/foo/bar> Pathname.new("uri:classloader:/foo/bar").expand_path # => <Pathname:uri:classloader:/foo/bar> Pathname.new("foo/bar").expand_path("uri:classloader://") # => <Pathname:uri:classloader://foo/bar> Pathname.new("foo/bar").expand_path("uri:classloader:/") # => <Pathname:uri:classloader://foo/bar> ``` That makes `Pathname#relative_path_from` (introduced with the offending commit) explode because we end up passing to different "uri:classloader" kind of paths to it. I believe this should be fixed in `jruby` be doing either or both of the following things: * Make `Pathname#expand_path` return consistent versions of "uri:classpath" paths. * Make `Pathname#relative_path_from` support different versions of "uri:classpath" paths, since they are both absolute paths after all. But I'm workarounding the issue in `bundler` by adding an extra `expand_path` call at an appropriate place to make sure that the URLs we pass to `Pathname#relative_path_from` have a consistent shape. Fixes #7598. NOTE: We currently don't have the ability to run a full test suite for every PR on jruby because it's too slow (#4796 attempted to improve that but it was never completed), and it doesn't even fully pass (#7603). As an alternative, I'm adding some realworld bare tests to be run under jruby, just to make sure common tasks like this one work. Co-authored-by: David Rodríguez <deivid.rodriguez@riseup.net>
| * | Workaround jruby issuejruby_issueDavid Rodríguez2020-02-021-1/+5
| | |
* | | Update GitHub URLs in error messages.Ellen Marie Dash2020-02-013-6/+6
|/ /
* | Simplify arguments to `sh`Nobuyoshi Nakada2020-01-281-6/+6
| | | | | | | | Get rid of escaping and splitting shell code repeatedly.
* | remove warn call on LoadErrorEmily Giurleo2020-01-231-5/+0
| |
* | Merge #7527Bundlerbot2020-01-231-2/+1
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 7527: Report original exception when failing to load openssl r=deivid-rodriguez a=p-mongo ### What was the end-user problem that led to this PR? See #7192. ### What was your diagnosis of the problem? Bundler discards `LoadError` class and message when reporting it. ### What is your fix for the problem, implemented in this PR? Report class and message of the original exception when reporting `LoadError`. Fixes #7192 Co-authored-by: Oleg Pudeyev <oleg@bsdpower.com> Co-authored-by: David Rodríguez <deivid.rodriguez@riseup.net> Co-authored-by: Emily Giurleo <e.m.giurleo@gmail.com>
| * always print backtrace on LoadErrorEmily Giurleo2020-01-221-1/+1
| |
| * remove trace and update the specs accordinglyEmily Giurleo2020-01-221-1/+0
| |
| * TweakDavid Rodríguez2020-01-031-1/+1
| |
| * Report original exception when failing to load openssl, fixes #7192Oleg Pudeyev2020-01-031-1/+1
| |
* | Add support for BUNDLER_ prefixed debug environment variablesSutou Kouhei2020-01-192-2/+7
| | | | | | | | | | DEBUG_RESOLVER is used in RubyGems too. So we can't enable it only for Bundler.
* | Merge #7577Bundlerbot2020-01-182-2/+2
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 7577: Update references to old repo location r=deivid-rodriguez a=duckinator Related: #7572. ### What was the end-user problem that led to this PR? A lot of things use the outdated `https://github.com/bundler/bundler` URL (and similarly for e.g. `bundler/bundler-site`). ### What is your fix for the problem, implemented in this PR? My fix was to update the outdated URLs. :slightly_smiling_face: ### TODO - [x] `bundler.gemspec` - [x] `CHANGELOG.md` (Moved to its own PR, #7582) - [x] `CODE_OF_CONDUCT.md` - [x] `doc/`, excluding reference to now-dead `pullreview.com` - [x] `doc/contributing/HOW_YOU_CAN_HELP.md` reference to long-dead `pullreview.com` - [x] `.github/config.yml` - [x] `lib/` (comments) - [ ] `lib/` (functional changes) - [ ] `man/` - [x] `README.md` - [x] `spec/` (comments, `skip` messages) - [ ] `spec/` (functional changes) - [ ] `task/release.rake` Co-authored-by: Ellen Marie Dash <me@duckie.co>
| * | [repo move] Update GitHub URL in comments in lib/.Ellen Marie Dash2020-01-162-2/+2
| | |
* | | Merge #7559Bundlerbot2020-01-171-2/+2
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 7559: Reactivate usused code for ruby version resolution r=deivid-rodriguez a=larskanis The code was changed in commit 38b0e7ed64c3ca1c40f43c5aa9a1ead2f6cd7049 so that RubyVersion.system was no longer respected. This is reactivated now and specs are adjusted accordingly. ### What was the end-user problem that led to this PR? Not known. ### What was your diagnosis of the problem? I read the bundler source code and noticed this. ### What is your fix for the problem, implemented in this PR? My fix re-adds the ruby version as it was before commit 38b0e7ed64c3ca1c40f43c5aa9a1ead2f6cd7049 , since it seems to be a mistake. ### Why did you choose this fix out of the possible options? As a alternative I added #7558 that removes the code in question. Co-authored-by: Lars Kanis <kanis@comcard.de>
| * | | Reactivate usused code for ruby version resolutionLars Kanis2020-01-161-2/+2
| |/ / | | | | | | | | | | | | The code was changed in commit 38b0e7ed64c3ca1c40f43c5aa9a1ead2f6cd7049 so that RubyVersion.system was no longer respected. This is reactivated now and specs are adjusted accordingly.
* | | Revert MatchPlatform#platforms_match?Sutou Kouhei2020-01-171-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Because some examples are failed: rspec ./spec/cache/gems_spec.rb:236 # bundle cache when previously cached doesn't remove gems that are for another platform rspec ./spec/commands/install_spec.rb:220 # bundle install with gem sources the simple case with a gem that installs multiple platforms installs gems for the local platform as first choice rspec ./spec/commands/update_spec.rb:39 # bundle update with --all updates the entire bundle rspec ./spec/commands/update_spec.rb:49 # bundle update with --all doesn't delete the Gemfile.lock file if something goes wrong rspec ./spec/commands/update_spec.rb:104 # bundle update with a top level dependency unlocks all child dependencies that are unrelated to other locked dependencies rspec ./spec/commands/update_spec.rb:115 # bundle update with an unknown dependency should inform the user rspec ./spec/commands/update_spec.rb:119 # bundle update with an unknown dependency should suggest alternatives rspec ./spec/commands/update_spec.rb:126 # bundle update with a child dependency should update the child dependency rspec ./spec/commands/update_spec.rb:299 # bundle update in a frozen bundle should suggest different command when frozen is set globally rspec ./spec/runtime/platform_spec.rb:60 # Bundler.setup with multi platform stuff will add the resolve for the current platform
* | | Don't ignore resolved platform informationSutou Kouhei2020-01-172-3/+11
|/ / | | | | | | This is a follow-up change of #7522.
* | Remove needless ifSutou Kouhei2020-01-161-4/+5
| |
* | Sort available platformsSutou Kouhei2020-01-151-7/+8
| |
* | Always add a spec group for all platforms to candidatesSutou Kouhei2020-01-151-26/+11
| |
* | SpecGroup#to_specs doesn't return duplicated specsSutou Kouhei2020-01-152-1/+9
| |
* | Fix styleSutou Kouhei2020-01-151-2/+2
| |
* | Always add "ruby" version to selected spec groups as fallbackSutou Kouhei2020-01-151-3/+5
| |
* | Rename SpecGroup#spec to SpecGroup#spec_forSutou Kouhei2020-01-152-4/+5
| |
* | Add SpecGroup#copy_forSutou Kouhei2020-01-152-12/+12
| |
* | Add support for force_ruby_platform with specific_platform againSutou Kouhei2020-01-151-5/+16
| |
* | Don't set platforms to dependency registered by gemspecSutou Kouhei2020-01-153-14/+1
| | | | | | | | | | | | | | | | | | Platform related dependencies are resolved in Resolver now. So we don't need to register all available platforms explicitly. This reverts commit 0a8ca4879e0b79aa4109a0dc424940b079ef38d0. See also: #4150 and #4102
* | Add support for specific_platform feature flagSutou Kouhei2020-01-151-5/+10
| |
* | Add support for multiple platform spec group againSutou Kouhei2020-01-152-4/+31
| |
* | Improve platform specific gem resolutionSutou Kouhei2020-01-152-6/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It resolves #6247. This changes includes the patches that add (RSpec) specs for this situation in #6247. If there is a platform specific gem but it can't be resolved available version, Bundler reports an error. For example, @index = build_index do gem "bar", "1.0.0" gem "foo", "1.0.0" gem "foo", "1.0.0", "x64-mingw32" do dep "bar", "< 1" end end dep "foo" platforms "x64-mingw32" raises an error because foo-1.0.0-x64-mingw32 requires bar<1 but there isn't bar<1. With this change, foo-1.0.0 (no x64-mingw32) is used as fallback. Because foo-1.0.0 doesn't depend on bar<1.
* | Fix instance variable nameSutou Kouhei2020-01-121-2/+2
| |
* | Fix ruby version parsing in compact indexSutou Kouhei2020-01-122-13/+71
| | | | | | | | | | We can't use the same logic as "dependencies" for "requirements". Because "," in "requirements" isn't escaped as "&".
* | Merge #5521Bundlerbot2020-01-087-11/+36
|\ \ | | | | | | | | | | | | | | | | | | | | | 5521: bundler gem: Support test-unit as a testing framework r=hsbt a=kou Co-authored-by: Kouhei Sutou <kou@clear-code.com>
| * | bundler gem: Support test-unit as a testing frameworkKouhei Sutou2019-12-117-11/+36
| | |
* | | Merge #7529Bundlerbot2020-01-051-22/+0
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 7529: Remove optional require net-http-pipeline from vendored net-http-persistent. r=deivid-rodriguez a=marciotoshio ### What was the end-user problem that led to this PR? See issue https://github.com/bundler/bundler/issues/7521. ### What was your diagnosis of the problem? My diagnosis was If you have net-http-pipeline gem installed bundler loads it and you can't vendor it. ### What is your fix for the problem, implemented in this PR? My fix is remove the optional require of net-http-pipeline. ### Why did you choose this fix out of the possible options? I chose this fix because was a recommendation in the issue by @deivid-rodriguez Fixes #7521. Co-authored-by: David Rodríguez <deivid.rodriguez@riseup.net> Co-authored-by: Marcio Toshio <marcio@tosh.io>
| * | | Remove require net-http-pipeline from vendored net-http-persistent.Marcio Toshio2020-01-031-22/+0
| | |/ | |/|
* | | Reset `Gemfile` to the empty string after bundler/inlinefix/bundler_inlineDavid Rodríguez2020-01-021-1/+1
|/ / | | | | | | | | To avoid Gemfile resolution afterwards, and use the "inline environment" instead.
* | Set master's version to 2.2.0.devbump_master_versionDavid Rodríguez2020-01-011-1/+1
| | | | | | | | | | | | | | So that it's always higher than the latest patch level release. This saves us from having to merge back the version bump after each patch level release, which is also not accurate since master is "bigger" than the latest patch level release anyways.
* | Unify deployment setting and flagimprove_deployment_flagDavid Rodríguez2019-12-311-2/+3
| | | | | | | | | | | | Previously, we were recommending `bundle config deployment true; bundle install` as an alternative to `bundle install --deployment`, but they were not working equally.
* | Do `require "rubygems"` only when neededYusuke Endoh2019-12-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This require causes circular require. ``` $ touch empty_file $ RUBYGEMS_GEMDEPS=empty_file ./local/bin/ruby -w -e '' /home/mame/work/ruby/local/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92: warning: /home/mame/work/ruby/local/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92: warning: loading in progress, circular require considered harmful - /home/mame/work/ruby/local/lib/ruby/2.7.0/rubygems.rb from <internal:gem_prelude>:1:in `<internal:gem_prelude>' from <internal:gem_prelude>:1:in `require' from /home/mame/work/ruby/local/lib/ruby/2.7.0/rubygems.rb:1417:in `<top (required)>' from /home/mame/work/ruby/local/lib/ruby/2.7.0/rubygems.rb:1203:in `use_gemdeps' from /home/mame/work/ruby/local/lib/ruby/2.7.0/rubygems/user_interaction.rb:47:in `use_ui' from /home/mame/work/ruby/local/lib/ruby/2.7.0/rubygems.rb:1204:in `block in use_gemdeps' from /home/mame/work/ruby/local/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in `require' from /home/mame/work/ruby/local/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in `require' from /home/mame/work/ruby/local/lib/ruby/2.7.0/bundler.rb:11:in `<top (required)>' from /home/mame/work/ruby/local/lib/ruby/2.7.0/bundler.rb:11:in `require_relative' from /home/mame/work/ruby/local/lib/ruby/2.7.0/bundler/rubygems_integration.rb:3:in `<top (required)>' from /home/mame/work/ruby/local/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in `require' from /home/mame/work/ruby/local/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in `require' ```