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

thread main panicked at called Option::unwrap() ... github.com-1ecc6299db9ec823/tree_magic_mini-3.0.3 #378

Closed
spital opened this issue Sep 19, 2022 · 5 comments

Comments

@spital
Copy link

spital commented Sep 19, 2022

Thanks for reporting a bug! Please include all of the following:

(1) A description of the issue. A screenshot is often helpful too.

thread 'main' panicked at 'called Option::unwrap() on a None value', ..../.cargo/registry/src/github.com-1ecc6299db9ec823/tree_magic_mini-3.0.3/src/fdo_magic/builtin/init.rs:26:34
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

or

'files::tests::test_null_bytes_are_binary' panicked at 'called Option::unwrap() on a None value', ..../.cargo/registry/src/github.com-1ecc6299db9ec823/tree_magic_mini-3.0.3/src/fdo_magic/builtin/init.rs:26:34

(2) A copy of what you're diffing. If you're diffing files, include
the before and after files. If you're using difftastic with a VCS
repository (e.g. git), include the URL and commit hash.

anything, even same files

(3) The version of difftastic you're using (see difft --version) and
your operating system.

0.35 local build or master local build or downloaded and unpacked latest v0.36.1

No idea what might be the problem, rustc 1.63.0 (Fedora 1.63.0-1.fc35)

cargo generate-lockfile; cargo clean; cargo test
# test files::tests::test_null_bytes_are_binary ... FAILED and next 2 as well

Workaround: tree_magic_mini = "2.0.0" in Cargo.toml (not 3.0.0, 3.0.1, 3.0.2, 3.0.3)

@Wilfred
Copy link
Owner

Wilfred commented Oct 9, 2022

Sounds like mbrubeck/tree_magic#12 where it's crashing on blank lines in the local MIME database.

@mbrubeck
Copy link

Sorry for the delay; this bug is now fixed upstream in tree_magic_mini 3.1.2.

@Wilfred
Copy link
Owner

Wilfred commented Mar 15, 2024

@mbrubeck thank you :)

@Wilfred
Copy link
Owner

Wilfred commented Mar 15, 2024

@mbrubeck FWIW tree_magic_mini 3.1.3 doesn't compile, at least on rust 1.65:

error[E0446]: private type `MagicRule<'_>` in public interface
   --> /home/wilfred/.cargo/registry/src/github.com-1ecc6299db9ec823/tree_magic_mini-3.1.3/src/fdo_magic/ruleset.rs:113:1
    |
113 | / pub fn from_multiple(
114 | |     files: &[Vec<u8>],
115 | | ) -> Result<FnvHashMap<&str, DiGraph<MagicRule<'_>, u32>>, String> {
    | |__________________________________________________________________^ can't leak private type
    |
   ::: /home/wilfred/.cargo/registry/src/github.com-1ecc6299db9ec823/tree_magic_mini-3.1.3/src/fdo_magic/mod.rs:6:1
    |
6   |   struct MagicRule<'a> {
    |   -------------------- `MagicRule<'_>` declared as private

@mbrubeck
Copy link

FWIW tree_magic_mini 3.1.3 doesn't compile, at least on rust 1.65

Oops, it looks like I accidentally depended on rust-lang/rust#113126 which requires Rust 1.74 or newer. Fixed in tree_magic_mini 3.1.4.

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

3 participants