ZeroTierOne icon indicating copy to clipboard operation
ZeroTierOne copied to clipboard

error: package `time v0.3.25` cannot be built

Open ZiangZheng opened this issue 3 years ago • 3 comments

I met an error here when I tried to build the ZeroTier.

Firstly it recommends me to upgrade the rustc.

I upgrade it using apt, and have the version=1.66.0

And still it report this error.

export PATH=//home/zza/.cargo/bin:$PATH; cd zeroidc && cargo build --release
error: package `time v0.3.25` cannot be built because it requires rustc 1.67.0 or newer, while the currently active rustc version is 1.66.1
Either upgrade to rustc 1.67.0 or newer, or use
cargo update -p [email protected] --precise ver
where `ver` is the latest version of `time` supporting rustc 1.66.1
make: *** [make-linux.mk:436: zeroidc] Error 101

So should I upgrade to a newer version? (this version is the latest release on apt)

Or fix it in another way.

Thank you!

ZiangZheng avatar Sep 23 '23 01:09 ZiangZheng

I think we mostly use rustup to get rust. you can do make ZT_SSO_SUPPORTED=0 if you don't want to deal with it.

laduke avatar Sep 23 '23 03:09 laduke

Debian and Ubuntu ship rather old -- by Rust standards, anyway -- versions of the Rust toolchain, which means many popular crates will refuse to build unless you upgrade via Rustup or another more current distribution channel.

That being said, it looks like the MSRV (minimum supported Rust version) for the time crate was only moved forward to 1.67 fairly recently, and prior to that should work down to 1.65.0: https://github.com/time-rs/time/blob/75e255dfc988543c0dd027380b4cba4ee08433e4/CHANGELOG.md?plain=1#L138

You can pin the version of time you use when building to 1.3.21 by changing the version number in Cargo.toml to be 0.3.21 instead of ~0.3. After that, the build should just work; if not, let us know. (And/or use rustup for an up-to-date Rust toolchain, per @laduke 's note; we do not currently test builds on a particularly wide range of Rust versions.)

rcoder avatar Sep 25 '23 16:09 rcoder

It works. Thank you very much!!!!

ZiangZheng avatar Sep 26 '23 01:09 ZiangZheng