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

Allow statically-linked compilation by disabling feature flags #759

Open
zinifier opened this issue Dec 24, 2024 · 0 comments
Open

Allow statically-linked compilation by disabling feature flags #759

zinifier opened this issue Dec 24, 2024 · 0 comments

Comments

@zinifier
Copy link

Currently, trying to compile to x86_64-unknown-linux-musl (for portable binaries) produces a NoWaylandLib error and refuses to start:

$ RUST_BACKTRACE=full cargo run --release --target=x86_64-unknown-linux-musl
    Finished `release` profile [optimized] target(s) in 0.38s
     Running `/prog/.cargo/target/x86_64-unknown-linux-musl/release/sticker-printer-gui`
thread 'main' panicked at /prog/.cargo/git/checkouts/libcosmic-41009aea1d72760b/75a11b3/iced/winit/src/program.rs:177:39:
Create event loop: Os(OsError { line: 63, file: "/prog/.cargo/git/checkouts/winit-d03127a0b2faf55d/1cc02bd/src/platform_impl/linux/wayland/event_loop/mod.rs", error: NoWaylandLib })
stack backtrace:
   0:     0x763043850cda - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::h4d925a43945ad333
   1:     0x76304389ceb3 - core::fmt::write::hcfaeabde0feb60be
   2:     0x76304384bdc3 - std::io::Write::write_fmt::h4ea182833dad27bd
   3:     0x763043850b22 - std::sys::backtrace::BacktraceLock::print::h378b293f8d5bee0e
   4:     0x763043851d1d - std::panicking::default_hook::{{closure}}::h55e037cd46ef863d
   5:     0x763043851b62 - std::panicking::default_hook::h5b88978f11f489c4
   6:     0x7630438523e7 - std::panicking::rust_panic_with_hook::h2c5057fbc1c11ffd
   7:     0x76304385218a - std::panicking::begin_panic_handler::{{closure}}::h7279d07160b25030
   8:     0x7630438511a9 - std::sys::backtrace::__rust_end_short_backtrace::h01262d840bed71d8
   9:     0x763043851e1d - rust_begin_unwind
  10:     0x763042d16070 - core::panicking::panic_fmt::h186872714c27c18d
  11:     0x763042d164a6 - core::result::unwrap_failed::h265ca1dbdb4601a6
  12:     0x763042d945a3 - iced_winit::program::run::h124582e31af565f4
  13:     0x763042d38d1b - cosmic::app::run::h314103374714143f
  14:     0x763042de3377 - sticker_printer_gui::main::h8d6f5214e0e39217
  15:     0x763042da6f83 - std::sys::backtrace::__rust_begin_short_backtrace::h4ebc646de044798c
  16:     0x763042e016f9 - std::rt::lang_start::{{closure}}::ha460436e810f83e2
  17:     0x7630438441d7 - std::rt::lang_start_internal::h781f6455e6949f85
  18:     0x763042de3455 - main

That's because some dependencies enable some dynamic library features with a dlopen feature flag:

  • smithay-clipboard/dlopen
  • softbuffer/wayland-dlopen and softbuffer/x11-dlopen
  • winit/wayland-dlopen
  • maybe others?

I think most of these feature flags are enabled within cosmic-managed or forked repositories so this should be fixable!

It would be great to enable statically linked applications like Appimages using libcosmic! :)

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

1 participant