Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set BUNDLE_PATH in CircleCI #13214

merged 1 commit into from Mar 8, 2020


Copy link

divergentdave commented Mar 7, 2020

Previously, #12995 migrated from using command line arguments to bundle to setting configuration with bundle config set. However, the path of ./vendor/bundle/ did not make the transition. As a result, the CircleCI builds now depend on the presence and contents of .bundle/config from the cache.

If a CircleCI build starts with an empty cache (I encountered this when using my own personal CircleCI account) then the bundle install command will attempt to install gems into system directories, and it will refuse to finish installation, with this prompt.

Cleaning all the gems on your system is dangerous! If you're sure you want to remove every system gem not in this bundle, run bundle clean --force.

Builds that start with a populated cache, such as those in the tootsuite account, will pick up BUNDLE_PATH: ./vendor/bundle/, which was stored in .bundle/config by the previous bundle install ... --path ./vendor/bundle/ ... command line, and they will continue to work as they did before.

This PR fixes this situation by setting the path through an environment variable in the defaults alias. I briefly explored adding a bundle config set path './vendor/bundle/' line to the install_ruby_dependencies alias, but this caused problems. install_ruby_dependencies is only used in the three install-ruby2.x jobs, and it seems whatever configuration file bundle config set writes is not captured by the workspace. The bundle path is needed for commands such as ./bin/rails and bundle exec i18n-tasks in other downstream jobs. Moreover, the install-ruby2.5 and install-ruby2.6 jobs seem to use a version of bundler that does not support the bundle config set syntax, because they report things like, You are replacing the current global value of set, which is currently "without development production".

Gargron approved these changes Mar 7, 2020
ThibG approved these changes Mar 8, 2020
@Gargron Gargron merged commit 05d83cb into tootsuite:master Mar 8, 2020
1 check passed
1 check passed
codeclimate All good!
@divergentdave divergentdave deleted the divergentdave:circleci-bundle-path branch Mar 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.