Repository navigation
etc: install readline as a yosys build dep - #10475
sombraSoft merged 2 commits into
Conversation
Add _install_yosys_dependencies() that installs the OS-appropriate readline development package (libreadline-dev on Debian/Ubuntu, readline-devel on RHEL/openSUSE, readline brew formula on Darwin) and call it from inside _install_yosys right before the git clone / make. OpenROAD itself uses vendored linenoise so readline is no longer in the base package lists, but _install_yosys still requires the headers at compile time. This co-locates the dep with its consumer instead of relying on downstream callers to add readline to their own package lists. Signed-off-by: SombraSoft <sombrio@sombrasoft.dev>
Local validationAll four OS targets pass the yosys build with the new
Reproducer (each OS): Gating verifiedRan the installer twice in the same Ubuntu 22.04 container:
|
|
clang-tidy review says "All clean, LGTM! 👍" |
There was a problem hiding this comment.
Code Review
This pull request introduces a new function, _install_yosys_dependencies, in etc/DependencyInstaller.sh to ensure that readline is installed before building Yosys. This change is necessary because OpenROAD now uses vendored linenoise, while Yosys still requires readline at compile time. Feedback suggests refactoring the new function to use _command_exists for more robust package manager detection and replacing dnf with yum to maintain consistency with the existing script's conventions for RHEL-based distributions.
Refactor _install_yosys_dependencies to use _command_exists for package
manager detection (matching _install_bazel's pattern) and switch from
dnf to yum on RHEL paths (matching _install_rhel_packages and the rest
of the script). Removes the implicit dependency on the dynamically
scoped ${os} variable.
Signed-off-by: SombraSoft <sombrio@sombrasoft.dev>
|
clang-tidy review says "All clean, LGTM! 👍" |
Why
Commit
7ebd5e3("Replace tclreadline+GNU readline with vendored linenoise") removedlibreadline-dev/readline-devel/tcl-tclreadlinefrom OpenROAD's base package lists, since OpenROAD itself now uses vendored linenoise. However,_install_yosysstill requires readline at compile time, so any caller of./etc/DependencyInstaller.sh -eqy(e.g. OpenROAD-flow-scripts) hits:OR's own CI didn't catch this because the OR Dockerfile passes
-base -commonbut never-eqy, so_install_yosysnever runs in OR-Public/master. ORFS-Nightly began failing on 2026-05-19 because it bumps the OR submodule to OR master and does pass-eqy. Two workaround PRs have already landed on ORFS (#4246, #4248) that add readline to ORFS's own package lists or reorder the Dockerfile invocation. Both are functional but neither addresses the root cause: yosys's build deps belong with yosys's install, not split across a downstream repo's OS package lists.What
Add
_install_yosys_dependencies()that installs the OS-appropriate readline development package:libreadline-devreadline-develreadline-devel(zypper)readline(brew)It's called from inside
_install_yosysright before thegit clone/make. The install happens only when yosys is actually going to be built (gated by the existing version-mismatch check), so users with yosys already at the right version don't pay any cost.OpenROAD's own base package lists stay free of the GPLv3 readline dep, preserving the licensing intent of
7ebd5e3.Effect on downstream
Once this lands, both ORFS workarounds become redundant and can be reverted in a follow-up:
libreadline-devto ORFS's_installUbuntuPackages)-allinto-base+-commoninDockerfile.dev; addedtcl-tclreadlineto ORFS's OS package functions)Test plan
./etc/DependencyInstaller.sh -ci -eqy -common -yosys-ver=v0.64onubuntu:22.04andubuntu:24.04— yosys compiles cleanlyrockylinux:8androckylinux:9_install_yosys_dependenciesis skipped (gated by version check) when yosys is already at the required version