Trouble building application with rdkafka

I am trying to build a minimal application to test out using a Kafka consumer and producer. When I try to build, I get the following error, which has me a bit confused. I am new to Rust, coming from a Scala/Java background, so a lot of the stack trace is not telling me anything I can interpret as useful.

/Users/mbossert/.cargo/bin/cargo check --color=always
   Compiling rdkafka-sys v1.0.0
error: failed to run custom build command for `rdkafka-sys v1.0.0`

Caused by:
  process didn't exit successfully: `/Users/mbossert/CLionProjects/metric_regression/target/debug/build/rdkafka-sys-b161e00d0fb90b2b/build-script-build` (exit code: 101)
--- stdout
Configuring librdkafka
using cache file config.cache
checking for OS or distribution... ok (osx)
checking for C compiler from CC env... failed
checking for gcc (by command)... ok (cached)
checking for C++ compiler from CXX env... failed
checking for C++ compiler (g++)... ok (cached)
checking executable ld... ok (cached)
checking executable nm... ok (cached)
checking executable objdump... ok (cached)
checking executable strip... ok (cached)
checking for debug symbols compiler flag (-g...)... ok (cached)
checking for pkgconfig (by command)... ok (cached)
checking for install (by command)... failed
checking for PIC (by compile)... ok (cached)
checking for GNU-compatible linker options... failed
checking for OSX linker options... ok (cached)
checking for GNU linker-script ld flag... failed
checking for Solaris linker-script ld flag... failed (ignore)
checking for __atomic_32 (by compile)... ok (cached)
checking for __atomic_64 (by compile)... ok (cached)
checking for socket (by compile)... ok (cached)
parsing version '0x010000ff'... ok (1.0.0)
checking for librt (by pkg-config)... failed
checking for librt (by compile)... failed
checking for libpthread (by pkg-config)... failed
checking for libpthread (by compile)... ok (cached)
checking for c11threads (by pkg-config)... failed
checking for c11threads (by compile)... failed (disable)
checking for libdl (by pkg-config)... failed
checking for libdl (by compile)... ok (cached)
checking for zlib (by pkg-config)... ok
checking for zlib (by compile)... ok (cached)
checking for libcrypto (by pkg-config)... ok
checking for libcrypto (by compile)... ok (cached)
checking for libssl (by pkg-config)... ok
checking for libssl (by compile)... ok (cached)
checking for libsasl2 (by pkg-config)... failed
checking for libsasl2 (by compile)... ok (cached)
checking for zstd (by pkg-config)... failed
checking for zstd (by compile)... ok (cached)
checking for libm (by pkg-config)... failed
checking for libm (by compile)... ok (cached)
checking for rapidjson (by compile)... failed (disable)
checking for crc32chw (by compile)... ok (cached)
checking for regex (by compile)... ok (cached)
checking for strndup (by compile)... ok (cached)
checking for strerror_r (by compile)... ok (cached)
checking for pthread_setname_gnu (by compile)... failed (disable)
checking for nm (by env NM)... ok (cached)
Generated Makefile.config
Generated config.h

Configuration summary:
  prefix                   /usr/local
  MKL_DISTRO               osx
  SOLIB_EXT                .dylib
  ARCH                     x86_64
  CPU                      generic
  GEN_PKG_CONFIG           y
  ENABLE_SSL               y
  ENABLE_GSSAPI            y
  ENABLE_DEVEL             n
  ENABLE_VALGRIND          n
  ENABLE_LZ4_EXT           n
  MKL_APP_NAME             librdkafka
  MKL_APP_DESC_ONELINE     The Apache Kafka C/C++ library
  CC                       gcc
  CXX                      g++
  LD                       ld
  NM                       nm
  OBJDUMP                  objdump
  STRIP                    strip
  CFLAGS                   -I/usr/local/Cellar/openssl/1.0.2s/include  -I/usr/local/Cellar/openssl/1.0.2s/include -I/usr/local/Cellar/openssl/1.0.2s/include
  CPPFLAGS                 -gstrict-dwarf -O2 -fPIC -Wall -Wsign-compare -Wfloat-equal -Wpointer-arith -Wcast-align
  PKG_CONFIG               pkg-config
  INSTALL                  install
  LIB_LDFLAGS              -shared -dynamiclib -Wl,-install_name,$(DESTDIR)$(libdir)/$(LIBFILENAME)
  MKL_APP_VERSION          1.0.0
  LIBS                     -lm -lzstd -lsasl2 -L/usr/local/Cellar/openssl/1.0.2s/lib -lssl -L/usr/local/Cellar/openssl/1.0.2s/lib -lcrypto -lz -ldl -lpthread
  CXXFLAGS                 -Wno-non-virtual-dtor
  SYMDUMPER                $(NM) -g
  exec_prefix              /usr/local
  bindir                   /usr/local/bin
  sbindir                  /usr/local/sbin
  libexecdir               /usr/local/libexec
  datadir                  /usr/local/share
  sysconfdir               /usr/local/etc
  sharedstatedir           /usr/local/com
  localstatedir            /usr/local/var
  libdir                   /usr/local/lib
  includedir               /usr/local/include
  infodir                  /usr/local/info
  mandir                   /usr/local/man
Generated config.cache

Now type 'make' to build

--- stderr
Building and linking librdkafka statically
Running command: "./configure --enable-sasl --enable-ssl --disable-lz4" in dir: librdkafka
thread 'main' panicked at 'Command failed with error: No such file or directory (os error 2)', /Users/mbossert/.cargo/registry/src/
stack backtrace:
   0: backtrace::backtrace::libunwind::trace
             at /Users/vsts/.cargo/registry/src/
   1: backtrace::backtrace::trace_unsynchronized
             at /Users/vsts/.cargo/registry/src/
   2: std::sys_common::backtrace::_print
             at src/libstd/sys_common/
   3: std::sys_common::backtrace::print
             at src/libstd/sys_common/
   4: std::panicking::default_hook::{{closure}}
             at src/libstd/
   5: std::panicking::default_hook
             at src/libstd/
   6: std::panicking::rust_panic_with_hook
             at src/libstd/
   7: std::panicking::continue_panic_fmt
             at src/libstd/
   8: std::thread::local::fast::Key<T>::try_initialize
   9: build_script_build::run_command_or_fail
             at ./
  10: build_script_build::build_librdkafka
             at ./
  11: build_script_build::main
             at ./
  12: std::rt::lang_start::{{closure}}
             at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/libstd/
  13: std::rt::lang_start_internal::{{closure}}
             at src/libstd/
  14: std::panicking::try::do_call
             at src/libstd/
  15: __rust_maybe_catch_panic
             at src/libpanic_unwind/
  16: std::panicking::try
             at src/libstd/
  17: std::panic::catch_unwind
             at src/libstd/
  18: std::rt::lang_start_internal
             at src/libstd/
  19: std::rt::lang_start
             at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/libstd/
  20: build_script_build::make_librdkafka

Process finished with exit code 101

and here is my Cargo.toml

name = "metric_regression"
version = "0.1.0"
authors = ["M. Aaron Bossert <>"]
edition = "2018"

# See more keys and their definitions at
version = "~0.21"
features = ["ssl", "sasl"]

At a glance without knowing the crate; I would suggest trying using the git version (and -sys) There are changes in that may or may not be a fix.

Thanks for the do I switch to the Git version?

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.