Skip to content

Unexpected doc path collision with combination of workspace, proc-macro, explicit target and optimizations #14986

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

Closed
PonasKovas opened this issue Dec 27, 2024 · 2 comments
Labels
C-bug Category: bug S-triage Status: This issue is waiting on initial triage.

Comments

@PonasKovas
Copy link

Problem

In these specific conditions (workspace with a proc-macro, building for a specific target with optimizations) cargo doc fails with an error that doesn't make any sense.

> cargo doc
error: document output filename collision
The lib `b` in package `b v0.1.0 (doc-collision-minimal/b)` has the same name as the lib `b` in package `b v0.1.0 (doc-collision-minimal/b)`.
Only one may be documented at once since they output to the same path.
Consider documenting only one, renaming one, or marking one with `doc = false` in Cargo.toml.

Tried on the latest nightly 1.85.0-nightly (917bfa784 2024-12-26) and the current stable 1.83.0 (5ffbef321 2024-10-29)

Steps

  • Workspace with 2 crates: a and b.
    • a depends on b, which is a proc-macro.
  • Compile with optimizations enabled (any opt-level except 0)
  • Specify an explicit target (e.g. x86_64-unknown-linux-musl)

Possible Solution(s)

No response

Notes

Minimal reproducible example

Version

cargo 1.85.0-nightly (c86f4b3a1 2024-12-24)
release: 1.85.0-nightly
commit-hash: c86f4b3a1b153218e6e50861214b0b4b4e695f23
commit-date: 2024-12-24
host: x86_64-unknown-linux-gnu
libgit2: 1.8.1 (sys:0.19.0 vendored)
libcurl: 8.9.0-DEV (sys:0.4.74+curl-8.9.0 vendored ssl:OpenSSL/1.1.1w)
ssl: OpenSSL 1.1.1w  11 Sep 2023
os: Arch Linux Rolling Release [64-bit]
@PonasKovas PonasKovas added C-bug Category: bug S-triage Status: This issue is waiting on initial triage. labels Dec 27, 2024
@PonasKovas
Copy link
Author

Oops, this appears to be a duplicate of #10368

@weihanglo
Copy link
Member

Thanks. Close in favor of #10368.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug S-triage Status: This issue is waiting on initial triage.
Projects
None yet
Development

No branches or pull requests

2 participants