for both windows and linux we are hitting an error where we can't install postgres_cli without mysql.
# cargo install diesel_cli -f
error: linking with `cc` failed: exit code: 1
|
= note: "cc" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-m64" "-L" "/home/garrett/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "/tmp/cargo-install.BEMIMGprFVwR/rele
ase/deps/diesel-29684b278ac6427c.0.o" "-o" "/tmp/cargo-install.BEMIMGprFVwR/release/deps/diesel-29684b278ac6427c" "-Wl,--gc-sections" "-pie" "-Wl,-O1" "-nodefaultlibs" "-L" "/tmp/cargo-install.BEMIMGprFVwR/relea
se/deps" "-L" "/usr/lib" "-L" "/home/garrett/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,-Bstatic" "-Wl,-Bdynamic" "/tmp/cargo-install.BEMIMGprFVwR/release/d
eps/libchrono-bf703a963ddf910e.rlib" "/tmp/cargo-install.BEMIMGprFVwR/release/deps/libnum-5196260a17d9d54c.rlib" "/tmp/cargo-install.BEMIMGprFVwR/release/deps/libnum_iter-2a175c94c0e0f047.rlib" "/tmp/cargo-insta
ll.BEMIMGprFVwR/release/deps/libdiesel_infer_schema-8fc739284302ecb6.rlib" "/tmp/cargo-install.BEMIMGprFVwR/release/deps/libdiesel-f11407be32cb87f3.rlib" "/tmp/cargo-install.BEMIMGprFVwR/release/deps/liblibsqlit
e3_sys-3e0ba7a833b9e2c0.rlib" "/tmp/cargo-install.BEMIMGprFVwR/release/deps/liburl-513654a7ee4afefb.rlib" "/tmp/cargo-install.BEMIMGprFVwR/release/deps/libnum_integer-4431efb114b81eb7.rlib" "/tmp/cargo-install.B
EMIMGprFVwR/release/deps/libmysqlclient_sys-f4634471e5df7400.rlib" "/tmp/cargo-install.BEMIMGprFVwR/release/deps/libidna-02b65ca4ad3c3601.rlib" "/tmp/cargo-install.BEMIMGprFVwR/release/deps/libunicode_bidi-c0305
0ac0e7e15d5.rlib" "/tmp/cargo-install.BEMIMGprFVwR/release/deps/libpq_sys-86a2b938aa821c55.rlib" "/tmp/cargo-install.BEMIMGprFVwR/release/deps/libsyn-1df92eef63e06580.rlib" "/tmp/cargo-install.BEMIMGprFVwR/relea
se/deps/libtime-21206bae916c8e9f.rlib" "/tmp/cargo-install.BEMIMGprFVwR/release/deps/libnum_traits-d95403325b93dccb.rlib" "/tmp/cargo-install.BEMIMGprFVwR/release/deps/libclap-3480d946d6b45eeb.rlib" "/tmp/cargo-
install.BEMIMGprFVwR/release/deps/libunicode_segmentation-077e3519e0fde862.rlib" "/tmp/cargo-install.BEMIMGprFVwR/release/deps/libvec_map-30b783050663ec47.rlib" "/tmp/cargo-install.BEMIMGprFVwR/release/deps/libb
itflags-e290cd5819b8b8f3.rlib" "/tmp/cargo-install.BEMIMGprFVwR/release/deps/libansi_term-c475da7956866055.rlib" "/tmp/cargo-install.BEMIMGprFVwR/release/deps/libstrsim-138c1b6b5d3ec75f.rlib" "/tmp/cargo-install
.BEMIMGprFVwR/release/deps/libunicode_width-532714aec7829268.rlib" "/tmp/cargo-install.BEMIMGprFVwR/release/deps/libterm_size-be805df2df4a7c0c.rlib" "/tmp/cargo-install.BEMIMGprFVwR/release/deps/libbyteorder-64c
292745be2fae0.rlib" "/tmp/cargo-install.BEMIMGprFVwR/release/deps/libmatches-48eeeed12bed3e42.rlib" "/tmp/cargo-install.BEMIMGprFVwR/release/deps/libunicode_normalization-4594db9563c011b7.rlib" "/tmp/cargo-insta
ll.BEMIMGprFVwR/release/deps/libdotenv-c0ef68bcfc5b2489.rlib" "/tmp/cargo-install.BEMIMGprFVwR/release/deps/libregex-fdb9994f7c855b40.rlib" "/tmp/cargo-install.BEMIMGprFVwR/release/deps/libutf8_ranges-eee6e01646
fa8d92.rlib" "/tmp/cargo-install.BEMIMGprFVwR/release/deps/libthread_local-6c1c3f7b9e578c1b.rlib" "/tmp/cargo-install.BEMIMGprFVwR/release/deps/libthread_id-daa3e2ddc51f8d14.rlib" "/tmp/cargo-install.BEMIMGprFVw
R/release/deps/libaho_corasick-5c6bc25d8d3a791d.rlib" "/tmp/cargo-install.BEMIMGprFVwR/release/deps/libmemchr-e065dc882bfa2df6.rlib" "/tmp/cargo-install.BEMIMGprFVwR/release/deps/liblibc-7cef59ab52023ebd.rlib" "
/tmp/cargo-install.BEMIMGprFVwR/release/deps/libregex_syntax-99506361c8e90f54.rlib" "/tmp/cargo-install.BEMIMGprFVwR/release/deps/libquote-63fa18d56efeeccd.rlib" "/tmp/cargo-install.BEMIMGprFVwR/release/deps/lib
synom-98080e92c35e7ee2.rlib" "/tmp/cargo-install.BEMIMGprFVwR/release/deps/libunicode_xid-f45192a71fffe946.rlib" "/home/garrett/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux
-gnu/lib/libstd-2ddb28df747fcb8c.rlib" "/home/garrett/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_unwind-21709492a058d9ce.rlib" "/home/garrett/.rustup/too
lchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libunwind-e19aa6725ab01bfd.rlib" "/home/garrett/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linu
x-gnu/lib/librand-99ff2e008613b591.rlib" "/home/garrett/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcollections-e2513aecb8fbb70c.rlib" "/home/garrett/.rustup/to
olchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-f3200ab7e7fe644c.rlib" "/home/garrett/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linu
x-gnu/lib/liballoc_jemalloc-e83ac2302b5439a3.rlib" "/home/garrett/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-dba58b8da674d203.rlib" "/home/garrett/.rustup
/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd_unicode-6d4348bcabf40a71.rlib" "/home/garrett/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unk
nown-linux-gnu/lib/libcore-9f45c45fdcba4301.rlib" "/home/garrett/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-b4ef8c9d93bc879a.rlib" "-l" "sqli
te3" "-l" "sqlite3" "-l" "mysqlclient" "-l" "pq" "-l" "util" "-l" "dl" "-l" "rt" "-l" "pthread" "-l" "gcc_s" "-l" "pthread" "-l" "c" "-l" "m" "-l" "rt" "-l" "util"
= note: /usr/bin/ld: cannot find -lmysqlclient
collect2: error: ld returned 1 exit status
discovered by @TheAustinJones
If you want to install without mysql support, run cargo install diesel_cli --no-default-features --features postgres
thanks! It would be great to add that to the tutorial
We're working on revamping it to deal with the fact that there are more backends today than there used to be. It's a long process.
This should be reopened, its still an issue.
@dessalines Did you actually read the replies?
This should bypass the mysql system requirement and give you a warning if that part of it fails. All diesel-cli installs now fail on a system without mysql.
So yes, I arrived at this thread(which was closed), and implemented the suggestion above. Everyone who doesn't use mysql has to get to this page if they want diesl-cli to work. It would be better to either fail and refer to this fix, or to pass with a warning telling you the mysql stuff didn't install.
One solution is being tracked in #999
Most helpful comment
If you want to install without mysql support, run
cargo install diesel_cli --no-default-features --features postgres