Skip to content

Don't create a dependencies WIT file if there are no dependencies #3439

@itowlson

Description

@itowlson

spin build currently always creates a spin-dependencies.wit. The idea was that this would allow us to have bindings generation in the templates in the simplest way possible.

However, the downside is that it turns out to be what software experts call "butt ugly." You're not using dependencies but suddenly every single project in your app has one of these turd-like empty files. Maybe it's not so annoying in a big project but for smaller projects it's a lot - and even in big projects devs get very protective over "stupid tools putting crap I didn't ask for in my code folder".

Image

So I'd like to change the logic so that, if there are no dependencies, the spin-dependencies.wit is not created (or is deleted).

The downside of this is that it requires additional logic in the templates / binding generators to handle the case where the file doesn't exist. This could be done with a SDK macro in Rust; in other languages, it might need more logic in the build script (e.g. the npm task), and we'd want to be confident we could do this in a cross-platform way.

Thoughts?

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