For Ubuntu 18.04 it looks like maybe glibc is too old (details below).
According to Ubuntu Releases It looks like Ubuntu 18.04 is 2 "LTS" releases behind the most recent, 20.04 LTS. Is Ubuntu a target platform for zebrad? Is there a minimum version cutoff?
Platform info and build failure transcript:
$ uname -a
Linux workshop 4.15.0-112-generic #113-Ubuntu SMP Thu Jul 9 23:41:39 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.5 LTS
Release: 18.04
Codename: bionic
$ git describe
v1.0.0-alpha.0
$ cargo build
Updating crates.io index
Compiling crossbeam-utils v0.8.0
Compiling signal-hook v0.1.16
Compiling clap v2.33.3
Compiling const-random-macro v0.1.11
error: `proc-macro` crate types currently cannot export any items other than functions tagged with `#[proc_macro]`, `#[proc_macro_derive]`, or `#[proc_
macro_attribute]`
--> /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/const-random-macro-0.1.11/src/lib.rs:21:1
|
21 | pub fn const_random(input: TokenStream) -> TokenStream {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by /home/user/sandbox/zectools/zebra/target/debug/deps/libproc_macro_h
ack
-8473c6bc44fee21a.so)
--> /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/const-random-macro-0.1.11/src/lib.rs:3:5
|
3 | use proc_macro_hack::proc_macro_hack;
| ^^^^^^^^^^^^^^^
error: aborting due to 2 previous errors
error: could not compile `const-random-macro`
To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by /home/user/sandbox/zectools/zebra/target/debug/deps/libconst_fn-26e4de
e2da2a866a.so)
--> /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/crossbeam-utils-0.8.0/src/atomic/atomic_cell.rs:15:5
|
15 | use const_fn::const_fn;
| ^^^^^^^^
error: aborting due to previous error
error: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by /home/user/sandbox/zectools/zebra/target/debug/deps/libconst_fn-26e4de
e2da2a866a.so)
--> /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/crossbeam-utils-0.8.0/src/atomic/atomic_cell.rs:15:5
|
15 | use const_fn::const_fn;
| ^^^^^^^^
error: aborting due to previous error
error: build failed
Question:
I tried to dig in a bit, but wasn't certain where /home/user/sandbox/zectools/zebra/target/debug/deps/libconst_fn-26e4dee2da2a866a.so comes from. A ripgrep of the repo excluding ./target, including Cargo.lock shows no hits for libconst_fn anywhere. Is the cargo build process fetching this .so or building it?
According to Ubuntu Releases It looks like
Ubuntu 18.04is 2 "LTS" releases behind the most recent, 20.04 LTS. Is Ubuntu a target platform for zebrad? Is there a minimum version cutoff?
Zebra does not have a supported platform policy yet, but our CI runs on Ubuntu 18.04 / the latest LTS:
https://github.com/ZcashFoundation/zebra#system-requirements
It looks like there are some rustc errors here, what version of rustc are you using?
Zebra doesn't have a minimum supported Rust version policy yet, but v1.0.0-alpha.0 seems to need 1.48.0 or later:
https://github.com/ZcashFoundation/zebra#build-troubleshooting
yea those errors don't seem related to glibc. I'd be extremely surprised if rust code can't be compiled on ubuntu 18.04. My guess is that this is an old rustc version as teor pointed out. Possibly because it was installed via apt instead of rustup?
edit: I see the glibc error. I thought this was all errors about proc macro expressions and const fns not being stable at first glance. I'm not as confident as I was before.
I tried to dig in a bit, but wasn't certain where
/home/user/sandbox/zectools/zebra/target/debug/deps/libconst_fn-26e4dee2da2a866a.socomes from. Aripgrepof the repo excluding./target, includingCargo.lockshows no hits forlibconst_fnanywhere. Is the cargo build process fetching this.soor building it?
const_fn is a crate which is fetched by cargo:
https://crates.io/crates/const_fn
The lib and .so are added to crate names by Rust, based on platform library conventions.
The const_fn crate is a secp256k1 build dependency:
โโโ secp256k1 v0.19.0
โ โโโ secp256k1-sys v0.3.0
โ โ [build-dependencies]
โ โ โโโ cc v1.0.41
โ โ โโโ rayon v1.5.0
โ โ โโโ crossbeam-deque v0.8.0
โ โ โ โโโ cfg-if v1.0.0
โ โ โ โโโ crossbeam-epoch v0.9.0
โ โ โ โ โโโ cfg-if v1.0.0
โ โ โ โ โโโ const_fn v0.4.3 (proc-macro)
โ โ โ โ โโโ crossbeam-utils v0.8.0
โ โ โ โ โ โโโ cfg-if v1.0.0
โ โ โ โ โ โโโ const_fn v0.4.3 (proc-macro)
โ โ โ โ โ โโโ lazy_static v1.4.0
...
Edit: this output is from cargo-tree
When we build on Ubuntu 18.04, the GitHub Action environment has this software installed; things that may be relevant include:
@teor2345 thanks for the explanation as to how to track down the dependency.
I probably have a weird-ass setup, so I wouldn't prioritize this ticket highly until I circle back to this. Most likely culprit: I was attempting to build with nix-shell -p clang, yet cargo/rustc living in ~/.cargo. Next cycle on this I'll just install the standard Ubuntu clang and avoid nix altogether, then I'll report back.
And then later I'll probably play with nix builds for fun. ;-)
Oh, also, thanks for the link to https://github.com/ZcashFoundation/zebra#system-requirements I had missed that and will pay attention there next time.
I probably have a weird-ass setup, so I wouldn't prioritize this ticket highly until I circle back to this. Most likely culprit: I was attempting to build with
nix-shell -p clang, yetcargo/rustcliving in~/.cargo. Next cycle on this I'll just install the standard Ubuntu clang and avoidnixaltogether, then I'll report back.
Since you're using Nix, this nix-shell file will probably do what you want:
https://github.com/ZcashFoundation/zebra/pull/1479/files
You might need to un-comment this line to get a clean cargo config and state:
export CARGO_HOME=$(mktemp -d)
You might also want to use nix-shell --pure to get a clean environment.
Also, libclang and clang are separate packages in Nix.