jextract icon indicating copy to clipboard operation
jextract copied to clipboard

7903783: Jextract should tolerate more CPP constructs when running with xc++

Open mcimadamore opened this issue 1 year ago • 4 comments

This PR fixes a bunch of issues with trying to run jextract in CPP mode, using a compile_flags.txt file containing the -xc++ flag.

I've found at least three issues:

  • extern C clauses are not recursively scanned
  • the first time we see a cursor with language != C, we stop with an exception (instead of skipping)
  • typing of enum constant is different in C++ and causes infinite recursion

These issues were preventing jextract to work with real world libraries (I tested OpenGL) when -xc++ was specified.

Now jextract will try to parse as much as possible. Unrecognized constructs/languages will be skipped and a diagnostic will be reported by the log.


Progress

  • [x] Change must not contain extraneous whitespace
  • [x] Change must be properly reviewed (no review required)

Issue

  • CODETOOLS-7903783: Jextract should tolerate more CPP constructs when running with xc++ (Bug - P4)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jextract.git pull/256/head:pull/256
$ git checkout pull/256

Update a local copy of the PR:
$ git checkout pull/256
$ git pull https://git.openjdk.org/jextract.git pull/256/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 256

View PR using the GUI difftool:
$ git pr show -t 256

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jextract/pull/256.diff

Webrev

Link to Webrev Comment

mcimadamore avatar Aug 01 '24 12:08 mcimadamore

:wave: Welcome back mcimadamore! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

bridgekeeper[bot] avatar Aug 01 '24 12:08 bridgekeeper[bot]

@mcimadamore This change now passes all automated pre-integration checks.

After integration, the commit message for the final commit will be:

7903783: Jextract should tolerate more CPP constructs when running with xc++

Reviewed-by: jvernee

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 5 new commits pushed to the master branch:

  • dd32493be8c8d2553208f87aaaa18870aa7deaca: Copy powershell script in make build as well
  • c2544346a34add700e786e89030df99d952797ba: Fix issue with missing JSON classes in make build
  • 92de95409cbae5707808fa47aa759434a09a84b8: Add support for Linux/AArch64
  • a76a76211e929fa573ed2a7546ef0aaee9680bd9: 7903788: preparation towards json configuration for jextract tool
  • e55aacfda23211406552357095b6eb780f0fa8e5: 7903782: clang warnings and diagnostics below warning level should be logged as well

Please see this link for an up-to-date comparison between the source branch of this pull request and the master branch. As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

openjdk[bot] avatar Aug 01 '24 12:08 openjdk[bot]

Webrevs

mlbridge[bot] avatar Aug 01 '24 12:08 mlbridge[bot]

@mcimadamore This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

bridgekeeper[bot] avatar Aug 29 '24 16:08 bridgekeeper[bot]

@mcimadamore This pull request has been inactive for more than 8 weeks and will now be automatically closed. If you would like to continue working on this pull request in the future, feel free to reopen it! This can be done using the /open pull request command.

bridgekeeper[bot] avatar Oct 08 '24 20:10 bridgekeeper[bot]

/open

mcimadamore avatar Oct 08 '24 21:10 mcimadamore

@mcimadamore This pull request is now open

openjdk[bot] avatar Oct 08 '24 21:10 openjdk[bot]

@mcimadamore This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

bridgekeeper[bot] avatar Nov 06 '24 00:11 bridgekeeper[bot]

@mcimadamore This pull request has been inactive for more than 8 weeks and will now be automatically closed. If you would like to continue working on this pull request in the future, feel free to reopen it! This can be done using the /open pull request command.

bridgekeeper[bot] avatar Dec 04 '24 01:12 bridgekeeper[bot]