l4l / yofi

yofi is a minimalistic menu for wayland
https://crates.io/crates/yofi
MIT License
361 stars 21 forks source link

add explicit allsorts dependency #88

Closed nim65s closed 2 years ago

nim65s commented 2 years ago

Hi,

On the current master, in my system, yofi panics.

It looks like one dependency is trying to make no_std stuff in a wrong way: https://github.com/l4l/yofi/blob/074a76b91b9a6cb16a302dd78a71c63941ad0fab/Cargo.lock#L54

This dependency is not even owned on crates.io by its authors: https://github.com/yeslogic/allsorts/issues/49

This PR workaround this issue by explicitly adding the right allsorts as a dependency. After this, yofi works as expected for me.

For reference, on my system with rustc 1.59.0 (9d1b2106e 2022-02-23):

show backtrace
$ RUST_BACKTRACE=1 ./target/debug/yofi
thread '' panicked at 'Must provide allocators in no-stdlib code', /home/gsaurel/.cargo/registry/src/github.com-1ecc6299db9ec823/brotli-decompressor-2.3.2/src/ffi/alloc_util.rs:185:13
stack backtrace:
   0: rust_begin_unwind
             at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/std/src/panicking.rs:498:5
   1: core::panicking::panic_fmt
             at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/core/src/panicking.rs:107:14
   2: core::panicking::panic
             at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/core/src/panicking.rs:48:5
   3: >::alloc_cell
             at /home/gsaurel/.cargo/registry/src/github.com-1ecc6299db9ec823/brotli-decompressor-2.3.2/src/ffi/alloc_util.rs:185:13
   4: brotli_decompressor::state::BrotliState::new_with_custom_dictionary
             at /home/gsaurel/.cargo/registry/src/github.com-1ecc6299db9ec823/brotli-decompressor-2.3.2/src/state.rs:403:36
   5: brotli_decompressor::ffi::BrotliDecoderCreateInstance::{{closure}}
             at /home/gsaurel/.cargo/registry/src/github.com-1ecc6299db9ec823/brotli-decompressor-2.3.2/src/ffi/mod.rs:75:23
   6: brotli_decompressor::ffi::catch_panic_state
             at /home/gsaurel/.cargo/registry/src/github.com-1ecc6299db9ec823/brotli-decompressor-2.3.2/src/ffi/mod.rs:208:8
   7: BrotliDecoderCreateInstance
             at /home/gsaurel/.cargo/registry/src/github.com-1ecc6299db9ec823/brotli-decompressor-2.3.2/src/ffi/mod.rs:66:11
   8: allsorts_no_std::woff2::decode_brotli_stream
             at /home/gsaurel/.cargo/registry/src/github.com-1ecc6299db9ec823/allsorts_no_std-0.5.2/src/woff2.rs:151:21
   9: ::read
             at /home/gsaurel/.cargo/registry/src/github.com-1ecc6299db9ec823/allsorts_no_std-0.5.2/src/woff2.rs:275:40
  10: ::read
             at /home/gsaurel/.cargo/registry/src/github.com-1ecc6299db9ec823/allsorts_no_std-0.5.2/src/font_data.rs:34:48
  11: ::read_dep
             at /home/gsaurel/.cargo/registry/src/github.com-1ecc6299db9ec823/allsorts_no_std-0.5.2/src/binary/read.rs:137:9
  12: allsorts_no_std::binary::read::ReadCtxt::read
             at /home/gsaurel/.cargo/registry/src/github.com-1ecc6299db9ec823/allsorts_no_std-0.5.2/src/binary/read.rs:367:9
  13: allsorts_no_std::binary::read::ReadScope::read
             at /home/gsaurel/.cargo/registry/src/github.com-1ecc6299db9ec823/allsorts_no_std-0.5.2/src/binary/read.rs:278:9
  14: rust_fontconfig::FcParseFont
             at /home/gsaurel/.cargo/registry/src/github.com-1ecc6299db9ec823/rust-fontconfig-0.1.5/src/lib.rs:398:21
  15: rust_fontconfig::FcParseFontFiles::{{closure}}
             at /home/gsaurel/.cargo/registry/src/github.com-1ecc6299db9ec823/rust-fontconfig-0.1.5/src/lib.rs:363:24
  16:  as rayon::iter::plumbing::Folder>::consume
             at /home/gsaurel/.cargo/registry/src/github.com-1ecc6299db9ec823/rayon-1.5.1/src/iter/filter_map.rs:123:36
  17: rayon::iter::plumbing::Folder::consume_iter
             at /home/gsaurel/.cargo/registry/src/github.com-1ecc6299db9ec823/rayon-1.5.1/src/iter/plumbing/mod.rs:179:20
  18: rayon::iter::plumbing::Producer::fold_with
             at /home/gsaurel/.cargo/registry/src/github.com-1ecc6299db9ec823/rayon-1.5.1/src/iter/plumbing/mod.rs:110:9
  19: rayon::iter::plumbing::bridge_producer_consumer::helper
             at /home/gsaurel/.cargo/registry/src/github.com-1ecc6299db9ec823/rayon-1.5.1/src/iter/plumbing/mod.rs:438:13
  20: rayon::iter::plumbing::bridge_producer_consumer::helper::{{closure}}
             at /home/gsaurel/.cargo/registry/src/github.com-1ecc6299db9ec823/rayon-1.5.1/src/iter/plumbing/mod.rs:427:21
  21: rayon_core::join::join_context::call_b::{{closure}}
             at /home/gsaurel/.cargo/registry/src/github.com-1ecc6299db9ec823/rayon-core-1.9.1/src/join/mod.rs:129:25
  22: rayon_core::job::StackJob::run_inline
             at /home/gsaurel/.cargo/registry/src/github.com-1ecc6299db9ec823/rayon-core-1.9.1/src/job.rs:97:9
  23: rayon_core::join::join_context::{{closure}}
             at /home/gsaurel/.cargo/registry/src/github.com-1ecc6299db9ec823/rayon-core-1.9.1/src/join/mod.rs:158:36
  24: rayon_core::registry::in_worker
             at /home/gsaurel/.cargo/registry/src/github.com-1ecc6299db9ec823/rayon-core-1.9.1/src/registry.rs:875:13
  25: rayon_core::join::join_context
             at /home/gsaurel/.cargo/registry/src/github.com-1ecc6299db9ec823/rayon-core-1.9.1/src/join/mod.rs:132:5
  26: rayon::iter::plumbing::bridge_producer_consumer::helper
             at /home/gsaurel/.cargo/registry/src/github.com-1ecc6299db9ec823/rayon-1.5.1/src/iter/plumbing/mod.rs:416:47
  27: rayon::iter::plumbing::bridge_producer_consumer::helper::{{closure}}
             at /home/gsaurel/.cargo/registry/src/github.com-1ecc6299db9ec823/rayon-1.5.1/src/iter/plumbing/mod.rs:427:21
  28: rayon_core::join::join_context::call_b::{{closure}}
             at /home/gsaurel/.cargo/registry/src/github.com-1ecc6299db9ec823/rayon-core-1.9.1/src/join/mod.rs:129:25
  29: rayon_core::job::StackJob::run_inline
             at /home/gsaurel/.cargo/registry/src/github.com-1ecc6299db9ec823/rayon-core-1.9.1/src/job.rs:97:9
  30: rayon_core::join::join_context::{{closure}}
             at /home/gsaurel/.cargo/registry/src/github.com-1ecc6299db9ec823/rayon-core-1.9.1/src/join/mod.rs:158:36
  31: rayon_core::registry::in_worker
             at /home/gsaurel/.cargo/registry/src/github.com-1ecc6299db9ec823/rayon-core-1.9.1/src/registry.rs:875:13
  32: rayon_core::join::join_context
             at /home/gsaurel/.cargo/registry/src/github.com-1ecc6299db9ec823/rayon-core-1.9.1/src/join/mod.rs:132:5
  33: rayon::iter::plumbing::bridge_producer_consumer::helper
             at /home/gsaurel/.cargo/registry/src/github.com-1ecc6299db9ec823/rayon-1.5.1/src/iter/plumbing/mod.rs:416:47
  34: rayon::iter::plumbing::bridge_producer_consumer::helper::{{closure}}
             at /home/gsaurel/.cargo/registry/src/github.com-1ecc6299db9ec823/rayon-1.5.1/src/iter/plumbing/mod.rs:427:21
  35: rayon_core::join::join_context::call_b::{{closure}}
             at /home/gsaurel/.cargo/registry/src/github.com-1ecc6299db9ec823/rayon-core-1.9.1/src/join/mod.rs:129:25
  36: rayon_core::job::StackJob::run_inline
             at /home/gsaurel/.cargo/registry/src/github.com-1ecc6299db9ec823/rayon-core-1.9.1/src/job.rs:97:9
  37: rayon_core::join::join_context::{{closure}}
             at /home/gsaurel/.cargo/registry/src/github.com-1ecc6299db9ec823/rayon-core-1.9.1/src/join/mod.rs:158:36
  38: rayon_core::registry::in_worker
             at /home/gsaurel/.cargo/registry/src/github.com-1ecc6299db9ec823/rayon-core-1.9.1/src/registry.rs:875:13
  39: rayon_core::join::join_context
             at /home/gsaurel/.cargo/registry/src/github.com-1ecc6299db9ec823/rayon-core-1.9.1/src/join/mod.rs:132:5
  40: rayon::iter::plumbing::bridge_producer_consumer::helper
             at /home/gsaurel/.cargo/registry/src/github.com-1ecc6299db9ec823/rayon-1.5.1/src/iter/plumbing/mod.rs:416:47
  41: rayon::iter::plumbing::bridge_producer_consumer::helper::{{closure}}
             at /home/gsaurel/.cargo/registry/src/github.com-1ecc6299db9ec823/rayon-1.5.1/src/iter/plumbing/mod.rs:418:21
  42: rayon_core::join::join_context::call_a::{{closure}}
             at /home/gsaurel/.cargo/registry/src/github.com-1ecc6299db9ec823/rayon-core-1.9.1/src/join/mod.rs:124:17
  43:  as core::ops::function::FnOnce<()>>::call_once
             at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/core/src/panic/unwind_safe.rs:271:9
  44: std::panicking::try::do_call
             at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/std/src/panicking.rs:406:40
  45: __rust_try
  46: std::panicking::try
             at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/std/src/panicking.rs:370:19
  47: std::panic::catch_unwind
             at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/std/src/panic.rs:133:14
  48: rayon_core::unwind::halt_unwinding
             at /home/gsaurel/.cargo/registry/src/github.com-1ecc6299db9ec823/rayon-core-1.9.1/src/unwind.rs:17:5
  49: rayon_core::join::join_context::{{closure}}
             at /home/gsaurel/.cargo/registry/src/github.com-1ecc6299db9ec823/rayon-core-1.9.1/src/join/mod.rs:141:24
  50: rayon_core::registry::in_worker
             at /home/gsaurel/.cargo/registry/src/github.com-1ecc6299db9ec823/rayon-core-1.9.1/src/registry.rs:875:13
  51: rayon_core::join::join_context
             at /home/gsaurel/.cargo/registry/src/github.com-1ecc6299db9ec823/rayon-core-1.9.1/src/join/mod.rs:132:5
  52: rayon::iter::plumbing::bridge_producer_consumer::helper
             at /home/gsaurel/.cargo/registry/src/github.com-1ecc6299db9ec823/rayon-1.5.1/src/iter/plumbing/mod.rs:416:47
  53: rayon::iter::plumbing::bridge_producer_consumer::helper::{{closure}}
             at /home/gsaurel/.cargo/registry/src/github.com-1ecc6299db9ec823/rayon-1.5.1/src/iter/plumbing/mod.rs:427:21
  54: rayon_core::join::join_context::call_b::{{closure}}
             at /home/gsaurel/.cargo/registry/src/github.com-1ecc6299db9ec823/rayon-core-1.9.1/src/join/mod.rs:129:25
  55: rayon_core::job::StackJob::run_inline
             at /home/gsaurel/.cargo/registry/src/github.com-1ecc6299db9ec823/rayon-core-1.9.1/src/job.rs:97:9
  56: rayon_core::join::join_context::{{closure}}
             at /home/gsaurel/.cargo/registry/src/github.com-1ecc6299db9ec823/rayon-core-1.9.1/src/join/mod.rs:158:36
  57: rayon_core::registry::in_worker
             at /home/gsaurel/.cargo/registry/src/github.com-1ecc6299db9ec823/rayon-core-1.9.1/src/registry.rs:875:13
  58: rayon_core::join::join_context
             at /home/gsaurel/.cargo/registry/src/github.com-1ecc6299db9ec823/rayon-core-1.9.1/src/join/mod.rs:132:5
  59: rayon::iter::plumbing::bridge_producer_consumer::helper
             at /home/gsaurel/.cargo/registry/src/github.com-1ecc6299db9ec823/rayon-1.5.1/src/iter/plumbing/mod.rs:416:47
  60: rayon::iter::plumbing::bridge_producer_consumer::helper::{{closure}}
             at /home/gsaurel/.cargo/registry/src/github.com-1ecc6299db9ec823/rayon-1.5.1/src/iter/plumbing/mod.rs:427:21
  61: rayon_core::join::join_context::call_b::{{closure}}
             at /home/gsaurel/.cargo/registry/src/github.com-1ecc6299db9ec823/rayon-core-1.9.1/src/join/mod.rs:129:25
  62:  as rayon_core::job::Job>::execute::call::{{closure}}
             at /home/gsaurel/.cargo/registry/src/github.com-1ecc6299db9ec823/rayon-core-1.9.1/src/job.rs:113:21
  63:  as core::ops::function::FnOnce<()>>::call_once
             at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/core/src/panic/unwind_safe.rs:271:9
  64: std::panicking::try::do_call
             at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/std/src/panicking.rs:406:40
  65: __rust_try
  66: std::panicking::try
             at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/std/src/panicking.rs:370:19
  67: std::panic::catch_unwind
             at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/std/src/panic.rs:133:14
  68: rayon_core::unwind::halt_unwinding
             at /home/gsaurel/.cargo/registry/src/github.com-1ecc6299db9ec823/rayon-core-1.9.1/src/unwind.rs:17:5
  69:  as rayon_core::job::Job>::execute
             at /home/gsaurel/.cargo/registry/src/github.com-1ecc6299db9ec823/rayon-core-1.9.1/src/job.rs:119:38
  70: rayon_core::job::JobRef::execute
             at /home/gsaurel/.cargo/registry/src/github.com-1ecc6299db9ec823/rayon-core-1.9.1/src/job.rs:59:9
  71: rayon_core::registry::WorkerThread::execute
             at /home/gsaurel/.cargo/registry/src/github.com-1ecc6299db9ec823/rayon-core-1.9.1/src/registry.rs:749:9
  72: rayon_core::registry::WorkerThread::wait_until_cold
             at /home/gsaurel/.cargo/registry/src/github.com-1ecc6299db9ec823/rayon-core-1.9.1/src/registry.rs:726:17
  73: rayon_core::registry::WorkerThread::wait_until
             at /home/gsaurel/.cargo/registry/src/github.com-1ecc6299db9ec823/rayon-core-1.9.1/src/registry.rs:700:13
  74: rayon_core::join::join_context::{{closure}}
             at /home/gsaurel/.cargo/registry/src/github.com-1ecc6299db9ec823/rayon-core-1.9.1/src/join/mod.rs:166:17
  75: rayon_core::registry::in_worker
             at /home/gsaurel/.cargo/registry/src/github.com-1ecc6299db9ec823/rayon-core-1.9.1/src/registry.rs:875:13
  76: rayon_core::join::join_context
             at /home/gsaurel/.cargo/registry/src/github.com-1ecc6299db9ec823/rayon-core-1.9.1/src/join/mod.rs:132:5
  77: rayon::iter::plumbing::bridge_producer_consumer::helper
             at /home/gsaurel/.cargo/registry/src/github.com-1ecc6299db9ec823/rayon-1.5.1/src/iter/plumbing/mod.rs:416:47
  78: rayon::iter::plumbing::bridge_producer_consumer::helper::{{closure}}
             at /home/gsaurel/.cargo/registry/src/github.com-1ecc6299db9ec823/rayon-1.5.1/src/iter/plumbing/mod.rs:418:21
  79: rayon_core::join::join_context::call_a::{{closure}}
             at /home/gsaurel/.cargo/registry/src/github.com-1ecc6299db9ec823/rayon-core-1.9.1/src/join/mod.rs:124:17
  80:  as core::ops::function::FnOnce<()>>::call_once
             at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/core/src/panic/unwind_safe.rs:271:9
  81: std::panicking::try::do_call
             at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/std/src/panicking.rs:406:40
  82: __rust_try
  83: std::panicking::try
             at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/std/src/panicking.rs:370:19
  84: std::panic::catch_unwind
             at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/std/src/panic.rs:133:14
  85: rayon_core::unwind::halt_unwinding
             at /home/gsaurel/.cargo/registry/src/github.com-1ecc6299db9ec823/rayon-core-1.9.1/src/unwind.rs:17:5
  86: rayon_core::join::join_context::{{closure}}
             at /home/gsaurel/.cargo/registry/src/github.com-1ecc6299db9ec823/rayon-core-1.9.1/src/join/mod.rs:141:24
  87: rayon_core::registry::in_worker
             at /home/gsaurel/.cargo/registry/src/github.com-1ecc6299db9ec823/rayon-core-1.9.1/src/registry.rs:875:13
  88: rayon_core::join::join_context
             at /home/gsaurel/.cargo/registry/src/github.com-1ecc6299db9ec823/rayon-core-1.9.1/src/join/mod.rs:132:5
  89: rayon::iter::plumbing::bridge_producer_consumer::helper
             at /home/gsaurel/.cargo/registry/src/github.com-1ecc6299db9ec823/rayon-1.5.1/src/iter/plumbing/mod.rs:416:47
  90: rayon::iter::plumbing::bridge_producer_consumer::helper::{{closure}}
             at /home/gsaurel/.cargo/registry/src/github.com-1ecc6299db9ec823/rayon-1.5.1/src/iter/plumbing/mod.rs:427:21
  91: rayon_core::join::join_context::call_b::{{closure}}
             at /home/gsaurel/.cargo/registry/src/github.com-1ecc6299db9ec823/rayon-core-1.9.1/src/join/mod.rs:129:25
  92:  as rayon_core::job::Job>::execute::call::{{closure}}
             at /home/gsaurel/.cargo/registry/src/github.com-1ecc6299db9ec823/rayon-core-1.9.1/src/job.rs:113:21
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
l4l commented 2 years ago

Ehm, that one looks fairly strange. I can see allsorts_no_std still present, so I guess it's not the issue. Also, yofi isn't intended to work in no_std environment, so no-std misuse should not be a problem. Perhaps alloc-stdlib for brotli-decompressor is sufficient?

l4l commented 2 years ago

Fixed in #114 anyway thanks for a hint that was helpful