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

Fix installation from gemfile shared across different directories#5508

Closed
faucct wants to merge 4 commits intorubygems:masterfrom
faucct:bugfix/gemfile_sharing
Closed

Fix installation from gemfile shared across different directories#5508
faucct wants to merge 4 commits intorubygems:masterfrom
faucct:bugfix/gemfile_sharing

Conversation

@faucct
Copy link
Copy Markdown

@faucct faucct commented Mar 8, 2017

No description provided.

bundle "install"
in_app_root_custom "app" do
bundle "install"
expect(out).to include("Bundle complete!")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please also add expect(the_bundle).to include_gem "foo 1.0"?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe I am having some troubles with that: it seems that the match you are suggesting to add does not care about .bundle/config and tries to validate the empty app/Gemfile.
The only reason I have created this empty Gemfile is to make app directory the bundler root, not the app/...

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bundler.root should probably be changed instead of creating this empty Gemfile: it should choose the first directory containing Gemfile, gems.rb or .bundle.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did an attempt to improve Bundler.root and added the check you've suggested.

@faucct faucct force-pushed the bugfix/gemfile_sharing branch 3 times, most recently from 264892e to aa3e8e2 Compare March 8, 2017 20:01
Comment thread lib/bundler/shared_helpers.rb Outdated
given_gemfile = ENV["BUNDLE_GEMFILE"]
return Pathname.new(given_gemfile).dirname if given_gemfile && !given_gemfile.empty?
search_up('') do |path|
if path.join("Gemfile").file? || path.join("gems.rb").file? || path.join(".bundle").directory?
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this will return ~ if the user is not in a bundle, which I don't think we want?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, so I should put the check from SharedExamples#default_bundle_dir here, right?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that should work, yeah!

@faucct faucct force-pushed the bugfix/gemfile_sharing branch from aa3e8e2 to a44a196 Compare March 9, 2017 06:31
Comment thread lib/bundler/shared_helpers.rb Outdated
def default_root
given_gemfile = ENV["BUNDLE_GEMFILE"]
return Pathname.new(given_gemfile).dirname if given_gemfile && !given_gemfile.empty?
search_up("") do |path|
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this still can return ~

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have rebased the thing and it looks like my changes here weren't necessary anymore, so I have removed them.

@segiddins
Copy link
Copy Markdown
Contributor

@faucct ping on my last comment about ~?

@faucct
Copy link
Copy Markdown
Author

faucct commented Apr 4, 2017

Hello, had no time to finish the thing yet. Will be done in couple weeks.

@bundlerbot
Copy link
Copy Markdown
Collaborator

☔ The latest upstream changes (presumably #5719) made this pull request unmergeable. Please resolve the merge conflicts.

@colby-swandale
Copy link
Copy Markdown
Member

ping @faucct is this still being worked on?

@faucct faucct force-pushed the bugfix/gemfile_sharing branch from a44a196 to fd7e379 Compare October 15, 2017 17:48
@faucct
Copy link
Copy Markdown
Author

faucct commented Oct 15, 2017

Finally rebased. Please, review this once again.

@faucct
Copy link
Copy Markdown
Author

faucct commented Jan 19, 2018

ping

Copy link
Copy Markdown
Member

@colby-swandale colby-swandale left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR needs a description about what exactly this is fixing and link and issues this relates to. See the PR template for more info.

@deivid-rodriguez
Copy link
Copy Markdown
Contributor

deivid-rodriguez commented Jul 9, 2019

Any news @faucct? I copied the test you added to both 2-0-stable and current master (in both 2.x and 3.x mode), and it passed in all cases, so we really need a description of what this is fixing. Thanks!

@faucct
Copy link
Copy Markdown
Author

faucct commented Jul 9, 2019

I guess this can be closed if the tests are passing.

@deivid-rodriguez
Copy link
Copy Markdown
Contributor

Ok, if you run into related trouble, make sure to let us know!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants