bundix icon indicating copy to clipboard operation
bundix copied to clipboard

remove "BUNDLED WITH" from Gemfile.lock

Open flokli opened this issue 6 years ago • 9 comments

When using bundix to package new applications, we should probably remove the "BUNDLED WITH" information from the generated Gemfile.lock.

For example, when packaging gitlab, on gitaly startup (done via bundle exec), it complains about the running version of bundler being older than the version that created the lockfile.

As we assemble the ruby environment via nix and not via bundler anyways, we can probably just remove the two lines from the Gemfile.lock

flokli avatar Sep 01 '19 17:09 flokli

Sounds reasonable, do you want to make an attempt?

manveru avatar Sep 01 '19 17:09 manveru

Huh, my ruby is pretty bad. Happy to try a patch, though ;-)

flokli avatar Sep 01 '19 18:09 flokli

Hmmm. Not sure this is a good idea — BUNDLED WITH is recorded so that Bundler can introduce breaking changes in its lockfiles. If we remove it, that’s not going to work.

I think we should be better at keeping Bundler up to date in Nixpkgs, but that probably requires a bit of Bundix work to make it happy with 1.x and 2.x.

alyssais avatar Sep 01 '19 19:09 alyssais

If you call version numbers MAJOR.MINOR.PATCH, in my case it was really just the "PATCH" part being being incremented by one in the Gemfile.lock - so having bundler complain about this makes me worry about version guarantees they try to make.

IIRC, this happened while backporting the gitlab rubyenv to 19.03.

I didn't really look into how we assemble bundler environments inside nixpkgs, but how much does bundler still do dependency resolution and environment setup if we use it inside such a bundix-generated expression for it to become a problem? Won't we notice too, as it'll simply fail to start later on?

flokli avatar Sep 10 '19 03:09 flokli

If you call version numbers MAJOR.MINOR.PATCH, in my case it was really just the "PATCH" part being being incremented by one in the Gemfile.lock - so having bundler complain about this makes me worry about version guarantees they try to make.

In this case, Bundler is mostly just doing it to tell you there's a new version available.

I didn't really look into how we assemble bundler environments inside nixpkgs, but how much does bundler still do dependency resolution and environment setup if we use it inside such a bundix-generated expression for it to become a problem? Won't we notice too, as it'll simply fail to start later on?

It does it when creating the Gemfile.lock. I don't think it should be doing much that can be incompatible when you are simply using a Bundix environment. You never know, but I don't think we can stand in the way of progress over a hypothetical.

alyssais avatar Sep 10 '19 10:09 alyssais

So what do we do here? Remove the BUNDLED WITH or keep it?

flokli avatar Sep 10 '19 16:09 flokli

Let's keep this unless it causes any actual issues.

manveru avatar Sep 11 '19 10:09 manveru

Ok.

flokli avatar Sep 11 '19 17:09 flokli

This seems to cause actual issues - see https://github.com/NixOS/nixpkgs/pull/85623#issuecomment-616635336.

flokli avatar Apr 20 '20 15:04 flokli