From 83a3b81d5fa82941f6f5db3d66948731e8ca64c6 Mon Sep 17 00:00:00 2001 From: Vitaly Provodin Date: Wed, 4 Sep 2024 01:25:10 +0400 Subject: [PATCH] JBR-7511 migrate build platforms to OL7 - modify scripts for building images from Oracle Linux 7 - update jb/build/VerifyDependencies.java to check libraries have no dependency on symbols from glibc version higher than 2.17 --- ...aarch64 => Dockerfile.oraclelinux_aarch64} | 35 +++++++------ .../docker/Dockerfile.oraclelinux_x86_64 | 50 +++++++++++++++++++ jb/project/docker/Dockerfile.x86_64 | 36 ------------- jb/project/docker/mkdocker_aarch64.sh | 7 ++- jb/project/docker/mkdocker_x86_64.sh | 28 +++++++++++ jb/project/docker/scl.repo | 6 +++ test/jdk/jb/build/VerifyDependencies.java | 5 +- 7 files changed, 109 insertions(+), 58 deletions(-) rename jb/project/docker/{Dockerfile.aarch64 => Dockerfile.oraclelinux_aarch64} (70%) create mode 100644 jb/project/docker/Dockerfile.oraclelinux_x86_64 create mode 100755 jb/project/docker/mkdocker_x86_64.sh create mode 100644 jb/project/docker/scl.repo diff --git a/jb/project/docker/Dockerfile.aarch64 b/jb/project/docker/Dockerfile.oraclelinux_aarch64 similarity index 70% rename from jb/project/docker/Dockerfile.aarch64 rename to jb/project/docker/Dockerfile.oraclelinux_aarch64 index db05aa28ce03..6ef1132b7e77 100644 --- a/jb/project/docker/Dockerfile.aarch64 +++ b/jb/project/docker/Dockerfile.oraclelinux_aarch64 @@ -6,24 +6,28 @@ # NB: this also means there may be no security-related fixes there, need to # move the version to the next manually. -# jetbrains/runtime:jbr17env_aarch64 -FROM arm64v8/centos:7 +FROM arm64v8/oraclelinux:7 + +COPY scl.repo /etc/yum.repos.d/ # Install the necessary build tools RUN yum -y update; \ - yum -y install centos-release-scl; \ - yum -y install devtoolset-10-10.1-0.el7; \ + yum -y install \ + devtoolset-10-libstdc++-devel-10.2.1-11.2.0.2.el7.aarch64 \ + devtoolset-10-runtime-10.1-0.el7.aarch64 \ + devtoolset-10-binutils-2.35-5.el7.aarch64 \ + devtoolset-10-gcc-10.2.1-11.2.0.2.el7.aarch64 \ + devtoolset-10-gcc-c++-10.2.1-11.2.0.2.el7.aarch64; \ yum -y install \ alsa-lib-devel-1.1.8-1.el7.aarch64 \ autoconf-2.69-11.el7.noarch \ automake-1.13.4-3.el7.noarch \ - bzip2-1.0.6-13.el7.aarch64 \ - cups-devel-1.6.3-51.el7.aarch64 \ + bzip2-libs-1.0.6-13.el7.aarch64 \ + cups-devel-1.6.3-52.el7_9.aarch64 \ file-5.11-37.el7.aarch64 \ fontconfig-devel-2.13.0-4.3.el7.aarch64 \ freetype-devel-2.8-14.el7_9.1.aarch64 \ - giflib-devel-4.1.6-9.el7.aarch64 \ - git-1.8.3.1-24.el7_9.aarch64 \ + git-1.8.3.1-25.el7_9.aarch64 \ libtool-2.4.2-22.el7_3.aarch64 \ libXi-devel-1.7.9-1.el7.aarch64 \ libXrandr-devel-1.5.1-2.el7.aarch64 \ @@ -32,15 +36,14 @@ RUN yum -y update; \ libXtst-devel-1.2.3-1.el7.aarch64 \ make-3.82-24.el7.aarch64 \ rsync-3.1.2-12.el7_9.aarch64 \ - tar-1.26-35.el7.aarch64 \ - unzip-6.0-24.el7_9.aarch64 \ - wayland-devel-1.15.0-1.el7 \ - zip-3.0-11.el7.aarch64; \ - yum -y clean all + unzip-6.0-24.0.1.el7_9.aarch64 \ + zip-3.0-11.el7.aarch64 \ + wayland-devel-1.15.0-1.el7.aarch64; \ + yum -y clean all + +RUN git config --global user.email "teamcity@jetbrains.com" && \ + git config --global user.name "builduser" ENV PATH="/opt/rh/devtoolset-10/root/usr/bin:${PATH}" ENV LD_LIBRARY_PATH="/opt/rh/devtoolset-10/root/usr/lib64:/opt/rh/devtoolset-10/root/usr/lib:/opt/rh/devtoolset-10/root/usr/lib64/dyninst:/opt/rh/devtoolset-10/root/usr/lib/dyninst:/opt/rh/devtoolset-10/root/usr/lib64:/opt/rh/devtoolset-10/root/usr/lib" ENV PKG_CONFIG_PATH="/opt/rh/devtoolset-10/root/usr/lib64/pkgconfig" - -RUN git config --global user.email "teamcity@jetbrains.com" && \ - git config --global user.name "builduser" diff --git a/jb/project/docker/Dockerfile.oraclelinux_x86_64 b/jb/project/docker/Dockerfile.oraclelinux_x86_64 new file mode 100644 index 000000000000..5fbcd260340d --- /dev/null +++ b/jb/project/docker/Dockerfile.oraclelinux_x86_64 @@ -0,0 +1,50 @@ +# NOTE: This Dockerfile is meant to be used from the mkdocker_x86_64.sh script. + +# Pull a concrete version of Linux that does NOT recieve updates after it's +# been created. This is so that the image is as stable as possible to make +# image creation reproducible. +# NB: this also means there may be no security-related fixes there, need to +# move the version to the next manually. + +FROM amd64/oraclelinux:7 + +COPY scl.repo /etc/yum.repos.d/ + +# Install the necessary build tools +RUN yum -y update; \ + yum -y install \ + devtoolset-10-libstdc++-devel-10.2.1-11.1.0.1.el7.x86_64 \ + devtoolset-10-runtime-10.1-0.el7.x86_64 \ + devtoolset-10-binutils-2.35-5.el7.x86_64 \ + devtoolset-10-gcc-10.2.1-11.2.0.1.el7.x86_64 \ + devtoolset-10-gcc-c++-10.2.1-11.2.0.1.el7.x86_64; \ + yum -y install \ + alsa-lib-devel-1.1.8-1.el7.x86_64 \ + autoconf-2.69-11.el7.noarch \ + automake-1.13.4-3.el7.noarch \ + bzip2-libs-1.0.6-13.el7.x86_64 \ + cups-devel-1.6.3-52.el7_9.x86_64 \ + file-5.11-37.el7.x86_64 \ + fontconfig-devel-2.13.0-4.3.el7.x86_64 \ + freetype-devel-2.8-14.el7_9.1.x86_64 \ + git-1.8.3.1-25.el7_9.x86_64 \ + libtool-2.4.2-22.el7_3.x86_64 \ + libXi-devel-1.7.9-1.el7.x86_64 \ + libXrandr-devel-1.5.1-2.el7.x86_64 \ + libXrender-devel-0.9.10-1.el7.x86_64 \ + libXt-devel-1.1.5-3.el7.x86_64 \ + libXtst-devel-1.2.3-1.el7.x86_64 \ + make-3.82-24.el7.x86_64 \ + rsync-3.1.2-12.el7_9.x86_64 \ + unzip-6.0-24.0.1.el7_9.x86_64 \ + zip-3.0-11.el7.x86_64 \ + wayland-devel-1.15.0-1.el7.x86_64; \ + yum -y clean all + +RUN git config --global user.email "teamcity@jetbrains.com" && \ + git config --global user.name "builduser" && \ + git config --global --add safe.directory '*' + +ENV PATH="/opt/rh/devtoolset-10/root/usr/bin:${PATH}" +ENV LD_LIBRARY_PATH="/opt/rh/devtoolset-10/root/usr/lib64:/opt/rh/devtoolset-10/root/usr/lib:/opt/rh/devtoolset-10/root/usr/lib64/dyninst:/opt/rh/devtoolset-10/root/usr/lib/dyninst:/opt/rh/devtoolset-10/root/usr/lib64:/opt/rh/devtoolset-10/root/usr/lib" +ENV PKG_CONFIG_PATH="/opt/rh/devtoolset-10/root/usr/lib64/pkgconfig" diff --git a/jb/project/docker/Dockerfile.x86_64 b/jb/project/docker/Dockerfile.x86_64 index e61c59f00373..e69de29bb2d1 100644 --- a/jb/project/docker/Dockerfile.x86_64 +++ b/jb/project/docker/Dockerfile.x86_64 @@ -1,36 +0,0 @@ -# jetbrains/runtime:jbr17env_x86_64 -FROM centos:7 -RUN yum -y install centos-release-scl; \ - yum -y install devtoolset-10-10.1-0.el7; \ - yum -y install \ - alsa-lib-devel-1.1.8-1.el7 \ - autoconf-2.69-11.el7 \ - automake-1.13.4-3.el7 \ - bzip2-1.0.6-13.el7 \ - cups-devel-1.6.3-51.el7 \ - file-5.11-37.el7 \ - fontconfig-devel-2.13.0-4.3.el7 \ - freetype-devel-2.8-14.el7_9.1 \ - giflib-devel-4.1.6-9.el7 \ - git-1.8.3.1-24.el7_9 \ - libtool-2.4.2-22.el7_3 \ - libXi-devel-1.7.9-1.el7 \ - libXrandr-devel-1.5.1-2.el7 \ - libXrender-devel-0.9.10-1.el7 \ - libXt-devel-1.1.5-3.el7 \ - libXtst-devel-1.2.3-1.el7 \ - make-3.82-24.el7 \ - tar-1.26-35.el7 \ - unzip-6.0-24.el7_9 \ - wayland-devel-1.15.0-1.el7 \ - wget-1.14-18.el7_6.1 \ - which-2.20-7.el7 \ - zip-3.0-11.el7 - -RUN mkdir .git && \ - git config user.email "teamcity@jetbrains.com" && \ - git config user.name "builduser" - -ENV LD_LIBRARY_PATH="/opt/rh/devtoolset-10/root/usr/lib64:/opt/rh/devtoolset-10/root/usr/lib:/opt/rh/devtoolset-10/root/usr/lib64/dyninst:/opt/rh/devtoolset-10/root/usr/lib/dyninst:/opt/rh/devtoolset-10/root/usr/lib64:/opt/rh/devtoolset-10/root/usr/lib" -ENV PATH="/opt/rh/devtoolset-10/root/usr/bin::${PATH}" -ENV PKG_CONFIG_PATH="/opt/rh/devtoolset-10/root/usr/lib64/pkgconfig" \ No newline at end of file diff --git a/jb/project/docker/mkdocker_aarch64.sh b/jb/project/docker/mkdocker_aarch64.sh index d427f5692e91..c0b82f99e68f 100755 --- a/jb/project/docker/mkdocker_aarch64.sh +++ b/jb/project/docker/mkdocker_aarch64.sh @@ -4,10 +4,9 @@ set -euo pipefail set -x # This script creates a Docker image suitable for building AArch64 variant -# of the JetBrains Runtime version 17. -BOOT_JDK_REMOTE_FILE=zulu17.30.15-ca-jdk17.0.1-linux_aarch64.tar.gz -BOOT_JDK_SHA=4d9c9116eb0cdd2d7fb220d6d27059f4bf1b7e95cc93d5512bd8ce3791af86c7 +BOOT_JDK_REMOTE_FILE=zulu21.36.17-ca-jdk21.0.4-linux_aarch64.tar.gz +BOOT_JDK_SHA=da3c2d7db33670bcf66532441aeb7f33dcf0d227c8dafe7ce35cee67f6829c4c BOOT_JDK_LOCAL_FILE=boot_jdk.tar.gz if [ ! -f $BOOT_JDK_LOCAL_FILE ]; then @@ -22,7 +21,7 @@ sha256sum -c - < 0) { + if (compareVersions(version, EXPECTED_VERSION) > 0) { throw new RuntimeException(libraryPath + " has a dependency on glibc version " + version); } } } - System.out.println(libraryPath + " has no dependency on glibc version higher than 2.17"); + System.out.println(libraryPath + " has no dependency on glibc version higher than " + EXPECTED_VERSION); } private static String extractVersion(String line) {