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

Fix typo in dcap-ql dependency #498

Merged
merged 1 commit into from
Jul 17, 2023
Merged

Fix typo in dcap-ql dependency #498

merged 1 commit into from
Jul 17, 2023

Conversation

raoulstrackx
Copy link
Contributor

A typo in the specification of the mbedtls dependency of dcap-ql may lead to a compilation error.

Fixes #497
cc: @Taowyoo @jethrogb @vn971 @mkaynov

@maxknv
Copy link

maxknv commented Jul 17, 2023

LGTM

@kostko
Copy link

kostko commented Jul 17, 2023

Would be cool if there was a build check as part of CI :)

@raoulstrackx
Copy link
Contributor Author

Would be cool if there was a build check as part of CI :)

Yes I totally agree. Unfortunately, the way features get enabled in a workspace, makes it difficult. Did you have a test in mind that reproduced the compilation error?

@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.

@Taowyoo
Copy link
Collaborator

Taowyoo commented Jul 17, 2023

bors r+

@bors
Copy link
Contributor

bors bot commented Jul 17, 2023

Build succeeded!

The publicly hosted instance of bors-ng is deprecated and will go away soon.

If you want to self-host your own instance, instructions are here.
For more help, visit the forum.

If you want to switch to GitHub's built-in merge queue, visit their help page.

@bors bors bot merged commit 6ece97b into master Jul 17, 2023
2 checks passed
@Taowyoo Taowyoo deleted the raoul/gh-497-fix_dcap-ql_dep branch July 17, 2023 21:56
@Taowyoo
Copy link
Collaborator

Taowyoo commented Jul 17, 2023

Created an issue for the build check problem above : #499

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

Successfully merging this pull request may close these issues.

Published dcap-ql 0.3.6 is broken
4 participants