-
Notifications
You must be signed in to change notification settings - Fork 973
Treat empty environment variables as unset #4422
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
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'm not quite sure if this is the optimal approach... at least it isn't aware of the existence of non_empty_env_var()
as @FranciscoTGouveia has noticed in FranciscoTGouveia@43f8115.
It might indeed be helpful to override the env var fetching behavior in all places, but some sort of merging would be better for future maintenance, and some more investigation/refactoring might be required to change something so global and fundamental in rustup's current behavior. As such, I am hesitant to merge this PR as-is.
I did indeed fail to notice/forgot about the existence of |
@djc You are probably right; but before reaching the conclusion I'd like to take some time to further investigate into the use cases of |
@djc Sorry for the long wait, but here is what I have found after my investigation:
... and the current env vars being used in this repo can go to several categories:
My current standpoint is that, if we can figure out the 4. above and conclude that it is not violating with what we would like to achieve, we can fully eliminate |
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.
@djc I am really sorry for the belated response! I've done a full audit of all the env variable uses in the final section of my previous response and concluded that Rustup already assumes these env variables to be non-empty if present to be able to proceed. So this should be a safe move as far as my investigation goes 🙏
Thanks for going through this! I wanted to spend time on it as well but haven't been able to yet. I'll follow up clean up the |
Fixes #4419.