tomara-x / quartz

visual programming and dsp playground
https://codeberg.org/tomara-x/quartz
Apache License 2.0
93 stars 3 forks source link

could not compile `bevy_dylib` #97

Closed dromer closed 9 months ago

dromer commented 9 months ago

Saw your project and wanted to try a build. Linux and rust 1.76.0

   Compiling bevy_dylib v0.13.0
error: the linked panic runtime `panic_unwind` is not compiled with this crate's panic strategy `abort`

error: could not compile `bevy_dylib` (lib) due to 1 previous error
tomara-x commented 9 months ago

oh lol sorry release is still untested, you should comment out dynamic linking if you want to build release https://github.com/tomara-x/quartz/blob/main/Cargo.toml#L37

tomara-x commented 9 months ago

also maybe comment out the lto, i haven't tested how that works, and it can take a ridiculous amount of time to compile https://github.com/tomara-x/quartz/blob/main/Cargo.toml#L60

dromer commented 9 months ago

The compile is ok, it's the linker stage that takes long ;)

dromer commented 9 months ago

Ok, without dynamic linking and lto, no --release:

$ RUST_BACKTRACE=full cargo run 
    Finished dev [optimized + debuginfo] target(s) in 0.11s
     Running `target/debug/quartz`
2024-03-03T03:51:09.566952Z  INFO bevy_winit::system: Creating new window "awawawa" (0v1)
2024-03-03T03:51:09.567062Z  INFO log: Guessed window scale factor: 1.0833333333333333    
2024-03-03T03:51:09.653879Z  INFO bevy_render::renderer: AdapterInfo { name: "NVIDIA GeForce RTX 2060", vendor: 4318, device: 7944, device_type: DiscreteGpu, driver: "NVIDIA", driver_info: "525.147.05", backend: Vulkan }
thread 'main' panicked at /home/dreamer/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bevy_render-0.13.0/src/renderer/mod.rs:289:10:
called `Result::unwrap()` on an `Err` value: RequestDeviceError { inner: Core(DeviceLost) }
stack backtrace:
   0:     0x55ea66a7df96 - std::backtrace_rs::backtrace::libunwind::trace::hbee8a7973eeb6c93
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/../../backtrace/src/backtrace/libunwind.rs:104:5
   1:     0x55ea66a7df96 - std::backtrace_rs::backtrace::trace_unsynchronized::hc8ac75eea3aa6899
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x55ea66a7df96 - std::sys_common::backtrace::_print_fmt::hc7f3e3b5298b1083
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/sys_common/backtrace.rs:68:5
   3:     0x55ea66a7df96 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hbb235daedd7c6190
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x55ea66aa7710 - core::fmt::rt::Argument::fmt::h76c38a80d925a410
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/fmt/rt.rs:142:9
   5:     0x55ea66aa7710 - core::fmt::write::h3ed6aeaa977c8e45
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/fmt/mod.rs:1120:17
   6:     0x55ea66a7b97f - std::io::Write::write_fmt::h78b18af5775fedb5
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/io/mod.rs:1810:15
   7:     0x55ea66a7dd74 - std::sys_common::backtrace::_print::h5d645a07e0fcfdbb
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/sys_common/backtrace.rs:47:5
   8:     0x55ea66a7dd74 - std::sys_common::backtrace::print::h85035a511aafe7a8
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/sys_common/backtrace.rs:34:9
   9:     0x55ea66a7f5f7 - std::panicking::default_hook::{{closure}}::hcce8cea212785a25
  10:     0x55ea66a7f359 - std::panicking::default_hook::hf5fcb0f213fe709a
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:292:9
  11:     0x55ea66a7fa88 - std::panicking::rust_panic_with_hook::h095fccf1dc9379ee
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:779:13
  12:     0x55ea66a7f962 - std::panicking::begin_panic_handler::{{closure}}::h032ba12139b353db
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:657:13
  13:     0x55ea66a7e496 - std::sys_common::backtrace::__rust_end_short_backtrace::h9259bc2ff8fd0f76
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/sys_common/backtrace.rs:171:18
  14:     0x55ea66a7f6c0 - rust_begin_unwind
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:645:5
  15:     0x55ea6536d6b5 - core::panicking::panic_fmt::h784f20a50eaab275
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/panicking.rs:72:14
  16:     0x55ea6536dcf3 - core::result::unwrap_failed::h03d8a5018196e1cd
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/result.rs:1649:5
  17:     0x55ea65fa83ae - futures_lite::future::block_on::h507f85c546fdcecb
  18:     0x55ea66026a32 - <bevy_render::RenderPlugin as bevy_app::plugin::Plugin>::build::h00e78c1d7edf9325
  19:     0x55ea66961f35 - bevy_app::app::App::add_boxed_plugin::h7763a3fac2a2cf27
  20:     0x55ea6697652d - bevy_app::plugin_group::PluginGroupBuilder::finish::h7b41063a60b5148c
  21:     0x55ea65724908 - <P as bevy_app::plugin::sealed::Plugins<bevy_app::plugin::sealed::PluginGroupMarker>>::add_to_app::h1a1bfd1347dde2e9
                               at /home/dreamer/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bevy_app-0.13.0/src/plugin.rs:147:13
  22:     0x55ea65724908 - bevy_app::app::App::add_plugins::he6185b34b2c83c13
                               at /home/dreamer/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bevy_app-0.13.0/src/app.rs:756:9
  23:     0x55ea65371e1b - quartz::main::hf6d7dafb35e112c8
                               at /home/dreamer/Sources/_video/quartz/src/main.rs:32:5
  24:     0x55ea6542d913 - core::ops::function::FnOnce::call_once::hea374e69110e044f
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/ops/function.rs:250:5
  25:     0x55ea6542d913 - std::sys_common::backtrace::__rust_begin_short_backtrace::h80dbaa1fb61092c8
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/sys_common/backtrace.rs:155:18
  26:     0x55ea65716929 - std::rt::lang_start::{{closure}}::hf2d3e2c783fe9751
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/rt.rs:166:18
  27:     0x55ea66a754e1 - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::h37600b1e5eea4ecd
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/ops/function.rs:284:13
  28:     0x55ea66a754e1 - std::panicking::try::do_call::hb4bda49fa13a0c2b
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:552:40
  29:     0x55ea66a754e1 - std::panicking::try::h8bbf75149211aaaa
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:516:19
  30:     0x55ea66a754e1 - std::panic::catch_unwind::h8c78ec68ebea34cb
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panic.rs:142:14
  31:     0x55ea66a754e1 - std::rt::lang_start_internal::{{closure}}::hffdf44a19fd9e220
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/rt.rs:148:48
  32:     0x55ea66a754e1 - std::panicking::try::do_call::hcb3194972c74716d
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:552:40
  33:     0x55ea66a754e1 - std::panicking::try::hcdc6892c5f0dba4c
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:516:19
  34:     0x55ea66a754e1 - std::panic::catch_unwind::h4910beb4573f4776
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panic.rs:142:14
  35:     0x55ea66a754e1 - std::rt::lang_start_internal::h6939038e2873596b
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/rt.rs:148:20
  36:     0x55ea6537672c - main
  37:     0x7f457eecc24a - __libc_start_call_main
                               at ./csu/../sysdeps/nptl/libc_start_call_main.h:58:16
  38:     0x7f457eecc305 - __libc_start_main_impl
                               at ./csu/../csu/libc-start.c:360:3
  39:     0x55ea6536dfb1 - _start
  40:                0x0 - <unknown>
tomara-x commented 9 months ago

yeah, the linker is generally slow, you should try the mold linker if you want quicker linking: https://bevyengine.org/learn/quick-start/getting-started/setup/#enable-fast-compiles-optional

i've disabled dynamic_linkine in b2ed28a i should get in the habit of using the command line feature anyways

i have no idea why bevy_render is panicking for you..

tomara-x commented 9 months ago

you could try cloning bevy and running one of the 2d examples and see if you get the same panic, if so report an issue there

tomara-x commented 9 months ago

or.. wait a minute! i think you need to install the dependencies of bevy first https://github.com/bevyengine/bevy/blob/main/docs/linux_dependencies.md

i should probably mention that in the instructions done

dromer commented 9 months ago

Ah! Apparently I needed to install libnvidia-rtcore package!

dromer commented 9 months ago

It does a thing: