Skip to content

Install yosys readline build deps before OpenROAD installer runs#4249

Closed
openroad-ci wants to merge 1 commit into
The-OpenROAD-Project:masterfrom
The-OpenROAD-Project-staging:fix-yosys-readline-dep
Closed

Install yosys readline build deps before OpenROAD installer runs#4249
openroad-ci wants to merge 1 commit into
The-OpenROAD-Project:masterfrom
The-OpenROAD-Project-staging:fix-yosys-readline-dep

Conversation

@openroad-ci

Copy link
Copy Markdown
Member

Summary

  • Hoist a per-OS _installYosysBuildDeps_* function ahead of _installORDependencies for Ubuntu, EL7, and EL8/EL9, so the readline development headers are present when OpenROAD's installer compiles yosys.
  • Remove the readline entries that Add readline to the dependency installer for yosys #4246 added inside _installUbuntuPackages / _install_EL{7,8_EL9}_Packages — those functions only run after _installORDependencies, so the apt/dnf step was happening too late to help yosys.
  • EL was also missing readline-devel (headers); Add readline to the dependency installer for yosys #4246 only added the runtime readline package, so EL would have stayed broken even after the previous fix.

Why

OpenROAD commit 7ebd5e3 ("Replace tclreadline+GNU readline with vendored linenoise") removed libreadline-dev / readline-devel from OpenROAD's etc/DependencyInstaller.sh. yosys, which OpenROAD's installer still builds via _install_yosys, requires <readline/readline.h>, so nightly Docker builds started failing with:

kernel/driver.cc:29:12: fatal error: readline/readline.h: No such file or directory

(see nightly builds 7023–7026 — all four failed at Dockerfile.dev step 13).

The previous fix (#4246) added the package back, but placed it in functions that run after _installORDependencies (which is where yosys is compiled), so the package install never happened before yosys tried to find the headers.

The master pipeline didn't catch this because it builds against ORFS's submodule pin of OpenROAD; only nightly explicitly bumps the OpenROAD submodule to origin/master (pipelineORFS.groovy:77-99).

Test plan

  • Local docker buildx build -f docker/Dockerfile.dev ./etc on ubuntu:22.04, with tools/OpenROAD bumped to origin/master to reproduce the nightly scenario
  • Same on ubuntu:24.04
  • Manual installer run inside rockylinux:8 container (CI does not exercise this path)
  • Manual installer run inside rockylinux:9 container (CI does not exercise this path)
  • Verify all four succeed past the yosys compilation step

Hoist a per-OS _installYosysBuildDeps_* function ahead of
_installORDependencies, since OpenROAD's installer (which builds yosys)
no longer pulls in readline after the linenoise switch.

The previous fix added libreadline-dev to _installUbuntuPackages, but
that function only runs after _installORDependencies, so yosys was still
compiling before the package was installed. For EL it added readline,
which is the runtime library — yosys needs readline-devel for the
headers.

Signed-off-by: SombraSoft <sombrio@sombrasoft.dev>

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors the dependency installation script to ensure readline development headers are installed before the OpenROAD installer compiles yosys. It introduces platform-specific functions for installing these build dependencies across EL7, EL8/9, and Ubuntu. The reviewer suggested including package manager updates within these new functions to ensure metadata is current and removing redundant update commands and environment exports from the subsequent installation steps.

Comment on lines +71 to +73
_installYosysBuildDeps_EL7() {
yum -y install readline-devel
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

It is recommended to run yum -y update before installing packages to ensure the metadata is current, especially since this function is now called early in the installation process and might be the first package manager interaction.

Suggested change
_installYosysBuildDeps_EL7() {
yum -y install readline-devel
}
_installYosysBuildDeps_EL7() {
yum -y update
yum -y install readline-devel
}


# Enterprise Linux 7 package installation (EL7 = RHEL 7 or CentOS 7)
_install_EL7_Packages() {
yum -y update

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This yum -y update call is now redundant if the update is performed in the hoisted _installYosysBuildDeps_EL7 function, which runs earlier in the same execution path.

Comment on lines +105 to +107
_installYosysBuildDeps_EL8_EL9() {
dnf -y install readline-devel
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Similar to the EL7 case, adding dnf -y update here ensures that the package manager has the latest metadata before attempting to install readline-devel.

Suggested change
_installYosysBuildDeps_EL8_EL9() {
dnf -y install readline-devel
}
_installYosysBuildDeps_EL8_EL9() {
dnf -y update
dnf -y install readline-devel
}

@@ -109,7 +120,6 @@ _install_EL8_EL9_Packages() {
dnf -y update

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This dnf -y update call is redundant as the metadata update is now handled by the hoisted dependency installation function.

Comment on lines 190 to 191
export DEBIAN_FRONTEND="noninteractive"
apt-get -y update

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The export DEBIAN_FRONTEND and apt-get -y update calls are redundant here. DEBIAN_FRONTEND was already exported in _installYosysBuildDeps_Ubuntu (or _installCI), and the package list was updated in those same functions which run earlier in the script.

@sombraSoft

Copy link
Copy Markdown
Contributor

Thanks @gemini-code-assist. Applied #1 and #3 (added the yum -y update / dnf -y update to the new _installYosysBuildDeps_EL* functions — makes them consistent with the Ubuntu equivalent and self-contained when called as the first package-manager interaction).

Holding off on #2, #4, #5 (removing the existing updates from _install_EL{7,8_EL9}_Packages and _installUbuntuPackages) — the gap between the hoisted yosys-deps install and the main package install includes the full yosys clone + compile (~5 min), during which mirror metadata can shift. Those functions have also been self-contained for a long time and refactoring how update is sequenced is broader than the readline fix this PR is targeting. Happy to do that cleanup in a follow-up PR if it's worth doing.

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Thanks for the update, @sombraSoft. That makes sense—prioritizing the fix for the immediate build failure while keeping the update sequencing logic as-is to avoid unintended side effects is a pragmatic approach. I agree that refactoring the update sequencing is better suited for a separate cleanup PR. The current changes look good for addressing the immediate issue.

@sombraSoft

Copy link
Copy Markdown
Contributor

Superseded by #4248 (vvbandeira), which is already merged and fixes the immediate readline issue on the OSes CI exercises (Ubuntu 22.04 / 24.04). Local tests confirmed Ubuntu builds pass on #4248's master.

Heads-up for anyone running ORFS on Rocky/Alma 8: #4248 has a latent gap there — tcl-tclreadline-devel is installed but not plain readline-devel, so _install_yosys still fails with readline/readline.h: No such file or directory. CI doesn't catch it because the Docker matrix is Ubuntu-only.

That EL8 gap will be addressed at the source in OpenROAD itself in a follow-up PR that adds _install_yosys_dependencies to etc/DependencyInstaller.sh so readline is installed by _install_yosys directly. Once that lands and propagates, both #4246 and #4248 (the readline additions to ORFS's package lists and the -base/-common Dockerfile split) become candidates for revert.

@sombraSoft sombraSoft closed this May 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants