integritee-network / sgx-runtime

a substrate runtime template to be instantiated inside the Integritee-worker enclave
The Unlicense
14 stars 10 forks source link

`cargo update` to sgx 1.1.5 fails CI #60

Closed Kailai-Wang closed 2 years ago

Kailai-Wang commented 2 years ago

As topic, steps to reproduce:

It fails with the errors:

error[E0658]: use of unstable library feature 'available_parallelism'
  --> /home/kai/.cargo/git/checkouts/incubator-teaclave-sgx-sdk-f208006cdf70a903/605c8ea/sgx_unwind/build.rs:92:13
   |
92 |             thread::available_parallelism()
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: see issue #74479 <https://github.com/rust-lang/rust/issues/74479> for more information
   = help: add `#![feature(available_parallelism)]` to the crate attributes to enable

root cause seems to be sgx_unwind 1.1.5 compilation.

Is it known? (or upstream issue?)

clangenb commented 2 years ago

Such errors usually occur, when the rust-compiler is older than the crate expects. If you update the rust-toolchain, you will probably find that the feature available_parallelism has been stabilized and hence does not need that feature flag anymore.

Kailai-Wang commented 2 years ago

Such errors usually occur, when the rust-compiler is older than the crate expects. If you update the rust-toolchain, you will probably find that the feature available_parallelism has been stabilized and hence does not need that feature flag anymore.

Thanks, this means howeverrust-toolchain.toml needs to be updated, right?

haerdib commented 2 years ago

Yes. I'd recommend using the same as in our worker repo: https://github.com/integritee-network/worker/blob/master/rust-toolchain.toml#L2

It is working with v1.1.5.

Kailai-Wang commented 2 years ago

Thanks @clangenb and @haerdib I already submitted a PR for the fix: https://github.com/integritee-network/sgx-runtime/pull/62

I tried to remove the sgx_tstd and sgx_patches patches too as I saw 1.1.5 was used in worker repo.

haerdib commented 2 years ago

Thanks a lot for the PR! Removing the patches seems to be the right choice 👍