Skip to content

Commit

Permalink
8293107: GHA: Bump to Ubuntu 22.04
Browse files Browse the repository at this point in the history
8293098: GHA: Harmonize GCC version handling for host and cross builds
8293361: GHA: dump config.log in case of configure failure
8295213: Run GHA manually with user-specified make and configure arguments
8313428: GHA: Bump GCC versions for July 2023 updates
8313707: GHA: Bootstrap sysroots with --variant=minbase

Reviewed-by: clanger
Backport-of: d7536588b38e368eaa6395bcbcc6724a39303fc5
  • Loading branch information
shipilev committed Aug 14, 2023
1 parent d7b3306 commit 260f287
Show file tree
Hide file tree
Showing 5 changed files with 113 additions and 29 deletions.
31 changes: 21 additions & 10 deletions .github/workflows/build-cross-compile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,23 @@ on:
workflow_call:
inputs:
gcc-major-version:
required: false
required: true
type: string
default: '10'
apt-gcc-version:
required: true
type: string
apt-gcc-cross-version:
required: true
type: string
extra-conf-options:
required: false
type: string
configure-arguments:
required: false
type: string
default: '10.4.0-4ubuntu1~22.04'
apt-gcc-cross-suffix:
make-arguments:
required: false
type: string
default: 'cross1'

jobs:
build-cross-compile:
Expand Down Expand Up @@ -109,8 +115,8 @@ jobs:
sudo apt-get install \
gcc-${{ inputs.gcc-major-version }}=${{ inputs.apt-gcc-version }} \
g++-${{ inputs.gcc-major-version }}=${{ inputs.apt-gcc-version }} \
gcc-${{ inputs.gcc-major-version }}-${{ matrix.gnu-arch }}-linux-gnu${{ matrix.gnu-abi}}=${{ inputs.apt-gcc-version }}${{ inputs.apt-gcc-cross-suffix }} \
g++-${{ inputs.gcc-major-version }}-${{ matrix.gnu-arch }}-linux-gnu${{ matrix.gnu-abi}}=${{ inputs.apt-gcc-version }}${{ inputs.apt-gcc-cross-suffix }} \
gcc-${{ inputs.gcc-major-version }}-${{ matrix.gnu-arch }}-linux-gnu${{ matrix.gnu-abi}}=${{ inputs.apt-gcc-cross-version }} \
g++-${{ inputs.gcc-major-version }}-${{ matrix.gnu-arch }}-linux-gnu${{ matrix.gnu-abi}}=${{ inputs.apt-gcc-cross-version }} \
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 }}
Expand All @@ -132,6 +138,7 @@ jobs:
--verbose
--include=fakeroot,symlinks,build-essential,libx11-dev,libxext-dev,libxrender-dev,libxrandr-dev,libxtst-dev,libxt-dev,libcups2-dev,libfontconfig1-dev,libasound2-dev,libfreetype6-dev,libpng-dev
--resolve-deps
--variant=minbase
${{ matrix.debian-version }}
sysroot
${{ matrix.debian-repository }}
Expand All @@ -157,12 +164,16 @@ jobs:
--openjdk-target=${{ matrix.gnu-arch }}-linux-gnu${{ matrix.gnu-abi}}
--with-sysroot=sysroot
--with-build-jdk=${{ steps.buildjdk.outputs.jdk-path }}
CC=${{ matrix.gnu-arch }}-linux-gnu${{ matrix.gnu-abi}}-gcc-10
CXX=${{ matrix.gnu-arch }}-linux-gnu${{ matrix.gnu-abi}}-g++-10
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'
make-target: 'hotspot ${{ inputs.make-arguments }}'
platform: linux-${{ matrix.target-cpu }}
26 changes: 21 additions & 5 deletions .github/workflows/build-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@ on:
required: false
type: string
default: '[ "debug", "release" ]'
gcc-major-version:
required: true
type: string
gcc-package-suffix:
required: false
type: string
default: ''
apt-gcc-version:
required: true
type: string
Expand All @@ -51,11 +58,17 @@ on:
apt-extra-packages:
required: false
type: string
configure-arguments:
required: false
type: string
make-arguments:
required: false
type: string

jobs:
build-linux:
name: build
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04

strategy:
fail-fast: false
Expand Down Expand Up @@ -101,8 +114,8 @@ jobs:
fi
sudo apt-get update
sudo apt-get install --only-upgrade apt
sudo apt-get install gcc-${{ inputs.apt-gcc-version }} g++-${{ inputs.apt-gcc-version }} libxrandr-dev${{ steps.arch.outputs.suffix }} libxtst-dev${{ steps.arch.outputs.suffix }} libcups2-dev${{ steps.arch.outputs.suffix }} libasound2-dev${{ steps.arch.outputs.suffix }} ${{ inputs.apt-extra-packages }}
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 100 --slave /usr/bin/g++ g++ /usr/bin/g++-10
sudo apt-get install gcc-${{ inputs.gcc-major-version }}${{ inputs.gcc-package-suffix }}=${{ inputs.apt-gcc-version }} g++-${{ inputs.gcc-major-version }}${{ inputs.gcc-package-suffix }}=${{ inputs.apt-gcc-version }} libxrandr-dev${{ steps.arch.outputs.suffix }} libxtst-dev${{ steps.arch.outputs.suffix }} libcups2-dev${{ steps.arch.outputs.suffix }} libasound2-dev${{ steps.arch.outputs.suffix }} ${{ inputs.apt-extra-packages }}
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: 'Configure'
run: >
Expand All @@ -115,13 +128,16 @@ jobs:
--with-gtest=${{ steps.gtest.outputs.path }}
--enable-jtreg-failure-handler
--with-zlib=system
${{ inputs.extra-conf-options }}
${{ 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: '${{ inputs.make-target }}'
make-target: '${{ inputs.make-target }} ${{ inputs.make-arguments }}'
platform: ${{ inputs.platform }}
debug-suffix: '${{ matrix.suffix }}'

Expand Down
13 changes: 11 additions & 2 deletions .github/workflows/build-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ on:
xcode-toolset-version:
required: true
type: string
configure-arguments:
required: false
type: string
make-arguments:
required: false
type: string

jobs:
build-macos:
Expand Down Expand Up @@ -97,13 +103,16 @@ jobs:
--with-gtest=${{ steps.gtest.outputs.path }}
--enable-jtreg-failure-handler
--with-zlib=system
${{ inputs.extra-conf-options }}
${{ 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: '${{ inputs.make-target }}'
make-target: '${{ inputs.make-target }} ${{ inputs.make-arguments }}'
platform: ${{ inputs.platform }}
debug-suffix: '${{ matrix.suffix }}'

Expand Down
13 changes: 11 additions & 2 deletions .github/workflows/build-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@ on:
msvc-toolset-architecture:
required: true
type: string
configure-arguments:
required: false
type: string
make-arguments:
required: false
type: string

env:
# These are needed to make the MSYS2 bash work properly
Expand Down Expand Up @@ -124,7 +130,10 @@ jobs:
--with-gtest=${{ steps.gtest.outputs.path }}
--enable-jtreg-failure-handler
--with-msvc-toolset-version=${{ inputs.msvc-toolset-version }}
${{ inputs.extra-conf-options }}
${{ inputs.extra-conf-options }} ${{ inputs.configure-arguments }} || (
echo "Dumping config.log:" &&
cat config.log &&
exit 1)
env:
# We need a minimal PATH on Windows
# Set PATH to "", so just GITHUB_PATH is included
Expand All @@ -134,7 +143,7 @@ jobs:
id: build
uses: ./.github/actions/do-build
with:
make-target: '${{ inputs.make-target }}'
make-target: '${{ inputs.make-target }} ${{ inputs.make-arguments }}'
platform: ${{ inputs.platform }}
debug-suffix: '${{ matrix.suffix }}'

Expand Down
59 changes: 49 additions & 10 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ on:
description: 'Platform(s) to execute on (comma separated, e.g. "linux-x64, macos, aarch64")'
required: true
default: 'linux-x64, linux-x86, linux-x64-variants, linux-cross-compile, macos-x64, macos-aarch64, windows-x64, windows-aarch64'
configure-arguments:
description: 'Additional configure arguments'
required: false
make-arguments:
description: 'Additional make arguments'
required: false

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand All @@ -49,7 +55,7 @@ jobs:

select:
name: 'Select platforms'
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
outputs:
linux-x64: ${{ steps.include.outputs.linux-x64 }}
linux-x86: ${{ steps.include.outputs.linux-x86 }}
Expand Down Expand Up @@ -121,7 +127,10 @@ jobs:
uses: ./.github/workflows/build-linux.yml
with:
platform: linux-x64
apt-gcc-version: '10=10.3.0-1ubuntu1~20.04'
gcc-major-version: '10'
apt-gcc-version: '10.5.0-1ubuntu1~22.04'
configure-arguments: ${{ github.event.inputs.configure-arguments }}
make-arguments: ${{ github.event.inputs.make-arguments }}
# The linux-x64 jdk bundle is used as buildjdk for the cross-compile job
if: needs.select.outputs.linux-x64 == 'true' || needs.select.outputs.linux-cross-compile == 'true'

Expand All @@ -131,12 +140,16 @@ jobs:
uses: ./.github/workflows/build-linux.yml
with:
platform: linux-x86
apt-gcc-version: '10-multilib'
gcc-major-version: '10'
gcc-package-suffix: '-multilib'
apt-gcc-version: '10.5.0-1ubuntu1~22.04'
apt-architecture: 'i386'
# Some multilib libraries do not have proper inter-dependencies, so we have to
# install their dependencies manually.
apt-extra-packages: 'libfreetype6-dev:i386 libtiff-dev:i386 libcupsimage2-dev:i386'
extra-conf-options: '--with-target-bits=32'
configure-arguments: ${{ github.event.inputs.configure-arguments }}
make-arguments: ${{ github.event.inputs.make-arguments }}
if: needs.select.outputs.linux-x86 == 'true'

build-linux-x64-hs-nopch:
Expand All @@ -147,8 +160,11 @@ jobs:
platform: linux-x64
make-target: 'hotspot'
debug-levels: '[ "debug" ]'
apt-gcc-version: '10=10.3.0-1ubuntu1~20.04'
gcc-major-version: '10'
apt-gcc-version: '10.5.0-1ubuntu1~22.04'
extra-conf-options: '--disable-precompiled-headers'
configure-arguments: ${{ github.event.inputs.configure-arguments }}
make-arguments: ${{ github.event.inputs.make-arguments }}
if: needs.select.outputs.linux-x64-variants == 'true'

build-linux-x64-hs-zero:
Expand All @@ -159,8 +175,11 @@ jobs:
platform: linux-x64
make-target: 'hotspot'
debug-levels: '[ "debug" ]'
apt-gcc-version: '10=10.3.0-1ubuntu1~20.04'
gcc-major-version: '10'
apt-gcc-version: '10.5.0-1ubuntu1~22.04'
extra-conf-options: '--with-jvm-variants=zero --disable-precompiled-headers'
configure-arguments: ${{ github.event.inputs.configure-arguments }}
make-arguments: ${{ github.event.inputs.make-arguments }}
if: needs.select.outputs.linux-x64-variants == 'true'

build-linux-x64-hs-minimal:
Expand All @@ -171,8 +190,11 @@ jobs:
platform: linux-x64
make-target: 'hotspot'
debug-levels: '[ "debug" ]'
apt-gcc-version: '10=10.3.0-1ubuntu1~20.04'
gcc-major-version: '10'
apt-gcc-version: '10.5.0-1ubuntu1~22.04'
extra-conf-options: '--with-jvm-variants=minimal --disable-precompiled-headers'
configure-arguments: ${{ github.event.inputs.configure-arguments }}
make-arguments: ${{ github.event.inputs.make-arguments }}
if: needs.select.outputs.linux-x64-variants == 'true'

build-linux-x64-hs-optimized:
Expand All @@ -184,8 +206,11 @@ jobs:
make-target: 'hotspot'
# Technically this is not the "debug" level, but we can't inject a new matrix state for just this job
debug-levels: '[ "debug" ]'
apt-gcc-version: '10=10.3.0-1ubuntu1~20.04'
gcc-major-version: '10'
apt-gcc-version: '10.5.0-1ubuntu1~22.04'
extra-conf-options: '--with-debug-level=optimized --disable-precompiled-headers'
configure-arguments: ${{ github.event.inputs.configure-arguments }}
make-arguments: ${{ github.event.inputs.make-arguments }}
if: needs.select.outputs.linux-x64-variants == 'true'

build-linux-cross-compile:
Expand All @@ -194,6 +219,12 @@ jobs:
- select
- build-linux-x64
uses: ./.github/workflows/build-cross-compile.yml
with:
gcc-major-version: '10'
apt-gcc-version: '10.5.0-1ubuntu1~22.04'
apt-gcc-cross-version: '10.5.0-1ubuntu1~22.04cross1'
configure-arguments: ${{ github.event.inputs.configure-arguments }}
make-arguments: ${{ github.event.inputs.make-arguments }}
if: needs.select.outputs.linux-cross-compile == 'true'

build-macos-x64:
Expand All @@ -203,6 +234,8 @@ jobs:
with:
platform: macos-x64
xcode-toolset-version: '12.5.1'
configure-arguments: ${{ github.event.inputs.configure-arguments }}
make-arguments: ${{ github.event.inputs.make-arguments }}
if: needs.select.outputs.macos-x64 == 'true'

build-macos-aarch64:
Expand All @@ -213,6 +246,8 @@ jobs:
platform: macos-aarch64
xcode-toolset-version: '12.5.1'
extra-conf-options: '--openjdk-target=aarch64-apple-darwin'
configure-arguments: ${{ github.event.inputs.configure-arguments }}
make-arguments: ${{ github.event.inputs.make-arguments }}
if: needs.select.outputs.macos-aarch64 == 'true'

build-windows-x64:
Expand All @@ -223,6 +258,8 @@ jobs:
platform: windows-x64
msvc-toolset-version: '14.29'
msvc-toolset-architecture: 'x86.x64'
configure-arguments: ${{ github.event.inputs.configure-arguments }}
make-arguments: ${{ github.event.inputs.make-arguments }}
if: needs.select.outputs.windows-x64 == 'true'

build-windows-aarch64:
Expand All @@ -235,6 +272,8 @@ jobs:
msvc-toolset-architecture: 'arm64'
make-target: 'hotspot'
extra-conf-options: '--openjdk-target=aarch64-unknown-cygwin'
configure-arguments: ${{ github.event.inputs.configure-arguments }}
make-arguments: ${{ github.event.inputs.make-arguments }}
if: needs.select.outputs.windows-aarch64 == 'true'

###
Expand All @@ -249,7 +288,7 @@ jobs:
with:
platform: linux-x64
bootjdk-platform: linux-x64
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04

test-linux-x86:
name: linux-x86
Expand All @@ -259,7 +298,7 @@ jobs:
with:
platform: linux-x86
bootjdk-platform: linux-x64
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04

test-macos-x64:
name: macos-x64
Expand All @@ -284,7 +323,7 @@ jobs:
# Remove bundles so they are not misconstrued as binary distributions from the JDK project
remove-bundles:
name: 'Remove bundle artifacts'
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
if: always()
needs:
- build-linux-x64
Expand Down

1 comment on commit 260f287

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.