Are there plans to have an option for jextract to create an optimized binding?

Maurizio Cimadamore maurizio.cimadamore at oracle.com
Thu Mar 9 11:18:05 UTC 2023


Hi Christoph,
note that jextract already supports a filtering mechanism. The basic 
usage is described here:

https://github.com/openjdk/jextract#filtering-symbols

That is:

1. you can run jextract in a way so that it dumps all the symbols it 
could find during its execution (--dump-includes=<filename>)
2. you can then edit the generated file, and drop all the symbols your 
application doesn't care about
3. you can pass the edited file back to jextract, as an "argfile" e.g. 
"@<filename>"

This will only generate bindings for the things you care about.

Hope this helps

Maurizio


On 09/03/2023 11:05, Christoph Läubrich wrote:
> Hi Panama Devs,
>
> I hope the mailinglist is the right place for such 
> questions/discussions/ideas, as the github repository has not enabled 
> Github-Discussions.
>
> jextract is doing a great work, but for some libs it produces a very 
> very large result ( ~ 3000 files or more), I therefore wonder if it 
> would be possible to have jextract passing some code (e.g. a jar) 
> using the binding and then it generates an optimized binding that only 
> contains the functions/constants that are actually used in the java code?
>
> thank in advance,
> Christoph


More information about the panama-dev mailing list