RFR: 7904073: Derive required symbols from client code to minimize generated bindings
Please review this change to add a small sample that extracts full bindings once, scans the compiled client classes to collect actually referenced symbols, filters the includes list, and re-runs jextract to produce a slim binding set. ------------- Commit messages: - add new sample Changes: https://git.openjdk.org/jextract/pull/288/files Webrev: https://webrevs.openjdk.org/?repo=jextract&pr=288&range=00 Issue: https://bugs.openjdk.org/browse/CODETOOLS-7904073 Stats: 183 lines in 7 files changed: 182 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jextract/pull/288.diff Fetch: git fetch https://git.openjdk.org/jextract.git pull/288/head:pull/288 PR: https://git.openjdk.org/jextract/pull/288
On Wed, 3 Sep 2025 15:49:24 GMT, Nizar Benalla <nbenalla@openjdk.org> wrote:
Please review this change to add a small sample that extracts full bindings once, scans the compiled client classes to collect actually referenced symbols, filters the includes list, and re-runs jextract to produce a slim binding set.
This fell off my radar, sorry. samples/opengl-minimal-bidings/Teapot.java line 76:
74: try (var arena = Arena.ofConfined()) { 75: var argc = arena.allocateFrom(C_INT, 0); 76: glutInit(argc, argc);
Second argument shouldn't be `argc`, bu a pointer to `argv` (https://www.opengl.org/resources/libraries/glut/spec3/node10.html). I think the other sample also gets this wrong, but I think it works out because we pass `0` as `argc`. samples/opengl-minimal-bidings/run_windows.ps1 line 10:
8: --enable-native-access=ALL-UNNAMED ` 9: -D"java.library.path=C:\Windows\System32`;$freeglutPath\bin\x64" ` 10: Teapot.java
I suggest just removing the Windows scripts, as it looks like the filtering script only work on Mac. ------------- Marked as reviewed by jvernee (Reviewer). PR Review: https://git.openjdk.org/jextract/pull/288#pullrequestreview-3295339847 PR Review Comment: https://git.openjdk.org/jextract/pull/288#discussion_r2399327878 PR Review Comment: https://git.openjdk.org/jextract/pull/288#discussion_r2399321989
Please review this change to add a small sample that extracts full bindings once, scans the compiled client classes to collect actually referenced symbols, filters the includes list, and re-runs jextract to produce a slim binding set.
Nizar Benalla has updated the pull request incrementally with one additional commit since the last revision: remove unsued file. Use `*argv` as second argument of glutInit ------------- Changes: - all: https://git.openjdk.org/jextract/pull/288/files - new: https://git.openjdk.org/jextract/pull/288/files/4c4e6dd2..63ca2beb Webrevs: - full: https://webrevs.openjdk.org/?repo=jextract&pr=288&range=01 - incr: https://webrevs.openjdk.org/?repo=jextract&pr=288&range=00-01 Stats: 15 lines in 3 files changed: 2 ins; 10 del; 3 mod Patch: https://git.openjdk.org/jextract/pull/288.diff Fetch: git fetch https://git.openjdk.org/jextract.git pull/288/head:pull/288 PR: https://git.openjdk.org/jextract/pull/288
On Wed, 15 Oct 2025 12:37:17 GMT, Nizar Benalla <nbenalla@openjdk.org> wrote:
Please review this change to add a small sample that extracts full bindings once, scans the compiled client classes to collect actually referenced symbols, filters the includes list, and re-runs jextract to produce a slim binding set.
Nizar Benalla has updated the pull request incrementally with one additional commit since the last revision:
remove unsued file. Use `*argv` as second argument of glutInit
Marked as reviewed by jvernee (Reviewer). ------------- PR Review: https://git.openjdk.org/jextract/pull/288#pullrequestreview-3340432424
On Wed, 15 Oct 2025 12:37:17 GMT, Nizar Benalla <nbenalla@openjdk.org> wrote:
Please review this change to add a small sample that extracts full bindings once, scans the compiled client classes to collect actually referenced symbols, filters the includes list, and re-runs jextract to produce a slim binding set.
Nizar Benalla has updated the pull request incrementally with one additional commit since the last revision:
remove unsued file. Use `*argv` as second argument of glutInit
@nizarbenalla Your change (at version 63ca2beba599840f12f6e34dfd02b2490c9fd12d) is now ready to be sponsored by a Committer. ------------- PR Comment: https://git.openjdk.org/jextract/pull/288#issuecomment-3406546942
On Wed, 15 Oct 2025 12:37:17 GMT, Nizar Benalla <nbenalla@openjdk.org> wrote:
Please review this change to add a small sample that extracts full bindings once, scans the compiled client classes to collect actually referenced symbols, filters the includes list, and re-runs jextract to produce a slim binding set.
Nizar Benalla has updated the pull request incrementally with one additional commit since the last revision:
remove unsued file. Use `*argv` as second argument of glutInit
@keithc-ca I cannot read and respond to your comment, you will need to accept the OpenJDK Terms of Use for your comment to appear. ------------- PR Comment: https://git.openjdk.org/jextract/pull/288#issuecomment-3412957418
On Wed, 15 Oct 2025 12:37:17 GMT, Nizar Benalla <nbenalla@openjdk.org> wrote:
Please review this change to add a small sample that extracts full bindings once, scans the compiled client classes to collect actually referenced symbols, filters the includes list, and re-runs jextract to produce a slim binding set.
Nizar Benalla has updated the pull request incrementally with one additional commit since the last revision:
remove unsued file. Use `*argv` as second argument of glutInit
I cannot read your comment because you have not accepted the OpenJDK TOU. ------------- PR Comment: https://git.openjdk.org/jextract/pull/288#issuecomment-3413242649
On Wed, 3 Sep 2025 15:49:24 GMT, Nizar Benalla <nbenalla@openjdk.org> wrote:
Please review this change to add a small sample that extracts full bindings once, scans the compiled client classes to collect actually referenced symbols, filters the includes list, and re-runs jextract to produce a slim binding set.
This pull request has now been integrated. Changeset: 91ff2392 Author: Nizar Benalla <nbenalla@openjdk.org> Committer: Maurizio Cimadamore <mcimadamore@openjdk.org> URL: https://git.openjdk.org/jextract/commit/91ff2392ac8c3ee7d0906486e8f523fccdf3... Stats: 188 lines in 7 files changed: 184 ins; 0 del; 4 mod 7904073: Derive required symbols from client code to minimize generated bindings Reviewed-by: jvernee ------------- PR: https://git.openjdk.org/jextract/pull/288
participants (3)
-
duke
-
Jorn Vernee
-
Nizar Benalla