meta-rust-bin
meta-rust-bin copied to clipboard
Build error when linking against an older glibc
The PR #82 solved the linking error I had (issue #70) but using this layer on master has raised another issue:
| /home/otavio/src/updatehub/yocto/build/tmp/work/core2-64-oel-linux/updatehub/1.1.90-r0/target/release/build/proc-macro2-378cfb6b48440bd3/build-script-build: /usr/lib/libc.so.6: version `GLIBC_2.32' not found (required by /home/otavio/src/updatehub/yocto/build/tmp/work/core2-64-oel-linux/updatehub/1.1.90-r0/target/release/build/proc-macro2-378cfb6b48440bd3/build-script-build)
So, looking at the logs that seem to happen is that OE-Core has glibc 2.32 and my Arch Linux has the 2.31. I am out of ideas on how to address this.
It is important to mention that this happens with and without #82 applied. So this is not a regression.
cargo build granularity only goes down to the arch tuple, thats the root cause
the build.rs is run by the host, but as per https://github.com/rust-embedded/meta-rust-bin/pull/82, the build.rs is now always linked for the target with the definition found in${CARGO_HOME}/config
.
it looks like you want to compile this project : https://github.com/UpdateHub/updatehub/blob/master/updatehub/build.rs#L8 , if so: you could remove those rustc-env
from the build script and have them passed on to the cargo class with an export
SRCREV="sha1"
S = "${WORKDIR}/git"
do_compile(){
export RUST_TEST_THREADS=1
export VERSION=${SRCREV}
cargo fetch --manifest-path ${S}/Cargo.toml
cargo_do_compile
}
this way you should be able to use https://github.com/rust-embedded/meta-rust-bin/pull/82 , with project that don't contains any build.rs
Yes. In fact it fails if the host has older version. Upgrading the host "fixed" it.
The fix is available as of rust 1.54.0
stable, you can enable it like this.
@jameshilliard Am I missing something or doesn't this still require a nightly version of cargo? I understand it works with stable rustc, but it's still a problem to include nightly versions of cargo in meta-rust-bin.
doesn't this still require a nightly version of cargo
Nope, works with stable cargo.
Simpler way to use this on stable, just set this in your env when building:
__CARGO_TEST_CHANNEL_OVERRIDE_DO_NOT_USE_THIS="nightly"
CARGO_UNSTABLE_TARGET_APPLIES_TO_HOST="true"
CARGO_TARGET_APPLIES_TO_HOST="false"