Skip to content
This repository has been archived by the owner on Nov 26, 2020. It is now read-only.

A generation mode for -sys crates #24

Closed
mzabaluev opened this issue Mar 9, 2015 · 7 comments
Closed

A generation mode for -sys crates #24

mzabaluev opened this issue Mar 9, 2015 · 7 comments
Assignees

Comments

@mzabaluev
Copy link
Member

A smaller goal than #1 is to implement the generation mode to produce just the sys crates, to stop manually editing the currently maintained -sys crates and enable generation of many more linkage crates from GIR.

A list of existing -sys crates that could benefit from this:

@gkoz
Copy link

gkoz commented Mar 10, 2015

To be clear, has any progress toward this goal been made so far?

@mzabaluev
Copy link
Member Author

There is an old branch, 'codegen', with some preliminary groundwork in Python reusing the parser and AST from gobject-introspection.

@gkoz
Copy link

gkoz commented Mar 31, 2015

Some observations after playing with GIR...
As mentioned in #1, typelibs alone are indeed inadequate for this purpose.

  • Platform-dependent integers are already resolved to specific fixed-width ones.
  • There are no version annotations so you need to process the definitions for each library version separately (extra fun with interdependencies expected).
  • Variadic functions are completely ignored! Good luck creating a simple message dialog.

I'm sure there's more. So even this smaller goal requires kludges, possibly some manual overlay definitions.

@mzabaluev
Copy link
Member Author

@gkoz GIR XML has none of those issues, and that is what I intend to use as the source format.

@gkoz
Copy link

gkoz commented Apr 2, 2015

Interesting. I've been making the XMLs out of typelibs assuming they're equivalent. I'll have to try generating them from sources then.

@gkoz
Copy link

gkoz commented Apr 2, 2015

You're right, the GIR definitions generated from source files are much more comprehensive, they should be workable.

@mzabaluev mzabaluev self-assigned this Oct 4, 2015
@mzabaluev
Copy link
Member Author

Development of the generator is underway in https://github.com/gi-rust/grust-gen.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants