Giter Site home page Giter Site logo

Comments (8)

waj avatar waj commented on August 28, 2024

In Bundler, if the version of a gem is changed in the Gemfile, a bundle install would update the version of that gem without requiring a bundle update, unless it requires changing the version of other gems.

In other words, install always feel more "safe" in terms of not changing what's not needed. And I just use update to get the latest version of one or more gems still matching the versions specified in the Gemfile.

Don't you think we should mimic that behaviour? I guess it would require saving the version specification in the shard.lock too, so install could figure out which versions were changed in the shard.yml.

from shards.

ysbaddaden avatar ysbaddaden commented on August 28, 2024

I don't recall such a behaviour in Bundler. I always have to run bundle update when I change a dependency version —maybe because they will update other dependencies.

I think I prefer to have install to always install the locked versions, and then have update to update the locked versions of one or many dependencies, with maybe a flag to avoid resolving recursively.

from shards.

waterlink avatar waterlink commented on August 28, 2024

Yeah, bundle install installs only new added dependencies and all currently locked ones. bundle update updates all dependencies. And bundle update <NAME> updates only specific dependency.

from shards.

waj avatar waj commented on August 28, 2024

I think the rationale is: if you change the version in the Gemfile, the version is now unlocked. That's why bundle install will update the version without asking for update.

@waterlink: bundle update <NAME> also updates the version of the recursive dependencies. If you have a stable project, you want to change as little as possible. That's why I think the behaviour of bundle install should be available, either with a flag in update or copying the Bundler's install.

I cannot make my mind with this yet, because I like the @ysbaddaden statement, of making install not changing locked versions, but after many years of Ruby development I always try to use update with care, only when needed.

from shards.

waterlink avatar waterlink commented on August 28, 2024

@waj Wouldn't the behavior of bundle install when changing version in Gemfile, update its dependencies too? (at least, if the requirements of the gem itself have changed in the newer version).

from shards.

waj avatar waj commented on August 28, 2024

@waterlink: if the change in the Gemfile requires to update other gems stated in the Gemfile too, then you're forced to update.

It seems Bundler will unlock the gem changed in the Gemfile and other dependencies of that gem (not in the Gemfile) and will try to update with that. If the dependencies cannot be satisfied, then you're forced to update.

from shards.

waterlink avatar waterlink commented on August 28, 2024

Yeah, that is exactly how it works

from shards.

kostya avatar kostya commented on August 28, 2024

👍 when shards count > 10, it very slow when need to update 1 shard often.

from shards.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.