zeromq / libzmq

ZeroMQ core engine in C++, implements ZMTP/3.1
https://www.zeromq.org
Mozilla Public License 2.0
9.71k stars 2.35k forks source link

pkg-config unable to locate `libzmq` for cross platform/architecture #4493

Closed dinbtechit closed 1 year ago

dinbtechit commented 1 year ago

Issue description

pkg-config unable to locate libzmq. I am trying to build by package for the following architectures.

✅ aarch64-apple-darwin (architecture type of the build machine) - Is able to locate the package on my current arch type.

but failed to find other libzmq for arch types.

❌ aarch64-apple-ios ❌ x86_64-apple-ios ❌ aarch64-apple-ios-sim ❌ x86_64-apple-darwin

Any advice is massively appreciated.

╰$ pkg-config --list-all | grep libzmq
libzmq                libzmq - 0MQ c++ library

Error while building the rust-dart package. The rust package is dependent on libzmq

error: failed to run custom build command for `zmq-sys v0.11.0`

Caused by:

  process didn't exit successfully: `/Users/srinivad/code/personal/aries_vcx/target/release/build/zmq-sys-1ee0440fdab5aa95/build-script-main` (exit status: 101)
  --- stdout
  cargo:rerun-if-env-changed=LIBZMQ_NO_PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG_ALLOW_CROSS_x86_64-apple-darwin
  cargo:rerun-if-env-changed=PKG_CONFIG_ALLOW_CROSS_x86_64_apple_darwin
  cargo:rerun-if-env-changed=TARGET_PKG_CONFIG_ALLOW_CROSS
  cargo:rerun-if-env-changed=PKG_CONFIG_ALLOW_CROSS
  cargo:rerun-if-env-changed=PKG_CONFIG_x86_64-apple-darwin
  cargo:rerun-if-env-changed=PKG_CONFIG_x86_64_apple_darwin
  cargo:rerun-if-env-changed=TARGET_PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64-apple-darwin
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64_apple_darwin
  cargo:rerun-if-env-changed=TARGET_PKG_CONFIG_SYSROOT_DIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR

  --- stderr
  thread 'main' panicked at 'Unable to locate libzmq:
  pkg-config has not been configured to support cross-compilation.

  Install a sysroot for the target platform and configure it via
  PKG_CONFIG_SYSROOT_DIR and PKG_CONFIG_PATH, or install a
  cross-compiling wrapper for pkg-config and set it via
  PKG_CONFIG environment variable.', /Users/srinivad/.cargo/registry/src/github.com-1ecc6299db9ec823/zmq-sys-0.11.0/build/pkg_config.rs:26:17
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...

error: failed to run custom build command for `libsodium-sys v0.0.16`

Caused by:

  process didn't exit successfully: `/Users/srinivad/code/personal/aries_vcx/target/release/build/libsodium-sys-ddf42e640e1f4386/build-script-build` (exit status: 101)
  --- stdout
  cargo:rerun-if-env-changed=SODIUM_LIB_DIR
  cargo:rerun-if-env-changed=SODIUM_STATIC
  cargo:rerun-if-env-changed=LIBSODIUM_NO_PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG_ALLOW_CROSS_x86_64-apple-ios
  cargo:rerun-if-env-changed=PKG_CONFIG_ALLOW_CROSS_x86_64_apple_ios
  cargo:rerun-if-env-changed=TARGET_PKG_CONFIG_ALLOW_CROSS
  cargo:rerun-if-env-changed=PKG_CONFIG_ALLOW_CROSS
  cargo:rerun-if-env-changed=PKG_CONFIG_x86_64-apple-ios
  cargo:rerun-if-env-changed=PKG_CONFIG_x86_64_apple_ios
  cargo:rerun-if-env-changed=TARGET_PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64-apple-ios
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64_apple_ios
  cargo:rerun-if-env-changed=TARGET_PKG_CONFIG_SYSROOT_DIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR

  --- stderr
  thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: "pkg-config has not been configured to support cross-compilation.\n\nInstall a sysroot for the target platform and configure it via\nPKG_CONFIG_SYSROOT_DIR and PKG_CONFIG_PATH, or install a\ncross-compiling wrapper for pkg-config and set it via\nPKG_CONFIG environment variable."', /Users/srinivad/.cargo/registry/src/github.com-1ecc6299db9ec823/libsodium-sys-0.0.16/build.rs:20:47
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Environment

bluca commented 1 year ago

You are using homebrew, report it to them