Description
Problem
When packaging, Cargo replaces inherited foo.workspace = true
fields with their actual values from the workspace.
Cargo seems to be substituting the readme
field with literal value from the workspace. However, the meaning of paths in readme
and license-file
file is different when the crate is used outside of a workspace, so the path needs to be adjusted accordingly.
When publishing a crate with readme.workspace = true
, the published value is readme = "README.md"
(same as in workspace's Cargo.toml
), but the path is taken from the workspace in a parent directory, so the resolved value should be changed to readme = "../README.md"
(or wherever the workspace is).
Steps
Example:
https://docs.rs/crate/zsplit-cli/0.3.0/source/Cargo.toml.orig
readme.workspace=true
meant the README.md
relative to the workspace, so in the workspace root.
https://docs.rs/crate/zsplit-cli/0.3.0/source/Cargo.toml
the published Cargo.toml
has readme = "README.md"
, but without workspace that now means relative to the crate, and the crate is in zsplit-cli/
directory,
https://docs.rs/crate/zsplit-cli/0.3.0/source/.cargo_vcs_info.json
so the readme path changed from root/README.md
to root/zsplit-cli/README.md
.
Possible Solution(s)
normalization that resolves workspace inheritance needs to change base of the paths from the root to the crate's directory.
Notes
No response
Version
No response