etc: move yosys readline dep from -common to -base#10569
Open
mguthaus wants to merge 2 commits into
Open
Conversation
The previous _install_yosys_dependencies() helper was invoked from
_install_yosys() during the -common phase. -common is meant to be
runnable without root (it installs into ${PREFIX:-/usr/local} and
setup.sh deliberately runs it as $SUDO_USER), but the helper called
apt-get/yum/zypper/brew, all of which need root on Linux. As a
result, the standard "setup.sh as sudo" install path (and any
unprivileged -common -prefix=... use case) failed with:
[INFO] Installing libreadline-dev for yosys...
E: Could not open lock file /var/lib/dpkg/lock-frontend ...
[ERROR] Failed to execute: apt-get -y install --no-install-recommends libreadline-dev
Move the dep into the per-platform -base package lists
(_install_ubuntu_packages, _install_rhel_packages,
_install_opensuse_packages, _install_darwin_packages) where the
other system -dev libs already live and where root is already
required, and drop _install_yosys_dependencies entirely. The original
"readline isn't in -base anymore because OpenROAD uses vendored
linenoise" rationale is fine for OpenROAD itself, but yosys still
needs it at build time and it has to be installed by the privileged
phase regardless. Slightly enlarges -base (libreadline-dev is small)
in exchange for making non-root -common work again.
Fixes The-OpenROAD-Project/OpenROAD-flow-scripts#4266.
Signed-off-by: Matthew Guthaus <mrg@ucsc.edu>
Contributor
There was a problem hiding this comment.
Code Review
This pull request refactors the installation of Yosys compile-time readline dependencies by moving them from a separate helper function into the per-platform base package installation functions (Ubuntu, RHEL, openSUSE, and Darwin). This prevents running root-only commands during the unprivileged common phase. Feedback indicates that the libreadline-dev dependency was missed in the Debian package installer, which should be added to avoid build failures on Debian systems.
Missed the Debian path in the previous commit. Same rationale: yosys needs libreadline at build time and the install has to happen in the privileged -base phase, not -common. Caught in PR review. Signed-off-by: Matthew Guthaus <mrg@ucsc.edu>
vvbandeira
approved these changes
Jun 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Move the
libreadline-dev/readline-devel/readlineinstall out of the per-build_install_yosys_dependencies()helper (invoked during the-commonphase) and into the per-platform-basepackage lists where the other system-devlibs already live.Fixes ORFS #4266.
Why
-commonis documented (andsetup.sharranges) as the unprivileged phase: it installs into${PREFIX:-/usr/local}andsetup.shcalls it viasudo -u $SUDO_USER. The previous_install_yosys_dependencies()helper, however, ranapt-get -y install libreadline-dev(and the yum/zypper/brew equivalents). On Linux those require root, so the standard "sudo ./setup.sh" install path (and any other non-root-common -prefix=…flow) failed with:The original commit that introduced
_install_yosys_dependencies()noted that OpenROAD itself uses vendored linenoise and dropped readline from-base. That's still true for OpenROAD, but yosys needslibreadline-devat build time and that has to come from a privileged install regardless. So the right home is-base, not-common.What this changes
libreadline-devto_install_ubuntu_packages.readline-develto_install_rhel_packages.readline-develto_install_opensuse_packages.readlineto_install_darwin_packages(brew)._install_yosys_dependencies()and its call site in_install_yosys._install_yosyspointing to where the dep now lives.Tiny growth of
-base(libreadline-dev is small) in exchange for restoring the non-root-commonworkflow.Testing
sudo ./setup.shon Ubuntu 24.04: completes-baseand-commoncleanly../build_openroad.sh --localafterwards: yosys builds and links against libreadline as before.