diesel-rs/diesel

Diesel_cli on Mac M1

theswerd opened this issue ยท 6 comments

I cannot install the diesel_cli on my Mac M1 Computer

Versions

  • Rust:
  • rustc 1.50.0-nightly (1c389ffef 2020-11-24)
  • rustup 1.23.1 (3df2264a9 2020-11-30)
    info: This is the version for the rustup toolchain manager, not the rustc compiler.
    info: The currently active rustc version is rustc 1.49.0-beta.4 (877c7cbe1 2020-12-10)
  • cargo 1.50.0-nightly (bfca1cd22 2020-11-24)
  • Diesel: N/A
  • Database: PostgreSQL
  • Operating System MacOS Big Sur

Feature Flags

cargo install diesel_cli --no-default-features --features postgres

Problem Description

I cannot install the diesel_cli on my Mac M1 Computer

What are you trying to accomplish?

I want to install the diesel_cli

What is the expected output?

The diesel_cli being installed

What is the actual output?

Updating crates.io index
  Installing diesel_cli v1.4.1
  Downloaded quote v1.0.8
  Downloaded syn v1.0.55
  Downloaded 2 crates (254.1 KB) in 1.04s
   Compiling libc v0.2.81
   Compiling autocfg v1.0.1
   Compiling proc-macro2 v1.0.24
   Compiling unicode-xid v0.2.1
   Compiling syn v1.0.55
   Compiling getrandom v0.1.15
   Compiling memchr v2.3.4
   Compiling bitflags v1.2.1
   Compiling cfg-if v0.1.10
   Compiling tinyvec_macros v0.1.0
   Compiling byteorder v1.3.4
   Compiling gimli v0.23.0
   Compiling adler v0.2.3
   Compiling unicode-xid v0.0.4
   Compiling pq-sys v0.4.6
   Compiling serde_derive v1.0.118
   Compiling serde v1.0.118
   Compiling regex v0.2.11
   Compiling rustc-demangle v0.1.18
   Compiling object v0.22.0
   Compiling ucd-util v0.1.8
   Compiling ppv-lite86 v0.2.10
   Compiling matches v0.1.8
   Compiling cfg-if v1.0.0
   Compiling lazy_static v1.4.0
   Compiling quote v0.3.15
   Compiling utf8-ranges v1.0.4
   Compiling unicode-width v0.1.8
   Compiling vec_map v0.8.2
   Compiling ansi_term v0.11.0
   Compiling strsim v0.8.0
   Compiling remove_dir_all v0.5.3
   Compiling percent-encoding v1.0.1
   Compiling tinyvec v1.1.0
   Compiling miniz_oxide v0.4.3
   Compiling num-traits v0.2.14
   Compiling num-integer v0.1.44
   Compiling synom v0.11.3
   Compiling regex-syntax v0.5.6
   Compiling unicode-bidi v0.3.4
   Compiling thread_local v0.3.6
   Compiling addr2line v0.14.0
   Compiling textwrap v0.11.0
   Compiling unicode-normalization v0.1.16
   Compiling syn v0.11.11
   Compiling aho-corasick v0.6.10
   Compiling quote v1.0.8
   Compiling atty v0.2.14
   Compiling time v0.1.44
   Compiling idna v0.1.5
   Compiling backtrace v0.3.55
   Compiling rand_core v0.5.1
   Compiling clap v2.33.3
   Compiling url v1.7.2
   Compiling error-chain v0.10.0
   Compiling rand_chacha v0.2.2
   Compiling derive-error-chain v0.10.1
   Compiling chrono v0.4.19
   Compiling rand v0.7.3
   Compiling dotenv v0.10.1
   Compiling tempfile v3.1.0
   Compiling diesel_derives v1.4.1
   Compiling diesel v1.4.5
   Compiling toml v0.4.10
   Compiling migrations_internals v1.4.1
   Compiling diesel_cli v1.4.1
error: linking with `cc` failed: exit code: 1
  |
  = note: "cc" "-arch" "arm64" "-L" "/usr/local/lib/rustlib/aarch64-apple-darwin/lib" "/var/folders/kr/bj4js45j12z5rgvz_g8c0w_h0000gn/T/cargo-installtKT37U/release/deps/diesel-a345985f0b46adbf.diesel.e6dmsf9d-cgu.0.rcgu.o" "/var/folders/kr/bj4js45j12z5rgvz_g8c0w_h0000gn/T/cargo-installtKT37U/release/deps/diesel-a345985f0b46adbf.diesel.e6dmsf9d-cgu.1.rcgu.o" "/var/folders/kr/bj4js45j12z5rgvz_g8c0w_h0000gn/T/cargo-installtKT37U/release/deps/diesel-a345985f0b46adbf.diesel.e6dmsf9d-cgu.10.rcgu.o" "/var/folders/kr/bj4js45j12z5rgvz_g8c0w_h0000gn/T/cargo-installtKT37U/release/deps/diesel-a345985f0b46adbf.diesel.e6dmsf9d-cgu.11.rcgu.o" "/var/folders/kr/bj4js45j12z5rgvz_g8c0w_h0000gn/T/cargo-installtKT37U/release/deps/diesel-a345985f0b46adbf.diesel.e6dmsf9d-cgu.12.rcgu.o" "/var/folders/kr/bj4js45j12z5rgvz_g8c0w_h0000gn/T/cargo-installtKT37U/release/deps/diesel-a345985f0b46adbf.diesel.e6dmsf9d-cgu.13.rcgu.o" "/var/folders/kr/bj4js45j12z5rgvz_g8c0w_h0000gn/T/cargo-installtKT37U/release/deps/diesel-a345985f0b46adbf.diesel.e6dmsf9d-cgu.14.rcgu.o" "/var/folders/kr/bj4js45j12z5rgvz_g8c0w_h0000gn/T/cargo-installtKT37U/release/deps/diesel-a345985f0b46adbf.diesel.e6dmsf9d-cgu.15.rcgu.o" "/var/folders/kr/bj4js45j12z5rgvz_g8c0w_h0000gn/T/cargo-installtKT37U/release/deps/diesel-a345985f0b46adbf.diesel.e6dmsf9d-cgu.2.rcgu.o" "/var/folders/kr/bj4js45j12z5rgvz_g8c0w_h0000gn/T/cargo-installtKT37U/release/deps/diesel-a345985f0b46adbf.diesel.e6dmsf9d-cgu.3.rcgu.o" "/var/folders/kr/bj4js45j12z5rgvz_g8c0w_h0000gn/T/cargo-installtKT37U/release/deps/diesel-a345985f0b46adbf.diesel.e6dmsf9d-cgu.4.rcgu.o" "/var/folders/kr/bj4js45j12z5rgvz_g8c0w_h0000gn/T/cargo-installtKT37U/release/deps/diesel-a345985f0b46adbf.diesel.e6dmsf9d-cgu.5.rcgu.o" "/var/folders/kr/bj4js45j12z5rgvz_g8c0w_h0000gn/T/cargo-installtKT37U/release/deps/diesel-a345985f0b46adbf.diesel.e6dmsf9d-cgu.6.rcgu.o" "/var/folders/kr/bj4js45j12z5rgvz_g8c0w_h0000gn/T/cargo-installtKT37U/release/deps/diesel-a345985f0b46adbf.diesel.e6dmsf9d-cgu.7.rcgu.o" "/var/folders/kr/bj4js45j12z5rgvz_g8c0w_h0000gn/T/cargo-installtKT37U/release/deps/diesel-a345985f0b46adbf.diesel.e6dmsf9d-cgu.8.rcgu.o" "/var/folders/kr/bj4js45j12z5rgvz_g8c0w_h0000gn/T/cargo-installtKT37U/release/deps/diesel-a345985f0b46adbf.diesel.e6dmsf9d-cgu.9.rcgu.o" "-o" "/var/folders/kr/bj4js45j12z5rgvz_g8c0w_h0000gn/T/cargo-installtKT37U/release/deps/diesel-a345985f0b46adbf" "/var/folders/kr/bj4js45j12z5rgvz_g8c0w_h0000gn/T/cargo-installtKT37U/release/deps/diesel-a345985f0b46adbf.3af7e03bxilofq81.rcgu.o" "-Wl,-dead_strip" "-nodefaultlibs" "-L" "/var/folders/kr/bj4js45j12z5rgvz_g8c0w_h0000gn/T/cargo-installtKT37U/release/deps" "-L" "/usr/local/opt/postgresql/lib" "-L" "/usr/local/lib/rustlib/aarch64-apple-darwin/lib" "/private/var/folders/kr/bj4js45j12z5rgvz_g8c0w_h0000gn/T/cargo-installtKT37U/release/deps/liburl-0b5243ffe004e114.rlib" "/private/var/folders/kr/bj4js45j12z5rgvz_g8c0w_h0000gn/T/cargo-installtKT37U/release/deps/libpercent_encoding-148f257574b9a64d.rlib" "/private/var/folders/kr/bj4js45j12z5rgvz_g8c0w_h0000gn/T/cargo-installtKT37U/release/deps/libidna-d212fc175447f32f.rlib" "/private/var/folders/kr/bj4js45j12z5rgvz_g8c0w_h0000gn/T/cargo-installtKT37U/release/deps/libunicode_normalization-603f8730464e9094.rlib" "/private/var/folders/kr/bj4js45j12z5rgvz_g8c0w_h0000gn/T/cargo-installtKT37U/release/deps/libtinyvec-60e5b3abef40e01e.rlib" "/private/var/folders/kr/bj4js45j12z5rgvz_g8c0w_h0000gn/T/cargo-installtKT37U/release/deps/libtinyvec_macros-a97427b963038c85.rlib" "/private/var/folders/kr/bj4js45j12z5rgvz_g8c0w_h0000gn/T/cargo-installtKT37U/release/deps/libunicode_bidi-6d62b7871555738a.rlib" "/private/var/folders/kr/bj4js45j12z5rgvz_g8c0w_h0000gn/T/cargo-installtKT37U/release/deps/libmatches-576bc8f9ece0e0c7.rlib" "/private/var/folders/kr/bj4js45j12z5rgvz_g8c0w_h0000gn/T/cargo-installtKT37U/release/deps/libtoml-2d228420fc18b387.rlib" "/private/var/folders/kr/bj4js45j12z5rgvz_g8c0w_h0000gn/T/cargo-installtKT37U/release/deps/libtempfile-97198fc056c13e4b.rlib" "/private/var/folders/kr/bj4js45j12z5rgvz_g8c0w_h0000gn/T/cargo-installtKT37U/release/deps/librand-77cc7ce1a7183848.rlib" "/private/var/folders/kr/bj4js45j12z5rgvz_g8c0w_h0000gn/T/cargo-installtKT37U/release/deps/librand_chacha-a5bec97e981f9aa3.rlib" "/private/var/folders/kr/bj4js45j12z5rgvz_g8c0w_h0000gn/T/cargo-installtKT37U/release/deps/libppv_lite86-7e7ed4c09ffd8086.rlib" "/private/var/folders/kr/bj4js45j12z5rgvz_g8c0w_h0000gn/T/cargo-installtKT37U/release/deps/librand_core-97a07e8024a41e1a.rlib" "/private/var/folders/kr/bj4js45j12z5rgvz_g8c0w_h0000gn/T/cargo-installtKT37U/release/deps/libgetrandom-73b261d803ef49c9.rlib" "/private/var/folders/kr/bj4js45j12z5rgvz_g8c0w_h0000gn/T/cargo-installtKT37U/release/deps/libremove_dir_all-afd4cb4b6a437111.rlib" "/private/var/folders/kr/bj4js45j12z5rgvz_g8c0w_h0000gn/T/cargo-installtKT37U/release/deps/libcfg_if-5bd8e31852d66425.rlib" "/private/var/folders/kr/bj4js45j12z5rgvz_g8c0w_h0000gn/T/cargo-installtKT37U/release/deps/libserde-36c0386cf0a58a50.rlib" "/private/var/folders/kr/bj4js45j12z5rgvz_g8c0w_h0000gn/T/cargo-installtKT37U/release/deps/libmigrations_internals-dad41943b1d881c6.rlib" "/private/var/folders/kr/bj4js45j12z5rgvz_g8c0w_h0000gn/T/cargo-installtKT37U/release/deps/libdotenv-6209b31a04def789.rlib" "/private/var/folders/kr/bj4js45j12z5rgvz_g8c0w_h0000gn/T/cargo-installtKT37U/release/deps/libregex-7b3b6bad2d075e2c.rlib" "/private/var/folders/kr/bj4js45j12z5rgvz_g8c0w_h0000gn/T/cargo-installtKT37U/release/deps/libutf8_ranges-3b8af8d8973e2201.rlib" "/private/var/folders/kr/bj4js45j12z5rgvz_g8c0w_h0000gn/T/cargo-installtKT37U/release/deps/libregex_syntax-04ff80c9d3d59541.rlib" "/private/var/folders/kr/bj4js45j12z5rgvz_g8c0w_h0000gn/T/cargo-installtKT37U/release/deps/libucd_util-5ef267e6c557185c.rlib" "/private/var/folders/kr/bj4js45j12z5rgvz_g8c0w_h0000gn/T/cargo-installtKT37U/release/deps/libthread_local-2e42aba377198daf.rlib" "/private/var/folders/kr/bj4js45j12z5rgvz_g8c0w_h0000gn/T/cargo-installtKT37U/release/deps/liblazy_static-cddbf7dbf0eddb2e.rlib" "/private/var/folders/kr/bj4js45j12z5rgvz_g8c0w_h0000gn/T/cargo-installtKT37U/release/deps/libaho_corasick-aa1872a1fd95cd7e.rlib" "/private/var/folders/kr/bj4js45j12z5rgvz_g8c0w_h0000gn/T/cargo-installtKT37U/release/deps/libmemchr-4449f8f90ddc5d90.rlib" "/private/var/folders/kr/bj4js45j12z5rgvz_g8c0w_h0000gn/T/cargo-installtKT37U/release/deps/liberror_chain-7dec5bc02ccdabee.rlib" "/private/var/folders/kr/bj4js45j12z5rgvz_g8c0w_h0000gn/T/cargo-installtKT37U/release/deps/libbacktrace-a0b8c53003f5b5bc.rlib" "/private/var/folders/kr/bj4js45j12z5rgvz_g8c0w_h0000gn/T/cargo-installtKT37U/release/deps/libobject-164b673db0d781cf.rlib" "/private/var/folders/kr/bj4js45j12z5rgvz_g8c0w_h0000gn/T/cargo-installtKT37U/release/deps/libaddr2line-6b4ab3b0818392a5.rlib" "/private/var/folders/kr/bj4js45j12z5rgvz_g8c0w_h0000gn/T/cargo-installtKT37U/release/deps/libgimli-1a8280fe046253c3.rlib" "/private/var/folders/kr/bj4js45j12z5rgvz_g8c0w_h0000gn/T/cargo-installtKT37U/release/deps/libcfg_if-4ca6e55db23b6b64.rlib" "/private/var/folders/kr/bj4js45j12z5rgvz_g8c0w_h0000gn/T/cargo-installtKT37U/release/deps/librustc_demangle-3c2e715f45fd1e0c.rlib" "/private/var/folders/kr/bj4js45j12z5rgvz_g8c0w_h0000gn/T/cargo-installtKT37U/release/deps/libdiesel-2a9e29d284463c68.rlib" "/private/var/folders/kr/bj4js45j12z5rgvz_g8c0w_h0000gn/T/cargo-installtKT37U/release/deps/libpq_sys-7438f9d7d2429494.rlib" "/private/var/folders/kr/bj4js45j12z5rgvz_g8c0w_h0000gn/T/cargo-installtKT37U/release/deps/libbyteorder-f1b5ccc94053fd27.rlib" "/private/var/folders/kr/bj4js45j12z5rgvz_g8c0w_h0000gn/T/cargo-installtKT37U/release/deps/libclap-33ff869ed3b2bd15.rlib" "/private/var/folders/kr/bj4js45j12z5rgvz_g8c0w_h0000gn/T/cargo-installtKT37U/release/deps/libvec_map-908d7c2575741dc1.rlib" "/private/var/folders/kr/bj4js45j12z5rgvz_g8c0w_h0000gn/T/cargo-installtKT37U/release/deps/libtextwrap-4b4d18ea07987d0c.rlib" "/private/var/folders/kr/bj4js45j12z5rgvz_g8c0w_h0000gn/T/cargo-installtKT37U/release/deps/libunicode_width-9840eb616596a2da.rlib" "/private/var/folders/kr/bj4js45j12z5rgvz_g8c0w_h0000gn/T/cargo-installtKT37U/release/deps/libstrsim-7e4ec259e6066874.rlib" "/private/var/folders/kr/bj4js45j12z5rgvz_g8c0w_h0000gn/T/cargo-installtKT37U/release/deps/libbitflags-bc30b0859e868e85.rlib" "/private/var/folders/kr/bj4js45j12z5rgvz_g8c0w_h0000gn/T/cargo-installtKT37U/release/deps/libatty-7593e8b90fe09639.rlib" "/private/var/folders/kr/bj4js45j12z5rgvz_g8c0w_h0000gn/T/cargo-installtKT37U/release/deps/libansi_term-8b1430a176ecfa1f.rlib" "/private/var/folders/kr/bj4js45j12z5rgvz_g8c0w_h0000gn/T/cargo-installtKT37U/release/deps/libchrono-1fdc49ab85c39834.rlib" "/private/var/folders/kr/bj4js45j12z5rgvz_g8c0w_h0000gn/T/cargo-installtKT37U/release/deps/libnum_integer-8d1303f9ca8c52eb.rlib" "/private/var/folders/kr/bj4js45j12z5rgvz_g8c0w_h0000gn/T/cargo-installtKT37U/release/deps/libnum_traits-5a6a1d76ea6fc2ef.rlib" "/private/var/folders/kr/bj4js45j12z5rgvz_g8c0w_h0000gn/T/cargo-installtKT37U/release/deps/libtime-1b7f213be9091192.rlib" "/private/var/folders/kr/bj4js45j12z5rgvz_g8c0w_h0000gn/T/cargo-installtKT37U/release/deps/liblibc-067510a10aa74392.rlib" "/usr/local/lib/rustlib/aarch64-apple-darwin/lib/libstd-5eabeb3a3819dfd4.rlib" "/usr/local/lib/rustlib/aarch64-apple-darwin/lib/libpanic_unwind-a104e55c0e8c3c7a.rlib" "/usr/local/lib/rustlib/aarch64-apple-darwin/lib/libobject-12271cf2a42717a5.rlib" "/usr/local/lib/rustlib/aarch64-apple-darwin/lib/libaddr2line-f6ce8950b6c3a914.rlib" "/usr/local/lib/rustlib/aarch64-apple-darwin/lib/libgimli-12faebb06eeb41bd.rlib" "/usr/local/lib/rustlib/aarch64-apple-darwin/lib/librustc_demangle-822117b987661e98.rlib" "/usr/local/lib/rustlib/aarch64-apple-darwin/lib/libhashbrown-7e7fa82c5dda46c8.rlib" "/usr/local/lib/rustlib/aarch64-apple-darwin/lib/librustc_std_workspace_alloc-6bd016db264bbf53.rlib" "/usr/local/lib/rustlib/aarch64-apple-darwin/lib/libunwind-ccb9dc71ac0c7aad.rlib" "/usr/local/lib/rustlib/aarch64-apple-darwin/lib/libcfg_if-409021e1c15c1440.rlib" "/usr/local/lib/rustlib/aarch64-apple-darwin/lib/liblibc-013dea17653562e2.rlib" "/usr/local/lib/rustlib/aarch64-apple-darwin/lib/liballoc-462d198da6085563.rlib" "/usr/local/lib/rustlib/aarch64-apple-darwin/lib/librustc_std_workspace_core-59337757ce77d920.rlib" "/usr/local/lib/rustlib/aarch64-apple-darwin/lib/libcore-a5fe7cb42ec76820.rlib" "/usr/local/lib/rustlib/aarch64-apple-darwin/lib/libcompiler_builtins-34e8335177269121.rlib" "-lpq" "-lSystem" "-lresolv" "-lc" "-lm"
  = note: ld: warning: ignoring file /usr/local/opt/postgresql/lib/libpq.dylib, building for macOS-arm64 but attempting to link with file built for macOS-x86_64
          Undefined symbols for architecture arm64:
            "_PQsetNoticeProcessor", referenced from:
                _$LT$diesel..pg..connection..PgConnection$u20$as$u20$diesel..connection..Connection$GT$::establish::h5cb451e20beba0b3 in libdiesel-2a9e29d284463c68.rlib(diesel-2a9e29d284463c68.diesel.7fgx3whn-cgu.7.rcgu.o)
            "_PQerrorMessage", referenced from:
                diesel::pg::connection::raw::last_error_message::hff0da2a261f16faf (.llvm.6704024895626427076) in libdiesel-2a9e29d284463c68.rlib(diesel-2a9e29d284463c68.diesel.7fgx3whn-cgu.4.rcgu.o)
            "_PQconnectdb", referenced from:
                diesel::pg::connection::raw::RawConnection::establish::hc7caa15452eb702f in libdiesel-2a9e29d284463c68.rlib(diesel-2a9e29d284463c68.diesel.7fgx3whn-cgu.4.rcgu.o)
            "_PQstatus", referenced from:
                diesel::pg::connection::raw::RawConnection::establish::hc7caa15452eb702f in libdiesel-2a9e29d284463c68.rlib(diesel-2a9e29d284463c68.diesel.7fgx3whn-cgu.4.rcgu.o)
            "_PQprepare", referenced from:
                diesel::pg::connection::stmt::Statement::prepare::h9edae1b05b0c69bf in libdiesel-2a9e29d284463c68.rlib(diesel-2a9e29d284463c68.diesel.7fgx3whn-cgu.15.rcgu.o)
            "_PQresultErrorMessage", referenced from:
                _$LT$diesel..pg..connection..result..PgErrorInformation$u20$as$u20$diesel..result..DatabaseErrorInformation$GT$::message::hd7be6af51ede295b in libdiesel-2a9e29d284463c68.rlib(diesel-2a9e29d284463c68.diesel.7fgx3whn-cgu.12.rcgu.o)
            "_PQgetlength", referenced from:
                _$LT$diesel..pg..connection..row..PgRow$u20$as$u20$diesel..row..Row$LT$diesel..pg..backend..Pg$GT$$GT$::take::h93d0a1f86d6d73df in libdiesel-2a9e29d284463c68.rlib(diesel-2a9e29d284463c68.diesel.7fgx3whn-cgu.6.rcgu.o)
            "_PQcmdTuples", referenced from:
                diesel::pg::connection::result::PgResult::rows_affected::h1850a991d862a316 in libdiesel-2a9e29d284463c68.rlib(diesel-2a9e29d284463c68.diesel.7fgx3whn-cgu.12.rcgu.o)
                _$LT$diesel..pg..connection..PgConnection$u20$as$u20$diesel..connection..Connection$GT$::execute::hbccf8ec5b45351b6 in libdiesel-2a9e29d284463c68.rlib(diesel-2a9e29d284463c68.diesel.7fgx3whn-cgu.7.rcgu.o)
            "_PQresultErrorField", referenced from:
                diesel::pg::connection::result::PgResult::new::h9b886fdd796cb38a in libdiesel-2a9e29d284463c68.rlib(diesel-2a9e29d284463c68.diesel.7fgx3whn-cgu.12.rcgu.o)
                _$LT$diesel..pg..connection..result..PgErrorInformation$u20$as$u20$diesel..result..DatabaseErrorInformation$GT$::message::hd7be6af51ede295b in libdiesel-2a9e29d284463c68.rlib(diesel-2a9e29d284463c68.diesel.7fgx3whn-cgu.12.rcgu.o)
                _$LT$diesel..pg..connection..result..PgErrorInformation$u20$as$u20$diesel..result..DatabaseErrorInformation$GT$::details::h768c92a0e56b3097 in libdiesel-2a9e29d284463c68.rlib(diesel-2a9e29d284463c68.diesel.7fgx3whn-cgu.12.rcgu.o)
                _$LT$diesel..pg..connection..result..PgErrorInformation$u20$as$u20$diesel..result..DatabaseErrorInformation$GT$::hint::hbefee285e3e4c945 in libdiesel-2a9e29d284463c68.rlib(diesel-2a9e29d284463c68.diesel.7fgx3whn-cgu.12.rcgu.o)
                _$LT$diesel..pg..connection..result..PgErrorInformation$u20$as$u20$diesel..result..DatabaseErrorInformation$GT$::table_name::haab372aa3f82a3a5 in libdiesel-2a9e29d284463c68.rlib(diesel-2a9e29d284463c68.diesel.7fgx3whn-cgu.12.rcgu.o)
                _$LT$diesel..pg..connection..result..PgErrorInformation$u20$as$u20$diesel..result..DatabaseErrorInformation$GT$::column_name::h320839a25ad35037 in libdiesel-2a9e29d284463c68.rlib(diesel-2a9e29d284463c68.diesel.7fgx3whn-cgu.12.rcgu.o)
                _$LT$diesel..pg..connection..result..PgErrorInformation$u20$as$u20$diesel..result..DatabaseErrorInformation$GT$::constraint_name::h569e46787f15b16e in libdiesel-2a9e29d284463c68.rlib(diesel-2a9e29d284463c68.diesel.7fgx3whn-cgu.12.rcgu.o)
                ...
            "_PQntuples", referenced from:
                diesel::pg::connection::result::PgResult::num_rows::he464661a900ff241 in libdiesel-2a9e29d284463c68.rlib(diesel-2a9e29d284463c68.diesel.7fgx3whn-cgu.12.rcgu.o)
            "_PQclear", referenced from:
                core::ptr::drop_in_place::h312e12fc9993b623 in libdiesel-2a9e29d284463c68.rlib(diesel-2a9e29d284463c68.diesel.7fgx3whn-cgu.12.rcgu.o)
                core::ptr::drop_in_place::h38fbf0db4f786d4b in libdiesel-2a9e29d284463c68.rlib(diesel-2a9e29d284463c68.diesel.7fgx3whn-cgu.12.rcgu.o)
                diesel::pg::connection::result::PgResult::new::h9b886fdd796cb38a in libdiesel-2a9e29d284463c68.rlib(diesel-2a9e29d284463c68.diesel.7fgx3whn-cgu.12.rcgu.o)
                diesel::pg::connection::stmt::Statement::prepare::h9edae1b05b0c69bf in libdiesel-2a9e29d284463c68.rlib(diesel-2a9e29d284463c68.diesel.7fgx3whn-cgu.15.rcgu.o)
                _$LT$diesel..pg..connection..raw..RawResult$u20$as$u20$core..ops..drop..Drop$GT$::drop::hdf6e8edea70bc5f9 in libdiesel-2a9e29d284463c68.rlib(diesel-2a9e29d284463c68.diesel.7fgx3whn-cgu.4.rcgu.o)
                core::ptr::drop_in_place::h8b32bc272d55920a in libdiesel-2a9e29d284463c68.rlib(diesel-2a9e29d284463c68.diesel.7fgx3whn-cgu.7.rcgu.o)
                _$LT$diesel..pg..connection..PgConnection$u20$as$u20$diesel..connection..SimpleConnection$GT$::batch_execute::h37b0cd69aa25f128 in libdiesel-2a9e29d284463c68.rlib(diesel-2a9e29d284463c68.diesel.7fgx3whn-cgu.7.rcgu.o)
                ...
            "_PQgetisnull", referenced from:
                _$LT$diesel..pg..connection..row..PgRow$u20$as$u20$diesel..row..Row$LT$diesel..pg..backend..Pg$GT$$GT$::take::h93d0a1f86d6d73df in libdiesel-2a9e29d284463c68.rlib(diesel-2a9e29d284463c68.diesel.7fgx3whn-cgu.6.rcgu.o)
                _$LT$diesel..pg..connection..row..PgRow$u20$as$u20$diesel..row..Row$LT$diesel..pg..backend..Pg$GT$$GT$::next_is_null::h3d2c9432536e7e0b in libdiesel-2a9e29d284463c68.rlib(diesel-2a9e29d284463c68.diesel.7fgx3whn-cgu.6.rcgu.o)
            "_PQexec", referenced from:
                _$LT$diesel..pg..connection..PgConnection$u20$as$u20$diesel..connection..SimpleConnection$GT$::batch_execute::h37b0cd69aa25f128 in libdiesel-2a9e29d284463c68.rlib(diesel-2a9e29d284463c68.diesel.7fgx3whn-cgu.7.rcgu.o)
            "_PQresultStatus", referenced from:
                diesel::pg::connection::result::PgResult::new::h9b886fdd796cb38a in libdiesel-2a9e29d284463c68.rlib(diesel-2a9e29d284463c68.diesel.7fgx3whn-cgu.12.rcgu.o)
            "_PQfinish", referenced from:
                diesel::pg::connection::raw::RawConnection::establish::hc7caa15452eb702f in libdiesel-2a9e29d284463c68.rlib(diesel-2a9e29d284463c68.diesel.7fgx3whn-cgu.4.rcgu.o)
                _$LT$diesel..pg..connection..raw..RawConnection$u20$as$u20$core..ops..drop..Drop$GT$::drop::he36e74e09efd3dc4 in libdiesel-2a9e29d284463c68.rlib(diesel-2a9e29d284463c68.diesel.7fgx3whn-cgu.4.rcgu.o)
                core::ptr::drop_in_place::h36960d70a7103ade in libdiesel-2a9e29d284463c68.rlib(diesel-2a9e29d284463c68.diesel.7fgx3whn-cgu.7.rcgu.o)
                core::ptr::drop_in_place::hd1475b2a9b441c93 in libdiesel-2a9e29d284463c68.rlib(diesel-2a9e29d284463c68.diesel.7fgx3whn-cgu.7.rcgu.o)
                _$LT$diesel..pg..connection..PgConnection$u20$as$u20$diesel..connection..Connection$GT$::establish::h5cb451e20beba0b3 in libdiesel-2a9e29d284463c68.rlib(diesel-2a9e29d284463c68.diesel.7fgx3whn-cgu.7.rcgu.o)
            "_PQgetvalue", referenced from:
                _$LT$diesel..pg..connection..row..PgRow$u20$as$u20$diesel..row..Row$LT$diesel..pg..backend..Pg$GT$$GT$::take::h93d0a1f86d6d73df in libdiesel-2a9e29d284463c68.rlib(diesel-2a9e29d284463c68.diesel.7fgx3whn-cgu.6.rcgu.o)
            "_PQexecPrepared", referenced from:
                diesel::pg::connection::stmt::Statement::execute::h3f9c718bb32450dd in libdiesel-2a9e29d284463c68.rlib(diesel-2a9e29d284463c68.diesel.7fgx3whn-cgu.15.rcgu.o)
          ld: symbol(s) not found for architecture arm64
          clang: error: linker command failed with exit code 1 (use -v to see invocation)
          

error: aborting due to previous error

error: failed to compile `diesel_cli v1.4.1`, intermediate artifacts can be found at `/var/folders/kr/bj4js45j12z5rgvz_g8c0w_h0000gn/T/cargo-installtKT37U`

Caused by:
  could not compile `diesel_cli`

To learn more, run the command again with --verbose.

Are you seeing any additional errors?

Steps to reproduce

run cargo install diesel_cli --no-default-features --features postgres on an M1 Mac

Checklist

  • I have already looked over the issue tracker for similar issues.
  • This issue can be reproduced on Rust's stable channel. (Your issue will be
    closed if this is not the case) - This is not true, however, I believe this issue should still be considered because the Rust stable channel is unavailable on Mac M1s as of now.

You need to get libpq built for macOS-arm64 (homebrew will install it somewhere under /opt/homebrew) and supply it to rustc using 'RUSTFLAGS='-L /path/to/library/directory''

Co something like:
RUSTFLAGS='-L /opt/homebrew/opt/libpq/lib' cargo install diesel_cli --no-default-features --features postgres

As pointed out by the comment above and the compiler error message this is not a diesel issue, but an issue with your environment (just install a compatible libpq or use the x86_64 target).

To avoid having to pass RUSTFLAGS='...' every time I run cargo build, I put this in ~/.cargo/config.toml:

[target.aarch64-apple-darwin]
rustflags = '-L /opt/homebrew/opt/libpq/lib -L /opt/homebrew/lib'

I included /opt/homebrew/lib in case you have a version of postgresql installed. If you do, then you shouldn't have to install libpq separately. Documentation on how this .cargo/config.toml file works is here: https://doc.rust-lang.org/cargo/reference/config.html#buildrustflags

Does anyone know why you don't have to do this on x86_64? Homebrew installs in /usr/local on x86_64, so maybe cargo includes /usr/local/lib in the library path but not /opt/homebrew/lib?

@mikeyhew That sounds more like a homebrew issue than anything rust related.

extra tip:

people who installed Postgres.app you should use path:

-L /Applications/Postgres.app/Contents/Versions/YOUR_INSTALLED_VERSION/lib

this indeed is an issue with homebrew, it can happen that the rosetta 2/intel version is referenced and therefor only arch64 version of the packages are installed.

To verify that this might be the case run brew config, if you find macOS: 10.15.7-x86_64 you have an intel version installed, if you have macOS: 14.4.1-arm64 you are on the correct version.

If you are on the wrong version, the easiest way is to completely uninstall and reinstall homebrew with the uninstall script.

hope that helps someone else.