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

Hygiene: Add MESSAGE_STORAGE. No leak Uint32/64 #91

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jonahbeckford
Copy link

@jonahbeckford jonahbeckford commented Nov 15, 2024

PENDING: I'm still editing this PR. I will remove this once done.

Three hygiene changes:

  • Expose module type MESSAGE_STORAGE which was used as a Capnp.Message.Make
    functor parameter but was previously hidden in Capnp__MessageStorage.S. (I say "hidden" because MessageStorage is not being exported by the capnp.ml wrapper, so a user has to hack into Dune internals to get access to the S module type.)
  • Stop leaking Uint32 and Uint64 in module types.
  • Expose ListStorageType. The Capnp.MessageSig.S is public (aka. part of wrapped capnp.ml) and has a ListStorage module. But ListStorage.t has a storage_type field of type Capnp.MessageSig.ListStorageType.t that was not public.

The first one is important since my MlFront analysis tool has a security posture that does not allow external access to double underscore (private) modules.

The second one is part of a broader issue that there are few .mli files in capnp-ocaml. That means unnecessary modules, types and values leak. This PR only addresses the one leak that is very visible to me.

The third one is similar to the first one.

Two hygiene changes:

- Expose module type `MESSAGE_STORAGE` which was used as a `Capnp.Message.Make`
  functor parameter but was previously hidden in `Capnp__MessageStorage.S`.
- Stop leaking `Uint32` and `Uint64` in module types.
@jonahbeckford jonahbeckford force-pushed the expose-public-types branch 2 times, most recently from 7e37b41 to 51e15f2 Compare November 15, 2024 22:09
Capnp.MessageSig.S is public (aka. part of wrapped capnp.ml), and has a ListStorage module.

But ListStorage.t has a storage_type field of type 'Capnp.MessageSig.ListStorageType.t' that is not public.

This commit makes ListStorageType public.
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.

1 participant