[PyRTG] Add Github CI workflow - #10850
Conversation
|
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? |
|
@maerhart wrote:
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.)
Looks like it would work. 😉 |
|
@seldridge Does that match what you had in mind? |
| # 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" |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
There's something off with the PyRTG control flow test. I'll take a look.
| 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 }} |
There was a problem hiding this comment.
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.
|
@maerhart wrote:
Yes, this matches what I had in mind! Let's see if the release matrix works with this. |
We don't have any CI for PyRTG yet. I'm interested in running it for 2 purposes:
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]