grpc-rs icon indicating copy to clipboard operation
grpc-rs copied to clipboard

grpcio-sys libabsl_bad_optional_access.a: file too small to be an archive

Open nuttert opened this issue 2 years ago • 6 comments

Describe the bug When I build my project with grpcio-sys I get the error:

Compiling grpcio v0.10.2
error: failed to add native library /myproject/target/debug/build/grpcio-sys-7a42ed9199705f9f/out/build/third_party/abseil-cpp/absl/types/libabsl_bad_optional_access.a: file too small to be an archive

error: could not compile `grpcio-sys` due to previous error
warning: build failed, waiting for other jobs to finish...
make[1]: *** [run] Error 101

To Reproduce Just build grpcio-sys

System information MacOs Ventura(13.1), M1, rustc 1.66.0, grpcio v0.10.2

I tried to put arch -arm64 before Cargo, but it didn't help.

nuttert avatar Jan 12 '23 05:01 nuttert

This error usually due to arch conflict. That is building the library as arm64/x86_64 architect while link it to x86_64/arm64.

BusyJay avatar Jan 12 '23 06:01 BusyJay

@BusyJay how can i fix it? I tried to build under Rosetta and without it, put arch -arm64, but it does not work.

nuttert avatar Jan 12 '23 07:01 nuttert

You may try to use a different terminal/shell that is built for aarch64.

BusyJay avatar Jan 12 '23 07:01 BusyJay

You may try to use a different terminal/shell that is built for aarch64.

Unfortunately it didn't help : (

nuttert avatar Jan 12 '23 12:01 nuttert

@BusyJay any other ideas? I would expect that in any terminal (not under the rosette) on M1 there should not be such assembly problems

nuttert avatar Jan 18 '23 10:01 nuttert

I'm afraid no. The solution I know is making sure all the toolchains like terminal/shell/cmake/compilers including C/C++/Rust are based on the same arch.

BusyJay avatar Feb 07 '23 11:02 BusyJay