jdk8u-dev
jdk8u-dev copied to clipboard
8193017: Import freetype sources into OpenJDK source tree
Imports the Freetype source to be consistent with JDK11+
As discussed in https://github.com/ibmruntimes/openj9-openjdk-jdk8/pull/631 CC @gnu-andrew
Progress
- [ ] Change must be properly reviewed (1 review required, with at least 1 Reviewer)
- [x] Change must not contain extraneous whitespace
- [x] Commit message must refer to an issue
- [ ] JDK-8193017 needs maintainer approval
Issue
- JDK-8193017: Import freetype sources into OpenJDK source tree (Bug - P3)
Reviewing
Using git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk8u-dev.git pull/318/head:pull/318
$ git checkout pull/318
Update a local copy of the PR:
$ git checkout pull/318
$ git pull https://git.openjdk.org/jdk8u-dev.git pull/318/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 318
View PR using the GUI difftool:
$ git pr show -t 318
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk8u-dev/pull/318.diff
Webrev
:wave: Welcome back gdams! 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.
This backport pull request has now been updated with issue from the original commit.
Webrevs
- 11: Full - Incremental (7f84ed17)
- 10: Full - Incremental (279fb6f9)
- 09: Full - Incremental (4eab0b01)
- 08: Full (7be05c5c)
- 07: Full - Incremental (40869c5e)
- 06: Full - Incremental (59602192)
- 05: Full (0d2a0045)
- 04: Full (9eb567e6)
- 03: Full - Incremental (ca2dd556)
- 02: Full - Incremental (7eea8f2c)
- 01: Full - Incremental (3061d5f2)
- 00: Full (03d00ee1)
Good to see this being proposed. I was wondering what had happened to it.
How close is this to JDK-8193017? Were other changes necessary on top?
I'll do a comparison of the two patches when I get a chance.
Mailing list message from Andrew Hughes on jdk8u-dev:
On 20:03 Wed 31 May , Thorsten Glaser wrote:
On Wed, 31 May 2023, Andrew John Hughes wrote:
Good to see this being proposed. I was wondering what had happened to it.
As long as there is a flag to still use the system library, and I can figure out how and where to add it in the build process?
bye, //mirabilos -- Infrastrukturexperte ? tarent solutions GmbH Am Dickobskreuz 10, D-53121 Bonn ? http://www.tarent.de/ Telephon +49 228 54881-393 ? Fax: +49 228 54881-235 HRB AG Bonn 5168 ? USt-ID (VAT): DE122264941 Gesch?ftsf?hrer: Dr. Stefan Barth, Kai Ebenrett, Boris Esser, Alexander Steeg
\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*/?\ The UTF-8 Ribbon ??? Campaign against Mit dem tarent-Newsletter nichts mehr verpassen: ??? HTML eMail! Also, https://www.tarent.de/newsletter ??? header encryption! ****************************************************
Given 8u is a stable release, I don't intend for any defaults to change, so you shouldn't have to add any new options.
This is primarily aimed at Windows, where FreeType is not readily available on the system and FreeType sources have to be supplied manually to the JDK build.
Thanks, -- Andrew :) Pronouns: he / him or they / them Principal Free Java Software Engineer OpenJDK Package Owner Red Hat, Inc. (http://www.redhat.com)
PGP Key: ed25519/0xCFDA0F9B35964222 (hkp://keys.gnupg.net) Fingerprint = 5132 579D D154 0ED2 3E04 C5A0 CFDA 0F9B 3596 4222
Please contact via e-mail, not proprietary chat networks -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 228 bytes Desc: not available URL: <https://mail.openjdk.org/pipermail/jdk8u-dev/attachments/20230601/18c9724d/signature-0001.asc>
Good to see this being proposed. I was wondering what had happened to it.
How close is this to JDK-8193017? Were other changes necessary on top?
I'll do a comparison of the two patches when I get a chance.
it's reasonably close, the main difference is that the freetype source is located in jdk/src/share/native/sun/awt/libfreetype/ rather than jdk/src/share/native/libfreetype to be consistent with other JDK8u sources. I also removed freetype task from the GitHub actions workflow.
@gdams 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!
Please keep this open
@gdams 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!
@gdams 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.
probably we should keep it open?
/open
@gdams This pull request is now open
❗ This change is not yet ready to be integrated. See the Progress checklist in the description for automated requirements.
@gdams this pull request can not be integrated into master due to one or more merge conflicts. To resolve these merge conflicts and update this pull request you can run the following commands in the local repository for your personal fork:
git checkout freetype
git fetch https://git.openjdk.org/jdk8u-dev.git master
git merge FETCH_HEAD
# resolve conflicts and follow the instructions given by git merge
git commit -m "Merge master"
git push
@gdams 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!
@gdams do you have a chance to look at the merge-conflict?
Yup @mrserb I'll try and get to it this week. I must stress that it would be good to make a decision on this as it's very painful to keep such a large changeset up to date
@mrserb I've resolved the merge conflicts. I'm slightly worried about the changes to common/autoconf/generated-configure.sh though. I've got [email protected] on my mac (installed using brew) but there might be a more specific version required?
@mrserb I've resolved the merge conflicts. I'm slightly worried about the changes to
common/autoconf/generated-configure.shthough. I've got[email protected]on my mac (installed using brew) but there might be a more specific version required?
I had a similar issue some time ago https://github.com/openjdk/jdk8u-dev/pull/413#issuecomment-1951600088, at that time I also run 2.69 on macos. Solved that by running autoconf on some linux hosts.
@mrserb I've resolved the merge conflicts. I'm slightly worried about the changes to
common/autoconf/generated-configure.shthough. I've got[email protected]on my mac (installed using brew) but there might be a more specific version required?I had a similar issue some time ago #413 (comment), at that time I also run 2.69 on macos. Solved that by running autoconf on some linux hosts.
that looks better, I've compiled it locally with the patch applied and the generated configure looks correct now
I did a quick test on macOS. If the "libfreetype.dylib" is deleted from some old jdk8 build(or jdk-21) the next exception is occurred for the font demo:
./jdk-8/bin/java -jar ./build/macosx-x86_64-normal-server-release/images/j2sdk-image/demo/jfc/Font2DTest/Font2DTest.jar Exception in thread "main" java.lang.UnsatisfiedLinkError: /Users/openjdk/jdk8u-dev/jdk-8/jre/lib/libfontmanager.dylib: dlopen(/Users/openjdk/jdk8u-dev/jdk-8/jre/lib/libfontmanager.dylib, 0x0001): Library not loaded: @rpath/libfreetype.dylib.6 Referenced from: <E45B410C-8F6D-3350-90ED-7D918CD703B6> /Users/openjdk/jdk8u-dev/jdk-8/jre/lib/libfontmanager.dylib Reason: tried: '/Users/openjdk/jdk8u-dev/jdk-8/jre/lib/./libfreetype.dylib.6' (no such file), '/Users/openjdk/jdk8u-dev/jdk-8/jre/lib/./libfreetype.dylib.6' (no such file), '/Users/openjdk/jdk8u-dev/jdk-8/jre/lib/server/./libfreetype.dylib.6' (no such file), '/Users/openjdk/jdk8u-dev/jdk-8/jre/lib/server/../libfreetype.dylib.6' (no such file), '/Users/openjdk/jdk8u-dev/jdk-8/bin/./libfreetype.dylib.6' (no such file), '/usr/lib/libfreetype.dylib.6' (no such file, not in dyld cache) at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1934) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1838) at java.lang.Runtime.loadLibrary0(Runtime.java:871) at java.lang.System.loadLibrary(System.java:1124) at sun.lwawt.macosx.LWCToolkit$1.run(LWCToolkit.java:93) at sun.lwawt.macosx.LWCToolkit$1.run(LWCToolkit.java:80) at java.security.AccessController.doPrivileged(Native Method) at sun.lwawt.macosx.LWCToolkit.
(LWCToolkit.java:79) .... at java.awt.Toolkit.getDefaultToolkit(Toolkit.java:854) .... at Font2DTest.main(Font2DTest.java:1031)
But If I delete the "libfreetype.dylib" from the build after this patch the demo works fine.
But If I delete the "libfreetype.dylib" from the build after this patch the demo works fine.
Using "DYLD_PRINT_LIBRARIES=YES" traced that the "Homebrew" version of freetype is loaded. it is unclear why this version is not loaded in case of jdk-21. @rpath looks the same.
Using "DYLD_PRINT_LIBRARIES=YES" traced that the "Homebrew" version of freetype is loaded. it is unclear why this version is not loaded in case of jdk-21. @rpath looks the same.
nevermind seems that in case of "macos+Homebrew" the jdk-21 is affected as well but only if I build jdk locally. tested on windows and works fine.
it will be good to test it on solartis and aix.
This one is outside the usual rules for 8u, which is closed for enhancements. For that reason, it must be accompanied by a very strong justification, and evidence that it carries no risk. By now, I'd have thought that everyone building JDK 8 on Windows etc. had workflows in place. We are at the (long) tail of the JDK 8 life cycle.
This one is outside the usual rules for 8u, which is closed for enhancements. For that reason, it must be accompanied by a very strong justification, and evidence that it carries no risk. By now, I'd have thought that everyone building JDK 8 on Windows etc. had workflows in place. We are at the (long) tail of the JDK 8 life cycle.
I'm not sure I'd call this an enhancement. The lack of in-tree sources for FreeType means that there is no reference version of FreeType to build and test against, as there is with other libraries used by the AWT classes (libjpeg, libpng, giflib, LCMS).
Historically, this is because Oracle did not use FreeType and its maintenance was largely left to others. There is evidence of this in this patch with the only JDK code changes being to allow FreeType to be used on non-OpenJDK builds (largely irrelevant to use I would expect)
Yes, those on Windows & Mac likely have some way of building against FreeType in place, but it is an ongoing burden to maintain that version of FreeType, and it means every person building OpenJDK potentially uses some different version of FreeType.
It's also an issue on the GNU/Linux side as there is no option not to use a system FreeType, which potentially reduces the portability of such builds. A build of OpenJDK may take place against one system installation of FreeType and then be used against a completely different one.
The reason these issues have not been a bigger problem up to now is FreeType is a pretty stable library. I think the risk of introducing this now is still very low (as I say, there are very few code changes at all) and it improves the maintainability of 8u for everyone.
@gdams 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!
Keep open. Would be good to get this in.
@gdams 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!