Skip to content

Conversation

HT154
Copy link
Contributor

@HT154 HT154 commented Sep 12, 2025

This PR is composed of two commits: the first adds the new functionality, the second regenerates all changed snippet outputs. Please review just the first commit.

Implements SPICE-0021

Resolves #994

@HT154 HT154 force-pushed the binary-renderer branch 4 times, most recently from b7285fb to bee69cc Compare September 12, 2025 23:11
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This PR extracts String-specific functionality to a new AbstractStringRenderer subclass so that binary renderers can still benefit from the converter logic here in AbstractRenderer. This is a breaking change for any out-of-tree inheritors from AbstractRenderer but the fix is as simple as s/AbstractRenderer/AbstractStringRenderer/g.

Comment on lines 60 to 61
return new PklBinaryDecoder(
unpacker, new Importer(module.getVmClass().getPClassInfo().getModuleUri()))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the piece I'm least confident in. Currently, the parser API requires users to supply a module as context. This module value is used to determine the URI of the "importing" module passed to SecurityManager.checkImportModule. Ideally this would be derived automatically from the call stack, but I'm unsure how to do that. I also see some utility to allowing callers to set this explicitly, eg. in cases where the parse happens inside a module in some package (which would in turn need to accept the context parameter from its caller).

@HT154 HT154 force-pushed the binary-renderer branch 5 times, most recently from 4b9a4a2 to 3a9b196 Compare September 17, 2025 21:14
@HT154 HT154 marked this pull request as ready for review September 17, 2025 22:20
@HT154 HT154 changed the title Implement Pkl binary renderer and parser SPICE-0021 Implement Pkl binary renderer and parser Sep 17, 2025
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.

Binary renderer/parser for Pkl
1 participant