emk / rust-musl-builder

Docker images for compiling static Rust binaries using musl-libc and musl-gcc, with static versions of useful C libraries. Supports openssl and diesel crates.
Apache License 2.0
1.54k stars 193 forks source link

build diesel cli for alpine image fail #131

Closed abdelmonem17 closed 2 years ago

abdelmonem17 commented 2 years ago

when I try to compile diesel cli using cargo install diesel_cli --no-default-features --features postgres for alpine image in your custom image 'ekidd/rust-musl-builder:lates' I got error from linker

error: linking with cc failed: exit code: 1 | = note: "cc" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-m64" "-Wl,--eh-frame-hdr" "-nostartfiles" "/opt/rust/rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-musl/lib/self-contained/crt1.o" "/opt/rust/rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-musl/lib/self-contained/crti.o" "-L" "/opt/rust/rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-musl/lib" "-L" "/opt/rust/rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-l ..... could you help me in doing that and solving this issue and thank you in advance.

emk commented 2 years ago

This is missing the necessary information to debug it, unfortunately. Please include the complete error.

I believe we actually ship a copy of diesel-cli in the image itself. It may or may not be easy to rebuild the image with the newest version.

emk commented 2 years ago

Sorry, it turns out we do not ship diesel-cli in the image.

You should probably run all of your diesel operations on your local development machine, and commit the schemas to git. If you need to run migrations on CI, consider using a separate container with diesel-cli installed normally.