Skip to content
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

[Optional] Improve the build check of dcap-ql #499

Closed
Taowyoo opened this issue Jul 17, 2023 · 0 comments
Closed

[Optional] Improve the build check of dcap-ql #499

Taowyoo opened this issue Jul 17, 2023 · 0 comments

Comments

@Taowyoo
Copy link
Collaborator

Taowyoo commented Jul 17, 2023

The default std I added for mbedtls in dcap-ql is for avoiding the compiling error when compile the dcap-ql with only verify and with mbedtls specify with default-features = false in a crate e.g.:

[package]
name = "dcap-ql-fail"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
dcap-ql = { version = "0.3.6", default-features = false, features = ["verify"] }
mbedtls = { version = "0.9.0", default-features = false}

Because mbedtls needs at least one of std or no_std_deps features is defined.

Reason
After some research, the problem actually is from cargo. cargo will automatically include dev dependencies when running cargo build. Ref: rust-lang/cargo#4988

So cargo build -p dcap-ql --no-default-features --features verify will succeed since there is a dev dependency of mbedtls with default feature.

And if use cargo build -p dcap-ql --no-default-features --features verify -Z avoid-dev-deps to exclude dev dependencies , then I found some other dependencies also has this problem which cause compilation failed.

And seems current only way is:

For people who are using stable version numbers to cargo check MSRV (so can't use nightly), there is a dirty hacky workaround.

Originally posted by @Taowyoo in #498 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant