Skip to content

build.rs support for cargo-component #407

@ryankurte

Description

@ryankurte

hi folks,

playing with building wasm components and it seems the current approach requires one to run cargo component bindings to generate a src/bindings.rs file, which then has to be committed into the repository for whatever component (and re-committed on any changes).

a more common/rusty way to do this that avoids generated files being included in the source tree would be to invoke the binding generation from build.rs then import the generated bindings (like bindgen does).

have you considered supporting this approach? i see adding build.rs support was discussed in #362 but not actioned. it seems like generating the bindings from build.rs should be straightforward, then cargo component would need to pick up a flag or something to say that it shouldn't generate bindings itself.

cheers,

ryan

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions