-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Windows: Prefer USERPROFILE over HOMEPATH on startup as well #7033
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
Conversation
| } | ||
| else if (get_special_folder(CSIDL_PERSONAL, env, numberof(env))) { | ||
| f = TRUE; | ||
| else { |
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.
Why separated only this else?
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.
The former code was made so that if either HOMEDRIVE or HOMEPATH is defined alone, then it still is used without the other half. Maybe this a questionable behavior, but I wanted to keep that how it is.
Maybe the diff -w output is more descriptive.
|
@larskanis FYI https://github.com/ruby/spec/actions/runs/3849235325/jobs/6557993944 failed, so I commented ruby/spec@c181abc, please rebase and uncomment it in this PR if it passes now |
|
Ah maybe that just needs a |
|
Yes, both specs are ruby-3.2 only for now. But the encoding fix is marked as to be backported to 3.1 and 3.0 in https://bugs.ruby-lang.org/issues/19243 . That's why I set the version guard to 3.0. Should fixes always be enabled on the latest ruby only at first? And later on extended when they are backported? |
3fe2118 to
bf71e25
Compare
In ruby/spec's at least yes. Because REQUIRED still depends on the branch maintainer decision, and latest ruby/spec is used by and must work on CRuby e.g. 3.1 3.0 etc branches (https://rubyci.org/). |
|
@eregon Makes sense. Thanks for clarification! I added the version guard and rebased the PR. |
|
Can this be merged? Since it affects the RubyInstaller tests, all ruby release versions are already patched that way. |
Enable the test commented out in d0f5dc9eac78ecade459. Extracted from GH-7033, that is for initialization at start up time and this test is unrelated to it.
|
This test in spec/ruby/core/dir/home_spec.rb seems irrelevant to the change to win32/win32.c, but the fix for d0f5dc9. |
Yes, you're right! There is no test for the startup behavior, so far. I didn't add it, since it would involve several external ruby process runs, which would slow down the specs. Still the order of the variables should be changed on startup as well. I rebased the PR to master branch. Can I do something more to get this fixed? |
bf71e25 to
b3d3e3a
Compare
Because ruby/ruby#7033 was merged to ruby master branch.
This is a fix-up of commit d0f5dc9 .
Unfortunately the original intention to allow the use of ruby in a
runasenvironment wasn't fixed by the above commit. This is because the win32 initialization sets theHOMEenvironment variable based on a separate evaluation ofUSERPROFILE,HOMEDRIVEandHOMEPATH. And theHOMEvariable is preferred byDir.home. I'm sorry I didn't know about this initialization, so that I missed to adjust this code part properly. This is now fixed.Fixes https://bugs.ruby-lang.org/issues/19244