[foreign] RFR 8220141: Disable libclang host environment inference in macro reparsing

Maurizio Cimadamore maurizio.cimadamore at oracle.com
Tue Mar 5 09:52:52 UTC 2019


Hi,
I got at the bottom of the issue affecting our complex macro test 
parsing on Windows. Essentially, test runs on Windows tweak the PATH 
variable so that it points to the right MSVC env used at build time; 
unfortunately, in this case, libclang picks that up and uses it as 
include paths for its work. This means that build-time dependencies will 
effectively leak into test execution. While in general this is not 
problematic, I think it makes little sense to search for system headers 
in the marco reparse case, which we want to be as efficient and 
self-contained as possible.

For this reason, this patch adds the -Xnostdinc option to the reparse 
unit, to disable the libclang automagic behavior. This effectively makes 
the extra filtering I added yesterday not necessary, but I'm keeping for 
extra robustness.

Webrev:

http://cr.openjdk.java.net/~mcimadamore/panama/8220141/

P.S.

I think we should probably tweak JextractToolRunner to use -nostdinc 
too, in order to get predictable test runs on all platforms.

Maurizio




More information about the panama-dev mailing list