Working towards Bundler 3

Working towards Bundler 3

Bundler hit a big milestone this year with the release of Bundler 2 🎉, but not without its bumps and hurdles. We'll look into the problems that some of our users have been experiencing after the Bundler 2 release, what the core team has been doing to fix these issues and what we've since learned. Afterwards, We'll look at the upcoming Bundler 2.1 and Bundler 3 releases.

81faf651bd1a239298307c7fd6efe944?s=128

Colby Swandale

April 20, 2019
Tweet

Transcript

  1. Working towards Bundler 3

  2. Colby Swandale @oceanicpanda

  3. ɹCore Maintainer ɹRelease Manager

  4. None
  5. None
  6. None
  7. None
  8. # Gemfile source 'https://rubygems.org' gem 'nokogiri' # XML Parser

  9. $ bundle install Fetching gem metadata from https://rubygems.org/...... Resolving dependencies...

    Using bundler 2.0.1 Fetching mini_portile2 2.4.0 Installing mini_portile2 2.4.0 Fetching nokogiri 1.10.2 Installing nokogiri 1.10.2 with native extensions
  10. GEM remote: https://rubygems.org/ specs: mini_portile2 (2.4.0) nokogiri (1.10.2) mini_portile2 (~>

    2.4.0) PLATFORMS ruby DEPENDENCIES nokogiri BUNDLED WITH 2.0.1
  11. # script.rb require "bundler/setup" require "nokogiri" Nokogiri.XML('<h1>Hello World</h1>')

  12. It's been a busy year

  13. Bundler 1.17

  14. Bundler 2

  15. Bundler ships with Ruby!

  16. Sadly it wasn't all that great

  17. Bundler 2 release (The one that broke )

  18. None
  19. None
  20. None
  21. It sucked

  22. Broke a lot of CI builds

  23. Broke default ruby on MacOS

  24. Pretty much killed "gem install bundler" on ruby < 2.6

  25. Also Pretty much killed "gem install rails" on ruby <

    2.6
  26. Forced users to run `gem update --system`

  27. None
  28. What happened?

  29. Problem 1 gem install bundler

  30. $ gem install bundler

  31. $ ruby --version ruby 2.2.0p0 (2014-12-25 revision 49005) [x86_64-darwin18] $

    gem install bundler Fetching: bundler-2.0.1.gem (100%) ERROR: Error installing bundler: bundler requires Ruby version >= 2.3.0.
  32. $ ruby --version ruby 2.4.6p354 (2019-04-01 revision 67394) [x86_64-darwin18] $

    gem --version 2.7.9 $ gem install bundler Fetching: bundler-2.0.0.gem (100%) ERROR: Error installing bundler: There are no versions of bundler (= 2.0.0) compatible with your Ruby & RubyGems bundler requires RubyGems version >= 3.0.0. The current RubyGems version is 2.7.9. Try 'gem update --system' to update RubyGems itself.
  33. $ gem install bundler -v '~> 2.0'

  34. Problem 2 Version auto switcher

  35. $ bundle _1.17.2_ install

  36. $ bundle install

  37. $ grep -A 1 "BUNDLED WITH" Gemfile.lock BUNDLED WITH 1.17.3

    $ bundle version Bundler version 1.17.3
  38. $ grep -A 1 "BUNDLED WITH" Gemfile.lock BUNDLED WITH 2.0.1

    $ bundle version Bundler version 2.0.1
  39. Managed by RubyGems

  40. Bundler Version Finder

  41. Filters possible versions of Bundler that can be activated by

    RubyGems
  42. RubyGems 3 Matches on major version (Same as Bundler 1)

    BUNDLED WITH 2.0.1 Bundler Versions 2.0.1 2.0.2 2.1.0 3.0.pre.1 1.17.2
  43. Different rules between RubyGems v2 - v3

  44. RubyGems 2 Matches on exact version BUNDLED WITH 2.0.1 Bundler

    Versions 2.0.1 2.0.2 2.1.0 3.0.pre.1 1.17.2
  45. Can't find gem bundler (>= 0.a) with executable bundle (Gem::GemNotFoundException)

    RubyGems 2 bug
  46. This is why Bundler 2.0.0 depended on RubyGems 3

  47. BundlerVersionFinder was first written during a very different time and

    ideas
  48. None
  49. $ gem update --system

  50. Why didn't Bundler 2 just read the bundler 1 lockfile?

  51. Breaking changes

  52. Have bundler manage it's own version

  53. None
  54. Problem 3 Communication

  55. None
  56. Discussions were in open channels but were not easily available

  57. Move all decisions to Github

  58. Improving future releases

  59. Ideas for a better major release • Actively engage for

    feedback from the community • Longer pre release cycles • More transparency around breaking changes
  60. Thank you for being patient while we work on fixing

    these issues
  61. I'm sorry for the disruption this caused

  62. Bundler is critical to developers and must be treated with

    care
  63. None
  64. What's coming up in Bundler

  65. Official windows support

  66. None
  67. None
  68. None
  69. Needs more work

  70. We want to have JRuby and TruffleRuby support also

  71. Contributors welcome

  72. Bundler 2.0.2

  73. Bundler 2.1

  74. Deprecations

  75. $ bundle show rack [DEPRECATED] use `bundle info rack` instead

    of `bundle show rack` /Users/colby/Desktop/.bundle/ruby/2.6.0/gems/rack-2.0.7
  76. Bundle clean git extensions

  77. Bundler 3

  78. The release where we (intentionally) break stuff

  79. Remembering options

  80. $ bundle install --path .bundle $ bundle config --parseable path=.bundle

  81. $ bundle install --path .bundle $ bundle install --path .bundle

    $ bundle config path .bundle Or
  82. Install options removed from CLI

  83. $ bundle install --path $ bundle install --only $ bundle

    install --without
  84. $ bundle config without production

  85. bundle default command

  86. $ bundle Using rake 12.3.2 Using bundler 2.0.1

  87. $ bundler Bundler version 3.0.0 Bundler commands: Primary commands: bundle

    install [OPTIONS] # Install the current environment to the bundle update [OPTIONS] # Update the current environment bundle cache [OPTIONS] # Locks and then caches all of the gems bundle exec [OPTIONS] # Run the command in context of the bundle config NAME [VALUE] # Retrieve or set a configuration value bundle help [COMMAND] # Describe available commands or one Utilities: bundle add GEM VERSION # Add gem to Gemfile and run bundl bundle binstubs GEM [OPTIONS] # Install the binstubs of the listed bundle check [OPTIONS] # Checks if the dependencies listed bundle doctor [OPTIONS] # Checks the bundle for common -V, [--verbose], [--no-verbose] # Enable verbose output mode
  88. Bundle update

  89. $ bundler update Fetching gem metadata from https://rubygems.org/... Fetching gem

    metadata from https://rubygems.org/. Resolving dependencies... Fetching rack 2.0.3 (was 1.6.8) Installing rack 2.0.3 (was 1.6.8) Removing rack (1.6.8) Bundle updated!
  90. $ bundler update To update everything, pass the `--all` flag.

  91. bundle show

  92. $ bundle show Gems included by the bundle: * bundler

    (2.0.1) * rake (12.3.2)
  93. $ bundle show rake /home/.bundle/ruby/2.6.0/gems/rake-12.3.2

  94. bundle info & bundle list

  95. $ bundle list Gems included by the bundle: * bundler

    (2.0.1) * rack (2.0.7)
  96. $ bundle info rack * rack (2.0.7) Summary: a modular

    Ruby webserver interface Homepage: https://rack.github.io/ Path: /home/c/Desktop/.bundle/ruby/2.6.0/gems/rack-2.0.7
  97. bundle viz

  98. bundle console

  99. Coming when it's ready

  100. Bundler 3+

  101. None
  102. None
  103. This will probably be the last Bundler talk

  104. @oceanicpanda colby-swandale slack.bundler.io#bundler

  105. bundler.io

  106. None
  107. ͋Γ͕ͱ͏͍͟͝·͢