Skip to content

[BUG] Document-features not compatible with vendored sources #26

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

Closed
LeoWherle opened this issue Nov 16, 2023 · 5 comments
Closed

[BUG] Document-features not compatible with vendored sources #26

LeoWherle opened this issue Nov 16, 2023 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@LeoWherle
Copy link

LeoWherle commented Nov 16, 2023

Description
When building a project using vendored sources, the Cargo.toml file is stripped of comments wich makes it impossible to build.

To Reproduce
Create a new project with the {project-root}/.cargo/config.toml file containing:

[source.crates-io]
replace-with = "vendored-sources"

[source.vendored-sources]
directory = "vendor"

execute the following commands :

cargo vendor
cargo build

Expected behavior
The compilation of scpi fails.

error: Could not find documented features in Cargo.toml
  --> {project-root}/vendor/scpi/src/lib.rs:31:10

Library and tool versions:

  • scpi version: 1.0.0
  • rust version: 1.70.0 (90c541806 2023-05-31)
  • cargo version: 1.70.0 (ec8a8a0ca 2023-04-25)

Additional context
Currently I am getting around it by duplicating the Cargo.toml from github and renaming it to Cargo.toml.orig (and putting it next to the vendored Cargo.toml)

curl -o vendor/scpi/Cargo.toml.orig https://raw.githubusercontent.com/Atmelfan/scpi-rs/master/scpi/Cargo.toml
curl -o vendor/scpi-contrib/Cargo.toml.orig https://raw.githubusercontent.com/Atmelfan/scpi-rs/master/scpi/Cargo.toml
@LeoWherle LeoWherle added the bug Something isn't working label Nov 16, 2023
@LeoWherle
Copy link
Author

LeoWherle commented Nov 20, 2023

I tried to implement the following fix proposed by document-features without success: https://docs.rs/document-features/latest/document_features/#compatibility as this just disables document-feature all-together if the doc is not built with cargo doc --all-features

@Atmelfan
Copy link
Owner

Atmelfan commented Dec 5, 2023

Sorry for the late reply.

I wouldn't mind removing the document-features dependency altogether.

I am currently quite busy though so it'll probably take a while before I get to it.

@MatthieuDartiailh
Copy link
Contributor

It appears that document-features 0.2.8 does not complain anymore when no documentation can be extracted from Cargo.toml (slint-ui/document-features#20 (comment)). I will check on @LeoWherle system next week and confirm if it now works as expected.

@Atmelfan
Copy link
Owner

Is this still an issue @LeoWherle / @MatthieuDartiailh or can I close it?

@MatthieuDartiailh
Copy link
Contributor

I finally managed to check and this can indeed be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants