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

Create our own openjdk7 builds for use as boot JDKs #1732

Open
sxa opened this issue May 7, 2020 · 6 comments
Open

Create our own openjdk7 builds for use as boot JDKs #1732

sxa opened this issue May 7, 2020 · 6 comments
Assignees
Labels
ansible Issues related to our ansible playbooks in the infrastructure repo docker Issues related to our docker files and docker scripts enhancement Issues that enhance the code or documentation of the repo in any way macos Issues that affect or relate to the MAC OS
Milestone

Comments

@sxa
Copy link
Member

sxa commented May 7, 2020

Java 8 can be built using JDK8 as the boot JDK but in general the preferred approach is to use the version one level back i.e. Java7.

This leaves us with the problem of sourceing a boot JDK, but for newer operating systems and distributions, a version of openjdk7 is not easily available from the distribution's repositories (e.g. RHEL8, Ubuntu 20.04, Debian10).

Since we try to encourae (or at least make it easy for) people to use our scripts to build their own JDK by providing the openjdk-infrastructure ansible scripts, docker files, and the scripts in openjdk-build we should also make it easy to source JDK7 on the operating systems/distrubutions that people are using.

To this end, we should look at building openjdk7. Even if it is not something we're ever going to properly support it would be useful to have it available for use in the playbooks when the distribution does not provide a JDK7. The alternate option would be to source it elsewhere e.g. [azul's Zulu](https://www.azul.com/downloads/zulu-community/?version=java-7-lts&package=jdk. Neither bellsoft Liberica nor SAPMachine have JDK7 available.

This was triggered by discovering that on the AIX build machines we seem to have a version of openjdk7 used for bootstrapping JDK8 and the new machine I was setting up for build appeared not to have that installed via the playbooks (from discussions it appears it may have been built by us from source at some point). The machine does have a version of IBM Java 7 but that did not appear suitable for bootstrapping openjdk8.

@sxa sxa added the enhancement Issues that enhance the code or documentation of the repo in any way label May 7, 2020
@sxa sxa added this to the May 2020 milestone May 7, 2020
@karianna
Copy link
Contributor

karianna commented May 7, 2020

I'm not sure we'll be able to build these ourselves for all of the platforms.

I'm comfortable with standardizing on Zulu for this. Azul is a supporter/sponsor and they are the lead maintainers for 7.

@Willsparker
Copy link
Contributor

I'm currently in the process of build JDK7 on CentOS6. I've tracked the process I've gone through , and will update as I go.

  1. Run the playbook on the CentOS6 machine (skip the ant install if it makes the next step easier, but I didn't bother)

  2. (Remove Ant 1.10.5 from /usr/local and) Download Ant 1.7.1 from here and extract to /usr/local

  3. Retrieve some of the source code that doesn't come from the openjdk-jdk7 mercurial clone, and place into a folder (i.e. DROP_DIR), still in it's zipped state

mkdir -p DROP_DIR && cd DROP_DIR
wget https://sourceforge.net/projects/jdk7src/files/input-archives/jdk7-jaf-2010_08_19.zip/download -o jdk7-jaf-2010_08_19.zip
wget https://sourceforge.net/projects/jdk7src/files/input-archives/jaxp145_01.zip/download -o jaxp145_01.zip
wget https://sourceforge.net/projects/jdk7src/files/input-archives/jdk7-jaxws2_2_4-b03-2011_05_27.zip/download -o jdk7-jaxws2_2_4-b03-2011_05_27.zip
  1. Clone the JDK7 source code:
hg clone http://hg.openjdk.java.net/jdk7/jdk7 JDK7_BUILD
cd JDK7_BUILD
sh ./get_sources.sh
  1. Change some of the source code to disable-warnings-as-errors when compiling :
  • In hotspot/make/linux/makefiles/adlc.make , comment out
CFLAGS_WARN = -Werror
CFLAGS += $(CFLAGS_WARN)
  • In hotspot/make/linux/makefiles/gcc.make, comment out
WARNINGS_ARE_ERRORS = -Werror`
  • In jdk/make/common/Defs-linux.gmk, comment out
ifeq ($(COMPILER_WARNINGS_FATAL),true)
  GCC_WARNINGS += -Werror
endif
  1. Run gmake sanity (which from what I can gather, is like configure) and then run gmake DISABLE_HOTSPOT_OS_VERSION_CHECK=ok. Setting that variable stops the build throwing an error about building on CentOS6 (as it thinks CentOS6 is too old, when it's actually too new)

Other help: https://hg.openjdk.java.net/jdk7u/jdk7u/raw-file/tip/README-builds.html

Current error:

java full version "1.7.0_261-mockbuild_2020_04_27_15_15-b00"
Using java runtime at: /usr/lib/jvm/java-1.7.0/jre
Error occurred during initialization of VM
Unable to load native library: /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.261.x86_64/jre/lib/amd64/libjava.so: symbol JVM_SetNativeThreadName, version SUNWprivate_1.1 not defined in file libjvm.so with link time reference
/home/vagrant/JDK7_build/hotspot/make/linux/Makefile:289: recipe for target 'product' failed
gmake[4]: *** [product] Error 1

@sxa
Copy link
Member Author

sxa commented May 11, 2020

@karianna They don't do AIX, and as per original comment I'm struggling to get any Java 7 that works on the AIX 7.1SP5 machine I'm trying to build the OpenJ9 JDK8 on at the moment.

For most of the bulid machines (earlier distributions) we're bootstrapping with the 7 that comes with them. We could certainly set up the playbooks with a zulu again (although we removed most of the references to the zulu repos) for the later distros which aren't supplied with a JDK7 from their repositories as an alternative

@sxa
Copy link
Member Author

sxa commented May 12, 2020

Given the problems Will has been having I'm good with using zulu on the newer Linux distributions although I believe it would be useful to be able to reproduce building our own on AIX

@sxa
Copy link
Member Author

sxa commented May 14, 2020

In fact zulu isn't available on any Linux architectures other than x64, so arm32, aarch64, s390x, ppc64le can't be sourced that way on modern distributions.

@karianna karianna modified the milestones: May 2020, June 2020 Jun 1, 2020
@karianna karianna modified the milestones: June 2020, July 2020 Jul 1, 2020
@karianna karianna modified the milestones: July 2020, August 2020 Aug 3, 2020
@karianna karianna modified the milestones: August 2020, September 2020 Sep 1, 2020
@karianna karianna modified the milestones: September 2020, November 2020 Nov 3, 2020
@karianna karianna modified the milestones: November 2020, December 2020 Jan 3, 2021
@karianna karianna modified the milestones: December 2020, March 2021 Mar 8, 2021
@gounthar
Copy link

gounthar commented Mar 9, 2022

In fact zulu isn't available on any Linux architectures other than x64, so arm32, aarch64, s390x, ppc64le can't be sourced that way on modern distributions.

It looks like Zulu is now available for other Linux architectures (I've seen arm32 and aarch64), but not in version 7 I'm afraid.

BellSoft version is also available for arm32.
SapMachine also provides for other architectures, but not earlier than version 11.

@github-actions github-actions bot added ansible Issues related to our ansible playbooks in the infrastructure repo docker Issues related to our docker files and docker scripts macos Issues that affect or relate to the MAC OS labels Mar 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ansible Issues related to our ansible playbooks in the infrastructure repo docker Issues related to our docker files and docker scripts enhancement Issues that enhance the code or documentation of the repo in any way macos Issues that affect or relate to the MAC OS
Projects
None yet
Development

No branches or pull requests

4 participants