[foreign] RFC: Additional jextract filtering

Jorn Vernee jbvernee at xs4all.nl
Mon Mar 11 15:44:02 UTC 2019


Well, I tried changing the defaults to using the REQUIRED preset for 
structs, enums and typedefs, and this is making a bunch (11) of the 
tests fail, including TestJextractFFI, which is not a good sign imho. 
This seems to be happening because the root set computation can not deal 
with the pimpl/opaque pointer idiom.

But, let's go back to the underlying goal; we want to create jextract 
output with the least 'junk' possible. I'd say this is not the job of 
jextract, but the job of the library maintainer. The header file is the 
interface for using the library, so it should contain things that are 
all more or less required to use the library. I don't think we will have 
much success trying to 'outsmart' the writer of the header file. After 
all, jextract does it's filtering automatically, and the header file is 
carefully hand-crafted.

On the other hand, not everything makes sense to use from a Panama 
perspective, so we still need some escape hatch to filter out some stuff 
we can't use, or breaks the binder. But, we'd like to go about that 
disciplined, and make sure we don't filter out things that are required 
by other things, so we use a dependency set.

Thoughts?

Jorn

Maurizio Cimadamore schreef op 2019-03-11 16:12:
> On 11/03/2019 13:45, Jorn Vernee wrote:
>> I can separate the parts of the patch a little bit into; Filter 
>> refactor + root set compute, and then leave the option changes out of 
>> it. But those 2 alone do not affect the filtering, since the root set 
>> is only used when filtering non-symbol/macro elements.
> 
> I guess then what I'm suggesting is to automatically filter out
> elements not in the root set, and see how that works out.
> 
> Maurizio


More information about the panama-dev mailing list