Skip to content

Commit fa6d74e

Browse files
committed
GHA: Use sysroot instead of container
1 parent 9b3617c commit fa6d74e

File tree

1 file changed

+23
-2
lines changed

1 file changed

+23
-2
lines changed

.github/workflows/build-linux.yml

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,9 @@ jobs:
6666
build-linux:
6767
name: build
6868
runs-on: ubuntu-latest
69-
container:
69+
#container:
7070
#image: debian:bullseye
71-
image: ubuntu:18.04
71+
#image: ubuntu:18.04
7272

7373
strategy:
7474
fail-fast: false
@@ -88,6 +88,23 @@ jobs:
8888
apt-get install -y software-properties-common
8989
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
9090
91+
- name: 'Cache sysroot'
92+
uses: actions/cache@v3
93+
with:
94+
path: sysroot-bullseye
95+
key: sysroot-bullseye-${{ runner.as }}
96+
97+
- name: 'Setup cross-compilation sysroot'
98+
run: |
99+
if [ ! -d sysroot-bullseye ]; then
100+
sudo debootstrap --arch=$(dpkg --print-architecture) bullseye sysroot-bullseye http://archive.ubuntu.com/ubuntu
101+
fi
102+
sudo chroot sysroot-bullseye apt-get update
103+
sudo chroot sysroot-bullseye 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
104+
# If we really need gcc-10, we can get it from this PPA:
105+
sudo chroot sysroot-bullseye apt-get install -y software-properties-common
106+
sudo chroot sysroot-bullseye sudo add-apt-repository ppa:ubuntu-toolchain-r/test
107+
91108
- name: 'Checkout the JDK source'
92109
uses: actions/checkout@v3.6.0
93110

@@ -139,6 +156,10 @@ jobs:
139156
--with-gtest=${{ steps.gtest.outputs.path }}
140157
--with-zlib=system
141158
--with-jmod-compress=zip-1
159+
--with-sysroot=$PWD/sysroot-bullseye
160+
--with-extra-cflags="--sysroot=$PWD/sysroot-bullseye"
161+
--with-extra-cxxflags="--sysroot=$PWD/sysroot-bullseye"
162+
--with-extra-ldflags="--sysroot=$PWD/sysroot-bullseye"
142163
${{ inputs.extra-conf-options }} ${{ inputs.configure-arguments }} || (
143164
echo "Dumping config.log:" &&
144165
cat config.log &&

0 commit comments

Comments
 (0)