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

rust workload failing on debian12 after recent upgrade #1950

Closed
anjalirai-intel opened this issue Jul 25, 2024 · 8 comments · Fixed by #1952
Closed

rust workload failing on debian12 after recent upgrade #1950

anjalirai-intel opened this issue Jul 25, 2024 · 8 comments · Fixed by #1952

Comments

@anjalirai-intel
Copy link
Contributor

Description of the problem

In Debian 12, rustc v1.63 can be installed from apt, but some of the packages have been upgraded and dependencies are compatible with rustc v1.70.0 and causing build failures.

Steps to reproduce

cd CI-Examples/rust
make distclean && make

Expected results

make should be successful and rust workload should be able to run with gramine

make
cargo build --release
gramine-manifest \
	-Dlog_level=error \
	-Darch_libdir=/lib/x86_64-linux-gnu \
	-Dself_exe=target/release/rust-hyper-http-server \
	rust-hyper-http-server.manifest.template rust-hyper-http-server.manifest
    Updating crates.io index
 Downloading crates ...
  Downloaded equivalent v1.0.1
  Downloaded want v0.3.1
  Downloaded try-lock v0.2.5
  Downloaded tower-service v0.3.2
  Downloaded cfg-if v1.0.0
  Downloaded autocfg v1.3.0
  Downloaded futures-sink v0.3.30
  Downloaded futures-task v0.3.30
  Downloaded futures-core v0.3.30
  Downloaded fnv v1.0.7
  Downloaded num_cpus v1.16.0
  Downloaded http-body v0.4.6
  Downloaded signal-hook-registry v1.4.2
  Downloaded httpdate v1.0.3
  Downloaded pin-utils v0.1.0
  Downloaded slab v0.4.9
  Downloaded scopeguard v1.2.0
  Downloaded futures-channel v0.3.30
  Downloaded itoa v1.0.11
  Downloaded tokio-macros v2.3.0
  Downloaded lock_api v0.4.12
  Downloaded quote v1.0.36
  Downloaded smallvec v1.13.2
  Downloaded pin-project-lite v0.2.14
  Downloaded parking_lot_core v0.9.10
  Downloaded once_cell v1.19.0
  Downloaded parking_lot v0.12.3
  Downloaded httparse v1.9.4
  Downloaded proc-macro2 v1.0.86
  Downloaded bytes v1.6.1
  Downloaded socket2 v0.5.7
  Downloaded unicode-ident v1.0.12
  Downloaded tracing-core v0.1.32
  Downloaded tracing v0.1.40
  Downloaded indexmap v2.2.6
  Downloaded http v0.2.12
  Downloaded mio v0.8.11
  Downloaded hashbrown v0.14.5
  Downloaded tokio-util v0.7.11
  Downloaded futures-util v0.3.30
  Downloaded h2 v0.3.26
  Downloaded hyper v0.14.30
  Downloaded syn v2.0.72
  Downloaded libc v0.2.155
  Downloaded tokio v1.38.1
   Compiling libc v0.2.155
   Compiling autocfg v1.3.0
   Compiling proc-macro2 v1.0.86
   Compiling unicode-ident v1.0.12
   Compiling pin-project-lite v0.2.14
   Compiling parking_lot_core v0.9.10
   Compiling cfg-if v1.0.0
   Compiling bytes v1.6.1
   Compiling smallvec v1.13.2
   Compiling scopeguard v1.2.0
   Compiling futures-core v0.3.30
   Compiling fnv v1.0.7
   Compiling once_cell v1.19.0
   Compiling itoa v1.0.11
   Compiling hashbrown v0.14.5
   Compiling tracing-core v0.1.32
   Compiling futures-sink v0.3.30
   Compiling pin-utils v0.1.0
   Compiling equivalent v1.0.1
   Compiling futures-task v0.3.30
   Compiling httparse v1.9.4
   Compiling http v0.2.12
   Compiling lock_api v0.4.12
   Compiling quote v1.0.36
   Compiling slab v0.4.9
   Compiling indexmap v2.2.6
   Compiling syn v2.0.72
   Compiling mio v0.8.11
   Compiling socket2 v0.5.7
   Compiling parking_lot v0.12.3
   Compiling num_cpus v1.16.0
   Compiling signal-hook-registry v1.4.2
   Compiling tracing v0.1.40
   Compiling futures-util v0.3.30
   Compiling try-lock v0.2.5
   Compiling want v0.3.1
   Compiling http-body v0.4.6
   Compiling futures-channel v0.3.30
   Compiling httpdate v1.0.3
   Compiling tower-service v0.3.2
   Compiling tokio-macros v2.3.0
   Compiling tokio v1.38.1
   Compiling tokio-util v0.7.11
   Compiling h2 v0.3.26
   Compiling hyper v0.14.30
   Compiling rust-hyper-http-server v0.1.0 (/home/intel/jenkins/workspace/local_ci_graphene_sgx_debian_12_6.1/gramine/CI-Examples/rust)
    Finished release [optimized] target(s) in 2m 45s

Actual results

package tokio v1.39.1 cannot be built because it requires rustc 1.70 or newer

make
cargo build --release
gramine-manifest \
	-Dlog_level=error \
	-Darch_libdir=/lib/x86_64-linux-gnu \
	-Dself_exe=target/release/rust-hyper-http-server \
	rust-hyper-http-server.manifest.template rust-hyper-http-server.manifest
    Updating crates.io index
 Downloading crates ...
  Downloaded futures-sink v0.3.30
  Downloaded futures-channel v0.3.30
  Downloaded equivalent v1.0.1
  Downloaded tower-service v0.3.2
  Downloaded want v0.3.1
  Downloaded try-lock v0.2.5
  Downloaded autocfg v1.3.0
  Downloaded scopeguard v1.2.0
  Downloaded httpdate v1.0.3
  Downloaded http-body v0.4.6
  Downloaded futures-task v0.3.30
  Downloaded fnv v1.0.7
  Downloaded pin-utils v0.1.0
  Downloaded futures-core v0.3.30
  Downloaded cfg-if v1.0.0
  Downloaded slab v0.4.9
  Downloaded pin-project-lite v0.2.14
  Downloaded signal-hook-registry v1.4.2
  Downloaded itoa v1.0.11
  Downloaded smallvec v1.13.2
  Downloaded tokio-macros v2.4.0
  Downloaded lock_api v0.4.12
  Downloaded parking_lot_core v0.9.10
  Downloaded httparse v1.9.4
  Downloaded bytes v1.6.1
  Downloaded once_cell v1.19.0
  Downloaded proc-macro2 v1.0.86
  Downloaded parking_lot v0.12.3
  Downloaded unicode-ident v1.0.12
  Downloaded quote v1.0.36
  Downloaded socket2 v0.5.7
  Downloaded tracing-core v0.1.32
  Downloaded indexmap v2.2.6
  Downloaded tracing v0.1.40
  Downloaded mio v1.0.1
  Downloaded http v0.2.12
  Downloaded tokio-util v0.7.11
  Downloaded hashbrown v0.14.5
  Downloaded futures-util v0.3.30
  Downloaded h2 v0.3.26
  Downloaded hyper v0.14.30
  Downloaded syn v2.0.72
  Downloaded libc v0.2.155
  Downloaded tokio v1.39.1
error: package `tokio v1.39.1` cannot be built because it requires rustc 1.70 or newer, while the currently active rustc version is 1.63.0
Either upgrade to rustc 1.70 or newer, or use
cargo update -p tokio@1.39.1 --precise ver
where `ver` is the latest version of `tokio` supporting rustc 1.63.0
make: *** [Makefile:26: target/release/rust-hyper-http-server] Error 101

Gramine commit hash

139f642

@anjalirai-intel anjalirai-intel changed the title rust workload failing for debian 12 distro with package cannot be built error because it requires rustc 1.70 or newer, while the currently active rustc version is 1.63.0 rust workload failing on debian12 after recent upgrade Jul 25, 2024
@kailun-qin
Copy link
Contributor

error: package tokio v1.39.1 cannot be built because it requires rustc 1.70 or newer, while the currently active rustc version is 1.63.0
Either upgrade to rustc 1.70 or newer, or use
cargo update -p tokio@1.39.1 --precise ver
where ver is the latest version of tokio supporting rustc 1.63.0

I think the error message is clear -- updating the rust compiler or downgrading/pinning tokio to a compiler-compatible version should solve the issue. Well, we could also pin the toolchain version at the same time. But what's the expectation here?

@jinengandhi-intel
Copy link
Contributor

@kailun-qin since this is a CI-Example and in the README we don't have any text saying this has been tested only on a particular distro, so the expectation would be that this example should work for all Gramine supported distros, which includes debian12.

So either we fix the example to also work on Debian12 (also would need to check the fix works on all distros) or we update the README to say this example does not work on Debian12.

@dimakuv
Copy link
Contributor

dimakuv commented Jul 25, 2024

https://crates.io/crates/tokio

Tokio crate has the policy of requiring MSRV (minimum supported rust version) of at least 6 months. This implies that Tokio will probably use new Rust features of compilers released ~6-9 months ago.

This clashes with OS distros policies... I think generally Rust community prefers to upgrade the Rust toolchain manually, using Rustup and not relying on the default Rust package in OS distro.

Anyway, I think in this particular example, Rust toolchain must be updated to the latest stable version on the machine.

If you want, we can add a quick "Before the build" step of "Upgrade Rust toolchain to latest stable" in the README of the Rust example.

@jinengandhi-intel
Copy link
Contributor

@dimakuv could you share more details on what steps you plan to recommend for Upgrade Rust toolchain to latest stable? Would it require testing on different distros? For ex: in this case on Debian12 by default it pulls v1.63 and we would be asking the users to upgrade to the latest stable which is v1.70 which would fix the issue for Debian12 but we don't know about other distros.

@jinengandhi-intel
Copy link
Contributor

Specifically I want to understand how upgrading rust on different distros will impact the packages that we defined in Cargo.toml and whether the versions mentioned there also would need to change.

@dimakuv
Copy link
Contributor

dimakuv commented Jul 25, 2024

Specifically I want to understand how upgrading rust on different distros will impact the packages that we defined in Cargo.toml and whether the versions mentioned there also would need to change.

No, I only talk about upgrading the Rust toolchain, basically the rustc compiler. Crates are not affected in any way.

@dimakuv
Copy link
Contributor

dimakuv commented Jul 25, 2024

@dimakuv could you share more details on what steps you plan to recommend for Upgrade Rust toolchain to latest stable? Would it require testing on different distros? For ex: in this case on Debian12 by default it pulls v1.63 and we would be asking the users to upgrade to the latest stable which is v1.70 which would fix the issue for Debian12 but we don't know about other distros.

Yes, we'll just say in the README that this example requires latest stable release of Rust toolchain (Rust compiler). That's the policy that (at least) the Tokio crate kinda requires, so it should warn users about this. How users obtain the latest stable release of Rust compiler, is not our business, but we can point them to https://rustup.rs/

@jinengandhi-intel
Copy link
Contributor

Got it. Thanks for the explanation. I am fine we changing the README.

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 a pull request may close this issue.

4 participants