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
Problem
When packaging, Cargo replaces inherited
foo.workspace = truefields with their actual values from the workspace.Cargo seems to be substituting the
readmefield with literal value from the workspace. However, the meaning of paths inreadmeandlicense-filefile 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 isreadme = "README.md"(same as in workspace'sCargo.toml), but the path is taken from the workspace in a parent directory, so the resolved value should be changed toreadme = "../README.md"(or wherever the workspace is).Steps
Example:
https://docs.rs/crate/zsplit-cli/0.3.0/source/Cargo.toml.orig
readme.workspace=truemeant theREADME.mdrelative to the workspace, so in the workspace root.https://docs.rs/crate/zsplit-cli/0.3.0/source/Cargo.toml
the published
Cargo.tomlhasreadme = "README.md", but without workspace that now means relative to the crate, and the crate is inzsplit-cli/directory,https://docs.rs/crate/zsplit-cli/0.3.0/source/.cargo_vcs_info.json
so the readme path changed from
root/README.mdtoroot/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