Skip to content

Replace libstd with spin crate in cpu::cache_detected_features. - #759

Merged
briansmith merged 1 commit into
masterfrom
b/no_std_cpu-2
Jan 31, 2019
Merged

Replace libstd with spin crate in cpu::cache_detected_features.#759
briansmith merged 1 commit into
masterfrom
b/no_std_cpu-2

Conversation

@briansmith

@briansmith briansmith commented Jan 15, 2019

Copy link
Copy Markdown
Owner

Eliminate one of the two remaining problems with #![no_std] support
and reduce platform variance.

@briansmith briansmith self-assigned this Jan 15, 2019
@elichai

elichai commented Jan 17, 2019

Copy link
Copy Markdown

It seems that the failure of the test here is because of a network problem, I would just try to rerun it.
https://travis-ci.org/briansmith/ring/jobs/479666488

@elichai

elichai commented Jan 17, 2019

Copy link
Copy Markdown

@briansmith If you could use version 0.4.10 instead it would be great, because 0.5.0 doesn't have feature(min_const_fn) and it's still an unstable feature in nightly-2018-10-01, so it doesn't compile at that version.
Then this would work with my PR to support sgx: #764

Comment thread Cargo.toml Outdated
untrusted = "0.6.2"

[target.'cfg(not(target_os = "ios"))'.dependencies]
spin = { version = "0.5.0", default-features = false }

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
spin = { version = "0.5.0", default-features = false }
spin = "0.4.10"

This would support @baidu/rust-sgx-sdk and there are no features in spin so that disabling default-features isn't needed

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

With this:

[target.'cfg(not(target_os = "ios"))'.dependencies]
spin = { version = "0.4.10", features = ["once"] }

I get:

error[E0554]: #![feature] may not be used on the stable release channel
#![cfg_attr(feature = "const_fn", feature(const_fn))]

So we have to use spin 0.5 in order for it to work on the stable channel.

IMO it would be much better to have the Baidu SGX SDK update the version of Rust it uses to a newer version. Is that not going to happen any time soon?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

That's too bad.
I hope it will be soon
apache/teaclave-sgx-sdk#48

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

So this isn't relevant anymore, Sorry for the trouble.
I still don't think the default-features = false, I see no features in the toml: https://github.com/mvdnes/spin-rs/blob/master/Cargo.toml

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

I still don't think the default-features = false, I see no features in the toml: https://github.com/mvdnes/spin-rs/blob/master/Cargo.toml

Thanks! I updated the PR to remove default-features = false.

@briansmith

Copy link
Copy Markdown
Owner Author

So, we can go ahead and do this, but if we do, this would be the first and only non-rust-lang crate that ring depends on. OTOH lazy_static does depend on spin itself it any crate has activated the spin_no_std feature, and we already depend on lazy_static (though we don't active spin_no_std ourselves).

@briansmith briansmith mentioned this pull request Jan 29, 2019
12 tasks
Eliminate one of the two remaining problems with `#![no_std]` support
and reduce platform variance.
@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.01%) to 93.627% when pulling 4925653 on b/no_std_cpu-2 into c7f0ead on master.

4 similar comments
@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.01%) to 93.627% when pulling 4925653 on b/no_std_cpu-2 into c7f0ead on master.

@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.01%) to 93.627% when pulling 4925653 on b/no_std_cpu-2 into c7f0ead on master.

@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.01%) to 93.627% when pulling 4925653 on b/no_std_cpu-2 into c7f0ead on master.

@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.01%) to 93.627% when pulling 4925653 on b/no_std_cpu-2 into c7f0ead on master.

@coveralls

coveralls commented Jan 29, 2019

Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.01%) to 93.627% when pulling 4925653 on b/no_std_cpu-2 into c7f0ead on master.

@briansmith
briansmith merged commit 154ca29 into master Jan 31, 2019
@briansmith
briansmith deleted the b/no_std_cpu-2 branch January 31, 2019 09:18
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.

3 participants