Closed brooksmtownsend closed 2 years ago
I don't think this has anything to do with this crate. Error about GLIBC_2.29
suggests that your cross-compilation setup is broken, and this in turn breaks compiler plugins for proc-macros, which in turn breaks anything using them.
I don't think this has anything to do with this crate. Error about
GLIBC_2.29
suggests that your cross-compilation setup is broken, and this in turn breaks compiler plugins for proc-macros, which in turn breaks anything using them.
It certainly has to do with the cross-compilation setup, but I am curious about what changed in the proc macro here to change whether or not the crate can compile in a previously working setup. Did anything change with the use of libpaste
with the most recent patch version?
This error:
error: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.29' not found (required by /target/release/deps/libpaste-84b805ce4b9c7c6a.so)
is from a dynamic linker, which suggests that libpaste failed to load. So the paste
macro fails to run, because it couldn't be loaded by the compiler, because you have broken glibc.
I think it's not the fault of libpaste, because it didn't even run at all. Possibly every proc macro would fail the same way in your unusably-broken setup, and this just happens to be the first one that is used.
Note that Rust requires you to have support for both native and cross platforms at the same time, because compile-time artifacts like proc macros and build.rs scripts run on the native/host platform. So if your cross-compilation setup forces all code to be cross-compiled, it will break these.
Personally I never managed to get cross-rs/cross working. For cross-compilation on Debian from ARM to x86 I use just this:
FROM rust:1-slim-bullseye
RUN rustup target add x86_64-unknown-linux-gnu
RUN dpkg --add-architecture amd64
RUN apt-get update; apt-get install pkg-config libssl-dev:amd64 libsqlite3-dev:amd64 build-essential crossbuild-essential-amd64 -y
What this seemed to come down to is sequentially building for different targets using cross
, and each build leaving behind intermediate build artifacts. Apparently, something about the paste library kept around the x86 linux version and attempting to compile with the x86 version of GLIBC (hence the error).
I was able to fix this by rm -rf target/release/build && rm -rf target/release/deps
between each compilation target, in case it helps others. You were correct that it was not due to the rmp library, it was just a strange red herring that reverting to an older version seemed to "fix" the issue
For
rmp-0.8.11
, using https://github.com/cross-rs/cross to compilermp
for aarch64-linux-unknown-gnu apparently attempts to use thepaste::paste
macro which attempts to use an x86 version of libc. This is not present in0.8.10
, and pinningrmp
specifically to that version will fix the issue.If you're interested, here is the GH Action where the build fails https://github.com/wasmCloud/capability-providers/runs/6499031722?check_suite_focus=true and the Rust build stacktrace:
Please let me know if I can provide any more information