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
Avoid infinite loop in case where pwd
returns relative path
#525
Avoid infinite loop in case where pwd
returns relative path
#525
Conversation
The `pwd` may return relative path if the `$PWD` is badly declared in bash/zsh (e.g. `PWD="." bash`). To avoid the infinite loop in `find_local_version_file()`, stop finding the version file if the target paths are same consecutively.
Sorry, I confiemd this doesn't work expectedly. Now I'm working to fix this, and will update issue if fixed. |
I've done fixing. I couldn't get the absolute path of The current patch will just preserve the value of |
Fix looks good, but:
|
To tell the truth, I have ran into this with I have already added a workaround for this in |
I like the simpler check but I'm still not sure whether this is an issue that needs fixing. Generally I'm uncomfortable by tools that set PWD manually since I don't see a reason for it. But in order to pull it in rbenv, I would definitely like a test that reproduces the issue. |
I don't know if this is the same bug or issue, but I've been having problems with an infinite loop in rbenv when using the system ruby on Mac OSX (Mavericks). Everything initially seems to work. But if I open a 2nd terminal window in the same rails directory, rails and rake will both loop in the 2nd window, while still working properly in the first. They are both repeatedly calling rbenv-which. I don't see this problem with other rails projects that are not using the system ruby and rails. Running "$(rbenv which rails) server" or "./bin/rails server" directly works OK. |
@sdm7g That definitely sounds weird. Does anything set |
On May 28, 2014, at 11:18 PM, Mislav Marohnić notifications@github.com wrote:
My theory about when it goes wrong seems to be wrong : it now hangs in a loop in every instance. I have only the dump of the non-working, looping instance, and I haven’t [ Here it is enclosed below. ] — Steve Majewski |
If you have some RBENV_DEBUG output, please paste it in a Gist or something, then link here. Thanks |
Closing due to this being stale. I haven't heard reports of this affecting anyone else in the wild. |
The
pwd
may return relative path if the$PWD
is badly declared in bash/zsh (e.g.PWD="." bash
). To avoid the infinite loop infind_local_version_file()
, stop finding the version file if the target paths are same consecutively.