6565jobs :
6666 build-linux :
6767 name : build
68- runs-on : ubuntu-20.04
69- container :
68+ runs-on : ubuntu-latest
69+ env :
70+ ACTIONS_RUNNER_DEBUG : true
71+ ACTIONS_STEP_DEBUG : true
72+ # container:
7073 # image: debian:bullseye
71- image : ubuntu:18.04
74+ # image: ubuntu:18.04
7275
7376 strategy :
7477 fail-fast : false
@@ -82,14 +85,34 @@ jobs:
8285 steps :
8386 - name : ' Install some dependencies'
8487 run : |
85- apt-get update
86- apt-get install -y build-essential git wget curl sudo unzip zip openjdk-11-jdk autoconf libfreetype6-dev libcups2-dev libx11-dev libxext-dev libxrender-dev libxrandr-dev libxtst-dev libxt-dev libasound2-dev libffi-dev file binutils libfontconfig-dev
88+ sudo apt-get update
89+ sudo apt-get install -y build-essential git wget curl sudo unzip zip openjdk-11-jdk autoconf libfreetype6-dev libcups2-dev libx11-dev libxext-dev libxrender-dev libxrandr-dev libxtst-dev libxt-dev libasound2-dev libffi-dev file binutils libfontconfig-dev debootstrap debian-archive-keyring
8790 # If we really need gcc-10, we can get it from this PPA:
88- apt-get install -y software-properties-common
91+ sudo apt-get install -y software-properties-common schroot fakeroot fakechroot
8992 sudo add-apt-repository ppa:ubuntu-toolchain-r/test
9093
94+ - name : ' Cache sysroot'
95+ uses : actions/cache@v3
96+ with :
97+ path : sysroot-focal
98+ key : sysroot-focal-${{ runner.as }}
99+
100+ - name : ' Setup cross-compilation sysroot'
101+ run : |
102+ set -vx
103+ if [ ! -d sysroot-focal ]; then
104+ sudo debootstrap --arch=$(dpkg --print-architecture) --foreign focal sysroot-focal http://archive.ubuntu.com/ubuntu
105+ fi
106+ sudo chroot sysroot-focal ${PWD}/sysroot-focal/$(which apt-get) update
107+ sudo chroot sysroot-focal ${PWD}/sysroot-focal/$(which apt-get) install -y build-essential git wget curl sudo unzip zip autoconf libfreetype6-dev libcups2-dev libx11-dev libxext-dev libxrender-dev libxrandr-dev libxtst-dev libxt-dev libasound2-dev libffi-dev file binutils libfontconfig-dev
108+ # If we really need gcc-10, we can get it from this PPA:
109+ sudo chroot sysroot-focal ${PWD}/sysroot-focal/$(which apt-get) install -y software-properties-common
110+ sudo chroot sysroot-focal ${PWD}/sysroot-focal/$(which sudo) add-apt-repository ppa:ubuntu-toolchain-r/test
111+ # So the OpenJDK configuration and build can use the sysroot
112+ sudo chown -R $USER:$USER sysroot-focal
113+
91114 - name : ' Checkout the JDK source'
92- uses : actions/checkout@v3
115+ uses : actions/checkout@v3.6.0
93116
94117 - name : ' Get the BootJDK'
95118 id : bootjdk
@@ -139,6 +162,10 @@ jobs:
139162 --with-gtest=${{ steps.gtest.outputs.path }}
140163 --with-zlib=system
141164 --with-jmod-compress=zip-1
165+ --with-sysroot=$PWD/sysroot-focal
166+ --with-extra-cflags="--sysroot=$PWD/sysroot-focal"
167+ --with-extra-cxxflags="--sysroot=$PWD/sysroot-focal"
168+ --with-extra-ldflags="--sysroot=$PWD/sysroot-focal"
142169 ${{ inputs.extra-conf-options }} ${{ inputs.configure-arguments }} || (
143170 echo "Dumping config.log:" &&
144171 cat config.log &&
0 commit comments