From afc0de4dbefe243e7d469dc65facef3e15fa56c4 Mon Sep 17 00:00:00 2001 From: "D. Jeff Dionne" Date: Mon, 22 Jun 2026 19:51:29 +0900 Subject: [PATCH 1/2] ci.sh: build yosys from source using CMake Yosys has switched to CMake; the Makefile build no longer works on current main. Ubuntu 22.04 apt ships CMake 3.22 which is too old (3.28+ required), so bootstrap a recent version via pip. Building yosys from source on the same runner eliminates the std::source_location ABI mismatch that caused plugin load failures when mixing an oss-cad-suite binary with a locally-compiled plugin. Both yosys and the plugin now use the same toolchain and headers. Tested: CI green on ubuntu-22.04 (run #10). --- ci.sh | 56 ++++++++++++++++++++++++++++++++++---------------------- 1 file changed, 34 insertions(+), 22 deletions(-) diff --git a/ci.sh b/ci.sh index 83321fe..a188c85 100755 --- a/ci.sh +++ b/ci.sh @@ -34,26 +34,43 @@ set +x gend } -# Build yosys (from scratch) -# Not used: too long. +# Build yosys (from scratch) using CMake. +# ABI guarantee: plugin and yosys are compiled with the same toolchain and +# headers, so std::source_location symbol names will always match. do_yosys_build () { gstart "[Build] yosys" "$ANSI_MAGENTA" +set -x + +# CMake 3.28+ is required. Ubuntu 22.04 apt ships 3.22, so get a recent +# version via pip. --break-system-packages not needed on 22.04. sudo apt-get install -y --no-install-recommends \ build-essential clang bison flex \ - libreadline-dev gawk tcl-dev libffi-dev git \ - graphviz xdot pkg-config python3 libboost-system-dev \ - libboost-python-dev libboost-filesystem-dev zlib1g-dev - -git clone https://github.com/YosysHQ/yosys.git -cd yosys -git submodule update --init -make config-clang -make -j4 -sudo make install -cd .. + libreadline-dev tcl-dev libffi-dev git \ + pkg-config python3 python3-pip zlib1g-dev +pip3 install --quiet --upgrade cmake +export PATH="$HOME/.local/bin:$PATH" + +cmake --version + +git clone --recursive https://github.com/YosysHQ/yosys.git +cmake \ + -S yosys \ + -B yosys/build \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=/usr/local \ + -DYOSYS_INSTALL_DRIVER=ON \ + -DYOSYS_INSTALL_LIBRARY=ON \ + -DYOSYS_WITH_PYTHON=OFF \ + -DBUILD_SHARED_LIBS=ON +cmake --build yosys/build -j$(nproc) +sudo cmake --install yosys/build + +which yosys +yosys --version +set +x gend } @@ -78,7 +95,7 @@ curl -L $url | tar zxf - set -x echo $PATH -PATH=$PATH:$PWD/oss-cad-suite/bin +PATH=$PWD/oss-cad-suite/bin:$PATH which ghdl ghdl --version @@ -101,16 +118,11 @@ do_plugin () { gstart "[Build] plugin" "$ANSI_MAGENTA" -echo PATH=$PATH -echo "yosys-config: $(which yosys-config)" - +set -x make -#cp ghdl.so /tmp/ghdl_yosys.so - -ldd -v ghdl.so +set +x gend - } # Run the testsuite @@ -122,7 +134,7 @@ printf "${ANSI_MAGENTA}[Test] testsuite ${ANSI_NOCOLOR}\n" } -do_yosys_fetch +do_yosys_build do_ghdl do_plugin do_test From f49c9f2ec49b2033d7eeaed47eaeddf1636eb806 Mon Sep 17 00:00:00 2001 From: tgingold Date: Mon, 22 Jun 2026 21:17:57 +0200 Subject: [PATCH 2/2] Update PATH variable order in ci.sh --- ci.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci.sh b/ci.sh index a4c8387..2dca184 100755 --- a/ci.sh +++ b/ci.sh @@ -95,7 +95,7 @@ curl -L $url | tar zxf - set -x echo $PATH -PATH=$PWD/oss-cad-suite/bin:$PATH +PATH=$PATH:$PWD/oss-cad-suite/bin which ghdl ghdl --version