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

[2.x] Replace Compilation Timestamp with content hashes #1430

Merged
merged 2 commits into from
Oct 6, 2024

Conversation

Friendseeker
Copy link
Member

@Friendseeker Friendseeker commented Oct 5, 2024

This PR replaces compilation timestamp used in detectAPIChanges with two types of content hashes. bytecodeHash computes content hash of all class files associated with a source file. extraBytecodeHash is a hash of all upstream classes's bytecodeHash, similar to #1388 (comment).

For a non-macro class, we employ bytecodeHash as a direct replacement of compilation timestamp.

For a macro class, there are cases for which the macro has same bytecodeHash after the macro is recompiled but the macro's upstream dependency is changed hence the macro expansion result would be different. Therefore if a class is macro we also compare by extraBytecodeHash to detect such change.

@Friendseeker Friendseeker changed the title [2.x] Replace Compilation Timestamp with content hash [2.x] Replace Compilation Timestamp with content hashes Oct 5, 2024
@eed3si9n eed3si9n merged commit c57ea64 into sbt:develop Oct 6, 2024
8 checks passed
@Friendseeker Friendseeker deleted the content-hashing branch October 6, 2024 06:06
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.

2 participants