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

Fix build for iOS #717

Open
wants to merge 1 commit into
base: upstream_winit
Choose a base branch
from
Open

Fix build for iOS #717

wants to merge 1 commit into from

Conversation

maun
Copy link
Contributor

@maun maun commented Dec 29, 2024

Tested using cargo-mobile2.

Works with a simple rect:

empty().style(|s| s.size_pct(70.0, 30.0).background(Color::RED))

but crashes when using text due to a panic in cosmic-text.

image
window creation done
window event Focused(true)
thread '<unnamed>' panicked at /Users/manuel/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cosmic-text-0.12.1/src/shape.rs:251:33:
no default font found
stack backtrace:
   0:        0x107505b24 - std::backtrace_rs::backtrace::libunwind::trace::h2504f6a7a9083436
                               at /rustc/90b35a6239c3d8bdabc530a6a0816f7ff89a0aaf/library/std/src/../../backtrace/src/backtrace/libunwind.rs:116:5
   1:        0x107505b24 - std::backtrace_rs::backtrace::trace_unsynchronized::h6d30c5a7e5c0e95b
                               at /rustc/90b35a6239c3d8bdabc530a6a0816f7ff89a0aaf/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:        0x107505b24 - std::sys::backtrace::_print_fmt::h4d241177db3ad3db
                               at /rustc/90b35a6239c3d8bdabc530a6a0816f7ff89a0aaf/library/std/src/sys/backtrace.rs:66:9
   3:        0x107505b24 - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::h7a0e784acb8aeff7
                               at /rustc/90b35a6239c3d8bdabc530a6a0816f7ff89a0aaf/library/std/src/sys/backtrace.rs:39:26
   4:        0x107520730 - core::fmt::rt::Argument::fmt::hdcf4364f643ba5f0
                               at /rustc/90b35a6239c3d8bdabc530a6a0816f7ff89a0aaf/library/core/src/fmt/rt.rs:177:76
   5:        0x107520730 - core::fmt::write::hc7ae0c33f591ced7
                               at /rustc/90b35a6239c3d8bdabc530a6a0816f7ff89a0aaf/library/core/src/fmt/mod.rs:1186:21
   6:        0x107503224 - std::io::Write::write_fmt::h73a91b3d4edc8b40
                               at /rustc/90b35a6239c3d8bdabc530a6a0816f7ff89a0aaf/library/std/src/io/mod.rs:1839:15
   7:        0x1075059d8 - std::sys::backtrace::BacktraceLock::print::ha96d44dc3d9057c0
                               at /rustc/90b35a6239c3d8bdabc530a6a0816f7ff89a0aaf/library/std/src/sys/backtrace.rs:42:9
   8:        0x1075068fc - std::panicking::default_hook::{{closure}}::h6410df3ad7c0548b
                               at /rustc/90b35a6239c3d8bdabc530a6a0816f7ff89a0aaf/library/std/src/panicking.rs:268:22
   9:        0x107506744 - std::panicking::default_hook::h04f2d093d7cf1671
                               at /rustc/90b35a6239c3d8bdabc530a6a0816f7ff89a0aaf/library/std/src/panicking.rs:295:9
  10:        0x1075070b4 - std::panicking::rust_panic_with_hook::h5564521c80b92207
                               at /rustc/90b35a6239c3d8bdabc530a6a0816f7ff89a0aaf/library/std/src/panicking.rs:801:13
  11:        0x107506d64 - std::panicking::begin_panic_handler::{{closure}}::h24bfefb8a0ebe306
                               at /rustc/90b35a6239c3d8bdabc530a6a0816f7ff89a0aaf/library/std/src/panicking.rs:674:13
  12:        0x107505fe8 - std::sys::backtrace::__rust_end_short_backtrace::hc1a47cedc59d63b1
                               at /rustc/90b35a6239c3d8bdabc530a6a0816f7ff89a0aaf/library/std/src/sys/backtrace.rs:170:18
  13:        0x107506a1c - rust_begin_unwind
                               at /rustc/90b35a6239c3d8bdabc530a6a0816f7ff89a0aaf/library/std/src/panicking.rs:665:5
  14:        0x10755e730 - core::panicking::panic_fmt::hcf86678192bed007
                               at /rustc/90b35a6239c3d8bdabc530a6a0816f7ff89a0aaf/library/core/src/panicking.rs:74:14
  15:        0x10755e710 - core::panicking::panic_display::hab223dafa50efa5e
                               at /rustc/90b35a6239c3d8bdabc530a6a0816f7ff89a0aaf/library/core/src/panicking.rs:264:5
  16:        0x10755e710 - core::option::expect_failed::hc0aae6e2775950e6
                               at /rustc/90b35a6239c3d8bdabc530a6a0816f7ff89a0aaf/library/core/src/option.rs:2021:5
  17:        0x10706e080 - core::option::Option<T>::expect::h61e77952fb293d2e
                               at /Users/manuel/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/src/rust/library/core/src/option.rs:933:21
  18:        0x107099d94 - cosmic_text::shape::shape_run::hbb59a34151ce1658
                               at /Users/manuel/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cosmic-text-0.12.1/src/shape.rs:251:16
  19:        0x10709ac50 - cosmic_text::shape::shape_run_cached::h062accfdf377c51c
                               at /Users/manuel/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cosmic-text-0.12.1/src/shape.rs:405:5
  20:        0x107098c58 - cosmic_text::shape::Shaping::run::h5d3b31157047d2d9

@jrmoulton jrmoulton requested a review from dzhou121 January 1, 2025 20:08
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

Successfully merging this pull request may close these issues.

1 participant