Skip to content
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

Implement RFC 47 (Serialise signature) #2272

Merged
merged 1 commit into from
Oct 18, 2017

Conversation

Praetonus
Copy link
Member

This change implements deterministic package and program signatures based on the contents and dependencies of the packages. Signatures are computed by hashing the serialised package ASTs with the BLAKE2 hash function. This hash function was chosen for its good speed and low collision rate.

The signature computation handles circular dependencies by computing signatures per package cycle instead of per package. Packages in the same group are discriminated by a group index.

In order to allow deterministic signatures, file parsing order is now always alphabetical inside of a package.

The compiler now outputs the package groups and dependencies when the -V3 or -V4 flags are enabled.

Signatures will be used for future work on separate package compilation in order to validate package identities.

Closes #2147.

@Praetonus Praetonus added the changelog - added Automatically add "Added" CHANGELOG entry on merge label Oct 11, 2017
@Theodus
Copy link
Contributor

Theodus commented Oct 11, 2017

appveyor failure:

c:\projects\ponyc\src\libponyc\pkg\program.c(7): fatal error C1083: Cannot open include file: 'blake2.h': No such file or directory

@Praetonus
Copy link
Member Author

Looks like I forgot to make the relevant edits to wscript.

@Praetonus Praetonus force-pushed the package-signature branch 2 times, most recently from 33992c2 to 7d5a9f2 Compare October 12, 2017 15:22
This change implements deterministic package and program signatures
based on the contents and dependencies of the packages. Signatures are
computed by hashing the serialised package ASTs with the BLAKE2 hash
function. This hash function was chosen for its good speed and low
collision rate.

The signature computation handles circular dependencies by computing
signatures per package cycle instead of per package. Packages in the
same group are discriminated by a group index.

In order to allow deterministic signatures, file parsing order is now
always alphabetical inside of a package.

The compiler now outputs the package groups and dependencies when the
`-V3` or `-V4` flags are enabled.

Signatures will be used for future work on separate package compilation
in order to validate package identities.

Closes ponylang#2147.
@SeanTAllen SeanTAllen merged commit 087c1c4 into ponylang:master Oct 18, 2017
ponylang-main added a commit that referenced this pull request Oct 18, 2017
@Praetonus Praetonus deleted the package-signature branch October 18, 2017 19:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog - added Automatically add "Added" CHANGELOG entry on merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants