-
Notifications
You must be signed in to change notification settings - Fork 432
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
Add support for x86_64-fortanix-unknown-sgx target #670
Conversation
Travis build failures are not caused by this PR. |
Not surprising considering we have no testing on SGX: is it possible to add CI testing? The patch presumably fixes local testing; I guess it's irrelevant once deployed on crates.io. Now, why are we depending on RDRAND to provide our randomness? |
NB: Not affiliated with fortanix and am only peripherally aware of
|
9c47330
to
ce59098
Compare
No, not until following requirements are met:
Cargo respects patch section only from the root crate Cargo.toml, so yeah it's required for local testing but gets ignored while building downstream crates.
RDRAND is the only source of randomness on this platform. |
NB. Building the tests can be done easily once item no. 3 has been resolved. Fulfilling the other two requirements is needed to run the tests. |
Okay, that answers my questions. Note that this conflicts with #643 which I would like to merge first. |
You can "rebase" this on master now. |
29d46da
to
97c19ec
Compare
Done. |
97c19ec
to
727c70f
Compare
Thank you. Do you have a release planned for sometime soon? I need releases for 0.4.x and 0.6.x |
We will hopefully release 0.6.2 tomorrow. This PR targets the |
@dhardy looks like you did release, but this PR was not included? |
This is actually a problem, because I need to remove this section to allow publishing (Cargo won't publish if there is a patch section), then use |
Hmm, I think this is a bug in Cargo/crates.io. Since the patch section has no effect when the crate is used as a dependency, I don't see a reason why it wouldn't be allowed when publishing. |
Filed rust-lang/cargo#6535 |
Having a [patch] section when publishing is not an error It is not necessary to throw an error when your `Cargo.toml` has a `[patch]` section. 1. Cargo will normalize your `Cargo.toml` while packaging, which will remove the `[patch]` section. 2. Even if the `[patch]` section were to somehow get to crates.io, it would be ignored when the crate is used since only the top-level crate's `[patch]` section is used. The current behavior is quite annoying for crate maintainers who need a permanent `[patch]` section, for example, [`rand`](rust-random/rand#670 (comment)). This is the situation that leads to rand needing a permanent `[patch]` section: ![image](https://user-images.githubusercontent.com/1132307/50951760-54cf3a00-14d4-11e9-8064-a7def2ed402f.png) Here, `rand` and `rand_core` are in the same repository, and `rdrand` is in a separate repository. When building `rand` as the top-level crate (e.g. in CI), the `rand->rand_core` path dependency will be used. This is of course a different crate than the crates.io rand_core used by `rdrand`. Therefore, when building `rand` as a top-level crate, you will *always* need to patch `crates-io.rand` to the path dependency. When building `rand` as a dependency, there are no issues, as the crates.io crates are used everywhere.
The x86_64-fortanix-unknown-sgx recently gained Tier 3 support upstream.
The introduced dependency 'rdrand' has 'rand_core' as dependency from crates.io. Any checkout of 'rand' has 'rand_core' as path dependency. For 'rdrand' to fetch dependency from the same source as 'rand', a patch for source crates.io for 'rand_core' dependency is required. This is achieved by the added patch section in Cargo.toml file.