Skip to content

Commit

Permalink
Merge branch 'sapmachine' of https://github.com/SAP/SapMachine
Browse files Browse the repository at this point in the history
  • Loading branch information
schmelter-sap committed Feb 16, 2024
2 parents 597d680 + 1ff242b commit 8cfb6af
Show file tree
Hide file tree
Showing 2,334 changed files with 41,025 additions and 29,762 deletions.
4 changes: 2 additions & 2 deletions .github/actions/do-build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,15 @@ runs:
shell: bash

- name: 'Upload build logs'
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: failure-logs-${{ inputs.platform }}${{ inputs.debug-suffix }}
path: failure-logs
if: steps.check.outputs.failure == 'true'

# This is the best way I found to abort the job with an error message
- name: 'Notify about build failures'
uses: actions/github-script@v6
uses: actions/github-script@v7
with:
script: core.setFailed('Build failed. See summary for details.')
if: steps.check.outputs.failure == 'true'
2 changes: 1 addition & 1 deletion .github/actions/get-bootjdk/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ runs:

- name: 'Check cache for BootJDK'
id: get-cached-bootjdk
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: bootjdk/jdk
key: boot-jdk-${{ inputs.platform }}-${{ steps.sha256.outputs.value }}
Expand Down
4 changes: 2 additions & 2 deletions .github/actions/get-bundles/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,14 @@ runs:
steps:
- name: 'Download bundles artifact'
id: download-bundles
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: bundles-${{ inputs.platform }}${{ inputs.debug-suffix }}
path: bundles
continue-on-error: true

- name: 'Download bundles artifact (retry)'
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: bundles-${{ inputs.platform }}${{ inputs.debug-suffix }}
path: bundles
Expand Down
12 changes: 9 additions & 3 deletions .github/actions/get-jtreg/action.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2023, 2024, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -41,7 +41,7 @@ runs:

- name: 'Check cache for JTReg'
id: get-cached-jtreg
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: jtreg/installed
key: jtreg-${{ steps.version.outputs.value }}
Expand All @@ -56,8 +56,14 @@ runs:

- name: 'Build JTReg'
run: |
# If runner architecture is x64 set JAVA_HOME_17_X64 otherwise set to JAVA_HOME_17_arm64
if [[ '${{ runner.arch }}' == 'X64' ]]; then
JDK="$JAVA_HOME_17_X64"
else
JDK="$JAVA_HOME_17_arm64"
fi
# Build JTReg and move files to the proper locations
bash make/build.sh --jdk "$JAVA_HOME_17_X64"
bash make/build.sh --jdk "$JDK"
mkdir ../installed
mv build/images/jtreg/* ../installed
working-directory: jtreg/src
Expand Down
3 changes: 1 addition & 2 deletions .github/actions/get-msys2/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ runs:
using: composite
steps:
- name: 'Install MSYS2'
# use a specific release of msys2/setup-msys2 to prevent jtreg build failures on newer release
uses: msys2/setup-msys2@7efe20baefed56359985e327d329042cde2434ff
uses: msys2/setup-msys2@v2.22.0
with:
install: 'autoconf tar unzip zip make'
path-type: minimal
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/upload-bundles/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ runs:
shell: bash

- name: 'Upload bundles artifact'
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: bundles-${{ inputs.platform }}${{ inputs.debug-suffix }}
path: bundles
Expand Down
1 change: 1 addition & 0 deletions .github/scripts/gen-test-summary.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ error_count=$(echo $errors | wc -w || true)

if [[ "$failures" = "" && "$errors" = "" ]]; then
# We know something went wrong, but not what
echo 'failure=true' >> $GITHUB_OUTPUT
echo 'error-message=Unspecified test suite failure. Please see log for job for details.' >> $GITHUB_OUTPUT
exit 0
fi
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-cross-compile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ jobs:
- name: 'Check cache for sysroot'
id: get-cached-sysroot
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: sysroot
key: sysroot-${{ matrix.debian-arch }}-${{ hashFiles('./.github/workflows/build-cross-compile.yml') }}
Expand Down
11 changes: 7 additions & 4 deletions .github/workflows/build-macos.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2022, 2024, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -31,6 +31,9 @@ on:
platform:
required: true
type: string
runs-on:
required: true
type: string
extra-conf-options:
required: false
type: string
Expand All @@ -55,7 +58,7 @@ on:
jobs:
build-macos:
name: build
runs-on: macos-13
runs-on: ${{ inputs.runs-on }}

strategy:
fail-fast: false
Expand All @@ -74,7 +77,7 @@ jobs:
id: bootjdk
uses: ./.github/actions/get-bootjdk
with:
platform: macos-x64
platform: ${{ inputs.platform }}

- name: 'Get JTReg'
id: jtreg
Expand All @@ -87,7 +90,7 @@ jobs:
- name: 'Install toolchain and dependencies'
run: |
# Run Homebrew installation and xcode-select
brew install make
brew install autoconf make
sudo xcode-select --switch /Applications/Xcode_${{ inputs.xcode-toolset-version }}.app/Contents/Developer
# This will make GNU make available as 'make' and not only as 'gmake'
echo '/usr/local/opt/make/libexec/gnubin' >> $GITHUB_PATH
Expand Down
17 changes: 14 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2022, 2024, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -235,6 +235,7 @@ jobs:
uses: ./.github/workflows/build-macos.yml
with:
platform: macos-x64
runs-on: 'macos-13'
xcode-toolset-version: '14.3.1'
configure-arguments: ${{ github.event.inputs.configure-arguments }}
make-arguments: ${{ github.event.inputs.make-arguments }}
Expand All @@ -246,8 +247,8 @@ jobs:
uses: ./.github/workflows/build-macos.yml
with:
platform: macos-aarch64
runs-on: 'macos-14'
xcode-toolset-version: '14.3.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'
Expand Down Expand Up @@ -328,6 +329,16 @@ jobs:
bootjdk-platform: macos-x64
runs-on: macos-13

test-macos-aarch64:
name: macos-aarch64
needs:
- build-macos-aarch64
uses: ./.github/workflows/test.yml
with:
platform: macos-aarch64
bootjdk-platform: macos-aarch64
runs-on: macos-14

test-windows-x64:
name: windows-x64
needs:
Expand Down Expand Up @@ -365,7 +376,7 @@ jobs:
# Hack to get hold of the api environment variables that are only defined for actions
- name: 'Get API configuration'
id: api
uses: actions/github-script@v6
uses: actions/github-script@v7
with:
script: 'return { url: process.env["ACTIONS_RUNTIME_URL"], token: process.env["ACTIONS_RUNTIME_TOKEN"] }'

Expand Down
11 changes: 8 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ jobs:
- 'hs/tier1 compiler part 1'
- 'hs/tier1 compiler part 2'
- 'hs/tier1 compiler part 3'
- 'hs/tier1 compiler not-xcomp'
- 'hs/tier1 gc'
- 'hs/tier1 runtime'
- 'hs/tier1 serviceability'
Expand Down Expand Up @@ -90,13 +91,17 @@ jobs:
debug-suffix: -debug

- test-name: 'hs/tier1 compiler part 2'
test-suite: 'test/hotspot/jtreg/:tier1_compiler_2 test/hotspot/jtreg/:tier1_compiler_not_xcomp'
test-suite: 'test/hotspot/jtreg/:tier1_compiler_2'
debug-suffix: -debug

- test-name: 'hs/tier1 compiler part 3'
test-suite: 'test/hotspot/jtreg/:tier1_compiler_3'
debug-suffix: -debug

- test-name: 'hs/tier1 compiler not-xcomp'
test-suite: 'test/hotspot/jtreg/:tier1_compiler_not_xcomp'
debug-suffix: -debug

- test-name: 'hs/tier1 gc'
test-suite: 'test/hotspot/jtreg/:tier1_gc'
debug-suffix: -debug
Expand Down Expand Up @@ -206,15 +211,15 @@ jobs:
if: always()

- name: 'Upload test results'
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
path: results
name: ${{ steps.package.outputs.artifact-name }}
if: always()

# This is the best way I found to abort the job with an error message
- name: 'Notify about test failures'
uses: actions/github-script@v6
uses: actions/github-script@v7
with:
script: core.setFailed('${{ steps.run-tests.outputs.error-message }}')
if: steps.run-tests.outputs.failure == 'true'
2 changes: 1 addition & 1 deletion .jcheck/conf
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ version=0
domain=openjdk.org

[checks "whitespace"]
files=.*\.cpp|.*\.hpp|.*\.c|.*\.h|.*\.java|.*\.cc|.*\.hh|.*\.m|.*\.mm|.*\.md|.*\.gmk|.*\.m4|.*\.ac|Makefile
files=.*\.cpp|.*\.hpp|.*\.c|.*\.h|.*\.java|.*\.cc|.*\.hh|.*\.m|.*\.mm|.*\.md|.*\.properties|.*\.gmk|.*\.m4|.*\.ac|Makefile
ignore-tabs=.*\.gmk|Makefile

[checks "merge"]
Expand Down
40 changes: 30 additions & 10 deletions doc/building.html
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ <h1 class="title">Building the JDK</h1>
<li><a href="#autoconf" id="toc-autoconf">Autoconf</a></li>
<li><a href="#gnu-make" id="toc-gnu-make">GNU Make</a></li>
<li><a href="#gnu-bash" id="toc-gnu-bash">GNU Bash</a></li>
<li><a href="#graphviz-and-pandoc" id="toc-graphviz-and-pandoc">Graphviz
and Pandoc</a></li>
</ul></li>
<li><a href="#running-configure" id="toc-running-configure">Running
Configure</a>
Expand Down Expand Up @@ -524,7 +526,7 @@ <h3 id="linux">Linux</h3>
<p>The basic tooling is provided as part of the core operating system,
but you will most likely need to install developer packages.</p>
<p>For apt-based distributions (Debian, Ubuntu, etc), try this:</p>
<pre><code>sudo apt-get install build-essential</code></pre>
<pre><code>sudo apt-get install build-essential autoconf</code></pre>
<p>For rpm-based distributions (Fedora, Red Hat, etc), try this:</p>
<pre><code>sudo yum groupinstall &quot;Development Tools&quot;</code></pre>
<p>For Alpine Linux, aside from basic tooling, install the GNU versions
Expand Down Expand Up @@ -862,6 +864,13 @@ <h3 id="gnu-bash">GNU Bash</h3>
href="https://www.gnu.org/software/bash">GNU Bash</a>. No other shells
are supported.</p>
<p>At least version 3.2 of GNU Bash must be used.</p>
<h3 id="graphviz-and-pandoc">Graphviz and Pandoc</h3>
<p>In order to build the full docs (see the
<code>--enable-full-docs</code> configure option) <a
href="https://www.graphviz.org">Graphviz</a> and <a
href="https://pandoc.org">Pandoc</a> are required. Any recent versions
should work. For reference, and subject to change, Oracle builds use
Graphviz 9.0.0 and Pandoc 2.19.2.</p>
<h2 id="running-configure">Running Configure</h2>
<p>To build the JDK, you need a "configuration", which consists of a
directory where to store the build output, coupled with information
Expand Down Expand Up @@ -2157,15 +2166,26 @@ <h3 id="using-multiple-configurations">Using Multiple
<code>configure</code> from there, e.g.
<code>mkdir build/&lt;name&gt; &amp;&amp; cd build/&lt;name&gt; &amp;&amp; bash ../../configure</code>.</p>
<p>Then you can build that configuration using
<code>make CONF_NAME=&lt;name&gt;</code> or
<code>make CONF=&lt;pattern&gt;</code>, where
<code>&lt;pattern&gt;</code> is a substring matching one or several
configurations, e.g. <code>CONF=debug</code>. The special empty pattern
(<code>CONF=</code>) will match <em>all</em> available configuration, so
<code>make CONF= hotspot</code> will build the <code>hotspot</code>
target for all configurations. Alternatively, you can execute
<code>make</code> in the configuration directory, e.g.
<code>cd build/&lt;name&gt; &amp;&amp; make</code>.</p>
<code>make CONF=&lt;selector&gt;</code>, where
<code>&lt;selector&gt;</code> is interpreted as follows:</p>
<ul>
<li>If <code>&lt;selector&gt;</code> exacly matches the name of a
configuration, this and only this configuration will be selected.</li>
<li>If <code>&lt;selector&gt;</code> matches (i.e. is a substring of)
the names of several configurations, then all these configurations will
be selected.</li>
<li>If <code>&lt;selector&gt;</code> is empty (i.e. <code>CONF=</code>),
then all configurations will be selected.</li>
<li>If <code>&lt;selector&gt;</code> begins with <code>!</code>, then
all configurations <strong>not</strong> matching the string following
<code>!</code> will be selected.</li>
</ul>
<p>A more specialized version, <code>CONF_NAME=&lt;name&gt;</code> also
exists, which will only match if the given <code>&lt;name&gt;</code>
exactly matches a single configuration.</p>
<p>Alternatively, you can execute <code>make</code> in the configuration
directory, e.g. <code>cd build/&lt;name&gt; &amp;&amp; make</code>.</p>
<p><code>make CONF_NAME=&lt;name&gt;</code> or</p>
<h3 id="handling-reconfigurations">Handling Reconfigurations</h3>
<p>If you update the repository and part of the configure script has
changed, the build system will force you to re-run
Expand Down
35 changes: 28 additions & 7 deletions doc/building.md
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ will most likely need to install developer packages.
For apt-based distributions (Debian, Ubuntu, etc), try this:

```
sudo apt-get install build-essential
sudo apt-get install build-essential autoconf
```

For rpm-based distributions (Fedora, Red Hat, etc), try this:
Expand Down Expand Up @@ -685,6 +685,14 @@ shells are supported.

At least version 3.2 of GNU Bash must be used.

### Graphviz and Pandoc

In order to build the full docs (see the `--enable-full-docs`
configure option) [Graphviz](https://www.graphviz.org) and
[Pandoc](https://pandoc.org) are required. Any recent versions should
work. For reference, and subject to change, Oracle builds use Graphviz
9.0.0 and Pandoc 2.19.2.

## Running Configure

To build the JDK, you need a "configuration", which consists of a directory
Expand Down Expand Up @@ -1944,12 +1952,25 @@ configuration with the name `<name>`. Alternatively, you can create a directory
under `build` and run `configure` from there, e.g. `mkdir build/<name> && cd
build/<name> && bash ../../configure`.

Then you can build that configuration using `make CONF_NAME=<name>` or `make
CONF=<pattern>`, where `<pattern>` is a substring matching one or several
configurations, e.g. `CONF=debug`. The special empty pattern (`CONF=`) will
match *all* available configuration, so `make CONF= hotspot` will build the
`hotspot` target for all configurations. Alternatively, you can execute `make`
in the configuration directory, e.g. `cd build/<name> && make`.
Then you can build that configuration using `make CONF=<selector>`, where
`<selector>` is interpreted as follows:

* If `<selector>` exacly matches the name of a configuration, this and only
this configuration will be selected.
* If `<selector>` matches (i.e. is a substring of) the names of several
configurations, then all these configurations will be selected.
* If `<selector>` is empty (i.e. `CONF=`), then all configurations will be
selected.
* If `<selector>` begins with `!`, then all configurations **not** matching the
string following `!` will be selected.

A more specialized version, `CONF_NAME=<name>` also exists, which will only
match if the given `<name>` exactly matches a single configuration.

Alternatively, you can execute `make` in the configuration directory, e.g. `cd
build/<name> && make`.

`make CONF_NAME=<name>` or

### Handling Reconfigurations

Expand Down
Loading

0 comments on commit 8cfb6af

Please sign in to comment.