grpcio-sys libabsl_bad_optional_access.a: file too small to be an archive
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.
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 how can i fix it? I tried to build under Rosetta and without it, put arch -arm64, but it does not work.
You may try to use a different terminal/shell that is built for aarch64.
You may try to use a different terminal/shell that is built for aarch64.
Unfortunately it didn't help : (
@BusyJay any other ideas? I would expect that in any terminal (not under the rosette) on M1 there should not be such assembly problems
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.