Skip to content

Migrate Win32Handler to Java's new Foreign Function & Memory API - #2908

Merged
HannesWell merged 1 commit into
eclipse-platform:masterfrom
HannesWell:win32Handler-ffm
Sep 12, 2026
Merged

Migrate Win32Handler to Java's new Foreign Function & Memory API#2908
HannesWell merged 1 commit into
eclipse-platform:masterfrom
HannesWell:win32Handler-ffm

Conversation

@HannesWell

@HannesWell HannesWell commented Sep 3, 2026

Copy link
Copy Markdown
Member

Migrate the Win32Handler off JNA and to the Java Foreign Function & Memory (FFM) API.
The FFM bindings are generated by jextract using the script added with this change.

Currently this contains TODOs that have to be resolved before this is submitted.

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Test Results

    54 files  ±0      54 suites  ±0   57m 13s ⏱️ -28s
 4 810 tests ±0   4 788 ✅ ±0   22 💤 ±0  0 ❌ ±0 
12 321 runs  ±0  12 168 ✅ ±0  153 💤 ±0  0 ❌ ±0 

Results for commit f07b368. ± Comparison against base commit aa2fb6d.

♻️ This comment has been updated with latest results.

@vogella

vogella commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Thanks for working on this @HannesWell I would like to look into the Linux side, so I suggest to move the BREE change out into an independent PR so that you can work on the Win side and I can work on the Linux side. I think only the BREE is actually overlapping for this. work.

@HannesWell

Copy link
Copy Markdown
Member Author

I would like to look into the Linux side, so I suggest to move the BREE change out into an independent PR so that you can work on the Win side and I can work on the Linux side. I think only the BREE is actually overlapping for this. work.

Yes, my plan was also to look at the Linux side subsequently.
But it was not only to convert the existing JNI bindings to FFM but to also move those parts that don't require own native code anymore to use Java NIO instead. See for that the discussion in #302 (comment) ff.
Furthermore I think it would be good to use again a tool to generate the binding deterministically, like jextract, and just let AI generate some bindings.
If you want to work on that, that's ok for me and I don't think updating the BREE change has to be separated. It can be done in any change and whichever is first, is first.

This allows to drop the dependency on JNA and requires to update the
required EE of 'org.eclipse.core.filesystem' to Java-25.

Use the jextract tool provided by the OpenJDK project to generate the
FFM bindings for the called methods of the Windows API.
Add a script to regenerate these bindings.
@HannesWell
HannesWell merged commit 31b3f6a into eclipse-platform:master Sep 12, 2026
15 of 18 checks passed
@HannesWell
HannesWell deleted the win32Handler-ffm branch September 12, 2026 13:39
@vogella

vogella commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

@HannesWell will you also address Mac OS?

@HannesWell

HannesWell commented Sep 13, 2026

Copy link
Copy Markdown
Member Author

will you also address Mac OS?

For the file-system, macOS should be 'handled' by

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants