-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
cargo doc works but cargo publish fails due to include_str! in lib.rs with relative path #13309
Comments
@softstream-link, does |
To add to what was said, iirc if you set |
When you run |
My problem is that I include a dozen different readmes which are otherwise chapters in a different context and some are in root and some are elsewhere. Is there a consistent way of including them all in a way that makes both docs and publish work correctly? |
At this time, there is not a way to remap repo paths outside of your package root to be within your package root during publish. Potential options
|
If symlink is an option, you could also symlink all content to the directory of the member package to make them package-local accessible. |
I have tried playing around with the package include, your second option, however unsuccessfully. I think it is due to the fact that include can only be used in a format that is relative to the Cargo.toml being package and not the virtual "parent" module's manifest. My structure is as follows:
I have tried specifying I did not quite understood your first option. Are you saying that I can specify more than one readme using |
This seems to be the only option for me since all the readme is in the root of the repo and I can symlink readme content to the necessary module. |
Problem
I have multi module project with following members
Cargo.toml
Which includes readme's in the rust doc like so
nonblocking/src/lib.rs
I am able to run
cargo doc --open
which creates the website and opens the documentation correctly, however then trying to publish thenonblocking
crate it fails saying.Error from `cargo publish -p links_nonblocking --dry-run
Steps
Possible Solution(s)
Do these two commands use two different
cwd
when running for each modules? if so what is the workaround this?Notes
na
Version
The text was updated successfully, but these errors were encountered: