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

RFC: rpc-autogen: module for haskell bindings #1407

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

eric-ch
Copy link
Contributor

@eric-ch eric-ch commented Jun 15, 2021

Provide generated Haskell bindings as a cabal module. The bindings were generated and versioned using dbus-gen, then are provided by the rpc-autogen recipe.

This makes it easier to track changes across versions and avoid depending on generated sources in-tree for the haskell components.

The goal of this is to provide a reasonably easy to modify alternative to rpcgen that could still, with low efforts, target different languages.

To avoid changes in existing Haskell projects the module names have been preserved. Changes to the cabal configuration is still necessary though. The GHC 6 dependent projects being the main consumer of the generated bindings, these were targeted first. As, given the age of the runtime, they are the most likely to become a target for replacement.

In this current implementation, only haskell bindings are generated by dbus-gen, the other generated bindings (for OCaml, C and JavaScript) still rely on rpcgen.

Dependencies:

External dependencies:

Provide generated Haskell bindings as a cabal module[1]
The bindings were generated and versioned using dbus-gen[2], then are
provided by the rpc-autogen recipe.
This makes it easier to track changes across versions and avoid
depending on generated sources in-tree for the haskell components.

The goal of this is to provide a reasonably easy to modify alternative
to rpcgen that could still with low efforts target different languages.

In this current implementation, only haskell is generated by dbus-gen,
the other generated bindings (for OCaml, C and JavaScript) still rely on
rpcgen.

Signed-off-by: Eric Chanudet <[email protected]>

[1] https://github.com/eric-ch/dbus-gen-bindings
[2] https://github.com/eric-ch/dbus-gen/tree/haskell-bindings
@dpsmith
Copy link
Member

dpsmith commented Jun 15, 2021

Big +1 on the approach. While the bindings generation may not be a significant contributor to full build time, every bit helps. This is also is very useful for development, in particular external development.

@eric-ch
Copy link
Contributor Author

eric-ch commented Jun 16, 2021

Some clarifications:

  • The content of dbus-gen-bindings is the output of openxt-haskell-stubs.sh against the currently OpenXT provided IDLs and the ones provided with NetworkManager 1.18.4, with matching nm-applet.
  • The bindings generated are intended to be semantically identical to the ones generated by rpcgen. Yet, the indentation and some expressions do not match, which will generate diff noise if compared as such.

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