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

Spoom fails when a BUNDLE_PATH is set #488

Open
notahat opened this issue Nov 28, 2023 · 3 comments
Open

Spoom fails when a BUNDLE_PATH is set #488

notahat opened this issue Nov 28, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@notahat
Copy link

notahat commented Nov 28, 2023

Describe the bug
Spoom ignores the BUNDLE_PATH when trying to bundle exec srb.

To Reproduce
Spoom version: 1.2.4

Steps to reproduce the behavior:

  1. Set a BUNDLE_PATH
  2. Run bundle exec spoom tc
  3. You'll get an error along the lines of:
bundler: failed to load command: srb (/app/bundle/bin/srb)
/usr/local/lib/ruby/3.1.0/bundler/source/git.rb:214:in rescue in load_spec_files': https://github.com/crafterm/apnotic.git (at e0a84c9@e0a84c9) is not yet checked out. Run bundle install first. (Bundler::GitError)

The above error is from a Docker instance in our CI environment, with BUNDLE_PATH set to /app/bundle and spoom being executed in /app/api. The particular error will depend on your bundle path and gems, but it'll always tell you it can't find your gems and that you need to bundle install.

Expected behavior
Spoom should respect the BUNDLE_PATH and successfully execute srb.

The code
This code is what causes the problem. Spoom removes the entire bundler environment and then re-runs bundle exec.

I would expect Spoom and Sorbet to always be in the same bundle, so you shouldn't need to re-run bundle exec. Maybe there's a use case I'm not thinking of though?

@notahat notahat added the bug Something isn't working label Nov 28, 2023
@Bo98
Copy link

Bo98 commented Dec 15, 2023

Worth nothing this is a regression in I think 1.2.0. Works fine under 1.1.x.

@Bo98
Copy link

Bo98 commented Dec 15, 2023

This was previously reported in #349, but that was closed with the explanation that we're expected to run spoom with a custom --sorbet that restores the stripped BUNDLE_* envs.

@mrcasals
Copy link

Just adding a bit more context, we also install gems in a different location (./vendor/bundle/). spoom was working fine for us in bundler 2.5.5, but started failing when we migrated to 2.5.10. Passing the manual --sorbet param as explained in #349 solved the issue, but maybe there's something in bundler in one of those versions between 2.5.5 and 2.5.10? We upgraded directly, not version by version, so I'm not sure where's the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants