Skip to content
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

Root path fix for windows #178

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jelmansouri
Copy link

No description provided.

.split_off(package_root_path.display().to_string().len() + 1);
.split_off(package_root_path.display().to_string().len() + 1)
// Handle Windows case where we end up here with backslashes
.replace("\\", "/");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This behavior on lines 743-749/751 looks quite a bit like strip_prefix. Could that be used instead? Would that help get rid of the special casing for windows?

Copy link
Author

@jelmansouri jelmansouri Jun 28, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we would still endup with src\lib.rs for example instead of src/lib.rs.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the clarification. For my own reference, from std::path::Path:

separated by / on Unix and by either / or \ on Windows

It would be nice to have a test case for this, though I'm not sure if CI even runs on windows. @acmcarther can you confirm.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, CI doesn't currently run on windows. Travis might have some support for running tests on windows though.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll be happy to add CI for windows support.
Commit bazelbuild/rules_rust@d2c4b14 just adds it on the bazel rust rules. So all windows support is quite fresh, if we're building through bazel in the CI we need the latest rust rules.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be accepted, if no CI work is planned please.

@acmcarther
Copy link
Member

I don't have a strong preference on this one way or the other, but would like to wait for dfreese@'s LGTM since he provided an initial review.

.split_off(package_root_path.display().to_string().len() + 1);
.split_off(package_root_path.display().to_string().len() + 1)
// Handle Windows case where we end up here with backslashes
.replace("\\", "/");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the clarification. For my own reference, from std::path::Path:

separated by / on Unix and by either / or \ on Windows

It would be nice to have a test case for this, though I'm not sure if CI even runs on windows. @acmcarther can you confirm.

dfreese pushed a commit that referenced this pull request Aug 21, 2020
Adds an additional error for non-unicode paths, which was previously a TODO in terms of handling.  #178 provided a similar solution.
samschlegel pushed a commit to discord/cargo-raze that referenced this pull request Aug 26, 2020
Adds an additional error for non-unicode paths, which was previously a TODO in terms of handling.  google#178 provided a similar solution.
@UebelAndre
Copy link
Collaborator

@jelmansouri Hey, would you be able to rebase and fix the conflict here?

@dfreese @acmcarther And would you guys be able to do another review here? Perhaps @damienmg would be able to fill in for @acmcarther if he's not reachable.

@UebelAndre
Copy link
Collaborator

Is this change still necessary?

Base automatically changed from master to main February 24, 2021 20:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants