-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Support path_in_vcs as part of cargo_vcs_metadata #9866
Conversation
r? @ehuss (rust-highfive has picked a reviewer for you, use r? to override) |
This is an API change - so I assume we'd want to go through some discussion/review to confirm it's reasonable |
This is very useful for rendering crate's READMEs correctly. |
aac20b6
to
94e4f0d
Compare
(Updated documentation as well here) |
Seems like a good change to me! I'll let @ehuss weigh in though as well. |
Sorry for the delay. There's a lot of comments to sift through here, can you maybe put together a summary? I'm a bit confused how the repository root comes into play. Doesn't it need to know the path of the README relative to the package root? I don't see how the repository root is related to that. |
Sure! I'll try to address the need in a summary. Original Issue rust-lang/crates.io#3484Relative links in README files which aren't in the repository root get rendered with incorrect links. Crates.io rewrites READMEs inside of github/bitbucket/gitlab repos so that the relative markdown links actually link to the page on github/bitbucket/gitlab. Unfortunately, crates.io did this by calculating ( Partial fixrust-lang/crates.io#3861 - partially fixes this by using the This still does not handle cases where the package is in a subdirectory - as Full fixCargo needs to provide enough information such that crates.io (or other providers) can calculate the full URL to links. With this diff, the approach is to add a #9837 had the non-backward-compatible approach of changing |
I see, that makes a lot more sense to me, thank you! Thanks for updating the docs. Just one minor request, can the details about the |
94e4f0d
to
b8b127a
Compare
Thanks! @bors r+ |
📌 Commit b8b127a has been approved by |
☀️ Test successful - checks-actions |
Update cargo 5 commits in 0121d66aa2ef5ffa9735f86c2b56f5fdc5a837a6..d56b42c549dbb7e7d0f712c51b39400260d114d4 2021-09-22 16:08:27 +0000 to 2021-09-27 13:44:18 +0000 - Allow `cargo update --precise` with metadata. (rust-lang/cargo#9945) - Support path_in_vcs as part of cargo_vcs_metadata (rust-lang/cargo#9866) - Doc about InstallTracker files and `install.root` (rust-lang/cargo#9948) - Add some clarity on the license/license-file warning. (rust-lang/cargo#9941) - Fix the problem that help cannot be displayed properly (rust-lang/cargo#9933)
Support relative URLs from repo-subdirectory packages Extract `.cargo_vcs_info.json` from the tarball and use it to determine the path in vcs. Support for this was added to cargo with rust-lang/cargo#9866 Fixes #3484 (note that support for this in admin::render_readmes not yet exists - would come with #4095) Depends on #4097 (Because of community/community#4477 - github ends up rendering the diffs together. Go to the commits tab and just look at the most recent commits to review).
Depends on #9865 - this PR will look simpler once that one lands. I can't target my PR to the base branch of #9865 as an external contributor (since it's in my fork). For now just review the latest commit of this one.
This is a backward compatible change that is an alternative to #9837