forked from dyninst/dyninst
-
Notifications
You must be signed in to change notification settings - Fork 5
ci(dyninst): Add workflows to test rocprofiler-systems #30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
kcossett-amd
wants to merge
6
commits into
dyninst_13
Choose a base branch
from
users/kcossett-amd/rocprof-sys-dyninst-workflows
base: dyninst_13
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
e445a1b
GCC 14 RHEL 10 compile failure fixes
kcossett-amd 7d4980b
Build and install dyninst
kcossett-amd 5320864
rocprofiler-systems workflows
kcossett-amd 623e45c
Move test binaries
kcossett-amd 231ff9f
Rename workflows
kcossett-amd add2d8c
Address copilot comments
kcossett-amd File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,75 +1,169 @@ | ||
| name: Build Dyninst | ||
| name: Build and Install Dyninst (reusable) | ||
|
|
||
| # Builds Dyninst's third-party libraries from source, then builds and installs Dyninst. | ||
| # This job verifies only that the tree configures, compiles and installs. | ||
| # Functional coverage lives in the "rocprofiler-systems Build and Test" workflow. | ||
|
|
||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| name: | ||
| description: Display name for this configuration | ||
| required: true | ||
| type: string | ||
| os: | ||
| image: | ||
| description: Container image to build in | ||
| required: true | ||
| type: string | ||
| extra-libs: | ||
| cc: | ||
| required: false | ||
| type: string | ||
| extra-cmake-flags: | ||
| default: gcc | ||
| cxx: | ||
| required: false | ||
| type: string | ||
| c-compiler: | ||
| required: true | ||
| type: string | ||
| cxx-compiler: | ||
| required: true | ||
| default: g++ | ||
| # Match rocprofiler-systems workflow build type | ||
| build-types: | ||
| description: JSON array of CMAKE_BUILD_TYPE values | ||
| required: false | ||
| type: string | ||
| is-clang: | ||
| default: '["RELWITHDEBINFO"]' | ||
| container-options: | ||
| required: false | ||
| type: boolean | ||
| default: false | ||
| type: string | ||
| default: '--shm-size=512m' | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| env: | ||
| TPL_PREFIX: ${{ github.workspace }}/.tpls | ||
| INSTALL_PREFIX: ${{ github.workspace }}/install | ||
|
|
||
| jobs: | ||
| tpls: | ||
| name: ${{ inputs.name }} / third-party libs | ||
| runs-on: ubuntu-latest | ||
| container: | ||
| image: ${{ inputs.image }} | ||
| options: ${{ inputs.container-options }} | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
|
|
||
| # The prefix bakes absolute paths (elfutils is built with an absolute | ||
| # RPATH), so the cache is only valid for an identical workspace path and | ||
| # image. Both are part of the key. | ||
| - name: Cache third-party libs | ||
| id: tpl-cache | ||
| uses: actions/cache@v6 | ||
| with: | ||
| path: ${{ env.TPL_PREFIX }} | ||
| key: tpls-${{ inputs.image }}-${{ hashFiles('scripts/tpl-versions.env', 'scripts/build-tpls.sh') }} | ||
|
|
||
| - name: Build third-party libs | ||
| if: steps.tpl-cache.outputs.cache-hit != 'true' | ||
| run: bash scripts/build-tpls.sh --prefix "${TPL_PREFIX}" --jobs "$(nproc)" | ||
|
|
||
| build: | ||
| permissions: | ||
| packages: read | ||
| name: ${{ inputs.name }} (${{ matrix.build-type }}) | ||
| needs: tpls | ||
| runs-on: ubuntu-latest | ||
| container: | ||
| image: ${{ inputs.image }} | ||
| options: ${{ inputs.container-options }} | ||
|
|
||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| build-type: ['DEBUG', 'RELWITHDEBINFO', 'RELEASE'] | ||
| runs-on: ubuntu-latest | ||
| container: | ||
| image: ghcr.io/dyninst/amd64/${{ inputs.os }}:latest | ||
| credentials: | ||
| username: ${{ github.actor }} | ||
| password: ${{ secrets.github_token }} | ||
| name: ${{ inputs.name }} (${{ matrix.build-type }}) | ||
| build-type: ${{ fromJSON(inputs.build-types) }} | ||
|
|
||
| env: | ||
| CCACHE_DIR: ${{ github.workspace }}/.ccache | ||
|
|
||
| steps: | ||
| # Clang doesn't allow for multiple libomp installations | ||
| - name: Clean libomp install | ||
| if: ${{ inputs.is-clang }} | ||
| run: apt remove --purge -y "libomp*" | ||
|
|
||
| - name: Install C compiler (${{ inputs.c-compiler }}) | ||
| run: | | ||
| apt update -qq | ||
| apt install -qq --no-install-recommends -y ${{ inputs.c-compiler }} | ||
| - uses: actions/checkout@v6 | ||
|
|
||
| - name: Restore third-party libs | ||
| uses: actions/cache/restore@v6 | ||
| with: | ||
| path: ${{ env.TPL_PREFIX }} | ||
| key: tpls-${{ inputs.image }}-${{ hashFiles('scripts/tpl-versions.env', 'scripts/build-tpls.sh') }} | ||
| fail-on-cache-miss: true | ||
|
|
||
| # There is no apt package for clang++ | ||
| - name: Install ${{ inputs.cxx-compiler }} | ||
| if: ${{ !inputs.is-clang }} | ||
| run: apt install -qq --no-install-recommends -y ${{ inputs.cxx-compiler }} | ||
| - name: Restore ccache | ||
| uses: actions/cache@v6 | ||
| with: | ||
| path: ${{ env.CCACHE_DIR }} | ||
| key: ccache-${{ inputs.image }}-${{ matrix.build-type }}-${{ github.sha }} | ||
| restore-keys: | | ||
| ccache-${{ inputs.image }}-${{ matrix.build-type }}- | ||
|
|
||
| - name: Install extra libs (${{ inputs.extra-libs }}) | ||
| if: ${{ inputs.extra-libs != '' }} | ||
| run: apt install -qq --no-install-recommends -y ${{ inputs.extra-libs }} | ||
| - name: Configure ccache | ||
| run: | | ||
| mkdir -p "${CCACHE_DIR}" | ||
| ccache --max-size=1G | ||
| ccache --set-config=sloppiness=time_macros,include_file_mtime,include_file_ctime,pch_defines | ||
| ccache -z | ||
|
|
||
| - name: Configure Dyninst (${{ matrix.build-type }}) | ||
| shell: bash | ||
| - name: Configure | ||
| run: | | ||
| cmake /dyninst/src \ | ||
| -DCMAKE_BUILD_TYPE="${{ matrix.build-type }}" \ | ||
| -DCMAKE_C_COMPILER="${{ inputs.c-compiler }}" \ | ||
| -DCMAKE_CXX_COMPILER="${{ inputs.cxx-compiler }}" \ | ||
| -DDYNINST_WARNINGS_AS_ERRORS=ON ${{ inputs.extra-cmake-flags }} | ||
| git config --global --add safe.directory "${GITHUB_WORKSPACE}" | ||
| cmake --version | ||
| ${{ inputs.cxx }} --version | ||
| cmake -S . -B build \ | ||
| -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} \ | ||
| -DCMAKE_INSTALL_PREFIX="${INSTALL_PREFIX}" \ | ||
| -DCMAKE_C_COMPILER=${{ inputs.cc }} \ | ||
| -DCMAKE_CXX_COMPILER=${{ inputs.cxx }} \ | ||
| -DCMAKE_C_COMPILER_LAUNCHER=ccache \ | ||
| -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ | ||
| -DDYNINST_WARNINGS_AS_ERRORS=ON \ | ||
| -DTBB_ROOT_DIR="${TPL_PREFIX}/tbb" \ | ||
| -DElfUtils_ROOT_DIR="${TPL_PREFIX}/elfutils" \ | ||
| -DLibIberty_ROOT_DIR="${TPL_PREFIX}/binutils" | ||
|
|
||
| - name: Build Dyninst | ||
| # A silent fallback to the distro's TBB/elfutils/libiberty would make this | ||
| # job green while testing the wrong dependency versions. LibIberty in | ||
| # particular does not reliably exclude system paths, so assert explicitly. | ||
| - name: Verify third-party libs resolved to the built prefix | ||
| run: | | ||
| cmake --build . --parallel 2 | ||
| fail=0 | ||
| check() { | ||
| val=$(grep -E "^$1:" build/CMakeCache.txt | head -1 | cut -d= -f2-) | ||
| if [ -z "${val}" ]; then | ||
| echo "MISSING $1 is not set in CMakeCache.txt" | ||
| fail=1 | ||
| elif [ "${val#"${TPL_PREFIX}"}" != "${val}" ]; then | ||
| echo "ok $1 = ${val}" | ||
| else | ||
| echo "WRONG $1 = ${val}" | ||
| echo " expected a path under ${TPL_PREFIX}" | ||
| fail=1 | ||
| fi | ||
| } | ||
| check Elfutils_LIBRARIES | ||
| check LibIberty_LIBRARIES | ||
| check TBB_DIR | ||
| exit "${fail}" | ||
|
|
||
| - name: Build | ||
| run: cmake --build build --parallel "$(nproc)" | ||
|
|
||
| - name: Install | ||
| run: cmake --install build | ||
|
|
||
| - name: ccache stats | ||
| if: always() | ||
| run: ccache -s | ||
|
|
||
| - name: Upload CMake logs | ||
| if: failure() | ||
| uses: actions/upload-artifact@v7 | ||
| with: | ||
| name: cmake-logs-${{ inputs.name }}-${{ matrix.build-type }} | ||
| path: | | ||
| build/CMakeCache.txt | ||
| build/CMakeFiles/CMakeConfigureLog.yaml | ||
| build/CMakeFiles/*.log | ||
| if-no-files-found: ignore | ||
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.