Skip to content

Normalize path output for --dump-includes - #307

Open
xpple wants to merge 3 commits into
openjdk:masterfrom
xpple:normalize-path-output
Open

Normalize path output for --dump-includes#307
xpple wants to merge 3 commits into
openjdk:masterfrom
xpple:normalize-path-output

Conversation

@xpple

@xpple xpple commented Jul 25, 2026

Copy link
Copy Markdown

This PR normalizes the path output for --dump-includes.

  1. Currently, when using jextract with multiple header files, the path outputs for --dump-includes may not be normalized. For example, the output could be:
    #### Extracted from: [...]/mylib/dir/../header.h
    
    --include-constant CONSTANT # header: [...]/mylib/dir/../header.h
    
  2. This is problematic because one may wish to use tools like grep to filter based on known paths to header files.
  3. To resolve this, I simply added a normalize() call in IncludeHelper.java.

I didn't test the PR locally using jtreg, but the tests on GitHub Actions ran successfully. I did also confirm that the new output correctly normalizes each path:

#### Extracted from: [...]/mylib/header.h

--include-constant CONSTANT # header: [...]/mylib/header.h

Progress

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

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 307

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

Using diff file

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

Using Webrev

Link to Webrev Comment

@bridgekeeper bridgekeeper Bot added the oca Needs verification of OCA signatory status label Jul 25, 2026
@bridgekeeper

bridgekeeper Bot commented Jul 25, 2026

Copy link
Copy Markdown

Hi @xpple, welcome to this OpenJDK project and thanks for contributing!

We do not recognize you as Contributor and need to ensure you have signed the Oracle Contributor Agreement (OCA). If you have not signed the OCA, please follow the instructions. Please fill in your GitHub username in the "Username" field of the application. Once you have signed the OCA, please let us know by writing /signed in a comment in this pull request.

If you already are an OpenJDK Author, Committer or Reviewer, please click here to open a new issue so that we can record that fact. Please use "Add GitHub user xpple" as summary for the issue.

If you are contributing this work on behalf of your employer and your employer has signed the OCA, please let us know by writing /covered in a comment in this pull request.

@openjdk

openjdk Bot commented Jul 25, 2026

Copy link
Copy Markdown

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

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

Normalize path output for --dump-includes

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 no new commits pushed to the master branch. If another commit should be pushed before you perform the /integrate command, your PR will be automatically rebased. If you prefer to avoid any potential automatic rebasing, please check the documentation for the /integrate command for further details.

As you do not have Committer status in this project an existing Committer must agree to sponsor your change.

➡️ To flag this PR as ready for integration with the above commit message, type /integrate in a new comment. (Afterwards, your sponsor types /sponsor in a new comment to perform the integration).

@bridgekeeper bridgekeeper Bot removed the oca Needs verification of OCA signatory status label Jul 29, 2026
@openjdk openjdk Bot added ready Pull request is ready to be integrated rfr Pull request is ready for review labels Jul 29, 2026
@mlbridge

mlbridge Bot commented Jul 29, 2026

Copy link
Copy Markdown

Webrevs

@mcimadamore

Copy link
Copy Markdown
Contributor

Seems a sensible fix -- thanks. Is there a test we can add?

@xpple
xpple force-pushed the normalize-path-output branch from 78d0b71 to 6eb8d1d Compare July 31, 2026 15:31
@openjdk

openjdk Bot commented Jul 31, 2026

Copy link
Copy Markdown

@xpple Please do not rebase or force-push to an active PR as it invalidates existing review comments. Note for future reference, the bots always squash all changes into a single commit automatically as part of the integration. See OpenJDK Developers’ Guide for more information.

@xpple

xpple commented Jul 31, 2026

Copy link
Copy Markdown
Author

I don't know why the test is failing, it is identical in structure to TestFilters#testDumpIncludes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready Pull request is ready to be integrated rfr Pull request is ready for review

Development

Successfully merging this pull request may close these issues.

2 participants