Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When Running install.sh script fails at cargo run #302

Closed
apothan opened this issue Oct 17, 2019 · 2 comments
Closed

When Running install.sh script fails at cargo run #302

apothan opened this issue Oct 17, 2019 · 2 comments

Comments

@apothan
Copy link

apothan commented Oct 17, 2019

OS: Debian GNU/Linux 10

Description:
After installing postgres, yarn and rust then setting up the database I ran install.sh. This caused the error. I walked through the install.sh file command by command and I found that this error was occuring at cargo run (originally though at yarn build). I got the output through cargo run --verbose .

Error Output:
error: linking with cc failed: exit code: 1
|
= note: "cc" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-m64" "-L" "/home/username/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "/home/username/projects/lemmy/server/target/debug/deps/migrations_macros-c3383e8531309582.migrations_macros.ebdeuesz-cgu.0.rcgu.o" "/home/username/projects/lemmy/server/target/debug/deps/migrations_macros-c3383e8531309582.migrations_macros.ebdeuesz-cgu.1.rcgu.o" "/home/username/projects/lemmy/server/target/debug/deps/migrations_macros-c3383e8531309582.migrations_macros.ebdeuesz-cgu.10.rcgu.o" "/home/username/projects/lemmy/server/target/debug/deps/migrations_macros-c3383e8531309582.migrations_macros.ebdeuesz-cgu.11.rcgu.o" "/home/username/projects/lemmy/server/target/debug/deps/migrations_macros-c3383e8531309582.migrations_macros.ebdeuesz-cgu.12.rcgu.o" "/home/username/projects/lemmy/server/target/debug/deps/migrations_macros-c3383e8531309582.migrations_macros.ebdeuesz-cgu.13.rcgu.o" "/home/username/projects/lemmy/server/target/debug/deps/migrations_macros-c3383e8531309582.migrations_macros.ebdeuesz-cgu.14.rcgu.o" "/home/username/projects/lemmy/server/target/debug/deps/migrations_macros-c3383e8531309582.migrations_macros.ebdeuesz-cgu.15.rcgu.o" "/home/username/projects/lemmy/server/target/debug/deps/migrations_macros-c3383e8531309582.migrations_macros.ebdeuesz-cgu.2.rcgu.o" "/home/username/projects/lemmy/server/target/debug/deps/migrations_macros-c3383e8531309582.migrations_macros.ebdeuesz-cgu.3.rcgu.o" "/home/username/projects/lemmy/server/target/debug/deps/migrations_macros-c3383e8531309582.migrations_macros.ebdeuesz-cgu.4.rcgu.o" "/home/username/projects/lemmy/server/target/debug/deps/migrations_macros-c3383e8531309582.migrations_macros.ebdeuesz-cgu.5.rcgu.o" "/home/username/projects/lemmy/server/target/debug/deps/migrations_macros-c3383e8531309582.migrations_macros.ebdeuesz-cgu.6.rcgu.o" "/home/username/projects/lemmy/server/target/debug/deps/migrations_macros-c3383e8531309582.migrations_macros.ebdeuesz-cgu.7.rcgu.o" "/home/username/projects/lemmy/server/target/debug/deps/migrations_macros-c3383e8531309582.migrations_macros.ebdeuesz-cgu.8.rcgu.o" "/home/username/projects/lemmy/server/target/debug/deps/migrations_macros-c3383e8531309582.migrations_macros.ebdeuesz-cgu.9.rcgu.o" "-o" "/home/username/projects/lemmy/server/target/debug/deps/libmigrations_macros-c3383e8531309582.so" "/home/username/projects/lemmy/server/target/debug/deps/migrations_macros-c3383e8531309582.3jcwr7822kweamgs.rcgu.o" "/home/username/projects/lemmy/server/target/debug/deps/migrations_macros-c3383e8531309582.15y814crg1u5tk8r.rcgu.o" "-Wl,--gc-sections" "-Wl,-zrelro" "-Wl,-znow" "-nodefaultlibs" "-L" "/home/username/projects/lemmy/server/target/debug/deps" "-L" "/home/username/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,-Bstatic" "/home/username/projects/lemmy/server/target/debug/deps/libsyn-5294e8dbe1313809.rlib" "/home/username/projects/lemmy/server/target/debug/deps/libsynom-3b25b93e2366beaf.rlib" "/home/username/projects/lemmy/server/target/debug/deps/libunicode_xid-f7e9ef51f87a54c7.rlib" "/home/username/projects/lemmy/server/target/debug/deps/libquote-8e90ce2bbedc6309.rlib" "/home/username/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libproc_macro-a02bd905b5af93ea.rlib" "/home/username/projects/lemmy/server/target/debug/deps/libmigrations_internals-f39445254ad89ed7.rlib" "/home/username/projects/lemmy/server/target/debug/deps/libdiesel-1b943e414c34d495.rlib" "/home/username/projects/lemmy/server/target/debug/deps/libpq_sys-7c88677cfbd5ce17.rlib" "/home/username/projects/lemmy/server/target/debug/deps/libchrono-b076d37d62cbf44b.rlib" "/home/username/projects/lemmy/server/target/debug/deps/libserde-43e40afdb54b3cd6.rlib" "/home/username/projects/lemmy/server/target/debug/deps/libnum_integer-ada99c1fe8fb6557.rlib" "/home/username/projects/lemmy/server/target/debug/deps/libnum_traits-bb1056d785042e89.rlib" "/home/username/projects/lemmy/server/target/debug/deps/libtime-cb7420d741ccf248.rlib" "/home/username/projects/lemmy/server/target/debug/deps/liblibc-4da7d67650a02e7e.rlib" "/home/username/projects/lemmy/server/target/debug/deps/libbyteorder-a77e7696892023d4.rlib" "/home/username/projects/lemmy/server/target/debug/deps/libbitflags-c59701b2eae932f0.rlib" "-Wl,--start-group" "/home/username/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-12ce12f1efc08aa3.rlib" "/home/username/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_unwind-5d3cd1b3ddab72e4.rlib" "/home/username/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libbacktrace-f8222943dfd167e2.rlib" "/home/username/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libbacktrace_sys-0cd00b2d3108cd48.rlib" "/home/username/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_demangle-485c05ba6ce1b438.rlib" "/home/username/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libhashbrown-63e6b1072426ba59.rlib" "/home/username/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_alloc-a421aff1d43911ee.rlib" "/home/username/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libunwind-3deef8ef4fe80dff.rlib" "/home/username/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcfg_if-f65a176f0586269e.rlib" "/home/username/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-ad46d4080f4d7e57.rlib" "/home/username/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-da6c590582bf0885.rlib" "/home/username/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_core-837ca740df32db0a.rlib" "/home/username/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-db27c965e824589f.rlib" "-Wl,--end-group" "/home/username/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-68a4f8466685ed76.rlib" "-Wl,-Bdynamic" "-lpq" "-lutil" "-lutil" "-ldl" "-lrt" "-lpthread" "-lgcc_s" "-lc" "-lm" "-lrt" "-lpthread" "-lutil" "-lutil" "-shared"
= note: /usr/bin/ld: cannot find -lpq
collect2: error: ld returned 1 exit status

error: aborting due to previous error

error: Could not compile migrations_macros.

Caused by:
process didn't exit successfully: rustc --crate-name migrations_macros /home/username/.cargo/registry/src/github.com-1ecc6299db9ec823/migrations_macros-1.4.0/src/lib.rs --color always --crate-type proc-macro --emit=dep-info,link -C prefer-dynamic -C debuginfo=2 --cfg 'feature="default"' -C metadata=c3383e8531309582 -C extra-filename=-c3383e8531309582 --out-dir /home/username/projects/lemmy/server/target/debug/deps -L dependency=/home/username/projects/lemmy/server/target/debug/deps --extern migrations_internals=/home/username/projects/lemmy/server/target/debug/deps/libmigrations_internals-f39445254ad89ed7.rlib --extern quote=/home/username/projects/lemmy/server/target/debug/deps/libquote-8e90ce2bbedc6309.rlib --extern syn=/home/username/projects/lemmy/server/target/debug/deps/libsyn-5294e8dbe1313809.rlib --cap-lints allow (exit code: 1)

@dessalines
Copy link
Member

I googled the error, looks like a GCC / rust issue that has nothing to do with lemmy:

rust-fuzz/afl.rs#141
https://dev.to/rrampage/cargo-refused-to-build-my-project---a-rust-debugging-story-25e9

I'm also not sure what version of rust you're on, what your OS is, etc. In the meantime, you can run the docker development.

@apothan
Copy link
Author

apothan commented Oct 18, 2019

I found the issue. It was missing the libpq-dev library on Debian 10 stable even after installing postgres and build essentials.

@apothan apothan closed this as completed Oct 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants