Stream: git-wasmtime

Topic: wasmtime / issue #8477 The additional_derives option on b...


view this post on Zulip Wasmtime GitHub notifications bot (Apr 25 2024 at 19:54):

alec-deason opened issue #8477:

#8441 recently added support for additional_derives in wasmtime::component::bindgen but the new version appears not to apply the derives to all types. In particular it seems to miss variants which are only used as fields in records, as in this definition:

package test:bindgen-test;

interface types {
    variant inner-variant {
        a,
        b,
        c
    }
    record outer-record{
        inner: inner-variant
    }
}

world bindgen-test {
    use types.{outer-record};
    export test-failure: func() -> outer-record;
}

In my testing the derives will be applied to OuterRecord but not to InnerVariant.

Attached is a complete test case which fails to compile.
bindgen_case.tgz

view this post on Zulip Wasmtime GitHub notifications bot (Apr 25 2024 at 23:46):

fibonacci1729 commented on issue #8477:

@alec-deason Sorry about that! I added the fix in #8482.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 26 2024 at 00:26):

alexcrichton closed issue #8477:

#8441 recently added support for additional_derives in wasmtime::component::bindgen but the new version appears not to apply the derives to all types. In particular it seems to miss variants which are only used as fields in records, as in this definition:

package test:bindgen-test;

interface types {
    variant inner-variant {
        a,
        b,
        c
    }
    record outer-record{
        inner: inner-variant
    }
}

world bindgen-test {
    use types.{outer-record};
    export test-failure: func() -> outer-record;
}

In my testing the derives will be applied to OuterRecord but not to InnerVariant.

Attached is a complete test case which fails to compile.
bindgen_case.tgz


Last updated: Dec 23 2024 at 13:07 UTC