hotspot: init MonitoringSupport_lock not only in G1GC case #280
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # This project is a modified version of OpenJDK, licensed under GPL v2. | |
| # Modifications Copyright (C) 2025 ByteDance Inc. | |
| # | |
| # Copyright (c) 2022, 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 | |
| # under the terms of the GNU General Public License version 2 only, as | |
| # published by the Free Software Foundation. Oracle designates this | |
| # particular file as subject to the "Classpath" exception as provided | |
| # by Oracle in the LICENSE file that accompanied this code. | |
| # | |
| # This code is distributed in the hope that it will be useful, but WITHOUT | |
| # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
| # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
| # version 2 for more details (a copy is included in the LICENSE file that | |
| # accompanied this code). | |
| # | |
| # You should have received a copy of the GNU General Public License version | |
| # 2 along with this work; if not, write to the Free Software Foundation, | |
| # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | |
| # | |
| # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA | |
| # or visit www.oracle.com if you need additional information or have any | |
| # questions. | |
| # | |
| name: 'CVM build and test' | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| on: | |
| pull_request: | |
| branches: | |
| - jdk17u-target8 | |
| - jdk25u-target8 | |
| workflow_dispatch: | |
| inputs: | |
| platforms: | |
| description: 'Platform(s) to execute on (comma separated, e.g. "linux-x64, macos, aarch64")' | |
| required: true | |
| default: 'linux-x64, linux-aarch64' | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| ### | |
| ### Determine platforms to include | |
| ### | |
| select: | |
| name: 'Select platforms' | |
| runs-on: ubuntu-22.04 | |
| outputs: | |
| linux-x64: ${{ steps.include.outputs.linux-x64 }} | |
| linux-aarch64: ${{ steps.include.outputs.linux-aarch64 }} | |
| steps: | |
| # This function must be inlined in main.yml, or we'd be forced to checkout the repo | |
| - name: 'Check what jobs to run' | |
| id: include | |
| run: | | |
| # Determine which platform jobs to run | |
| # Returns 'true' if the input platform list matches any of the platform monikers given as argument, | |
| # 'false' otherwise. | |
| # arg $1: platform name or names to look for | |
| function check_platform() { | |
| if [[ '${{ !secrets.JDK_SUBMIT_FILTER || startsWith(github.ref, 'refs/heads/submit/') }}' == 'false' ]]; then | |
| # If JDK_SUBMIT_FILTER is set, and this is not a "submit/" branch, don't run anything | |
| echo 'false' | |
| return | |
| fi | |
| if [[ $GITHUB_EVENT_NAME == workflow_dispatch ]]; then | |
| input='${{ github.event.inputs.platforms }}' | |
| elif [[ $GITHUB_EVENT_NAME == pull_request ]]; then | |
| input='${{ secrets.JDK_SUBMIT_PLATFORMS }}' | |
| else | |
| echo 'Internal error in GHA' | |
| exit 1 | |
| fi | |
| normalized_input="$(echo ,$input, | tr -d ' ')" | |
| if [[ "$normalized_input" == ",," ]]; then | |
| # For an empty input, assume all platforms should run | |
| echo 'true' | |
| return | |
| else | |
| # Check for all acceptable platform names | |
| for part in $* ; do | |
| if echo "$normalized_input" | grep -q -e ",$part," ; then | |
| echo 'true' | |
| return | |
| fi | |
| done | |
| fi | |
| echo 'false' | |
| } | |
| echo "linux-x64=$(check_platform linux-x64 linux x64)" >> $GITHUB_OUTPUT | |
| echo "linux-aarch64=$(check_platform linux-aarch64 linux aarch64)" >> $GITHUB_OUTPUT | |
| ### | |
| ### Build jobs | |
| ### | |
| build-linux-x64: | |
| name: linux-x64 | |
| needs: select | |
| uses: ./.github/workflows/build-linux.yml | |
| with: | |
| platform: linux_x64 | |
| apt-gcc-version: '9' | |
| runs-on: ubuntu-22.04 | |
| # 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' | |
| build-linux-aarch64: | |
| name: linux-aarch64 | |
| needs: select | |
| uses: ./.github/workflows/build-linux.yml | |
| with: | |
| platform: linux_aarch64 | |
| apt-gcc-version: '9' | |
| runs-on: ubuntu-22.04-arm | |
| # The linux-aarch64 jdk bundle is used as buildjdk for the cross-compile job | |
| if: needs.select.outputs.linux-aarch64 == 'true' || needs.select.outputs.linux-cross-compile == 'true' | |
| ### | |
| ### Test jobs | |
| ### | |
| test-linux-x64: | |
| name: linux-x64 | |
| needs: | |
| - build-linux-x64 | |
| uses: ./.github/workflows/test-cvm8+17.yml | |
| with: | |
| platform: linux_x64 | |
| arch: x64 | |
| runs-on: ubuntu-22.04 | |
| debug-level: release | |
| test-linux-aarch64: | |
| name: linux-aarch64 | |
| needs: | |
| - build-linux-aarch64 | |
| uses: ./.github/workflows/test-cvm8+17.yml | |
| with: | |
| platform: linux_aarch64 | |
| arch: aarch64 | |
| runs-on: ubuntu-22.04-arm | |
| debug-level: release | |
| # Remove bundles so they are not misconstrued as binary distributions from the JDK project | |
| remove-bundles: | |
| name: 'Remove bundle artifacts' | |
| runs-on: ubuntu-22.04 | |
| if: always() | |
| needs: | |
| - build-linux-x64 | |
| - test-linux-x64 | |
| - build-linux-aarch64 | |
| - test-linux-aarch64 | |
| steps: | |
| # 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 | |
| with: | |
| script: 'return { url: process.env["ACTIONS_RUNTIME_URL"], token: process.env["ACTIONS_RUNTIME_TOKEN"] }' | |
| - name: 'Remove bundle artifacts' | |
| run: | | |
| # Find and remove all bundle artifacts | |
| ALL_ARTIFACT_IDS="$(curl -sL \ | |
| -H 'Accept: application/vnd.github+json' \ | |
| -H 'Authorization: Bearer ${{ github.token }}' \ | |
| -H 'X-GitHub-Api-Version: 2022-11-28' \ | |
| '${{ github.api_url }}/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts?per_page=100')" | |
| BUNDLE_ARTIFACT_IDS="$(echo "$ALL_ARTIFACT_IDS" | jq -r -c '.artifacts | map(select(.name|startswith("cvm"))) | .[].id')" | |
| for id in $BUNDLE_ARTIFACT_IDS; do | |
| echo "Removing $id" | |
| curl -sL \ | |
| -X DELETE \ | |
| -H 'Accept: application/vnd.github+json' \ | |
| -H 'Authorization: Bearer ${{ github.token }}' \ | |
| -H 'X-GitHub-Api-Version: 2022-11-28' \ | |
| "${{ github.api_url }}/repos/${{ github.repository }}/actions/artifacts/$id" \ | |
| || echo "Failed to remove bundle" | |
| done |