Skip to content

Conversation

@volhovm
Copy link
Contributor

@volhovm volhovm commented Jul 23, 2025

make docs-rust was generating quite a few warnings with broken links. This PR fixes broken internal links.

@dannywillems dannywillems force-pushed the volhovm/fix-cargo-docs-broken-links branch from 5019e66 to 96ce191 Compare July 23, 2025 14:56
@dannywillems
Copy link
Member

If it fixes all warnings, can you change the CI to make the job fail if we introduce a new warning?

@dannywillems
Copy link
Member

There are still some warnings. But LGTM.

@volhovm
Copy link
Contributor Author

volhovm commented Jul 23, 2025

I only get the following warnings which are not docs specific:

її> make docs-rust
Generating Rust API documentation...
# Using nightly with --enable-index-page to generate workspace index
# See: https://github.com/rust-lang/cargo/issues/8229
warning: profiles for the non root package will be ignored, specify profiles at the workspace root:
package:   /home/volhovm/code/openmina/ledger/Cargo.toml
workspace: /home/volhovm/code/openmina/Cargo.toml
warning: profiles for the non root package will be ignored, specify profiles at the workspace root:
package:   /home/volhovm/code/openmina/tools/fuzzing/Cargo.toml
workspace: /home/volhovm/code/openmina/Cargo.toml
warning: output filename collision.
The bin target `openmina-node-testing` in package `openmina-node-testing v0.16.0 (/home/volhovm/code/openmina/node/testing)` has the same output filename as the lib target `openmina_node_testing` in package `openmina-node-testing v0.16.0 (/home/volhovm/code/openmina/node/testing)`.
Colliding filename is: /home/volhovm/code/openmina/target/doc/openmina_node_testing/index.html
The output filenames should be unique.
This is a known bug where multiple crates with the same name use
the same path; see <https://github.com/rust-lang/cargo/issues/6313>.
If this looks unexpected, it may be a bug in Cargo. Please file a bug report at
https://github.com/rust-lang/cargo/issues/ with as much information as you
can provide.
cargo 1.86.0-nightly (045bf21b3 2025-01-17) running on `x86_64-unknown-linux-gnu` target `x86_64-unknown-linux-gnu`
First unit: Unit { pkg: Package { id: PackageId { name: "openmina-node-testing", version: "0.16.0", source: "/home/volhovm/code/openmina/node/testing" }, ..: ".." }, target: TargetInner { name: "openmina-node-testing", doc: true, ..: with_path("/home/volhovm/code/openmina/node/testing/src/main.rs", Edition2021) }, profile: Profile { ..: default_dev() }, kind: Host, mode: Doc { deps: false, json: false }, features: ["default", "documented", "p2p-libp2p", "scenario-generators"], rustflags: [], rustdocflags: ["--enable-index-page", "-Zunstable-options"], links_overrides: {}, artifact: false, artifact_target_for_features: None, is_std: false, dep_hash: 10944158186853082742 }
Second unit: Unit { pkg: Package { id: PackageId { name: "openmina-node-testing", version: "0.16.0", source: "/home/volhovm/code/openmina/node/testing" }, ..: ".." }, target: TargetInner { ..: lib_target("openmina_node_testing", ["lib"], "/home/volhovm/code/openmina/node/testing/src/lib.rs", Edition2021) }, profile: Profile { ..: default_dev() }, kind: Host, mode: Doc { deps: false, json: false }, features: ["default", "documented", "p2p-libp2p", "scenario-generators"], rustflags: [], rustdocflags: ["--enable-index-page", "-Zunstable-options"], links_overrides: {}, artifact: false, artifact_target_for_features: None, is_std: false, dep_hash: 7577084202221957118 }
warning: output filename collision.
The bin target `openmina-producer-dashboard` in package `openmina-producer-dashboard v0.16.0 (/home/volhovm/code/openmina/producer-dashboard)` has the same output filename as the lib target `openmina_producer_dashboard` in package `openmina-producer-dashboard v0.16.0 (/home/volhovm/code/openmina/producer-dashboard)`.
Colliding filename is: /home/volhovm/code/openmina/target/doc/openmina_producer_dashboard/index.html
The output filenames should be unique.
This is a known bug where multiple crates with the same name use
the same path; see <https://github.com/rust-lang/cargo/issues/6313>.
If this looks unexpected, it may be a bug in Cargo. Please file a bug report at
https://github.com/rust-lang/cargo/issues/ with as much information as you
can provide.
cargo 1.86.0-nightly (045bf21b3 2025-01-17) running on `x86_64-unknown-linux-gnu` target `x86_64-unknown-linux-gnu`
First unit: Unit { pkg: Package { id: PackageId { name: "openmina-producer-dashboard", version: "0.16.0", source: "/home/volhovm/code/openmina/producer-dashboard" }, ..: ".." }, target: TargetInner { name: "openmina-producer-dashboard", doc: true, ..: with_path("/home/volhovm/code/openmina/producer-dashboard/src/bin/producer_dashboard.rs", Edition2021) }, profile: Profile { ..: default_dev() }, kind: Host, mode: Doc { deps: false, json: false }, features: [], rustflags: [], rustdocflags: ["--enable-index-page", "-Zunstable-options"], links_overrides: {}, artifact: false, artifact_target_for_features: None, is_std: false, dep_hash: 8473980020151131647 }
Second unit: Unit { pkg: Package { id: PackageId { name: "openmina-producer-dashboard", version: "0.16.0", source: "/home/volhovm/code/openmina/producer-dashboard" }, ..: ".." }, target: TargetInner { name_inferred: true, ..: lib_target("openmina_producer_dashboard", ["lib"], "/home/volhovm/code/openmina/producer-dashboard/src/lib.rs", Edition2021) }, profile: Profile { ..: default_dev() }, kind: Host, mode: Doc { deps: false, json: false }, features: [], rustflags: [], rustdocflags: ["--enable-index-page", "-Zunstable-options"], links_overrides: {}, artifact: false, artifact_target_for_features: None, is_std: false, dep_hash: 7411929789928042247 }

@volhovm
Copy link
Contributor Author

volhovm commented Jul 23, 2025

If it fixes all warnings, can you change the CI to make the job fail if we introduce a new warning?

I added -D warnings into Makefile's target docs-rust which is a dependency of docs-integrate-rust which is a dependency of docs-build and docs-served which are checked in the docs.yaml CI workflow. I think this should work.

@volhovm volhovm enabled auto-merge July 23, 2025 15:56
@dannywillems
Copy link
Member

I only get the following warnings which are not docs specific:

її> make docs-rust
Generating Rust API documentation...
# Using nightly with --enable-index-page to generate workspace index
# See: https://github.com/rust-lang/cargo/issues/8229
warning: profiles for the non root package will be ignored, specify profiles at the workspace root:
package:   /home/volhovm/code/openmina/ledger/Cargo.toml
workspace: /home/volhovm/code/openmina/Cargo.toml
warning: profiles for the non root package will be ignored, specify profiles at the workspace root:
package:   /home/volhovm/code/openmina/tools/fuzzing/Cargo.toml
workspace: /home/volhovm/code/openmina/Cargo.toml
warning: output filename collision.
The bin target `openmina-node-testing` in package `openmina-node-testing v0.16.0 (/home/volhovm/code/openmina/node/testing)` has the same output filename as the lib target `openmina_node_testing` in package `openmina-node-testing v0.16.0 (/home/volhovm/code/openmina/node/testing)`.
Colliding filename is: /home/volhovm/code/openmina/target/doc/openmina_node_testing/index.html
The output filenames should be unique.
This is a known bug where multiple crates with the same name use
the same path; see <https://github.com/rust-lang/cargo/issues/6313>.
If this looks unexpected, it may be a bug in Cargo. Please file a bug report at
https://github.com/rust-lang/cargo/issues/ with as much information as you
can provide.
cargo 1.86.0-nightly (045bf21b3 2025-01-17) running on `x86_64-unknown-linux-gnu` target `x86_64-unknown-linux-gnu`
First unit: Unit { pkg: Package { id: PackageId { name: "openmina-node-testing", version: "0.16.0", source: "/home/volhovm/code/openmina/node/testing" }, ..: ".." }, target: TargetInner { name: "openmina-node-testing", doc: true, ..: with_path("/home/volhovm/code/openmina/node/testing/src/main.rs", Edition2021) }, profile: Profile { ..: default_dev() }, kind: Host, mode: Doc { deps: false, json: false }, features: ["default", "documented", "p2p-libp2p", "scenario-generators"], rustflags: [], rustdocflags: ["--enable-index-page", "-Zunstable-options"], links_overrides: {}, artifact: false, artifact_target_for_features: None, is_std: false, dep_hash: 10944158186853082742 }
Second unit: Unit { pkg: Package { id: PackageId { name: "openmina-node-testing", version: "0.16.0", source: "/home/volhovm/code/openmina/node/testing" }, ..: ".." }, target: TargetInner { ..: lib_target("openmina_node_testing", ["lib"], "/home/volhovm/code/openmina/node/testing/src/lib.rs", Edition2021) }, profile: Profile { ..: default_dev() }, kind: Host, mode: Doc { deps: false, json: false }, features: ["default", "documented", "p2p-libp2p", "scenario-generators"], rustflags: [], rustdocflags: ["--enable-index-page", "-Zunstable-options"], links_overrides: {}, artifact: false, artifact_target_for_features: None, is_std: false, dep_hash: 7577084202221957118 }
warning: output filename collision.
The bin target `openmina-producer-dashboard` in package `openmina-producer-dashboard v0.16.0 (/home/volhovm/code/openmina/producer-dashboard)` has the same output filename as the lib target `openmina_producer_dashboard` in package `openmina-producer-dashboard v0.16.0 (/home/volhovm/code/openmina/producer-dashboard)`.
Colliding filename is: /home/volhovm/code/openmina/target/doc/openmina_producer_dashboard/index.html
The output filenames should be unique.
This is a known bug where multiple crates with the same name use
the same path; see <https://github.com/rust-lang/cargo/issues/6313>.
If this looks unexpected, it may be a bug in Cargo. Please file a bug report at
https://github.com/rust-lang/cargo/issues/ with as much information as you
can provide.
cargo 1.86.0-nightly (045bf21b3 2025-01-17) running on `x86_64-unknown-linux-gnu` target `x86_64-unknown-linux-gnu`
First unit: Unit { pkg: Package { id: PackageId { name: "openmina-producer-dashboard", version: "0.16.0", source: "/home/volhovm/code/openmina/producer-dashboard" }, ..: ".." }, target: TargetInner { name: "openmina-producer-dashboard", doc: true, ..: with_path("/home/volhovm/code/openmina/producer-dashboard/src/bin/producer_dashboard.rs", Edition2021) }, profile: Profile { ..: default_dev() }, kind: Host, mode: Doc { deps: false, json: false }, features: [], rustflags: [], rustdocflags: ["--enable-index-page", "-Zunstable-options"], links_overrides: {}, artifact: false, artifact_target_for_features: None, is_std: false, dep_hash: 8473980020151131647 }
Second unit: Unit { pkg: Package { id: PackageId { name: "openmina-producer-dashboard", version: "0.16.0", source: "/home/volhovm/code/openmina/producer-dashboard" }, ..: ".." }, target: TargetInner { name_inferred: true, ..: lib_target("openmina_producer_dashboard", ["lib"], "/home/volhovm/code/openmina/producer-dashboard/src/lib.rs", Edition2021) }, profile: Profile { ..: default_dev() }, kind: Host, mode: Doc { deps: false, json: false }, features: [], rustflags: [], rustdocflags: ["--enable-index-page", "-Zunstable-options"], links_overrides: {}, artifact: false, artifact_target_for_features: None, is_std: false, dep_hash: 7411929789928042247 }

Are you sure you are rebuilding everything? I have warnings on my side.

@dannywillems
Copy link
Member

Running cargo 1.90.0-nightly on my side, and got a few warnings, but the target works fine.

@dannywillems
Copy link
Member

See #1244

@dannywillems dannywillems disabled auto-merge July 23, 2025 16:46
@dannywillems dannywillems enabled auto-merge July 23, 2025 16:46
@dannywillems dannywillems disabled auto-merge July 23, 2025 16:46
@dannywillems dannywillems enabled auto-merge July 23, 2025 16:46
@dannywillems dannywillems merged commit cf3f7e4 into develop Jul 23, 2025
38 checks passed
@dannywillems dannywillems deleted the volhovm/fix-cargo-docs-broken-links branch October 16, 2025 11:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants