-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Fix error when trying to find bundler with a deleted "working directo… #3090
Conversation
…ry" - `pwd': No such file or directory - getcwd (Errno::ENOENT)
8e73b30
to
a13d246
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for putting in a super quick fix to this! I left some comments from that I gathered as I investigated this issue - please use or discard them as you see fit (:
Dir.chdir(dir) | ||
end | ||
|
||
assert_nil bvf.bundler_version_with_reason |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this test probably should chdir back to its old dir, otherwise the other tests are going to have a hard time / fail in an order-dependent way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bronzdoc can you elaborate on why you marked this as resolved? I have the same concern as @asf-stripe, but I may be missing some context. (E.g., does the setup process run before each test call Dir.chdir
, or something like that?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks both of you! I fixed it. It will restore to the original PWD, somehow I thought I was passing that block to Dir.chdir
...
4187449
to
e4df2de
Compare
For some reason the CI Windows environment can't delete the tmpdir of the test I added for this change - @MSP-Greg Have this happened to you in the past? maybe you can point me to the right track 🙇 |
Similar. I've debated whether to track down the issue or not. Windows uses TEMP and TMP for ENV settings to get the temp folder. The path is What I've done when it's an issue is set TMPDIR to a folder. TMPDIR is the first ENV value checked by Ruby. From years ago, I've also set up my local systems that way... Maybe something like: - name: Run Test
run: |
mkdir temp
$env:TMPDIR = "$pwd/temp"
ridk enable
rake test |
I just looked at the test that's causing the issue. On Windows, one can't delete the dir that is |
Thanks so much for looking into this @MSP-Greg! |
I'm probably missing something, but I think the test won't work on Windows and, hence, needs to be skipped. As one can't delete |
…pwd/Dir.pwd. Nothing to do with temp files or directories
e4df2de
to
0eb98af
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me, aside from the same issue that was mentioned by @asf-stripe — I'm wondering if you may need to Dir.chdir
back to where it was prior to the test running.
Dir.chdir(dir) | ||
end | ||
|
||
assert_nil bvf.bundler_version_with_reason |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bronzdoc can you elaborate on why you marked this as resolved? I have the same concern as @asf-stripe, but I may be missing some context. (E.g., does the setup process run before each test call Dir.chdir
, or something like that?)
@bundlerbot r+ |
3090: Fix error when trying to find bundler with a deleted "working directo… r=bronzdoc a=bronzdoc closes #3087 # Description: Fix and error in the Bundler version finder when run in a deleted `current working directory` ______________ I will abide by the [code of conduct](https://github.com/rubygems/rubygems/blob/master/CODE_OF_CONDUCT.md). 3127: Refactor ruby path finding r=bronzdoc a=deivid-rodriguez # Description: We have some duplicated logic to find out the fullpath to the ruby binary. I think `RbConfig.ruby` can be fully trusted as the source of truth for this information. # Tasks: - [x] Describe the problem / feature - [ ] Write tests - [x] Write code to solve the problem - [ ] Get code review from coworkers / friends I will abide by the [code of conduct](https://github.com/rubygems/rubygems/blob/master/CODE_OF_CONDUCT.md). Co-authored-by: bronzdoc <lsagastume1990@gmail.com> Co-authored-by: David Rodríguez <deivid.rodriguez@riseup.net>
Build succeeded
|
closes #3087
Description:
Fix and error in the Bundler version finder when run in a deleted
current working directory
I will abide by the code of conduct.