Skip to content

[PyRTG] Add Github CI workflow - #10850

Open
maerhart wants to merge 15 commits into
mainfrom
maerhart-pyrtg-ci
Open

[PyRTG] Add Github CI workflow#10850
maerhart wants to merge 15 commits into
mainfrom
maerhart-pyrtg-ci

Conversation

@maerhart

Copy link
Copy Markdown
Member

We don't have any CI for PyRTG yet. I'm interested in running it for 2 purposes:

  1. Check that changes to PyRTG and the RTG dialect don't break it
  2. Check that LLVM bumps don't break it (has happened in the past)

We could runs on PRs filter on the PyRTG and RTG dialect directories, but it also means the 2nd case is only covered by runs on the main branch.

Assisted-by: Claude Code:Opus 4.8[1M]

@circt-bot

circt-bot Bot commented Jul 17, 2026

Copy link
Copy Markdown

Results of circt-tests run for ea830ae compared to results for 4c75b01: no change to test results.

@seldridge

Copy link
Copy Markdown
Member

If this isn't that expensive, then we could consider pulling it in as part of the UBTI testing. This looks like it's just an additional CMake option without any other special configuration.

@maerhart

Copy link
Copy Markdown
Member Author

If this isn't that expensive, then we could consider pulling it in as part of the UBTI testing. This looks like it's just an additional CMake option without any other special configuration.

If CIRCT with Python Bindings is already compiled, it's super cheap, just copying a bunch of python files and <3s running the tests (for me locally). However, unifiedBuildTestAndInstall.yml doesn't seem to be automatically dispatched? And buildAndTest.yml doesn't seem to build the Python bindings?

@seldridge

seldridge commented Jul 17, 2026

Copy link
Copy Markdown
Member

@maerhart wrote:

If CIRCT with Python Bindings is already compiled, it's super cheap, just copying a bunch of python files and <3s running the tests (for me locally). However, unifiedBuildTestAndInstall.yml doesn't seem to be automatically dispatched? And buildAndTest.yml doesn't seem to build the Python bindings?

They are currently only turned on if integration tests run. We can change this, though. Relevant lines are here: https://github.com/llvm/circt/blob/main/.github/workflows/unifiedBuildTestAndInstall.yml#L316-L324 (This can be made unconditional as opposed to only being turned on for integration tests.)

buildAndTest.yml eventually delegates to unifiedBuildTestAndInstall.yml after it sets the build matrix: https://github.com/llvm/circt/blob/main/.github/workflows/buildAndTest.yml#L218

Looks like it would work. 😉

@maerhart maerhart added the RTG Involving the `rtg` dialect label Jul 21, 2026
@maerhart
maerhart marked this pull request as ready for review July 22, 2026 15:21
@maerhart
maerhart requested a review from teqdruid as a code owner July 22, 2026 15:21
@maerhart

Copy link
Copy Markdown
Member Author

@seldridge Does that match what you had in mind?

@circt-bot

circt-bot Bot commented Jul 22, 2026

Copy link
Copy Markdown

Results of circt-tests run for 66bf4fb compared to results for 2aea5be: no change to test results.

Comment on lines +327 to +332
# A statically-linked libstdc++ conflicts with Python extension
# modules that get dlopen'd into a live python3 process alongside
# other dynamically-linked C++ code: the duplicated libstdc++
# symbols get interposed process-wide and corrupt the heap. So
# disable it whenever the Python bindings are enabled.
echo cmake="-DMLIR_ENABLE_BINDINGS_PYTHON=ON -DCIRCT_BINDINGS_PYTHON_ENABLED=ON -DCIRCT_ENABLE_FRONTENDS=PyRTG -DLLVM_STATIC_LINK_CXX_STDLIB=OFF -DPython3_EXECUTABLE=\"$PYTHON_EXECUTABLE\" -DPython_EXECUTABLE=\"$PYTHON_EXECUTABLE\"" >> "$GITHUB_OUTPUT"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This -DLLVM_STATIC_LINK_CXX_STDLIB=OFF conflicts (overwrites?) the option specified elsewhere of -DLLVM_STATIC_LINK_CXX_STDLIB=ON.

I don't know if this is fine, but we can test with a full release matrix. As long as this works, it would be better to not set this global option here (as this build step runs all the time) and instead make this change in the Configure CIRCT step instead.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I kicked off the release matrix here: https://github.com/llvm/circt/actions/runs/29942721163

If this creates problems, then this direction may have been bad guidance on my part and a narrower, one-off CI may be easier.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

There's something off with the PyRTG control flow test. I'll take a look.

Comment on lines -396 to +410
cmake -G Ninja -S "$(pwd)/../llvm/llvm" -DCMAKE_BUILD_TYPE=${{ inputs.cmake_build_type }} -DBUILD_SHARED_LIBS=${{ inputs.build_shared_libs }} -DLLVM_BUILD_TOOLS=ON -DLLVM_BUILD_EXAMPLES=OFF -DLLVM_ENABLE_ASSERTIONS=${{ inputs.llvm_enable_assertions }} -DLLVM_ENABLE_PROJECTS=mlir -DLLVM_EXTERNAL_PROJECTS=circt -DLLVM_EXTERNAL_CIRCT_SOURCE_DIR=".." -DLLVM_STATIC_LINK_CXX_STDLIB=ON -DLLVM_PARALLEL_LINK_JOBS=1 -DLLVM_RAM_PER_COMPILE_JOB=4096 -DLLVM_TARGETS_TO_BUILD="host" -DLLVM_FORCE_ENABLE_STATS=ON -DLLVM_ENABLE_ZSTD=OFF -DCIRCT_RELEASE_TAG_ENABLED=ON -DCIRCT_RELEASE_TAG=firtool -DCMAKE_EXPORT_COMPILE_COMMANDS=OFF -DCMAKE_C_COMPILER=${{ steps.set-cmake-options.outputs.cmake_c_compiler }} -DCMAKE_CXX_COMPILER=${{ steps.set-cmake-options.outputs.cmake_cxx_compiler }} ${{ steps.configure-sccache.outputs.enable_sccache }} -DCMAKE_INSTALL_PREFIX="$(pwd)/../install" -DLLVM_INSTALL_UTILS=ON -DCIRCT_SLANG_FRONTEND_ENABLED=ON -DCIRCT_INCLUDE_EXAMPLES=ON -DLLVM_LIT_ARGS="${{ steps.set-cmake-options.outputs.llvm_lit_args }}" ${{ steps.setup-linux.outputs.cmake }} ${{ steps.setup-macos.outputs.cmake }} ${{ steps.setup-macos-integration.outputs.cmake }} ${{ steps.setup-windows.outputs.cmake }} ${{ steps.integration-test-setup-generic.outputs.cmake }} ${{ inputs.extra_cmake_args }}
cmake -G Ninja -S "$(pwd)/../llvm/llvm" -DCMAKE_BUILD_TYPE=${{ inputs.cmake_build_type }} -DBUILD_SHARED_LIBS=${{ inputs.build_shared_libs }} -DLLVM_BUILD_TOOLS=ON -DLLVM_BUILD_EXAMPLES=OFF -DLLVM_ENABLE_ASSERTIONS=${{ inputs.llvm_enable_assertions }} -DLLVM_ENABLE_PROJECTS=mlir -DLLVM_EXTERNAL_PROJECTS=circt -DLLVM_EXTERNAL_CIRCT_SOURCE_DIR=".." -DLLVM_STATIC_LINK_CXX_STDLIB=ON -DLLVM_PARALLEL_LINK_JOBS=1 -DLLVM_RAM_PER_COMPILE_JOB=4096 -DLLVM_TARGETS_TO_BUILD="host" -DLLVM_FORCE_ENABLE_STATS=ON -DLLVM_ENABLE_ZSTD=OFF -DCIRCT_RELEASE_TAG_ENABLED=ON -DCIRCT_RELEASE_TAG=firtool -DCMAKE_EXPORT_COMPILE_COMMANDS=OFF -DCMAKE_C_COMPILER=${{ steps.set-cmake-options.outputs.cmake_c_compiler }} -DCMAKE_CXX_COMPILER=${{ steps.set-cmake-options.outputs.cmake_cxx_compiler }} ${{ steps.configure-sccache.outputs.enable_sccache }} -DCMAKE_INSTALL_PREFIX="$(pwd)/../install" -DLLVM_INSTALL_UTILS=ON -DCIRCT_SLANG_FRONTEND_ENABLED=ON -DCIRCT_INCLUDE_EXAMPLES=ON -DLLVM_LIT_ARGS="${{ steps.set-cmake-options.outputs.llvm_lit_args }}" ${{ steps.setup-linux.outputs.cmake }} ${{ steps.setup-macos.outputs.cmake }} ${{ steps.setup-macos-integration.outputs.cmake }} ${{ steps.setup-windows.outputs.cmake }} ${{ steps.python-bindings-setup-generic.outputs.cmake }} ${{ inputs.extra_cmake_args }}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

For the reader, the only change here is that ${{ steps.integration-test-setup-generic.outputs.cmake }} is changed to ${{ steps.python-bindings-setup-generic.outputs.cmake }} to revlect the new step name.

@seldridge

Copy link
Copy Markdown
Member

@maerhart wrote:

@seldridge Does that match what you had in mind?

Yes, this matches what I had in mind! Let's see if the release matrix works with this.

@circt-bot

circt-bot Bot commented Jul 23, 2026

Copy link
Copy Markdown

Results of circt-tests run for 19a49d1 compared to results for 2aea5be: no change to test results.

@maerhart

Copy link
Copy Markdown
Member Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

RTG Involving the `rtg` dialect

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants