onagre-launcher / onagre

A general purpose application launcher for X and wayland inspired by rofi/wofi and alfred
MIT License
511 stars 27 forks source link

Fail to build on Ubuntu 22.04 `could not find system library 'fontconfig'` #63

Closed yh-sb closed 9 months ago

yh-sb commented 9 months ago

Describe the bug I've tried to build according to both instructions: from sources and with cargo. Both are failing with the same error:

  thread 'main' panicked at '`"pkg-config" "--libs" "--cflags" "fontconfig" "fontconfig >= 2.11.1"` did not exit successfully: exit status: 1
  error: could not find system library 'fontconfig' required by the 'servo-fontconfig-sys' crate

But the fontconfig is present in the system:

$ fc-list -V
fontconfig version 2.13.1

Build log:

~/dev/onagre$ cargo build --release
   Compiling servo-fontconfig-sys v5.1.0
   Compiling wayland-server v0.30.1
   Compiling phf_shared v0.11.2
   Compiling kurbo v0.8.3
   Compiling concurrent-queue v2.2.0
   Compiling aho-corasick v1.0.2
   Compiling dirs-sys v0.3.7
   Compiling smithay-client-toolkit v0.16.0
error: failed to run custom build command for `servo-fontconfig-sys v5.1.0`

Caused by:
  process didn't exit successfully: `/home/user/dev/onagre/target/release/build/servo-fontconfig-sys-575a6d90b30b6b9d/build-script-build` (exit status: 101)
  --- stdout
  cargo:rerun-if-env-changed=FONTCONFIG_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=FONTCONFIG_STATIC
  cargo:rerun-if-env-changed=FONTCONFIG_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

  --- stderr
  thread 'main' panicked at '`"pkg-config" "--libs" "--cflags" "fontconfig" "fontconfig >= 2.11.1"` did not exit successfully: exit status: 1
  error: could not find system library 'fontconfig' required by the 'servo-fontconfig-sys' crate

  --- stderr
  Package fontconfig was not found in the pkg-config search path.
  Perhaps you should add the directory containing `fontconfig.pc'
  to the PKG_CONFIG_PATH environment variable
  No package 'fontconfig' found
  Package fontconfig was not found in the pkg-config search path.
  Perhaps you should add the directory containing `fontconfig.pc'
  to the PKG_CONFIG_PATH environment variable
  No package 'font config' found
  ', /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/servo-fontconfig-sys-5.1.0/build.rs:34:17
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...

Config Repository head on the latest master https://github.com/oknozor/onagre/commit/c044ccf42d4d5048cd9abb49cf8b64229eb84a93

To Reproduce Steps to reproduce the behavior:

git clone https://github.com/oknozor/onagre.git
cd onagre
cargo build --release
sudo mv target/release/onagre /usr/bin/onagre

OR

cargo install --git https://github.com/oknozor/onagre

Expected behavior Build successful.

Screenshots -

Window manager (please complete the following information):

Additional context -

yh-sb commented 9 months ago

Fixed after installing:

libfontconfig1-dev
libxkbcommon-dev
libegl1-mesa-dev
libegl-dev

But the new issue is that onagre failed to start with the following error:

$ onagre 
Failed to parse theme:
Failed to open config file
Failing back to default theme
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "No such file or directory" }', src/app/subscriptions/pop_launcher.rs:78:14
stack backtrace:
   0:     0x55e4fba4c4b3 - std::backtrace_rs::backtrace::libunwind::trace::hf4179216f2af7039
                               at /build/rustc-ujz1Py/rustc-1.66.1+dfsg0ubuntu1/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x55e4fba4c4b3 - std::backtrace_rs::backtrace::trace_unsynchronized::hfa14eb12e4b8ce4f
                               at /build/rustc-ujz1Py/rustc-1.66.1+dfsg0ubuntu1/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x55e4fba4c4b3 - std::sys_common::backtrace::_print_fmt::hc81cbee2043ec868
                               at /build/rustc-ujz1Py/rustc-1.66.1+dfsg0ubuntu1/library/std/src/sys_common/backtrace.rs:65:5
   3:     0x55e4fba4c4b3 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h7b2be2009a6bcba2
                               at /build/rustc-ujz1Py/rustc-1.66.1+dfsg0ubuntu1/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x55e4fb655cee - core::fmt::write::hccee7882499b620f
                               at /build/rustc-ujz1Py/rustc-1.66.1+dfsg0ubuntu1/library/core/src/fmt/mod.rs:1209:17
   5:     0x55e4fba2ead4 - std::io::Write::write_fmt::h69e1f37bb24a9f49
                               at /build/rustc-ujz1Py/rustc-1.66.1+dfsg0ubuntu1/library/std/src/io/mod.rs:1682:15
   6:     0x55e4fba4c27f - std::sys_common::backtrace::_print::h86df92192f156e4c
                               at /build/rustc-ujz1Py/rustc-1.66.1+dfsg0ubuntu1/library/std/src/sys_common/backtrace.rs:47:5
   7:     0x55e4fba4c27f - std::sys_common::backtrace::print::h3b76d5113eea7ae3
                               at /build/rustc-ujz1Py/rustc-1.66.1+dfsg0ubuntu1/library/std/src/sys_common/backtrace.rs:34:9
   8:     0x55e4fba3a92f - std::panicking::default_hook::{{closure}}::h634bc187e8e58de8
                               at /build/rustc-ujz1Py/rustc-1.66.1+dfsg0ubuntu1/library/std/src/panicking.rs:267:22
   9:     0x55e4fba3b4c1 - std::panicking::default_hook::h262aef5e4abfc826
                               at /build/rustc-ujz1Py/rustc-1.66.1+dfsg0ubuntu1/library/std/src/panicking.rs:286:9
  10:     0x55e4fba3b4c1 - std::panicking::rust_panic_with_hook::hedb8a8e4067bf251
                               at /build/rustc-ujz1Py/rustc-1.66.1+dfsg0ubuntu1/library/std/src/panicking.rs:688:13
  11:     0x55e4fba4c912 - std::panicking::begin_panic_handler::{{closure}}::hf501de419c9dcde3
                               at /build/rustc-ujz1Py/rustc-1.66.1+dfsg0ubuntu1/library/std/src/panicking.rs:579:13
  12:     0x55e4fba4c87c - std::sys_common::backtrace::__rust_end_short_backtrace::h8542e72ad556a307
                               at /build/rustc-ujz1Py/rustc-1.66.1+dfsg0ubuntu1/library/std/src/sys_common/backtrace.rs:137:18
  13:     0x55e4fba3ad51 - rust_begin_unwind
                               at /build/rustc-ujz1Py/rustc-1.66.1+dfsg0ubuntu1/library/std/src/panicking.rs:575:5
  14:     0x55e4fb45de52 - core::panicking::panic_fmt::h1688e859668ba1d0
                               at /build/rustc-ujz1Py/rustc-1.66.1+dfsg0ubuntu1/library/core/src/panicking.rs:65:14
  15:     0x55e4fb45e182 - core::result::unwrap_failed::h9f204f08b8ff9323
                               at /build/rustc-ujz1Py/rustc-1.66.1+dfsg0ubuntu1/library/core/src/result.rs:1791:5
  16:     0x55e4fb5a00c4 - <onagre::app::subscriptions::pop_launcher::PopLauncherSubscription as iced_futures::subscription::Recipe<H,I>>::stream::h03c9cf179200e85d
  17:     0x55e4fb4cea3a - <iced_futures::subscription::Map<H,E,A,B> as iced_futures::subscription::Recipe<H,E>>::stream::h8ccc33a4f5f3b9c8
  18:     0x55e4fb4d0f06 - iced_futures::runtime::Runtime<Hasher,Event,Executor,Sender,Message>::track::h97d7751d9e464b3c
  19:     0x55e4fb4abe82 - iced_winit::application::run_instance::{{closure}}::hf4cf9310591f6b1a
  20:     0x55e4fb4c25ef - iced_winit::application::run::{{closure}}::h9369033c1daf9e8f
  21:     0x55e4fb56a744 - winit::platform_impl::platform::x11::EventLoop<T>::run_return::single_iteration::h27772c11e53c9811
  22:     0x55e4fb4bae92 - iced_winit::application::run::hf4500915a28edb08
  23:     0x55e4fb5bfd30 - onagre::main::h861c99c22771c864
  24:     0x55e4fb4f9a53 - std::sys_common::backtrace::__rust_begin_short_backtrace::h685942a9996001a2
  25:     0x55e4fb5c8510 - main
  26:     0x7fa066db7d90 - __libc_start_call_main
                               at ./csu/../sysdeps/nptl/libc_start_call_main.h:58:16
  27:     0x7fa066db7e40 - __libc_start_main_impl
                               at ./csu/../csu/libc-start.c:392:3
  28:     0x55e4fb49bb65 - _start
  29:                0x0 - <unknown>
yh-sb commented 9 months ago

Separate issue created: https://github.com/oknozor/onagre/issues/64