Skip to content

Conversation

@Rylan12
Copy link
Member

@Rylan12 Rylan12 commented Jan 26, 2026

This is a cleaner attempt of #21429.

I've added serialize and deserialize methods to FormulaStruct to efficiently store formula data in JSON format. After the simplifications made in #21455, the code needed to accomplish this is pretty straightforward.

The goal is that the only special handling needed in FormulaStruct#serialize and FormulaStruct#deserialize is for cases where there is a simpler way to store the data than is needed by Formulary. At the moment, the only two customizations needed are:

  • bottle data: only need to store the relevant checksum (and can leave information like the bottle tag, cellar, and rebuild if they are the default values)
  • dependency/uses_from_macos information: deduplicate dependencies that are both stable and head deps by storing shared dependencies separately

I also added a handful of methods to Utils so they can, eventually, be used by CaskStruct. I've added tests for all of these methods.

@Rylan12 Rylan12 force-pushed the serialize-formula-structs branch from b36efc6 to 4742a6e Compare January 26, 2026 02:23
@Rylan12 Rylan12 force-pushed the extract-formula-struct-generator branch from 671bca4 to f91a070 Compare January 26, 2026 02:23
Copy link
Member

@MikeMcQuaid MikeMcQuaid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Good to merge when comments addressed.

@Rylan12 Rylan12 force-pushed the extract-formula-struct-generator branch 2 times, most recently from f552819 to 7f0c605 Compare January 26, 2026 15:23
@Rylan12 Rylan12 force-pushed the serialize-formula-structs branch from 4742a6e to 517a518 Compare January 26, 2026 15:23
Base automatically changed from extract-formula-struct-generator to main January 26, 2026 16:05
@Rylan12 Rylan12 force-pushed the serialize-formula-structs branch from 517a518 to 59813a2 Compare January 26, 2026 16:18
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