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

Add check of Dir.home's permission #4886

Closed
wants to merge 2 commits into from

Conversation

allenzhao
Copy link
Contributor

Ref #4778

@@ -136,6 +136,10 @@ def print_major_deprecations!
major_deprecation("Bundler will only support rubygems >= 2.0, you are running #{Bundler.rubygems.version}")
end

def check_home_dir_permissions
raise PathError, "There was an error while trying to use your home path #{Dir.home}" unless File.writable?(Dir.home)
Copy link
Member

Choose a reason for hiding this comment

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

this should specifically mention that the home directory must exist & be writable

@segiddins
Copy link
Member

@allenzhao ping?

@indirect
Copy link
Member

I think Bundler should just work, even if home directories are unwritable or do not exist. User-level settings should not be persisted, and cached files like the compact index and gem download cache should go into /tmp/bundler instead.

@allenzhao
Copy link
Contributor Author

@indirect So what should be the solution here?
@segiddins I've already added the test and updated according to @JuanitoFatas 's advice.
Thanks!

@segiddins
Copy link
Member

@allenzhao there are RuboCop failures in addition

Signed-off-by: Zehan Zhao <[email protected]>
@indirect
Copy link
Member

@allenzhao I added notes to the list ticket #4871:

Use /tmp/bundler for compact_index when Dir.home isn't writable #4792 #4819
Skip persisting global settings to disk if Dir.home is missing or unwritable #4918

I think it means we will want to fix this problem in a different way, with PRs that solve those two problems. I would be very happy to have you work on those, and if you would like me to write a more detailed description of how that should work, I am happy to do it, just let me know.

@allenzhao
Copy link
Contributor Author

@indirect Please do by opening a new issue, and I will close this PR.

@allenzhao allenzhao closed this Sep 8, 2016
homu added a commit that referenced this pull request Sep 30, 2016
Fallback to a temp dir when the home directory is not usable

Closes #4778
This is an alternative to #4886
\c @allenzhao @indirect
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.

4 participants