Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

bundle directory structure differs depending on where BUNDLE_PATH is specified #2987

Closed
jacknagel opened this issue Apr 18, 2014 · 7 comments

Comments

@jacknagel
Copy link

First, here's a gist of bundle env along with an illustration of the problem: https://gist.github.com/jacknagel/11055804

My global config looks like:

$ cat ~/.bundle/config

---
BUNDLE_PATH: .bundle
BUNDLE_DISABLE_SHARED_GEMS: '1'

It seems that, depending on whether BUNDLE_PATH is specified globally in ~/.bundle/config or locally in .bundle/config changes the resulting structure of the bundle.

If specified only globally, then the resulting directory structure looks like:

$ ls -l .bundle
total 8
drwxr-xr-x  3 jacknagel  wheel  102 Apr 18 12:50 bin
drwxr-xr-x  3 jacknagel  wheel  102 Apr 18 12:50 build_info
drwxr-xr-x  3 jacknagel  wheel  102 Apr 18 12:50 cache
-rw-r--r--  1 jacknagel  wheel   36 Apr 18 12:50 config
drwxr-xr-x  2 jacknagel  wheel   68 Apr 18 12:50 doc
drwxr-xr-x  2 jacknagel  wheel   68 Apr 18 12:50 extensions
drwxr-xr-x  3 jacknagel  wheel  102 Apr 18 12:50 gems
drwxr-xr-x  3 jacknagel  wheel  102 Apr 18 12:50 specifications

However, if I also specify it in .bundle/config, then I get:

$ ls -l .bundle
total 8
-rw-r--r--  1 jacknagel  wheel   59 Apr 18 12:52 config
drwxr-xr-x  3 jacknagel  wheel  102 Apr 18 12:52 ruby

and

$ ls -l .bundle/ruby/2.1.0
total 0
drwxr-xr-x  3 jacknagel  wheel  102 Apr 18 12:52 bin
drwxr-xr-x  3 jacknagel  wheel  102 Apr 18 12:52 build_info
drwxr-xr-x  3 jacknagel  wheel  102 Apr 18 12:52 cache
drwxr-xr-x  2 jacknagel  wheel   68 Apr 18 12:52 doc
drwxr-xr-x  2 jacknagel  wheel   68 Apr 18 12:52 extensions
drwxr-xr-x  3 jacknagel  wheel  102 Apr 18 12:52 gems
drwxr-xr-x  3 jacknagel  wheel  102 Apr 18 12:52 specifications

Being unfamiliar with the bundler codebase, I wasn't able to determine why this would happen. If someone could shed some light, that would be great.

If I've omitted anything, please me know, I'm happy to provide more information but I'm unsure what else will be helpful.

@indirect
Copy link
Member

It was hardcoded that way :/

Undoing that for Bundler 2 would be great, and pulls to the 2-0-dev branch are welcome.

On Fri, Apr 18, 2014 at 10:55 AM, Jack Nagel notifications@github.com
wrote:

First, here's a gist of bundle env along with an illustration of the problem: https://gist.github.com/jacknagel/11055804
My global config looks like:

$ cat ~/.bundle/config
---
BUNDLE_PATH: .bundle
BUNDLE_DISABLE_SHARED_GEMS: '1'

It seems that, depend on whether BUNDLE_PATH is specified globally in ~/.bundle/config or locally in .bundle/config changes the resulting structure of the bundle.
If specified only globally, then the resulting directory structure looks like:

$ ls -l .bundle
total 8
drwxr-xr-x  3 jacknagel  wheel  102 Apr 18 12:50 bin
drwxr-xr-x  3 jacknagel  wheel  102 Apr 18 12:50 build_info
drwxr-xr-x  3 jacknagel  wheel  102 Apr 18 12:50 cache
-rw-r--r--  1 jacknagel  wheel   36 Apr 18 12:50 config
drwxr-xr-x  2 jacknagel  wheel   68 Apr 18 12:50 doc
drwxr-xr-x  2 jacknagel  wheel   68 Apr 18 12:50 extensions
drwxr-xr-x  3 jacknagel  wheel  102 Apr 18 12:50 gems
drwxr-xr-x  3 jacknagel  wheel  102 Apr 18 12:50 specifications

However, if I also specify it in .bundle/config, then I get:

$ ls -l .bundle
total 8
-rw-r--r--  1 jacknagel  wheel   59 Apr 18 12:52 config
drwxr-xr-x  3 jacknagel  wheel  102 Apr 18 12:52 ruby

and

$ ls -l .bundle/ruby/2.1.0
total 0
drwxr-xr-x  3 jacknagel  wheel  102 Apr 18 12:52 bin
drwxr-xr-x  3 jacknagel  wheel  102 Apr 18 12:52 build_info
drwxr-xr-x  3 jacknagel  wheel  102 Apr 18 12:52 cache
drwxr-xr-x  2 jacknagel  wheel   68 Apr 18 12:52 doc
drwxr-xr-x  2 jacknagel  wheel   68 Apr 18 12:52 extensions
drwxr-xr-x  3 jacknagel  wheel  102 Apr 18 12:52 gems
drwxr-xr-x  3 jacknagel  wheel  102 Apr 18 12:52 specifications

Being unfamiliar with the bundler codebase, I wasn't able to determine why this would happen. If someone could shed some light, that would be great.

If I've omitted anything, please me know, I'm happy to provide more information but I'm unsure what else will be helpful.

Reply to this email directly or view it on GitHub:
#2987

@jacknagel
Copy link
Author

:/

I assume the desirable behavior is to always use the ruby/<version> prefix?

@indirect
Copy link
Member

Yup, that’s the one.

On Apr 18, 2014, at 11:18 AM, Jack Nagel notifications@github.com wrote:

:/

I assume the desirable behavior is to always use the ruby/ prefix?


Reply to this email directly or view it on GitHub.

@kdaigle
Copy link

kdaigle commented May 18, 2014

I think 841881f makes this work as intended for 2.0. Using the 2-0-dev branch with only a global config set:

kdaigle ~/code/pry-development » ls -l .bundle/ruby/2.0.0
total 0
drwxr-xr-x  4 kdaigle  staff  136 May 18 19:55 bin
drwxr-xr-x  5 kdaigle  staff  170 May 18 19:55 build_info
drwxr-xr-x  3 kdaigle  staff  102 May 18 19:55 bundler
drwxr-xr-x  6 kdaigle  staff  204 May 18 19:55 cache
drwxr-xr-x  2 kdaigle  staff   68 May 18 19:55 doc
drwxr-xr-x  5 kdaigle  staff  170 May 18 19:55 gems
drwxr-xr-x  5 kdaigle  staff  170 May 18 19:55 specifications

This looks fixed with a 2.0 release. 👍

@jacknagel
Copy link
Author

Closing since this is already fixed on the 2.0 branch, thanks.

@swrobel
Copy link

swrobel commented Oct 28, 2014

Wow, this inconsistency was making me think I'd lost my mind. Any chance of getting this fix backported into 1.8?

@indirect
Copy link
Member

Unfortunately that would break backwards compatibility, so we can't do it until 2.0.

On Oct 28, 2014, at 2:56 AM, Stefan Wrobel notifications@github.com wrote:

Wow, this inconsistency was making me think I'd lost my mind. Any chance of getting this fix backported into 1.8?


Reply to this email directly or view it on GitHub.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants