rock-core / autoproj

Rock (Robot Construction Kit) package-oriented build system
http://rock-robotics.org/rock-and-syskit/workspace
23 stars 22 forks source link

Autoproj tries to install incompatible Bundler version #401

Closed chhtz closed 10 months ago

chhtz commented 11 months ago

As of version 2.5, bundler requires Ruby version 3.0, which is not (easily) available on some systems. Therefore bootstraps will fail. You can work-around this by adding the following line to your config_seed.yml (if you use that):

bundler_version: '2.4.22'

But maybe there is a more elegant solution (also not fixing the bundler version for users who use Ruby 3 already).

doudou commented 11 months ago

Another temporary soluition is to put

Autoproj.config.set "bundler_version", "2.4.22"

in autoproj/init.rb, which ensures that everyone that use your buildconf gets the fix.

moooeeeep commented 10 months ago

Does it make sense to add some logic to the determination of the default bundler version, to account for the new version constraints?

Untested example:

def self.default_bundler_version
    ruby_version = Gem::Version.new(RUBY_VERSION)
    if ruby_version >= Gem::Version.new("3.0.0")
        # most recent version should work
        return
    elsif ruby_version >= Gem::Version.new("2.6.0")
        # bundler 2.5+ requires ruby 3.0 or higher
        return "2.4.22"
    else
        # bundler 2.4+ requires ruby 2.6 or higher
        return "2.3.27"
    end
end

btw, does it work to leave out the patch part of the version spec here, to default to the most recent patch for a specific minor version, e.g., return 2.3 instead of 2.3.27 (was 2.3.6 before) ? Might specify the requirement with ~>. Not sure if it breaks anything though...