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

Make the npm steps roundtrip serializable #2135

Merged
merged 8 commits into from
May 29, 2024
Merged

Make the npm steps roundtrip serializable #2135

merged 8 commits into from
May 29, 2024

Conversation

nedtwigg
Copy link
Member

@nedtwigg nedtwigg commented May 24, 2024

  • These aren't done yet, but it's close. The gist is that I think these are likely going to implement FormatterStep themselves, no Formatter.createLazy. I think this should be the last PR needed for Support Gradle configuration cache on multiple JVMs  #1274. Too sleepy to finish right now, I'll get back to it...

@nedtwigg
Copy link
Member Author

@simschla Just FYI, to support Gradle's configuration cache, we now have a separate FileSignature and FileSignature.Promised. The deal is that .Promised can roundtrip through serialization losslessly, and then FileSignature has the path-independent equality semantics but it can't roundtrip losslessly.

When you create a FormatterStep, you can now choose between implementing FormatterStep from scratch, or you can provide two separate states - one that gets roundtripped through serialization for configuration cache, and another which is used for equality checks.

In this PR I hacked up the NPM steps by removing all the transient fields so that the steps all work again. The only asterisk is that if you change the contents of a configuration file, these steps will not mark themselves as changed at the moment. I'm tracking that issue in #2140.

@nedtwigg nedtwigg changed the base branch from feat/all-stragglers-except-npm to feat/kill-never-up-to-date-step May 29, 2024 17:42
Base automatically changed from feat/kill-never-up-to-date-step to main May 29, 2024 17:54
@nedtwigg nedtwigg merged commit e9962c5 into main May 29, 2024
21 checks passed
@nedtwigg nedtwigg deleted the feat/npm-refactor branch May 29, 2024 17:57
@simschla
Copy link
Contributor

@simschla Just FYI, to support Gradle's configuration cache, we now have a separate FileSignature and FileSignature.Promised. The deal is that .Promised can roundtrip through serialization losslessly, and then FileSignature has the path-independent equality semantics but it can't roundtrip losslessly.

When you create a FormatterStep, you can now choose between implementing FormatterStep from scratch, or you can provide two separate states - one that gets roundtripped through serialization for configuration cache, and another which is used for equality checks.

In this PR I hacked up the NPM steps by removing all the transient fields so that the steps all work again. The only asterisk is that if you change the contents of a configuration file, these steps will not mark themselves as changed at the moment. I'm tracking that issue in #2140.

Thank you for the heads-up. I'll look into #2140 as soon as time permits!

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