CodeChain-io/intertrait

Not running with Rust 1.56.0

Closed this issue · 10 comments

I tried to run all tests with rust 1.56.0, and they fail.

Rust 1.55.0 works fine.

@beoboo first of all, thank you for checking it out w/ the new Rust release. But when I just tried to run all of the tests in intertrait, it compiles well and all of the tests pass just fine at least under WSL2 on Windows 10 w/ Rust 1.56.0. Could you elaborate more on what's wrong w/ the new Rust release?

I'm using it in a Mac with Catalina, It compiles fine but 10 out of 25 tests fail. The failures are on

failures: tests::cast_arc tests::cast_arc_from_any tests::cast_box tests::cast_box_from_any tests::cast_mut tests::cast_mut_from_any tests::cast_rc tests::cast_rc_from_any tests::cast_ref tests::cast_ref_from_any tests::impls_arc tests::impls_box tests::impls_mut tests::impls_rc tests::impls_ref

and, for example, the first failure is

---- tests::cast_box stdout ---- thread 'tests::cast_box' panicked at 'assertion failed: debug.is_ok()', src/lib.rs:340:9

If I can I'll try also the nightly build.

It doesn't work also with the latest nightly. Is there anything I can try?

I found that in v1.55 the length of the CASTER_MAP during tests is 1, while in v1.56 is 0. This is why it doesn't find any castable type. Continuining the investigation...

If I understooìd that correctlly, it's linkme that's failing on this call

And this seems the related issue: dtolnay/linkme#41 (failing exactly in the same spots, still unsolved).

@beoboo many thanks to your effort. Yes, linkme may behave differently on different platforms. I'll take a look at it.

@beoboo as you might expect, there's virtually nothing I can do w/o the relevant fix from linkme side, and it doesn't seem coming soon. If you feel there should be an option to work around the problem, I can either:

  1. Add a way of registering the generated casters manually
  2. Add an option to use an alternative mechanism such as inventory that works different from linkme

It would be best to come up w/ a solution not relying on such a platform specific hack, but due to the way intertrait works, I couldn't reach such a solution yet.

@dynaxis thanks a lot, I think adding the manual registration could improve the project in terms of testability/debuggability, and would work as a workaround for now (until linkme is fixed).

The relevant problem in linkme has been fixed and released as part of 0.2.9. So I'm closing this issue as resolved, but will try to add manual registrations of casters soon. Recently I couldn't spare any time to devote to the relevant work.