Atmelfan / scpi-rs

Rust SCPI parser
Apache License 2.0
36 stars 6 forks source link

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

Closed LeoWherle closed 4 months ago

LeoWherle commented 10 months ago

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:

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 commented 10 months ago

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 commented 9 months ago

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 commented 5 months ago

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

Atmelfan commented 4 months ago

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

MatthieuDartiailh commented 4 months ago

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