LuckyTurtleDev / mstickereditor

import sticker packs from telegram, to be used at the Maunium sticker picker for Matrix
Apache License 2.0
32 stars 3 forks source link

Debian build fails on fresh build from git #54

Open PlanetSmasher opened 3 months ago

PlanetSmasher commented 3 months ago

Hi I am trying to build mstickeditor for my Debian Server (I tried 11 and 12) It fails to build from scratch as it complains about rlottie.

As I am not a Rust dev, I assumed it would prepare all packages during build. For now I tried building rlottie from scratch on my dev machine (debian 11) and it startet complaining about libclang. after installing that it, comes back to rlottie and fails

I used the command:

cargo install --locked mstickereditor

LibC error:

error: failed to run custom build command for rlottie-sys v0.2.9

Caused by: process didn't exit successfully: /tmp/cargo-installngcOY1/release/build/rlottie-sys-771085b9b23b4109/build-script-build (exit status: 101) --- stdout cargo:rerun-if-env-changed=RLOTTIE_NO_PKG_CONFIG cargo:rerun-if-env-changed=PKG_CONFIG_x86_64-unknown-linux-gnu cargo:rerun-if-env-changed=PKG_CONFIG_x86_64_unknown_linux_gnu cargo:rerun-if-env-changed=HOST_PKG_CONFIG cargo:rerun-if-env-changed=PKG_CONFIG cargo:rerun-if-env-changed=RLOTTIE_STATIC cargo:rerun-if-env-changed=RLOTTIE_DYNAMIC cargo:rerun-if-env-changed=PKG_CONFIG_ALL_STATIC cargo:rerun-if-env-changed=PKG_CONFIG_ALL_DYNAMIC cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64-unknown-linux-gnu cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64_unknown_linux_gnu cargo:rerun-if-env-changed=HOST_PKG_CONFIG_PATH cargo:rerun-if-env-changed=PKG_CONFIG_PATH cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64-unknown-linux-gnu cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64_unknown_linux_gnu cargo:rerun-if-env-changed=HOST_PKG_CONFIG_LIBDIR cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64-unknown-linux-gnu cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64_unknown_linux_gnu cargo:rerun-if-env-changed=HOST_PKG_CONFIG_SYSROOT_DIR cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR cargo:rerun-if-env-changed=SYSROOT cargo:rerun-if-env-changed=RLOTTIE_STATIC cargo:rerun-if-env-changed=RLOTTIE_DYNAMIC cargo:rerun-if-env-changed=PKG_CONFIG_ALL_STATIC cargo:rerun-if-env-changed=PKG_CONFIG_ALL_DYNAMIC cargo:rustc-link-search=native=/usr/lib cargo:rustc-link-lib=rlottie cargo:rerun-if-env-changed=PKG_CONFIG_x86_64-unknown-linux-gnu cargo:rerun-if-env-changed=PKG_CONFIG_x86_64_unknown_linux_gnu cargo:rerun-if-env-changed=HOST_PKG_CONFIG cargo:rerun-if-env-changed=PKG_CONFIG cargo:rerun-if-env-changed=RLOTTIE_STATIC cargo:rerun-if-env-changed=RLOTTIE_DYNAMIC cargo:rerun-if-env-changed=PKG_CONFIG_ALL_STATIC cargo:rerun-if-env-changed=PKG_CONFIG_ALL_DYNAMIC cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64-unknown-linux-gnu cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64_unknown_linux_gnu cargo:rerun-if-env-changed=HOST_PKG_CONFIG_PATH cargo:rerun-if-env-changed=PKG_CONFIG_PATH cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64-unknown-linux-gnu cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64_unknown_linux_gnu cargo:rerun-if-env-changed=HOST_PKG_CONFIG_LIBDIR cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64-unknown-linux-gnu cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64_unknown_linux_gnu cargo:rerun-if-env-changed=HOST_PKG_CONFIG_SYSROOT_DIR cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR cargo:rerun-if-changed=wrapper.h cargo:rerun-if-env-changed=TARGET cargo:rerun-if-env-changed=BINDGEN_EXTRA_CLANG_ARGS_x86_64-unknown-linux-gnu cargo:rerun-if-env-changed=BINDGEN_EXTRA_CLANG_ARGS_x86_64_unknown_linux_gnu cargo:rerun-if-env-changed=BINDGEN_EXTRA_CLANG_ARGS

--- stderr thread 'main' panicked at /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bindgen-0.68.1/lib.rs:611:31: Unable to find libclang: "couldn't find any valid shared libraries matching: ['libclang.so', 'libclang-.so', 'libclang.so.', 'libclang-.so.'], set the LIBCLANG_PATH environment variable to a path where one of these files can be found (invalid: [])" note: run with RUST_BACKTRACE=1 environment variable to display a backtrace warning: build failed, waiting for other jobs to finish... error: failed to compile mstickereditor v0.3.6, intermediate artifacts can be found at /tmp/cargo-installngcOY1. To reuse those artifacts with a future compilation, set the environment variable CARGO_TARGET_DIR to that path.

rlottie error:

error: failed to run custom build command for rlottie-sys v0.2.9

Caused by: process didn't exit successfully: /tmp/cargo-installugFQtA/release/build/rlottie-sys-771085b9b23b4109/build-script-build (exit status: 101) --- stdout cargo:rerun-if-env-changed=RLOTTIE_NO_PKG_CONFIG cargo:rerun-if-env-changed=PKG_CONFIG_x86_64-unknown-linux-gnu cargo:rerun-if-env-changed=PKG_CONFIG_x86_64_unknown_linux_gnu cargo:rerun-if-env-changed=HOST_PKG_CONFIG cargo:rerun-if-env-changed=PKG_CONFIG cargo:rerun-if-env-changed=RLOTTIE_STATIC cargo:rerun-if-env-changed=RLOTTIE_DYNAMIC cargo:rerun-if-env-changed=PKG_CONFIG_ALL_STATIC cargo:rerun-if-env-changed=PKG_CONFIG_ALL_DYNAMIC cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64-unknown-linux-gnu cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64_unknown_linux_gnu cargo:rerun-if-env-changed=HOST_PKG_CONFIG_PATH cargo:rerun-if-env-changed=PKG_CONFIG_PATH cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64-unknown-linux-gnu cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64_unknown_linux_gnu cargo:rerun-if-env-changed=HOST_PKG_CONFIG_LIBDIR cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64-unknown-linux-gnu cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64_unknown_linux_gnu cargo:rerun-if-env-changed=HOST_PKG_CONFIG_SYSROOT_DIR cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR cargo:rerun-if-env-changed=SYSROOT cargo:rerun-if-env-changed=RLOTTIE_STATIC cargo:rerun-if-env-changed=RLOTTIE_DYNAMIC cargo:rerun-if-env-changed=PKG_CONFIG_ALL_STATIC cargo:rerun-if-env-changed=PKG_CONFIG_ALL_DYNAMIC cargo:rustc-link-search=native=/usr/lib cargo:rustc-link-lib=rlottie cargo:rerun-if-env-changed=PKG_CONFIG_x86_64-unknown-linux-gnu cargo:rerun-if-env-changed=PKG_CONFIG_x86_64_unknown_linux_gnu cargo:rerun-if-env-changed=HOST_PKG_CONFIG cargo:rerun-if-env-changed=PKG_CONFIG cargo:rerun-if-env-changed=RLOTTIE_STATIC cargo:rerun-if-env-changed=RLOTTIE_DYNAMIC cargo:rerun-if-env-changed=PKG_CONFIG_ALL_STATIC cargo:rerun-if-env-changed=PKG_CONFIG_ALL_DYNAMIC cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64-unknown-linux-gnu cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64_unknown_linux_gnu cargo:rerun-if-env-changed=HOST_PKG_CONFIG_PATH cargo:rerun-if-env-changed=PKG_CONFIG_PATH cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64-unknown-linux-gnu cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64_unknown_linux_gnu cargo:rerun-if-env-changed=HOST_PKG_CONFIG_LIBDIR cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64-unknown-linux-gnu cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64_unknown_linux_gnu cargo:rerun-if-env-changed=HOST_PKG_CONFIG_SYSROOT_DIR cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR cargo:rerun-if-changed=wrapper.h cargo:rerun-if-env-changed=TARGET cargo:rerun-if-env-changed=BINDGEN_EXTRA_CLANG_ARGS_x86_64-unknown-linux-gnu cargo:rerun-if-env-changed=BINDGEN_EXTRA_CLANG_ARGS_x86_64_unknown_linux_gnu cargo:rerun-if-env-changed=BINDGEN_EXTRA_CLANG_ARGS

--- stderr wrapper.h:1:10: fatal error: 'rlottie_capi.h' file not found thread 'main' panicked at /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rlottie-sys-0.2.9/build.rs:17:10: Unable to generate bindings: ClangDiagnostic("wrapper.h:1:10: fatal error: 'rlottie_capi.h' file not found\n") note: run with RUST_BACKTRACE=1 environment variable to display a backtrace warning: build failed, waiting for other jobs to finish... error: failed to compile mstickereditor v0.3.6, intermediate artifacts can be found at /tmp/cargo-installugFQtA. To reuse those artifacts with a future compilation, set the environment variable CARGO_TARGET_DIR to that path.

Could someon clarify whats the correct way of building mstickeditor?

thanks a lot

PlanetSmasher commented 3 months ago

I Installed rust from their website

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

the rlottie make install was here:

user@debian:~/git/rlottie/build$ sudo make install
[sudo] Passwort für user:
[ 89%] Built target rlottie
[ 94%] Built target rlottie-image-loader
[100%] Built target lottie2gif
Install the project...
-- Install configuration: "MinSizeRel"
-- Installing: /usr/lib/pkgconfig/rlottie.pc
-- Installing: /home/user/test/include/rlottie.h
-- Installing: /home/user/test/include/rlottie_capi.h
-- Installing: /home/user/test/include/rlottiecommon.h
-- Installing: /usr/lib/librlottie.a
-- Installing: /usr/lib/cmake/rlottie/rlottieTargets.cmake
-- Installing: /usr/lib/cmake/rlottie/rlottieTargets-minsizerel.cmake
-- Installing: /usr/lib/cmake/rlottie/rlottieConfig.cmake
-- Installing: /usr/lib/cmake/rlottie/rlottieConfigVersion.cmake
-- Installing: /usr/lib/librlottie-image-loader.so
LuckyTurtleDev commented 3 months ago

As I am not a Rust dev, I assumed it would prepare all packages during build.

This happen with rust dependencies. But rlottie i a c libary, which makes stuff complicated. You can disable lottie support and all optional features with cargo install mstickereditor --no-default-features. ffmped support can be reenable with --features ffmpeg or --features ffmpeg-build.

I can not help you much with the rlottie issue. You should create a issue at the rlottie create https://github.com/msrd0/rlottie-rs.

PlanetSmasher commented 3 months ago

Thanks it works without default features.

But without rlottie means for me > no animated stickers?

LuckyTurtleDev commented 3 months ago

Yes. But video sticker are still supported with the ffmpeg feature. Lottie is the reason why i do not publish a binary. C libs are real pain sometimes. How mention above you can ask at the lottie-rs crate repo about this issue.

msrd0 commented 3 months ago

Hey, author of lottie-rs here. I can tell you that lottie-rs needs to dynamically link libclang.so during compile time, and expects pkg-config to find some form of rlottie library on your system. Depending on your system (I hope it's Linux, otherwise you're completely on your own, see https://github.com/msrd0/rlottie-rs/issues/43) the way to install that can be different. The install command you showed above however looks promising, so assuming you have the corresponding llvm/clang libs installed it should™ compile.

PlanetSmasher commented 3 months ago

Thanks a lot for the many quick answers.

I have build now mstickereditor without rlottie support.

My assumption that I can build the software without building all dependencies is not correct.

My take please correct me if I am wrong:

For the users that read this issue I guess that I have to build first all dependencies, partly from scratch with the appropiate build tools, before I can start building mstickereditor.

msrd0 commented 2 months ago

I have to build first all dependencies, partly from scratch with the appropiate build tools, before I can start building mstickereditor.

This is correct but let me add some additional info.

I suggest we split up dependencies into three categories: