Skip to content

Print file paths instead of file:// URLs. #5994

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

Merged
merged 4 commits into from
Sep 11, 2018

Conversation

zachlute
Copy link
Contributor

@zachlute zachlute commented Sep 8, 2018

Fixes #4661.

This change ensures cargo will output file paths in the expected format
(C:\foo... on Windows, /foo/... elsewhere). Previously it would output
file:// URLs instead.

To support this change, additional changes were made to the test suite
string processing such that [ROOT] is now replaced with the appropriate
file path root for the platform.

The CWD template was also updated to use [CWD] like other replacement
templates and to do the replacement on the expected value rather than
the actual value to avoid replacing things we don't expect with CWD.

This change ensures cargo will output file paths in the expected format
(C:\foo\... on Windows, /foo/... elsewhere). Previously it would output
file:// URLs instead.

To support this change, additional changes were made to the test suite
string processing such that [ROOT] is now replaced with the appropriate
file path root for the platform.

The CWD template was also updated to use [CWD] like other replacement
templates and to do the replacement on the expected value rather than
the actual value to avoid replacing things we don't expect with CWD.
@rust-highfive
Copy link

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @matklad (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@zachlute
Copy link
Contributor Author

zachlute commented Sep 8, 2018

Test failures were due to overzealous replacement of file:// for git repositories. Strange that it didn't fail on Windows...

@zachlute
Copy link
Contributor Author

zachlute commented Sep 8, 2018

Though I guess that is a question worth asking: I made the decision that git paths should still be file:// URIs, because I think people expect git paths to be URIs, and we tack extra junk on to the end of them that would make it weird as a file path anyway. So please let me know if that seems wrong.

Looks like things fail on my Mac, so I can use that to track down the issues.

Copy link
Member

@dwijnand dwijnand left a comment

Choose a reason for hiding this comment

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

LGTM

@dwijnand
Copy link
Member

dwijnand commented Sep 8, 2018

Thank you, @zachlute!

@alexcrichton
Copy link
Member

Indeed looks great to me, thanks @zachlute!

@bors: r+

@bors
Copy link
Contributor

bors commented Sep 9, 2018

📌 Commit a5a95fe65d4d3c207c31b48b1525d3d0f47c5813 has been approved by alexcrichton

@bors
Copy link
Contributor

bors commented Sep 9, 2018

🔒 Merge conflict

This pull request and the master branch diverged in a way that cannot be automatically merged. Please rebase on top of the latest master branch, and let the reviewer approve again.

How do I rebase?

Assuming self is your fork and upstream is this repository, you can resolve the conflict following these steps:

  1. git checkout convert-file-uris (switch to your branch)
  2. git fetch upstream master (retrieve the latest master)
  3. git rebase upstream/master -p (rebase on top of it)
  4. Follow the on-screen instruction to resolve conflicts (check git status if you got lost).
  5. git push self convert-file-uris --force-with-lease (update this PR)

You may also read Git Rebasing to Resolve Conflicts by Drew Blessing for a short tutorial.

Please avoid the "Resolve conflicts" button on GitHub. It uses git merge instead of git rebase which makes the PR commit history more difficult to read.

Sometimes step 4 will complete without asking for resolution. This is usually due to difference between how Cargo.lock conflict is handled during merge and rebase. This is normal, and you should still perform step 5 to update this PR.

Error message
Auto-merging tests/testsuite/workspaces.rs
Auto-merging tests/testsuite/tool_paths.rs
Auto-merging tests/testsuite/search.rs
CONFLICT (content): Merge conflict in tests/testsuite/search.rs
Auto-merging tests/testsuite/rename_deps.rs
Auto-merging tests/testsuite/registry.rs
CONFLICT (content): Merge conflict in tests/testsuite/registry.rs
Auto-merging tests/testsuite/publish.rs
Auto-merging tests/testsuite/patch.rs
CONFLICT (content): Merge conflict in tests/testsuite/patch.rs
Auto-merging tests/testsuite/overrides.rs
CONFLICT (content): Merge conflict in tests/testsuite/overrides.rs
Auto-merging tests/testsuite/install.rs
CONFLICT (content): Merge conflict in tests/testsuite/install.rs
Auto-merging tests/testsuite/git.rs
Auto-merging tests/testsuite/doc.rs
Auto-merging tests/testsuite/directory.rs
Auto-merging tests/testsuite/cross_publish.rs
CONFLICT (content): Merge conflict in tests/testsuite/cross_publish.rs
Auto-merging tests/testsuite/build_script.rs
Auto-merging tests/testsuite/build.rs
Auto-merging tests/testsuite/alt_registry.rs
CONFLICT (content): Merge conflict in tests/testsuite/alt_registry.rs
Auto-merging src/cargo/core/source/source_id.rs
CONFLICT (content): Merge conflict in src/cargo/core/source/source_id.rs
Automatic merge failed; fix conflicts and then commit the result.

@bors
Copy link
Contributor

bors commented Sep 9, 2018

☔ The latest upstream changes (presumably #5990) made this pull request unmergeable. Please resolve the merge conflicts.

@zachlute
Copy link
Contributor Author

@alexcrichton This one should be good to go again if anybody wants to get this on the path to integration before somebody changes all the same strings I did again. :)

@alexcrichton
Copy link
Member

@bors: r+

Of course!

@bors
Copy link
Contributor

bors commented Sep 10, 2018

📌 Commit 730d07c has been approved by alexcrichton

@bors
Copy link
Contributor

bors commented Sep 10, 2018

⌛ Testing commit 730d07c with merge 43d6198f984f1128bb3b493a08edd2f88f0c81ec...

@dwijnand
Copy link
Member

Sorry for the clash.

@bors
Copy link
Contributor

bors commented Sep 10, 2018

💥 Test timed out

@zachlute
Copy link
Contributor Author

Oh no, what does that mean? There doesn't seem to be any way to view a log or anything to know what it was doing.

@alexcrichton
Copy link
Member

@bors: retry

ah we just gotta try again

@bors
Copy link
Contributor

bors commented Sep 10, 2018

⌛ Testing commit 730d07c with merge 32d73f85305ef4681b0dd24beda42263713cd8b0...

@bors
Copy link
Contributor

bors commented Sep 11, 2018

💥 Test timed out

@alexcrichton
Copy link
Member

@bors: retry

...

@bors
Copy link
Contributor

bors commented Sep 11, 2018

⌛ Testing commit 730d07c with merge 943eedbb3d19bf781270dea00cc090871cfd0617...

@bors
Copy link
Contributor

bors commented Sep 11, 2018

💥 Test timed out

@alexcrichton
Copy link
Member

@bors: retry

@bors
Copy link
Contributor

bors commented Sep 11, 2018

⌛ Testing commit 730d07c with merge c1c4fc2...

bors added a commit that referenced this pull request Sep 11, 2018
Print file paths instead of file:// URLs.

Fixes #4661.

This change ensures cargo will output file paths in the expected format
(C:\foo\... on Windows, /foo/... elsewhere). Previously it would output
file:// URLs instead.

To support this change, additional changes were made to the test suite
string processing such that [ROOT] is now replaced with the appropriate
file path root for the platform.

The CWD template was also updated to use [CWD] like other replacement
templates and to do the replacement on the expected value rather than
the actual value to avoid replacing things we don't expect with CWD.
@bors
Copy link
Contributor

bors commented Sep 11, 2018

☀️ Test successful - status-appveyor, status-travis
Approved by: alexcrichton
Pushing c1c4fc2 to master...

@bors bors merged commit 730d07c into rust-lang:master Sep 11, 2018
@zachlute
Copy link
Contributor Author

Woohoo!

@zachlute zachlute deleted the convert-file-uris branch September 11, 2018 14:51
@ehuss ehuss added this to the 1.31.0 milestone Feb 6, 2022
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.

"Documenting..." messages should use \ on windows
7 participants