2

Im trying to run the tests in https://github.com/anza-xyz/agave/tree/master/cli using cargo test

But i'm getting some linker errors:

--- stderr
  ld: warning: -bind_at_load is deprecated on macOS
  ld: multiple errors: archive member '/' not a mach-o file in '/Users/jonasmac2/Documents/GitHub/agave/target/debug/build/protobuf-src-787ce1ecf69b05bc/out/install/build/src/.libs/libprotobuf.a'; archive member '/' not a mach-o file in '/Users/jonasmac2/Documents/GitHub/agave/target/debug/build/protobuf-src-787ce1ecf69b05bc/out/install/build/src/.libs/libprotobuf.a'; archive member '/' not a mach-o file in '/Users/jonasmac2/Documents/GitHub/agave/target/debug/build/protobuf-src-787ce1ecf69b05bc/out/install/build/src/.libs/libprotoc.a'; archive member '/' not a mach-o file in '/Users/jonasmac2/Documents/GitHub/agave/target/debug/build/protobuf-src-787ce1ecf69b05bc/out/install/build/src/.libs/libprotoc.a'
  clang: error: linker command failed with exit code 1 (use -v to see invocation)
  make[1]: *** [protoc] Error 1
  make: *** [install-recursive] Error 1
  thread 'main' panicked at /Users/jonasmac2/.cargo/registry/src/index.crates.io-6f17d22bba15001f/autotools-0.2.5/src/lib.rs:715:5:

  command did not execute successfully, got: exit status: 2

  build script failed, must exit now
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Im on a mac M3. I guess it has something to do with protobuff so I installed it using hoomebrew.

protoc --version libprotoc 28.2

The file exists: file /Users/jonasmac2/Documents/GitHub/agave/target/debug/build/protobuf-src-787ce1ecf69b05bc/out/install/build/src/.libs/libprotoc.a current ar archive

cargo build works fine just cargo test fails

Not sure what to do else

1 Answer 1

2

I finally got it working:

  • first i tried in a new user setup and it worked
  • Then i went and deleted target folder and ran a command without any path variables:
env -i PATH="/usr/bin:/bin:/Users/jonasmac2/.cargo/bin" cargo test

then i installed protobuf and ran

env -i PATH="/usr/bin:/bin:/Users/jonasmac2/.cargo/bin" HOME="$HOME" PROTOC="/opt/homebrew/bin/protoc" cargo test

That worked so i went through all path variables and cleaned them up. And think what was happening is that my NixOs installation was in the path and it had protobuf installed with the linux plattform and it was picking that one during the build. So i removed that and now its also working with just cargo test.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.