< prev index next >

.github/workflows/build-cross-compile.yml

Print this page
*** 59,31 ***
--- 59,36 ---
            - target-cpu: aarch64
              gnu-arch: aarch64
              debian-arch: arm64
              debian-repository: https://httpredir.debian.org/debian/
              debian-version: bullseye
+             tolerate-sysroot-errors: false
            - target-cpu: arm
              gnu-arch: arm
              debian-arch: armhf
              debian-repository: https://httpredir.debian.org/debian/
              debian-version: bullseye
+             tolerate-sysroot-errors: false
              gnu-abi: eabihf
            - target-cpu: s390x
              gnu-arch: s390x
              debian-arch: s390x
              debian-repository: https://httpredir.debian.org/debian/
              debian-version: bullseye
+             tolerate-sysroot-errors: false
            - target-cpu: ppc64le
              gnu-arch: powerpc64le
              debian-arch: ppc64el
              debian-repository: https://httpredir.debian.org/debian/
              debian-version: bullseye
+             tolerate-sysroot-errors: false
            - target-cpu: riscv64
              gnu-arch: riscv64
              debian-arch: riscv64
              debian-repository: https://httpredir.debian.org/debian/
              debian-version: sid
+             tolerate-sysroot-errors: true
  
      steps:
        - name: 'Checkout the JDK source'
          uses: actions/checkout@v4
  

*** 91,17 ***
          id: bootjdk
          uses: ./.github/actions/get-bootjdk
          with:
            platform: linux-x64
  
-         # Use linux-x64 JDK bundle as build JDK
-       - name: 'Get build JDK'
-         id: buildjdk
-         uses: ./.github/actions/get-bundles
-         with:
-           platform: linux-x64
- 
        - name: 'Get GTest'
          id: gtest
          uses: ./.github/actions/get-gtest
  
          # Upgrading apt to solve libc6 installation bugs, see JDK-8260460.
--- 96,10 ---

*** 118,30 ***
                libxrandr-dev libxtst-dev libcups2-dev libasound2-dev
            sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${{ inputs.gcc-major-version }} 100 --slave /usr/bin/g++ g++ /usr/bin/g++-${{ inputs.gcc-major-version }}
  
        - name: 'Check cache for sysroot'
          id: get-cached-sysroot
!         uses: actions/cache@v3
          with:
            path: sysroot
            key: sysroot-${{ matrix.debian-arch }}-${{ hashFiles('./.github/workflows/build-cross-compile.yml') }}
  
        - name: 'Install sysroot dependencies'
          run: sudo apt-get install debootstrap qemu-user-static
          if: steps.get-cached-sysroot.outputs.cache-hit != 'true'
  
        - name: 'Create sysroot'
          run: >
            sudo debootstrap
            --arch=${{ matrix.debian-arch }}
            --verbose
            --include=fakeroot,symlinks,build-essential,libx11-dev,libxext-dev,libxrender-dev,libxrandr-dev,libxtst-dev,libxt-dev,libcups2-dev,libfontconfig1-dev,libasound2-dev,libfreetype-dev,libpng-dev
            --resolve-deps
            --variant=minbase
            ${{ matrix.debian-version }}
            sysroot
            ${{ matrix.debian-repository }}
          if: steps.get-cached-sysroot.outputs.cache-hit != 'true'
  
        - name: 'Prepare sysroot'
          run: |
            # Prepare sysroot and remove unused files to minimize cache
--- 116,32 ---
                libxrandr-dev libxtst-dev libcups2-dev libasound2-dev
            sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${{ inputs.gcc-major-version }} 100 --slave /usr/bin/g++ g++ /usr/bin/g++-${{ inputs.gcc-major-version }}
  
        - name: 'Check cache for sysroot'
          id: get-cached-sysroot
!         uses: actions/cache@v4
          with:
            path: sysroot
            key: sysroot-${{ matrix.debian-arch }}-${{ hashFiles('./.github/workflows/build-cross-compile.yml') }}
  
        - name: 'Install sysroot dependencies'
          run: sudo apt-get install debootstrap qemu-user-static
          if: steps.get-cached-sysroot.outputs.cache-hit != 'true'
  
        - name: 'Create sysroot'
+         id: create-sysroot
          run: >
            sudo debootstrap
            --arch=${{ matrix.debian-arch }}
            --verbose
            --include=fakeroot,symlinks,build-essential,libx11-dev,libxext-dev,libxrender-dev,libxrandr-dev,libxtst-dev,libxt-dev,libcups2-dev,libfontconfig1-dev,libasound2-dev,libfreetype-dev,libpng-dev
            --resolve-deps
            --variant=minbase
            ${{ matrix.debian-version }}
            sysroot
            ${{ matrix.debian-repository }}
+         continue-on-error: ${{ matrix.tolerate-sysroot-errors }}
          if: steps.get-cached-sysroot.outputs.cache-hit != 'true'
  
        - name: 'Prepare sysroot'
          run: |
            # Prepare sysroot and remove unused files to minimize cache

*** 149,11 ***
            sudo chown ${USER} -R sysroot
            rm -rf sysroot/{dev,proc,run,sys,var}
            rm -rf sysroot/usr/{sbin,bin,share}
            rm -rf sysroot/usr/lib/{apt,gcc,udev,systemd}
            rm -rf sysroot/usr/libexec/gcc
!         if: steps.get-cached-sysroot.outputs.cache-hit != 'true'
  
        - name: 'Configure'
          run: >
            bash configure
            --with-conf-name=linux-${{ matrix.target-cpu }}
--- 149,16 ---
            sudo chown ${USER} -R sysroot
            rm -rf sysroot/{dev,proc,run,sys,var}
            rm -rf sysroot/usr/{sbin,bin,share}
            rm -rf sysroot/usr/lib/{apt,gcc,udev,systemd}
            rm -rf sysroot/usr/libexec/gcc
!         if: steps.create-sysroot.outcome == 'success' && steps.get-cached-sysroot.outputs.cache-hit != 'true'
+ 
+       - name: 'Remove broken sysroot'
+         run: |
+           sudo rm -rf sysroot/
+         if: steps.create-sysroot.outcome != 'success' && steps.get-cached-sysroot.outputs.cache-hit != 'true'
  
        - name: 'Configure'
          run: >
            bash configure
            --with-conf-name=linux-${{ matrix.target-cpu }}

*** 163,20 ***
            --with-zlib=system
            --enable-debug
            --disable-precompiled-headers
            --openjdk-target=${{ matrix.gnu-arch }}-linux-gnu${{ matrix.gnu-abi}}
            --with-sysroot=sysroot
-           --with-build-jdk=${{ steps.buildjdk.outputs.jdk-path }}
            --with-jmod-compress=zip-1
            CC=${{ matrix.gnu-arch }}-linux-gnu${{ matrix.gnu-abi}}-gcc-${{ inputs.gcc-major-version }}
            CXX=${{ matrix.gnu-arch }}-linux-gnu${{ matrix.gnu-abi}}-g++-${{ inputs.gcc-major-version }}
            ${{ inputs.extra-conf-options }} ${{ inputs.configure-arguments }} || (
            echo "Dumping config.log:" &&
            cat config.log &&
            exit 1)
  
        - name: 'Build'
          id: build
          uses: ./.github/actions/do-build
          with:
            make-target: 'hotspot ${{ inputs.make-arguments }}'
            platform: linux-${{ matrix.target-cpu }}
--- 168,21 ---
            --with-zlib=system
            --enable-debug
            --disable-precompiled-headers
            --openjdk-target=${{ matrix.gnu-arch }}-linux-gnu${{ matrix.gnu-abi}}
            --with-sysroot=sysroot
            --with-jmod-compress=zip-1
            CC=${{ matrix.gnu-arch }}-linux-gnu${{ matrix.gnu-abi}}-gcc-${{ inputs.gcc-major-version }}
            CXX=${{ matrix.gnu-arch }}-linux-gnu${{ matrix.gnu-abi}}-g++-${{ inputs.gcc-major-version }}
            ${{ inputs.extra-conf-options }} ${{ inputs.configure-arguments }} || (
            echo "Dumping config.log:" &&
            cat config.log &&
            exit 1)
+         if: steps.create-sysroot.outcome == 'success' || steps.get-cached-sysroot.outputs.cache-hit == 'true'
  
        - name: 'Build'
          id: build
          uses: ./.github/actions/do-build
          with:
            make-target: 'hotspot ${{ inputs.make-arguments }}'
            platform: linux-${{ matrix.target-cpu }}
+         if: steps.create-sysroot.outcome == 'success' || steps.get-cached-sysroot.outputs.cache-hit == 'true'
< prev index next >