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

Update cpufeatures fork #857

Merged
merged 1 commit into from
Jul 16, 2021
Merged

Update cpufeatures fork #857

merged 1 commit into from
Jul 16, 2021

Conversation

jcape
Copy link
Contributor

@jcape jcape commented Jul 15, 2021

Motivation

Due to issues with cargo feature unification, which is seemingly only exposed (sadly) when running on an actual enclave, we need to make our patches to cpufeatures just use target_features directly.

In this PR

  • Update our crates.io patch of cpufeatures to one which works in our environment.

Future Work

  • Create test case and report issue to cargo
  • Get a reasonable patch for cpufeatures upstreamed after cargo issue is fixed.

@jcape jcape added this to the Build on M1 milestone Jul 15, 2021
@jcape jcape requested review from a team July 15, 2021 22:36
@jcape jcape added this to In progress in Consensus via automation Jul 15, 2021
@jcape jcape self-assigned this Jul 15, 2021
@@ -39,7 +39,6 @@ mbedtls = { version = "0.8.1", default-features = false, features = ["no_std_dep
mbedtls-sys-auto = { version = "2.26.1", default-features = false, features = ["custom_threading"] }

# We include these here so we can select in-the-enclave features
cpufeatures = { version = "0.1.5", features = ["compile-only"] }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So we're changing the patch version and removing it?

Copy link
Contributor Author

@jcape jcape Jul 15, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cpufeatures is used directly by the RustCrypto crates (aes-gcm, sha2, maybe blake2, etc.).

This line was there to ensure the "compile-only" feature was turned on, via feature unification, but not actually used in the trusted crate.

Since feature unification doesn't work that way given how the RustCrypto crates use it, there's no need for this line to exist.

We still patch in our fork in the enclave so our fork is the one used by the upstream RustCrypto crates.

Consensus automation moved this from In progress to Reviewer approved Jul 16, 2021
@jcape jcape merged commit cd7753a into mobilecoinfoundation:master Jul 16, 2021
Consensus automation moved this from Reviewer approved to Done Jul 16, 2021
@jcape jcape deleted the bugfix/cpufeatures-hack-fix branch July 16, 2021 18:54
Consensus automation moved this from Done to Reviewer approved Aug 2, 2021
Consensus automation moved this from Reviewer approved to Done Aug 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Consensus
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

3 participants