Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add java-11-openjdk #4784

Merged
merged 64 commits into from
Aug 26, 2021
Merged

Add java-11-openjdk #4784

merged 64 commits into from
Aug 26, 2021

Conversation

arnebjarne
Copy link
Contributor

@arnebjarne arnebjarne commented Aug 15, 2021

Motivation: Java is missing from repo.
Linked issues: #4773

Checklist

  • Build rule all-supported completed successfully
  • Package upgrade completed successfully
  • New installation of package completed successfully

@hgy59
Copy link
Contributor

hgy59 commented Aug 15, 2021

wow, a lot of work!

some overall suggestions:
it is not worth to generate and include documentation (man pages, pdf, html, ps, ...) in the packages, as there is no man page command available on the target devices, and to keep the packages as small as possible.

The PLIST files contain the build artifacts that are installed and added to the spk file. Please remove any documentation, header-files, *.la, .a files and pkgconfig files (.pc). You can even omit the executable files from PLIST when a package is used as library only (maybe cross/cups ?).

BUILD_DEPENDS is used for dependencies that are required to build a package, i.e. for build tools (native/...) or for dependencies that are required to build and are prerequisites defined as SPK_DEPENDS (e.g. BUILD_DEPENDS=cross/python3 and SPK_DEPENDS = python3).
So BUILD_DEPENDS = cross/zlib should be DEPENDS = cross/zlib and many others.

We prefer official source packages when available. So avoid the download methods git and hg where ever possible.

For the jdk download it would be great when the source packages of https://github.com/openjdk/jdk/releases could be used. The hg checkout does not only have different content with each download, but it needs a long time too. And I am afraid that the max path length is reached for some source files in the temp. download location when creating the archive.

I propose to remove the ADDITIONAL_CFLAGS = -D_LINUX_QUOTA_VERSION=1 and drop DSM-5 support (as DSM-5 is EOL)

more later....

@arnebjarne
Copy link
Contributor Author

some overall suggestions:
it is not worth to generate and include documentation (man pages, pdf, html, ps, ...) in the packages, as there is no man page command available on the target devices, and to keep the packages as small as possible.

Got it. I will remove them from the spk/java-11-openjdk

The PLIST files contain the build artifacts that are installed and added to the spk file. Please remove any documentation, header-files, *.la, .a files and pkgconfig files (.pc). You can even omit the executable files from PLIST when a package is used as library only (maybe cross/cups ?).

*.la and *.a I agree. headers and *.pc are needed by ./configure scripts (sort of... if packages were build in chroots then paths from *.pc would be valid ;)). I will keep *.pc's and hope that the build system get converted to chroot some day ;)

BUILD_DEPENDS is used for dependencies that are required to build a package, i.e. for build tools (native/...) or for dependencies that are required to build and are prerequisites defined as SPK_DEPENDS (e.g. BUILD_DEPENDS=cross/python3 and SPK_DEPENDS = python3).
So BUILD_DEPENDS = cross/zlib should be DEPENDS = cross/zlib and many others.

So... I did it right? java needs zlib to build, so that will be a BUILD_DEPENDS.
I have not "lint'ed" all the files in the spk to see if they have dynamic dependencies or ie. zlib have been compiled statically into Java. Does the current build system have such hook - to check for external dependencies?

We prefer official source packages when available. So avoid the download methods git and hg where ever possible.
Ok will try to avoid CVS systems.

I propose to remove the ADDITIONAL_CFLAGS = -D_LINUX_QUOTA_VERSION=1 and drop DSM-5 support (as DSM-5 is EOL)

Check, as a newbee I just followed the build example that says use ./cross/transmission as template. Maybe it should be also removed there ? ;)

BR,
Bjarne

@hgy59
Copy link
Contributor

hgy59 commented Aug 16, 2021

*.la and *.a I agree. headers and *.pc are needed by ./configure scripts (sort of... if packages were build in chroots then paths from *.pc would be valid ;)). I will keep *.pc's and hope that the build system get converted to chroot some day ;)

The PLIST file is used to create the final spk file only. All files (whether in PLIST or not) will be available in the install folder for the build (for configure, make, make install, ...) of dependent packages.
Another hint for the creation of PLIST files:
Only real binaries are allowed to be marked as bin or lib as those will be stripped (and will log an error if strip fails). All other must be rsc (or lnk for symlinks).

sorry, I don't understand what you want to say with chroot build system...

@hgy59
Copy link
Contributor

hgy59 commented Aug 16, 2021

So... I did it right? java needs zlib to build, so that will be a BUILD_DEPENDS.

No, I meant executables needed for build (not libraries). I successfully built for x64-6.1 and the only build dependency was jdk itself (installed with sudo apt-get install default-jdk) as it is a kind o bootstrapping here (you need jdk to build jdk).

@hgy59
Copy link
Contributor

hgy59 commented Aug 16, 2021

Another PLIST issue:
The file spk/java-11-openjdk/PLIST must be empty, as spk/java-11-openjdk/Makefile does not build any code but uses cross/{package} dependencies that bring there own PLIST.

@arnebjarne
Copy link
Contributor Author

The file spk/java-11-openjdk/PLIST must be empty, as spk/java-11-openjdk/Makefile does not build any code but uses cross/{package} dependencies that bring there own PLIST.

Ah, that I have missed. I will empty it now

@arnebjarne
Copy link
Contributor Author

Still.

2021-08-16T15:08:29.1115094Z ===> Compiling for libXt
2021-08-16T15:08:29.1146371Z make[3]: Entering directory '/github/workspace/spk/java-11-openjdk/work-armv7-7.0/libXt-1.1.5'
2021-08-16T15:08:29.1176930Z make all-recursive
2021-08-16T15:08:29.1205553Z make[4]: Entering directory '/github/workspace/spk/java-11-openjdk/work-armv7-7.0/libXt-1.1.5'
2021-08-16T15:08:29.1247527Z Making all in util
2021-08-16T15:08:29.1272943Z make[5]: Entering directory '/github/workspace/spk/java-11-openjdk/work-armv7-7.0/libXt-1.1.5/util'
2021-08-16T15:08:29.1290077Z CC makestrs.o
2021-08-16T15:08:29.1371420Z In file included from /github/workspace/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/arm-unknown-linux-gnueabi/sysroot/usr/include/features.h:447,
2021-08-16T15:08:29.1373466Z from /github/workspace/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/arm-unknown-linux-gnueabi/sysroot/usr/include/bits/libc-header-start.h:33,
2021-08-16T15:08:29.1375585Z from /github/workspace/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/arm-unknown-linux-gnueabi/sysroot/usr/include/stdio.h:27,
2021-08-16T15:08:29.1376612Z from makestrs.c:29:
2021-08-16T15:08:29.1378083Z /github/workspace/toolchain/syno-armv7-7.0/work/arm-unknown-linux-gnueabi/arm-unknown-linux-gnueabi/sysroot/usr/include/gnu/stubs.h:7:11: fatal error: gnu/stubs-soft.h: No such file or directory
2021-08-16T15:08:29.1382235Z # include <gnu/stubs-soft.h>
2021-08-16T15:08:29.1382636Z ^~~~~~~~~~~~~~~~~~

libXt will not compile due to an toolchain error i think.

@arnebjarne
Copy link
Contributor Author

I use a rather old group of packages (from CentOS 7).
I can try rebuilding it all towards latest Fedora 34 which has latest libXt.

@hgy59
Copy link
Contributor

hgy59 commented Aug 16, 2021

linux-gnueabi/sysroot/usr/include/gnu/stubs.h:7:11: fatal error: gnu/stubs-soft.h: No such file or directory
2021-08-16T15:08:29.1382235Z # include <gnu/stubs-soft.h>
2021-08-16T15:08:29.1382636Z ^~~~~~~~~~~~~~~~~~

libXt will not compile due to an toolchain error i think.

you can fix this by adding the following lines to /spksrc/toolchain/syno-armv7-6.1/Makefile (before include ../../mk/spksrc.tc.mk)

# ensure gnu/hard-float.h is used
TC_EXTRA_CFLAGS = -D__ARM_PCS_VFP=1

@hgy59 hgy59 changed the title Added missing digests for java-11-openjdk packages Add java-11-openjdk Aug 17, 2021
@arnebjarne
Copy link
Contributor Author

Now i looks very good to me
@arnebjarne can you please do the final PLIST update (and propably switch back to make product-images) as you have a real test case.

Ok ill will verify the lib list and check with make product-images

@arnebjarne
Copy link
Contributor Author

@hgy59 my OCD goes off reading

OpenJDK 11 version 11.0.12+7 :-D

May I suggest

OpenJDK version 11.0.12+7 ?

in description

@arnebjarne
Copy link
Contributor Author

hmm still breaks with same error though zlib is now included.

I will try compiling java with zlib=system

spk/java-11-openjdk/Makefile Outdated Show resolved Hide resolved
Co-authored-by: hgy59 <hpgy59@gmail.com>
@hgy59 hgy59 requested a review from publicarray August 23, 2021 20:17
Copy link
Member

@publicarray publicarray left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small nits that I found while going over the PR. But looks good to me!

cross/x11proto/Makefile Outdated Show resolved Hide resolved
cross/xau/Makefile Outdated Show resolved Hide resolved
cross/xcb/Makefile Outdated Show resolved Hide resolved
cross/java-11-openjdk/Makefile Show resolved Hide resolved
@arnebjarne
Copy link
Contributor Author

I have renamed the dependencies and deleted the 2 unneedded patches.

mk/spksrc.cross-env.mk Outdated Show resolved Hide resolved
@arnebjarne arnebjarne requested a review from publicarray August 24, 2021 23:07
Copy link
Member

@publicarray publicarray left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great Work!

@publicarray
Copy link
Member

publicarray commented Aug 26, 2021

If you have PARALLEL_MAKE = max in your local.mk the build fails:

$ make -C spk/java-11-openjdk arch-x64-7.0
[..]
===>  Compiling for java-11-openjdk
sed -i -e "s|\$(INSTALL_PREFIX)|/spksrc/spk/java-11-openjdk/work-x64-7.0/install/var/packages/java-11-openjdk/target|g" /spksrc/spk/java-11-openjdk/work-x64-7.0/jdk11u-jdk-11.0.12-7/make/Install.gmk
make[3]: Entering directory '/spksrc/spk/java-11-openjdk/work-x64-7.0/jdk11u-jdk-11.0.12-7'
Note: Command line contains non-control variables:
* TCVERSION=7.0
* ARCH=x64
Make sure it is not mistyped, and that you intend to override this variable.
'make help' will list known control variables.

make[4]: Entering directory '/spksrc/spk/java-11-openjdk/work-x64-7.0/jdk11u-jdk-11.0.12-7'
make[4]: Leaving directory '/spksrc/spk/java-11-openjdk/work-x64-7.0/jdk11u-jdk-11.0.12-7'
Error: 'make -jN' is not supported, use 'make JOBS=N'
/spksrc/spk/java-11-openjdk/work-x64-7.0/jdk11u-jdk-11.0.12-7/make/Init.gmk:115: *** Cannot continue.  Stop.

@publicarray publicarray linked an issue Aug 26, 2021 that may be closed by this pull request
@arnebjarne
Copy link
Contributor Author

If you have PARALLEL_MAKE = max in your local.mk the build fails:

$ make -C spk/java-11-openjdk arch-x64-7.0
[..]
===>  Compiling for java-11-openjdk
sed -i -e "s|\$(INSTALL_PREFIX)|/spksrc/spk/java-11-openjdk/work-x64-7.0/install/var/packages/java-11-openjdk/target|g" /spksrc/spk/java-11-openjdk/work-x64-7.0/jdk11u-jdk-11.0.12-7/make/Install.gmk
make[3]: Entering directory '/spksrc/spk/java-11-openjdk/work-x64-7.0/jdk11u-jdk-11.0.12-7'
Note: Command line contains non-control variables:
* TCVERSION=7.0
* ARCH=x64
Make sure it is not mistyped, and that you intend to override this variable.
'make help' will list known control variables.

make[4]: Entering directory '/spksrc/spk/java-11-openjdk/work-x64-7.0/jdk11u-jdk-11.0.12-7'
make[4]: Leaving directory '/spksrc/spk/java-11-openjdk/work-x64-7.0/jdk11u-jdk-11.0.12-7'
Error: 'make -jN' is not supported, use 'make JOBS=N'
/spksrc/spk/java-11-openjdk/work-x64-7.0/jdk11u-jdk-11.0.12-7/make/Init.gmk:115: *** Cannot continue.  Stop.

Ok I will change the Makefile. I have seen some races in cups I think, but since I have reduced cups to only build the libcups.so it might be unneeded.

@publicarray
Copy link
Member

Thanks for your work on this.
So annoying that this is a hard error not just a soft fail.

@publicarray publicarray merged commit 6f9a00f into SynoCommunity:master Aug 26, 2021
publicarray pushed a commit to publicarray/spksrc that referenced this pull request Aug 26, 2021
* Initial java-1.8.0-openjdk package

* Added LICENSE files

* Disabled parallel build for cups due to race conditions

* Removed Java AOT. Not available on all arches

* Removed debug symbols and cups to reduce package size

* Changed zlib,libjpeg,giflib,libpng and lcms to use system and not bundled

* Removed RedHat patches and added Debian patches

* Added fix for PARALLEL_MAKE

Co-authored-by: hgy59 <hpgy59@gmail.com>
@DigitalBox98
Copy link
Contributor

Really nice work for the missing java on DSM 7.0 :)

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.

[Package Request] OpenJDK
4 participants