Skip to content
This repository was archived by the owner on Jan 11, 2026. It is now read-only.
This repository was archived by the owner on Jan 11, 2026. It is now read-only.

Feature Request: include the code generated UML and dotfile in the generated code. #46

@andrew-otiv

Description

@andrew-otiv

I spent a few hours today unsuccessfully trying to integrate typestate-rs's UML generation into a bazel (or buck2) build.

The challenge is that the extra artifacts containing the UML or dotfile are generated at compile-time by the procedural macro code, but the starlark rules in rules_rust (and prelude for buck2) don't know anything about the extra build-time output. I tried forking or vendoring the rules and modifying them to declare the extra output, but this stuff is so complex I think it would take me days to get working.

Similarly, genrule doesn't have ~any of that logic needed to find the toolchain and build the rust binary. I tried to write a run_binary command that runs the "cargo expand" tool, but then I would need to build and include that tool too in my CICD environment, even if I ~could figure out how to get "run_binary" to find cargo (I couldn't).

I looked briefly at how the procedural macros work, but they're getting compiled to a .so file.

I think a possible way forward would be for typestate-rs to optionally include the UML (and dot) in the generated source file as a static string. Then I could make a build target that just outputs the UML when called, and call that from run_binary.

Anyway, appologies for the noise if nobody has interest in getting this particular feature of this particular library working in this particular build system; just wanted to share an experince. Most of my difficulty stems from being new to both bazel and procedural macros; typestate-rs is working as documented!

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