Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

--standalone generates file in incorrect PWD #2048

Open
ismell opened this Issue · 8 comments

4 participants

Raul E Rangel André Arko Xavier Shay André Medeiros
Raul E Rangel

Hello,
I ran the following

bundle install --gemfile=src/main/webapp/WEB-INF/Gemfile --path ./target/bundler/ --standalone

and it generated the setup file in the following location target/bundler/bundler/setup.rb while it installed the gems in src/main/webapp/WEB-INF/target/bundler/. So it assumed that the --path was relative to the Gemfile instead of the PWD. It also created the .bundle/config in the WEB-INF folder.

Personally I think the --path option should be relative to the PWD but it seems to be relative to the Gemfile. So I think we should just make the bundler/setup.rb also relative to the Gemfile's path.

André Arko
Owner

Yeah, I think you're right, and the --path should be relative to the CWD when you invoke the Bundle command. Sounds like standalone makes the right assumption, but the general install code doesn't. Thanks for reporting this!

Raul E Rangel

Cool, I also think --path should be relative to CWD. I think the .bundle folder should also be created in the CWD instead of next to the Gemfile. The reason for this is that the .bundle/config has the --path writen into it so it has to be relative to where it was ran.
Raul

Xavier Shay
Collaborator

Still an issue.

André Medeiros andremedeiros closed this issue from a commit
André Medeiros andremedeiros `bundle install --path` is now relative to the CWD.
This makes the option a lot more intuitive, seen as it works like other
CLI commands do. Fixes #2048
1447f0f
André Medeiros
Collaborator

Reopening this one.

My attempted fix broke the specs, which is an indicator that it might break in production as well.

André Medeiros andremedeiros reopened this
Xavier Shay
Collaborator

Just hit this, admittedly I'm doing something weird: bundle install --standalone in a subdirectory from the Gemfile, expecting the bundle directory to be created inside that subdirectory - instead getting a split.

Trying to get a standalone repro together, but also hitting nil pointer errors so trying to figure out wtf is going on.

Xavier Shay
Collaborator

nil error happens on 1.6.3 with this repro, but is fixed on master. Master still displays the split install problem:

#!/bin/bash

set -ex

REPRO_DIR=/tmp/repro-2048

rm -Rf $REPRO_DIR
mkdir -p $REPRO_DIR
cd $REPRO_DIR

bundle env

cat > Gemfile <<RUBY
source "https://rubygems.org"

gem 'O_o'
RUBY

mkdir test
cd test
bundle install --standalone

!(test -e ../bundle) && test -e bundle/ruby
André Medeiros
Collaborator

@indirect what do you say we add the new behaviour back?

André Arko
Owner

If we can do it without breaking specs, let's do it! If not, we should do this in 2.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.