Skip to content

Dealing with rust-lang/rust-bindgen and cargo-dist #145

Open

Description

@hashcatHitman

Similarly to #139, rust-lang/rust-bindgen has generated workflows. Namely, rust-lang/rust-bindgen/.github/workflows/release.yml@bb8bd1b is generated by cargo-dist.

Dealing with this would require migrating away from cargo-dist or sending patches upstream, which may be nontrivial (I haven't checked yet). It looks like they may be open to such patches upstream, as they've been fixed before (see: axodotdev/cargo-dist#2133). That said, issues of the same nature have been open for a few months now, so it seems like it may be a "if you want it done, do it yourself" situation (see: axodotdev/cargo-dist#2320). Which is fair and reasonable, but maybe in that case we'd be better off trying to migrate away from cargo-dist anyway, so we aren't relying on upstream patches being accepted and released to fix issues with CI.

I'm assigning this to myself, but input/help is welcome. Maybe upstream patches aren't too difficult to get done? We'll see.

Activity

  1. self-assigned this
    on Nov 4, 2026
  2. ubiratansoares commented on Nov 9, 2026

    @ubiratansoares
    Contributor

    Patching these templates upstream should be the way go.

    If you are willing to send a few patches, it's worth considering how to extend their CI suite in way to catch zizmor regressions, e.g. having a new Job that every PR generates the GHA dist Worklow and also runs zizmor against it. Just an idea.

  3. hashcatHitman commented on Nov 9, 2026

    @hashcatHitman
    MemberAuthor

    I think that sounds pretty reasonable, yeah. The question is what level of "zizmor support" would be accepted, if any. For our needs, they'd need to consider pedantic or higher, but they may be hesitant to provide support at all, especially if it later leads to others wanting auditor support.

    They specify to open an issue before doing anything in their CONTRIBUTING.md, so I'll open an issue and we'll see where it goes from there.

  4. hashcatHitman commented on Nov 12, 2026

    @hashcatHitman
    MemberAuthor

    In axodotdev/cargo-dist#2576, we got zizmor integrated into the test suite and CI. Similar to what we do here with crabwatch, there is a zizmor config file which disables all the lints that currently do not pass. It should be possible to incrementally (and concurrently) work on this, so feel free to help out.

    As per some discussion on the PR, we're skipping unpinned-uses for now, potentially to be revisited later. I'm currently looking into dealing with excessive-permissions and undocumented-permissions, which I fear (though I'm not yet certain) may require significant refactoring to do properly (on top of already being one of the hardest to address, IMO, and only getting worse... (#t-infra/crabwatch > `excessive-permissions` may become more difficult to fix)).

    I suspect we will want to skip concurrency-limits for similar reasons to why release-plz does.

    Since the whole point of these workflows is producing and shipping artifacts, I suspect that the only correct way to address cache-poisoning will be to remove caching entirely, which may be controversial.

    unpinned-images will probably also be skipped for reasons similar to unpinned-uses, but I'm not yet sure if cargo-dist provides a mechanism that allows end-users to cleanly resolve this themselves (unlike unpinned-images). If it doesn't it would be good to add such a mechanism.

    I'm not sure what the deal with use-trusted-publishing is yet. I suspect cargo-dist does support using trusted publishing, but I haven't confirmed. rust-lang/rust-bindgen#3517 seems to suggest it is possible, but non-trivial. Regardless of whether it does or doesn't, I suspect there will be no desire to require it, so this probably can't be "completely solved".

    anonymous-definition and template-injection will (hopefully) be fairly trivial to address.

    I don't think I've ever had to deal with secrets-inherit before, so I'm not sure what to expect there, yet.

  5. ubiratansoares commented on Nov 12, 2026

    @ubiratansoares
    Contributor

    I don't get this, but maybe I'm not too used to cargo-dist:

    Since the whole point of these workflows is producing and shipping artifacts, I suspect that the only correct way to address cache-poisoning will be to remove caching entirely, which may be controversial.

    Which actions cache-poisoning flags in the generated workflows?

  6. hashcatHitman commented on Nov 12, 2026

    @hashcatHitman
    MemberAuthor

    Which actions cache-poisoning flags in the generated workflows?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

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