Skip to content

Bundler 2.1.4 requires to use GEM_HOME

Kamil Trzciński requested to merge fix-gitaly-install-gem-home into master

What does this MR do?

This is after this slack thread: https://gitlab.slack.com/archives/C2Z9A056E/p1604584592492400.

It appears that the meaning of BUNDLE_PATH and Bundler.bundle_path changed in Bundler 2.1.x: https://github.com/docker-library/ruby/pull/306

  • Bundler 2.1.4 does not like it, due to fact that BUNDLE_PATH is treated differently, and Bundler.bundle_path returning something different.
  • This started failing, as Gitaly currently have older dependencies than GitLab Rails, so, they would not be loaded properly, as they would not be found. The bundle install for Gitaly would still run, but it would install these required deps in a completely different folder. The intent for Gitaly in tests is to share bundler directory.
  • So, lets assume that BUNDLE_PATH=/data/cache/bundle-2.7. The gitaly.rake task would read Bundler.bundle_path and set a BUNDLE_PATH=/data/cache/bundle-2.7/ruby/2.7.0. The gitlab.rake would call make install and install deps in this folder, but Gitaly would still be tried to run with BUNDLE_PATH=/data/cache/bundle-2.7.
  • The above is specific to GCK, that sets BUNDLE_PATH, if you only use GEM_PATH everything should be fine.

Related to: gitlab-compose-kit!138 (merged)

Does this MR meet the acceptance criteria?

Conformity

Edited by Kamil Trzciński

Merge request reports