Skip to content

Cargo config doesn't work sometimes #15589

Open
@GuillaumeGomez

Description

@GuillaumeGomez

Problem

When running this command on docs.rs to generate JSON output:

cargo "+nightly" "rustdoc" "--lib" "-Zrustdoc-map" "--all-features" "--config" "build.rustflags=[\"--cfg\", \"docsrs\"]" "-Zhost-config" "-Ztarget-applies-to-host" "--config" "host.rustflags=[\"--cfg\", \"docsrs\"]" "--config" "build.rustdocflags=[\"--cfg\", \"docsrs\", \"-Z\", \"unstable-options\", \"--output-format\", \"json\", \"--static-root-path\", \"/-/rustdoc.static/\", \"--cap-lints\", \"warn\", \"--extern-html-root-takes-precedence\"]" "--offline" "-Zunstable-options" "--config=doc.extern-map.registries.crates-io=\"https://docs.rs/{pkg_name}/{version}/x86_64-unknown-linux-gnu\"" "-Zrustdoc-scrape-examples" "-j6"

We instead get the HTML format. It happened only on two crates so far: scsys-macros (version 0.2.6) and scsys-derive (version 0.2.6).

When checking what arguments rustdoc received, I saw nothing coming from --config, so I suspect the problem coming from cargo.

Steps

  1. git clone https://github.com/scattered-systems/scsys
  2. cd scsys/macros
  3. git checkout v0.2.6
  4. Run the cargo command from above

Possible Solution(s)

No response

Notes

No response

Version

cargo 1.87.0-nightly (6cf826701 2025-03-14)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions