Skip to content

Commit d773903

Browse files
committed
GHA: Try using a sysroot instead of a container
1 parent b24d30c commit d773903

File tree

6 files changed

+42
-15
lines changed

6 files changed

+42
-15
lines changed

.github/actions/get-gtest/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ runs:
4040
var: GTEST_VERSION
4141

4242
- name: 'Checkout GTest source'
43-
uses: actions/checkout@v3
43+
uses: actions/checkout@v4
4444
with:
4545
repository: google/googletest
4646
ref: 'v${{ steps.version.outputs.value }}'

.github/actions/get-jtreg/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ runs:
5252
key: jtreg-${{ steps.version.outputs.value }}
5353

5454
- name: 'Checkout the JTReg source'
55-
uses: actions/checkout@v3
55+
uses: actions/checkout@v4
5656
with:
5757
repository: openjdk/jtreg
5858
ref: jtreg-${{ steps.version.outputs.value }}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ on:
4444
jobs:
4545
build-cross-compile:
4646
name: build
47-
runs-on: ubuntu-22.04
47+
runs-on: ubuntu-latest
4848

4949
strategy:
5050
fail-fast: false

.github/workflows/build-linux.yml

Lines changed: 34 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,13 @@ on:
6565
jobs:
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 &&

.github/workflows/build-windows.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ env:
6363
jobs:
6464
build-windows:
6565
name: build
66-
runs-on: windows-2019
66+
runs-on: windows-2022
6767
defaults:
6868
run:
6969
shell: bash

.github/workflows/main.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ jobs:
5757

5858
select:
5959
name: 'Select platforms'
60-
runs-on: ubuntu-20.04
60+
runs-on: ubuntu-latest
6161
outputs:
6262
linux-x64: ${{ steps.include.outputs.linux-x64 }}
6363
linux-x86: ${{ steps.include.outputs.linux-x86 }}
@@ -300,7 +300,7 @@ jobs:
300300
with:
301301
platform: linux-x64
302302
bootjdk-platform: linux-x64
303-
runs-on: ubuntu-20.04
303+
runs-on: ubuntu-latest
304304

305305
test-linux-x86:
306306
name: linux-x86
@@ -310,7 +310,7 @@ jobs:
310310
with:
311311
platform: linux-x86
312312
bootjdk-platform: linux-x64
313-
runs-on: ubuntu-20.04
313+
runs-on: ubuntu-latest
314314

315315
test-macos-x64:
316316
name: macos-x64
@@ -330,7 +330,7 @@ jobs:
330330
with:
331331
platform: windows-x64
332332
bootjdk-platform: windows-x64
333-
runs-on: windows-2019
333+
runs-on: windows-2022
334334

335335
# Remove bundles so they are not misconstrued as binary distributions from the JDK project
336336
#remove-bundles:

0 commit comments

Comments
 (0)