From fd3e42abd21abd638d85f1bf41be61b1e9df0d7d Mon Sep 17 00:00:00 2001 From: Huang Rui Date: Fri, 3 Jul 2026 05:56:30 -0700 Subject: [PATCH] sci-electronics/circt: add 1.151.0, drop 1.140.0 Drop the mig-require-libz3 patch since upstream removed that test. Two new tests need handling for our Z3-less external-llvm build: disable Z3 discovery with Z3_DISABLE so the z3 integration tests skip instead of running against a circt that has no Z3 backend, and symlink circt's empty llvm submodule at the real tree so the circt-tblgen tests find their mlir tablegen includes. Signed-off-by: Huang Rui --- sci-electronics/circt/Manifest | 4 +-- ...ct-1.140.0.ebuild => circt-1.151.0.ebuild} | 29 +++++++++++-------- .../circt-1.140.0-mig-require-libz3.patch | 15 ---------- 3 files changed, 19 insertions(+), 29 deletions(-) rename sci-electronics/circt/{circt-1.140.0.ebuild => circt-1.151.0.ebuild} (81%) delete mode 100644 sci-electronics/circt/files/circt-1.140.0-mig-require-libz3.patch diff --git a/sci-electronics/circt/Manifest b/sci-electronics/circt/Manifest index 8269efd10b..fc14b1f0cf 100644 --- a/sci-electronics/circt/Manifest +++ b/sci-electronics/circt/Manifest @@ -1,2 +1,2 @@ -DIST circt-1.140.0.tar.gz 4798906 BLAKE2B 1788be3cb1423af2759c1ea3560c777741f43e9bef59d3b468948b687f3a5e034fca36cb5fbc893aaa6c5efd7ae0ac3b57168042f7afcc66a49151fc4faee25d SHA512 b2871d47bdd236b9c874485c23b25bdd3238a2abd63a6abef8bee9e0ecf7f450372b63de417901fcc345b5bbd687f23d45459ffc51532ddad93050fb0f80f442 -DIST llvm-project-b7c1a6f8b447fba6fff47d309eb7ba1bc22e8c53.tar.gz 259559644 BLAKE2B ecf347c488b5278a968bd4b3053e4a356594cd3a7a2bd54013bbe5b5cc5a149df1ca3aded024fc7dd2e2422c23cebbfebd6b132f80c25319b44909da7e9bef96 SHA512 8f6dcde994769148797c3a8652f3738f050b06a1a4d8303609a776b439ad26e8880b12c84111fbcdff3d18b71dc1252f95b22704dfd55d483e11609ae2a23c31 +DIST circt-1.151.0.tar.gz 10160863 BLAKE2B a67b8ad8a8cb30f2e21c172b5b385dc6e38e3f494a366533c41cd24fef7a16410322a4928cd75c7f7366f17442d5fc3e6e86c25db553da14214d5c8de0a45942 SHA512 9d428e203dd19da448a7ae9bb5a39c45e4ce3b6d2483238683c84caa999853616292aa5bed89d3fef7bfbacc5d27bb04c85e2763eccd1d57471758d0a47cb39e +DIST llvm-project-040a641988f6ed6f4fab250706ca2b620c1de2d8.tar.gz 275008647 BLAKE2B 6ae8c8f832a34d1cf2721cd133cf674bab7efd2d742bca198a312682504160d0a0b76c03b557436d5a4600570c4fbf5f8c21a20e7db3b6f45a2f63d4e8246a89 SHA512 719c03e7bd215f40bbedac5492d472a5b5686cef8add383a7b8e8e2044d3732e3323d5c24dc458a788a1fe0c329d8d1fcff988ec37cd91571875f8cdfc92a24c diff --git a/sci-electronics/circt/circt-1.140.0.ebuild b/sci-electronics/circt/circt-1.151.0.ebuild similarity index 81% rename from sci-electronics/circt/circt-1.140.0.ebuild rename to sci-electronics/circt/circt-1.151.0.ebuild index 8f4a116946..d4ae57a97c 100644 --- a/sci-electronics/circt/circt-1.140.0.ebuild +++ b/sci-electronics/circt/circt-1.151.0.ebuild @@ -4,7 +4,7 @@ EAPI="8" MY_PV="${PV//./\/}" -MY_LLVM_PV="b7c1a6f8b447fba6fff47d309eb7ba1bc22e8c53" +MY_LLVM_PV="040a641988f6ed6f4fab250706ca2b620c1de2d8" CMAKE_BUILD_TYPE="Release" PYTHON_COMPAT=( python3_{12..14} ) inherit cmake python-r1 @@ -63,17 +63,6 @@ DOCS=( "${S_CIRCT}/circt-LICENSE" ) -src_prepare() { - # mig.mlir lacks the libz3/circt-lec-jit REQUIRES guards its sibling - # circt-synth LEC tests carry, so it runs and fails when Z3 is - # unavailable instead of being skipped. See - # https://bugs.gentoo.org/977874 - pushd "${S_CIRCT}" > /dev/null || die - eapply "${FILESDIR}"/${PN}-1.140.0-mig-require-libz3.patch - popd > /dev/null || die - cmake_src_prepare -} - src_configure() { python_setup @@ -89,6 +78,12 @@ src_configure() { # it, so the app-arch/zstd RDEPEND always matches. See # https://bugs.gentoo.org/977877 -D LLVM_ENABLE_ZSTD=FORCE_ON + # We do not link Z3 into circt, so the SMT/LEC passes and the z3 + # integration tests cannot work. Disable z3 discovery entirely so + # those tests are skipped instead of detected-but-broken. Without + # this, a z3 binary on PATH enables the lit 'z3' feature and tests + # like circt-synth/functional-reduction-z3.mlir run and fail. + -D Z3_DISABLE=ON -D LLVM_BUILD_EXAMPLES=OFF -D LLVM_ENABLE_BINDINGS=OFF -D LLVM_ENABLE_OCAMLDOC=OFF @@ -105,6 +100,16 @@ src_test() { # mlir-runner JIT tests that dlopen the MLIR runtime shared libraries, # which our static CMAKE_SKIP_RPATH build does not expose, and which are # out of scope for packaging CIRCT. See https://bugs.gentoo.org/977441 + # + # The circt-tblgen RTG instruction tests include mlir tablegen headers + # through circt's llvm submodule path (llvm/mlir/include), which is empty + # in the release tarball because we build against a separate llvm-project + # checkout. Point it at the real tree so those tests find + # mlir/IR/OpBase.td instead of failing. + if [[ ! -L ${S_CIRCT}/llvm ]]; then + rmdir "${S_CIRCT}/llvm" || die + ln -s "${S_LLVM}" "${S_CIRCT}/llvm" || die + fi pushd "${BUILD_DIR}" || die eninja check-circt eninja check-circt-integration diff --git a/sci-electronics/circt/files/circt-1.140.0-mig-require-libz3.patch b/sci-electronics/circt/files/circt-1.140.0-mig-require-libz3.patch deleted file mode 100644 index 00e5e62c1d..0000000000 --- a/sci-electronics/circt/files/circt-1.140.0-mig-require-libz3.patch +++ /dev/null @@ -1,15 +0,0 @@ -Add the libz3/circt-lec-jit REQUIRES guards that every other circt-synth -LEC test already carries. Without them mig.mlir runs its circt-lec ---shared-libs=%libz3 commands even when Z3 is unavailable, and the JIT -aborts on unresolved Z3 symbols instead of the test being skipped. - -https://bugs.gentoo.org/977874 - ---- a/integration_test/circt-synth/mig.mlir -+++ b/integration_test/circt-synth/mig.mlir -@@ -1,3 +1,5 @@ -+// REQUIRES: libz3 -+// REQUIRES: circt-lec-jit - // RUN: circt-opt %s --pass-pipeline='builtin.module(hw.module(hw-aggregate-to-comb,convert-comb-to-synth{target-ir=mig},convert-synth-to-comb))' -o %t.mlir - // RUN: circt-lec %t.mlir %s -c1=bit_logical -c2=bit_logical --shared-libs=%libz3 | FileCheck %s --check-prefix=COMB_BIT_LOGICAL - // COMB_BIT_LOGICAL: c1 == c2