-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Fix linker failure on windows #38949
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
@@ -667,7 +667,9 @@ pub fn phase_2_configure_and_expand<F>(sess: &Session, | |||
new_path.push(path); | |||
} | |||
} | |||
env::set_var("PATH", &env::join_paths(new_path).unwrap()); | |||
if let Ok(p) = env::join_paths(new_path) { |
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.
Instead of not setting PATH
altogether, we should just ignore the components that make construction of the PATH
to fail.
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.
It would give an invalid PATH. Not sure this is what we want... At least, the current change doesn't set the variable at all if any path is not valid.
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.
It would give an invalid PATH.
What? Of course it would become a valid PATH
once you filter out all the parts that can’t be put into PATH
. Maybe it would not be complete, but certainly valid.
What your current patch does, on the other hand, is making whatever function this code had not come into effect whenever there’s any path from any source that cannot be put into PATH
.
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 I missed something then. In here, we just join 2 paths, if one is invalid, we should only keep the other one, right? I'll try to update in this way then.
bda1011
to
9c198ed
Compare
@nagisa: Better? |
Remembering that So here’s some implementation strategies I had in mind:
or
does it make what I meant any clearer? |
Indeed. I'll just take your first example then. |
9c198ed
to
6f58b7f
Compare
Updated. |
Any news @nagisa? |
This approach LGTM to me. |
@bors: r=nagisa |
📌 Commit 6f58b7f has been approved by |
⌛ Testing commit 6f58b7f with merge 4ce7acc... |
☀️ Test successful - status-appveyor, status-travis |
Fixes #38933.
r? @ollie27