Skip to content

New command: zig pkg hash #15326

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

DraagrenKirneh
Copy link
Contributor

This PR implements a new package command zig pkg hash which output the package hash the current directory.
Although not directly described as a command to be implemented in #14288 I found it useful to have this command when implementing other package manager stuff, and can see a good use case for including this for user pre/post validating of uploads/downloads of packages later on.

The command will check if either build.zig or build.zig.zon is present or the override flag "--allow-directory" before starting to hash to limit accidental trying to hash a large directory structure by using the command at the wrong place.

It uses a crude directory exclusions of the most common directories not part of a package as #14311 is not implemented yet.

@andrewrk andrewrk force-pushed the feature/hash-package-command branch from 0c76561 to a395e6f Compare July 24, 2023 21:41
@andrewrk
Copy link
Member

Closing:

I suggest to revisit this once that prerequisite issue is solved.

We should definitely not duplicate the hash logic. That's just asking for trouble.

@andrewrk andrewrk closed this Jul 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants