-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Strip unc if it exists, fix #1110 #1129 #1151
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
Thanks! |
linux-pinned: | ||
imageName: 'ubuntu-16.04' | ||
rustup_toolchain: 1.43.0 | ||
rustup_toolchain: 1.45.0 |
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 do we need the bump btw?
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.
error[E0658]: use of unstable library feature 'str_strip': newly added
--> src/cmd/init.rs:65:26
|
65 | match path_to_refine.strip_prefix(LOCAL_UNC) {
| ^^^^^^^^^^^^
|
= note: see issue #67302 <https://github.com/rust-lang/rust/issues/67302> for more information
error: aborting due to previous error
For more information about this error, try `rustc --explain E0658`.
error: could not compile `zola`.
This was stabilized in 1.45, (https://github.com/rust-lang/rust/blob/master/RELEASES.md#stabilized-apis-1), I manage to confirm using rustc as well. So minimum version to bump is 1.45 to avoid this error. I'm gonna change that accordingly.
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.
Wouldn't trim_start_matches
do the same?
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.
In that case, I think yes. To be honest I used strip_prefix because I looked at the documentation and it was what I needed and I did not look further at it. (shame on me)
As I used a version > 1.45, I have not realize that this method was not stable before that release.
Anyway, would you like me to use trim_start_matches instead of strip_prefix and come back to 1.43 for the pinned version ?
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.
If you have time and don't mind sure
It looks like this is only doing a trivial string prefix removal instead of actually testing that it's valid. UNC paths can represent paths on windows that are otherwise unrepresentable, so removing it can make a path invalid. It should only be removed (if at all) if the resultant path is still valid. This is also why the current rust method returns what it does, because it is the kernel itself performing the canonicalization. |
Sanity check:
Code changes
next
branch?Explanation:
Remove unc on windows platform see #1110 .
Sorry I mistakenly closed the previous PR on that topic #1129 .
So here is the new one I did 3 things: