dtolnay / typetag

Serde serializable and deserializable trait objects
Apache License 2.0
1.19k stars 38 forks source link

Surprising test failure on FreeBSD #18

Closed pizzamig closed 5 years ago

pizzamig commented 5 years ago

Running cargo test on FreeBSD surprisingly fails. I say surprisingly, because I don't see operating system dependent section that can cause it. I guess, that deserialization is the problem. Here the output:

running 11 tests
test adjacently_tagged::test_json_serialize ... ok
test adjacently_tagged::test_bincode_round_trip ... FAILED
test adjacently_tagged::test_json_deserialize ... FAILED
test externally_tagged::test_bincode_round_trip ... FAILED
test externally_tagged::test_json_serialize ... ok
test externally_tagged::test_json_deserialize ... FAILED
test internally_tagged::test_json_serialize ... ok
test marker_traits::deserialize ... ok
test marker_traits::test_serialize ... ok
test internally_tagged::test_bincode_round_trip ... FAILED
test internally_tagged::test_json_deserialize ... FAILED

failures:

---- adjacently_tagged::test_bincode_round_trip stdout ----
thread 'adjacently_tagged::test_bincode_round_trip' panicked at 'called `Result::unwrap()` on an `Err` value: Custom("unknown variant `A`, there are no variants")', src/libcore/result.rs:999:5

---- adjacently_tagged::test_json_deserialize stdout ----
thread 'adjacently_tagged::test_json_deserialize' panicked at 'called `Result::unwrap()` on an `Err` value: Error("unknown variant `B`, there are no variants", line: 1, column: 11)', src/libcore/result.rs:999:5
note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.

---- externally_tagged::test_bincode_round_trip stdout ----
thread 'externally_tagged::test_bincode_round_trip' panicked at 'called `Result::unwrap()` on an `Err` value: Custom("unknown variant `A`, there are no variants")', src/libcore/result.rs:999:5

---- externally_tagged::test_json_deserialize stdout ----
thread 'externally_tagged::test_json_deserialize' panicked at 'called `Result::unwrap()` on an `Err` value: Error("unknown variant `B`, there are no variants", line: 1, column: 4)', src/libcore/result.rs:999:5

---- internally_tagged::test_bincode_round_trip stdout ----
thread 'internally_tagged::test_bincode_round_trip' panicked at 'called `Result::unwrap()` on an `Err` value: Custom("unknown variant `A`, there are no variants")', src/libcore/result.rs:999:5

---- internally_tagged::test_json_deserialize stdout ----
thread 'internally_tagged::test_json_deserialize' panicked at 'called `Result::unwrap()` on an `Err` value: Error("unknown variant `B`, there are no variants", line: 1, column: 11)', src/libcore/result.rs:999:5

Any idea why it's happening? I'd more than happy to contribute with a patch, but I don't know where to start.

pizzamig commented 5 years ago

I've found the crate OS dependant: ctor , used by inventory Once ctor has FreeBSD support, all tests are fine. I'll send a PR

pizzamig commented 5 years ago

The crate ctor has a new version (0.1.12) that fixed the issue, not tests are happy