Summary
The -common dependency phase is intended to run without root and install into a user-specified prefix (-prefix=DIR / -local). But it tries to apt-get install libreadline-dev for the yosys build, which requires root, so a non-privileged local install fails.
Steps to reproduce
On a fresh master checkout:
source dev_env.sh
sudo ./etc/DependencyInstaller.sh -base
./etc/DependencyInstaller.sh -common -prefix="./dependencies"
./build_openroad.sh
During the third step (-common), it fails:
[INFO] Installing libreadline-dev for yosys... ✖
E: Could not open lock file /var/lib/dpkg/lock-frontend - open (13: Permission denied)
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), are you root?
[ERROR] Failed to execute: apt-get -y install --no-install-recommends libreadline-dev
Environment
- OS: Ubuntu 24.04.4 LTS
- ORFS:
master (7b05472e7)
- OpenROAD submodule pin:
04cbde6e14
Root cause
In tools/OpenROAD/etc/DependencyInstaller.sh, readline was moved out of the -base package lists and into a build-time step that runs during -common:
# OpenROAD itself uses vendored linenoise, so readline is no longer in the
# base package lists. Yosys still requires it at compile time, so install it
# here right before the yosys build.
_install_yosys_dependencies() {
if _command_exists "apt-get"; then
export DEBIAN_FRONTEND="noninteractive"
_execute "Installing libreadline-dev for yosys..." \
apt-get -y install --no-install-recommends libreadline-dev
...
Call chain: -common → (-eqy) _install_equivalence_deps → _install_yosys → _install_yosys_dependencies → apt-get install libreadline-dev.
libreadline-dev no longer appears in any -base/-all apt list, so it is only installed from this path. This puts a privileged, system-wide apt-get inside the unprivileged -common phase, which contradicts the -prefix/-local non-root use case (and setup.sh, which deliberately runs -common as $SUDO_USER).
What's the intended fix for a non-root "local" -common build?
A few options — would appreciate guidance on the preferred one:
- Move readline back into
-base (the privileged phase), where the other system -dev packages live. -common then assumes it's already present. Simplest and matches the original layout.
- Skip the
apt-get in -common when unprivileged / already present, e.g. guard _install_yosys_dependencies with [[ -f /usr/include/readline/readline.h ]] || [[ "$(id -u)" -ne 0 ]] && return 0, and document that readline must be installed via -base/system beforehand.
- Build readline into the prefix like the other
-common deps (heaviest; probably overkill for a system lib).
More broadly: is a fully non-root -common -prefix=… (tools into a user tree, system -dev libs via a one-time sudo -base) a supported workflow? It seems like a common thing to want, so it's surprising it currently breaks.
Summary
The
-commondependency phase is intended to run without root and install into a user-specified prefix (-prefix=DIR/-local). But it tries toapt-get install libreadline-devfor the yosys build, which requires root, so a non-privileged local install fails.Steps to reproduce
On a fresh
mastercheckout:During the third step (
-common), it fails:Environment
master(7b05472e7)04cbde6e14Root cause
In
tools/OpenROAD/etc/DependencyInstaller.sh,readlinewas moved out of the-basepackage lists and into a build-time step that runs during-common:Call chain:
-common→ (-eqy)_install_equivalence_deps→_install_yosys→_install_yosys_dependencies→apt-get install libreadline-dev.libreadline-devno longer appears in any-base/-allapt list, so it is only installed from this path. This puts a privileged, system-wideapt-getinside the unprivileged-commonphase, which contradicts the-prefix/-localnon-root use case (andsetup.sh, which deliberately runs-commonas$SUDO_USER).What's the intended fix for a non-root "local"
-commonbuild?A few options — would appreciate guidance on the preferred one:
-base(the privileged phase), where the other system-devpackages live.-commonthen assumes it's already present. Simplest and matches the original layout.apt-getin-commonwhen unprivileged / already present, e.g. guard_install_yosys_dependencieswith[[ -f /usr/include/readline/readline.h ]] || [[ "$(id -u)" -ne 0 ]] && return 0, and document that readline must be installed via-base/system beforehand.-commondeps (heaviest; probably overkill for a system lib).More broadly: is a fully non-root
-common -prefix=…(tools into a user tree, system-devlibs via a one-timesudo -base) a supported workflow? It seems like a common thing to want, so it's surprising it currently breaks.