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

Consolidate doc collision detection. #9526

Merged
merged 1 commit into from
Jun 1, 2021

Conversation

ehuss
Copy link
Contributor

@ehuss ehuss commented May 31, 2021

This removes the separate collision detection pass (in cargo_doc.rs) and uses the global collision detection instead. This removes the separate pass for running the resolver (which resulted in running the resolver four times every time cargo doc was run).

The --open option needs to know which path to open, so this is passed in a roundabout way via Compilation. Since this method uses the root units, I added a sort on the roots so that the crate that is opened is consistent between runs. This results in some slight behavioral changes.

This also makes the collision check slightly more stringent. The test doc_multiple_targets_same_name now generates an error instead of a warning because the old code did not check for collisions between libs and bins across packages (which should be very rare).

@rust-highfive
Copy link

r? @alexcrichton

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 31, 2021
@alexcrichton
Copy link
Member

@bors: r+

@bors
Copy link
Contributor

bors commented Jun 1, 2021

📌 Commit 81defa6 has been approved by alexcrichton

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 1, 2021
@bors
Copy link
Contributor

bors commented Jun 1, 2021

⌛ Testing commit 81defa6 with merge 0c9eb20...

@bors
Copy link
Contributor

bors commented Jun 1, 2021

☀️ Test successful - checks-actions
Approved by: alexcrichton
Pushing 0c9eb20 to master...

@bors bors merged commit 0c9eb20 into rust-lang:master Jun 1, 2021
JohnTitor added a commit to JohnTitor/rust that referenced this pull request Jun 3, 2021
Update cargo

10 commits in e931e4796b61de593aa1097649445e535c9c7ee0..0cecbd67323ca14a7eb6505900d0d7307b00355b
2021-05-24 16:17:27 +0000 to 2021-06-01 20:09:13 +0000
- Configure hosts separately from targets when --target is specified. (rust-lang/cargo#9322)
- Add some validation to rustc-link-arg (rust-lang/cargo#9523)
- Implement suggestions for unknown features in workspace (rust-lang/cargo#9420)
- Extract common `make_dep_path` to cargo_util (rust-lang/cargo#9529)
- Add a note about rustflags compatibility. (rust-lang/cargo#9524)
- Consolidate doc collision detection. (rust-lang/cargo#9526)
- Add `--depth` option for `cargo-tree` (rust-lang/cargo#9499)
- `cargo tree -e no-proc-macro` to hide procedural macro dependencies (rust-lang/cargo#9488)
- Update to semver 1.0.0 (rust-lang/cargo#9508)
- Update tar dependency to 0.4.35 (rust-lang/cargo#9517)
bors added a commit that referenced this pull request Jun 18, 2021
Relax doc collision error.

#9526 moved the `cargo doc` output name collision code to be shared with the other collision detection code. However, the way it detected collisions wasn't quite the same, and started generating errors for situations that were just warnings before. It was intended that the code should behave the same, so this PR relaxes the checks to be more like the original code.  (It's still not 100% the same, but should be close enough.)

Closes #9564
ehuss pushed a commit to ehuss/cargo that referenced this pull request Jun 22, 2021
…alexcrichton

Relax doc collision error.

rust-lang#9526 moved the `cargo doc` output name collision code to be shared with the other collision detection code. However, the way it detected collisions wasn't quite the same, and started generating errors for situations that were just warnings before. It was intended that the code should behave the same, so this PR relaxes the checks to be more like the original code.  (It's still not 100% the same, but should be close enough.)

Closes rust-lang#9564
@ehuss ehuss added this to the 1.54.0 milestone Feb 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants