Skip to content

tclreadline proper support #137

tclreadline proper support

tclreadline proper support #137

Workflow file for this run

# Copyright (C) 2025 Silimate Inc.
#
# Adapted from Yosys wheels
#
# Copyright (C) 2024 Efabless Corporation
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
name: Build and run tests
on:
push:
branches:
- "*"
pull_request:
jobs:
build_and_test:
strategy:
fail-fast: false
matrix:
os:
[
{
name: "Ubuntu 22.04",
family: "linux",
runner: "ubuntu-22.04",
arch: "x86_64",
},
{
name: "macOS 14",
family: "macos",
runner: "macos-14",
arch: "arm64",
},
]
name: Build and Test | ${{ matrix.os.name }} | ${{ matrix.os.arch }}
runs-on: ${{ matrix.os.runner }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
- if: ${{ matrix.os.family == 'macos' }}
name: Brew Dependencies
run: |
(cd third_party/opensta && brew bundle install)
brew install ninja readline autoconf automake libtool
# macOS has no tclreadline package; build it from source so the
# interactive prompt works and the tclreadline test passes.
git clone --depth 1 --branch v2.4.1 https://github.com/flightaware/tclreadline /tmp/tclreadline
cd /tmp/tclreadline
autoreconf -fi
./configure --prefix=/usr/local \
--with-tcl=$(brew --prefix tcl-tk@8)/lib \
--with-tcl-includes=$(brew --prefix tcl-tk@8)/include/tcl-tk \
--with-readline-includes=$(brew --prefix readline)/include \
--with-readline-library="-L$(brew --prefix readline)/lib -lreadline"
make -j$(sysctl -n hw.ncpu)
sudo make install
echo "PATH=$(brew --prefix bison)/bin:$(brew --prefix flex)/bin:$PATH" >> $GITHUB_ENV
echo "CMAKE_ARGS=-DTCL_LIBRARY=$(brew --prefix tcl-tk@8)/lib/libtcl8.6.dylib -DTCL_INCLUDE_PATH=$(brew --prefix tcl-tk@8)/include/tcl-tk -DFLEX_INCLUDE_DIR=$(brew --prefix flex)/include -DTCL_READLINE_LIBRARY=/usr/local/lib/libtclreadline.dylib -DTCL_READLINE_INCLUDE=/usr/local/include" >> $GITHUB_ENV
- if: ${{ matrix.os.family == 'linux' }}
name: Apt Dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
wget \
cmake \
gcc \
tcl-dev \
tcl-tclreadline \
libeigen3-dev \
swig \
bison \
flex \
libfl-dev \
libdwarf-dev \
libdw-dev \
libelf-dev \
elfutils \
automake \
autotools-dev \
ninja-build
- if: ${{ matrix.os.family == 'linux' }}
name: Cudd (Linux)
run: |
curl -L https://raw.githubusercontent.com/davidkebo/cudd/main/cudd_versions/cudd-3.0.0.tar.gz | tar -xzvC .
cd cudd-3.0.0
./configure
make -j$(nproc)
sudo make install
- run: |
mkdir -p build
cd build
cmake -G Ninja -DCMAKE_BUILD_TYPE=Release $CMAKE_ARGS ..
ninja
- run: |
cd build
ctest --output-on-failure