[foreign] RFR 8212049: Improve jextract usability
Henry Jen
henry.jen at oracle.com
Thu Oct 11 16:37:14 UTC 2018
Absolutely, didn’t see Sundar already mentioned it.
Regarding to system header, the comment still said exclude system headers. As the code now include system headers in the same package(i.e extra headers included by the main header in the same folder or subfolder), you probably want to remove that comment at line Contex.javat:367.
Other than that, +1 for the patch.
For sake of continuing development regarding include, your approach works nicely if the package is in a self-contained folder, like /usr/include/python. It was like that before, but that would blur the boundary if the source header file is directly put in somewhere like /usr/include.
I sent out a patch to enable include system headers explicitly, and throw NoSuchMethodException at runtime for missing symbols.
http://mail.openjdk.java.net/pipermail/panama-dev/2018-August/002425.html
With your patch, symbol checker will exclude missing symbols, which is good. However, we probably still need the binder in case -l is not used during extract to enable symbol checker.
Cheers,
Henry
> On Oct 11, 2018, at 9:01 AM, Maurizio Cimadamore <maurizio.cimadamore at oracle.com> wrote:
>
> Does the --infer-rpath option address your conern?
>
> Maurizio
>
>
> On 11/10/18 16:35, Henry Jen wrote:
>> It’s good, with a nitpick. I prefer to have separate option to infer rpath instead of —rpath=auto. It’s just a matter not to impost unnecessary limitation. Who knows if user like to have a folder named auto.
>>
>> Cheers,
>> Henry
>>
>>
>>> On Oct 11, 2018, at 8:37 AM, Sundararajan Athijegannathan <sundararajan.athijegannathan at oracle.com> wrote:
>>>
>>>
>>> All tests pass on Mac. Questions:
>>>
>>> * Do we need some escaped name for "auto"? something that can't occur in file system normally?
>>>
>>> Is the debug print leftover or help for debugging test? (JtregJextract driver)
>>>
>>> + System.err.println(jextrOpts);
>>>
>>>
>>> -Sundar
>>>
>>>
>>> On 11/10/18, 8:32 PM, Maurizio Cimadamore wrote:
>>>> Hi,
>>>> quoting from the JBS issue:
>>>>
>>>> "There are some low hanging fruits that could significantly improve usability of jextract:
>>>>
>>>> 1) auto excluding symbols not found with -l/-L
>>>> 2) inferring rpath from -L/-l (e.g. -rpath:auto)
>>>> 3) applying same header settings (e.g. rpath) to ALL headers being extracted, not just the explicitly provided ones
>>>> 4) treat headers in the same folders as a 'unit' (even if in system folders), and ignore dependencies outside this unit
>>>>
>>>> (3) and (4) are particularly important because right now we tend to have many subtle asymmetries between different header files being generated, depending on whether they are explicit/implicit and whether they live in system folders or not. This makes the jextract behaviour particularly hard to grasp."
>>>>
>>>> This patch fixes all 1-4 (and additionally fixes a crash when libraries could not be loaded by the symbol checker enabled with -l and -L).
>>>>
>>>> I've added (with help of Sundar many thanks!) tests for (1), (2), and (3) (and the crash issue). I also have test for (4), although is probably a bit limited (but better than nothing): I simply check that when extracting an header that depends on <stdio.h> we don't end up generating artifacts for stdio too.
>>>>
>>>> Webrev:
>>>>
>>>> http://cr.openjdk.java.net/~mcimadamore/panama/8212049_v3/webrev/
>>>>
>>>> You might want to check any existing local tests you might have to make sure nothing is broken by these cha
>>>>
>>>> Maurizio
>>>>
>>>>
>
More information about the panama-dev
mailing list