$30 off During Our Annual Pro Sale. View Details »

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.

Colby Swandale

April 20, 2019
Tweet

More Decks by Colby Swandale

Other Decks in Programming

Transcript

  1. Working towards
    Bundler 3

    View Slide

  2. Colby Swandale
    @oceanicpanda

    View Slide

  3. ɹCore Maintainer
    ɹRelease Manager

    View Slide

  4. View Slide

  5. View Slide

  6. View Slide

  7. View Slide

  8. # Gemfile
    source 'https://rubygems.org'
    gem 'nokogiri' # XML Parser

    View Slide

  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

    View Slide

  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

    View Slide

  11. # script.rb
    require "bundler/setup"
    require "nokogiri"
    Nokogiri.XML('Hello World')

    View Slide

  12. It's been a busy year

    View Slide

  13. Bundler 1.17

    View Slide

  14. Bundler 2

    View Slide

  15. Bundler ships with
    Ruby!

    View Slide

  16. Sadly it wasn't all that great

    View Slide

  17. Bundler 2 release
    (The one that broke )

    View Slide

  18. View Slide

  19. View Slide

  20. View Slide

  21. It sucked

    View Slide

  22. Broke a lot of CI builds

    View Slide

  23. Broke default ruby on
    MacOS

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

  27. View Slide

  28. What happened?

    View Slide

  29. Problem 1
    gem install bundler

    View Slide

  30. $ gem install bundler

    View Slide

  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.

    View Slide

  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.

    View Slide

  33. $ gem install bundler -v '~> 2.0'

    View Slide

  34. Problem 2
    Version auto switcher

    View Slide

  35. $ bundle _1.17.2_ install

    View Slide

  36. $ bundle install

    View Slide

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

    View Slide

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

    View Slide

  39. Managed by RubyGems

    View Slide

  40. Bundler Version Finder

    View Slide

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

    View Slide

  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

    View Slide

  43. Different rules between
    RubyGems v2 - v3

    View Slide

  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

    View Slide

  45. Can't find gem bundler (>= 0.a) with executable bundle
    (Gem::GemNotFoundException)
    RubyGems 2 bug

    View Slide

  46. This is why Bundler 2.0.0
    depended on RubyGems 3

    View Slide

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

    View Slide

  48. View Slide

  49. $ gem update --system

    View Slide

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

    View Slide

  51. Breaking changes

    View Slide

  52. Have bundler manage
    it's own version

    View Slide

  53. View Slide

  54. Problem 3
    Communication

    View Slide

  55. View Slide

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

    View Slide

  57. Move all decisions to
    Github

    View Slide

  58. Improving future
    releases

    View Slide

  59. Ideas for a better major release
    • Actively engage for feedback from the
    community
    • Longer pre release cycles
    • More transparency around breaking changes

    View Slide

  60. Thank you for being patient while
    we work on fixing these issues

    View Slide

  61. I'm sorry for the
    disruption this caused

    View Slide

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

    View Slide

  63. View Slide

  64. What's coming up in
    Bundler

    View Slide

  65. Official windows
    support

    View Slide

  66. View Slide

  67. View Slide

  68. View Slide

  69. Needs more work

    View Slide

  70. We want to have JRuby and
    TruffleRuby support also

    View Slide

  71. Contributors welcome

    View Slide

  72. Bundler 2.0.2

    View Slide

  73. Bundler 2.1

    View Slide

  74. Deprecations

    View Slide

  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

    View Slide

  76. Bundle clean git
    extensions

    View Slide

  77. Bundler 3

    View Slide

  78. The release where we
    (intentionally) break stuff

    View Slide

  79. Remembering options

    View Slide

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

    View Slide

  81. $ bundle install --path .bundle
    $ bundle install --path .bundle
    $ bundle config path .bundle
    Or

    View Slide

  82. Install options removed
    from CLI

    View Slide

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

    View Slide

  84. $ bundle config without production

    View Slide

  85. bundle default
    command

    View Slide

  86. $ bundle
    Using rake 12.3.2
    Using bundler 2.0.1

    View Slide

  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

    View Slide

  88. Bundle update

    View Slide

  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!

    View Slide

  90. $ bundler update
    To update everything, pass the `--all`
    flag.

    View Slide

  91. bundle show

    View Slide

  92. $ bundle show
    Gems included by the bundle:
    * bundler (2.0.1)
    * rake (12.3.2)

    View Slide

  93. $ bundle show rake
    /home/.bundle/ruby/2.6.0/gems/rake-12.3.2

    View Slide

  94. bundle info & bundle list

    View Slide

  95. $ bundle list
    Gems included by the bundle:
    * bundler (2.0.1)
    * rack (2.0.7)

    View Slide

  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

    View Slide

  97. bundle viz

    View Slide

  98. bundle console

    View Slide

  99. Coming when it's ready

    View Slide

  100. Bundler 3+

    View Slide

  101. View Slide


  102. View Slide

  103. View Slide

  104. This will probably be
    the last Bundler talk

    View Slide

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

    View Slide

  106. bundler.io

    View Slide

  107. View Slide

  108. ͋Γ͕ͱ͏͍͟͝·͢

    View Slide