Skip to content

Expose the hash of a given target #8445

@ns-cweber

Description

@ns-cweber

This has come up several times for our team, but it would be nice to have access to the hash of a given target. Most recently, we're building PEX files with pants and then dropping them into Docker Images--we'd like to tag the Docker Image with the hash of the PEX's inputs so our deploy pipeline will see that the image tags are the same and not trigger a redeploy.

We could hash the PEX file, but then we're at the mercy of pants to produce exactly (bit for bit) the same PEX file with each build. Admittedly, a shared cache probably makes this mostly an academic concern.

I'm not familiar with pants internals, but ideally this would be agnostic to the type of target--the same use case could easily apply to Node or Go images as for Python.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions