Repository navigation
kepler-formal: delete the submodule and the per-platform build code; a bump is one line #4732
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
oharboe
wants to merge
16
commits into
The-OpenROAD-Project:master
Choose a base branch
from
oharboe:kepler-formal-bazel
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
f072fc3
build_openroad: install kepler-formal with a relative RUNPATH
saikatchatrg 21f7101
etc/kepler-formal: pin kepler-formal and install it with one command
oharboe 513e510
build_openroad: install kepler-formal from etc/kepler-formal
oharboe a92b10c
Remove the tools/kepler-formal submodule
oharboe 2aa8f0a
DependencyInstaller: drop the packages only kepler-formal needed
oharboe 24b3a01
etc/kepler-formal: say why the C++ standard is set here
oharboe 65fab0f
etc/kepler-formal: take kepler-formal from the registry
oharboe d3d8600
etc/kepler-formal: the compiler lines stay; llvm 0.8.26
oharboe 5b49f83
Merge origin/master into kepler-formal-bazel
oharboe 6d431ed
etc/kepler-formal: kepler-formal 1.0.0; clang on x86-64 Linux only
oharboe 2c38639
Merge remote-tracking branch 'upstream/master' into kepler-formal-bazel
oharboe e965a18
Merge remote-tracking branch 'upstream/master' into kepler-formal-bazel
oharboe 1387053
EL8: keep gcc-toolset-13 for Yosys
oharboe 1da6017
.dockerignore: exclude tools/kepler-formal/
oharboe 9f240ea
etc/kepler-formal/.bazelrc: say what dynamic_mode=off does
oharboe 225ee88
kepler-formal: install the dependency license notices
oharboe File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| common --registry=https://bcr.bazel.build/ | ||
|
|
||
| # kepler-formal and naja do not set the C++ standard on their targets, | ||
| # so the build sets it, as their registry presubmits do. OpenROAD | ||
| # requires C++20 too. | ||
| build --cxxopt=-std=c++20 | ||
| build --host_cxxopt=-std=c++20 | ||
| build -c opt | ||
|
|
||
| # As kepler-formal's own .bazelrc: link statically on Linux. The clang | ||
| # toolchain is chosen by register_toolchains in MODULE.bazel, on x86-64 | ||
| # Linux only. | ||
| common --enable_platform_specific_config | ||
| build:linux --dynamic_mode=off |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 8.6.0 |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| # bazelisk run //:install -- <prefix> | ||
| alias( | ||
| name = "install", | ||
| actual = "@kepler-formal//:install", | ||
| ) |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| """Pins the kepler-formal that build_openroad.sh installs. | ||
|
|
||
| ORFS is not a Bazel project: this module exists only to install | ||
| kepler-formal into tools/install/kepler-formal. See README.md. | ||
| """ | ||
|
|
||
| module(name = "orfs-kepler-formal") | ||
|
|
||
| # To bump kepler-formal, change this version. | ||
| bazel_dep(name = "kepler-formal", version = "1.0.0-20261105-6870bd1a") | ||
|
|
||
| # kepler-formal builds with a downloaded clang on x86-64 Linux. It | ||
| # registers that toolchain for its own builds only, a dev_dependency by | ||
| # design, so a module that depends on it registers it too, at the same | ||
| # version, as kepler-formal's .github/consumer-test does. Elsewhere the | ||
| # host compiler is used. | ||
| bazel_dep(name = "llvm", version = "0.8.26") | ||
|
|
||
| llvm_toolchains = use_extension("@llvm//extensions:toolchain.bzl", "toolchain") | ||
| llvm_toolchains.exec( | ||
| arch = "x86_64", | ||
| os = "linux", | ||
| ) | ||
| llvm_toolchains.target( | ||
| arch = "x86_64", | ||
| os = "linux", | ||
| ) | ||
| use_repo(llvm_toolchains, "llvm_toolchains") | ||
|
|
||
| register_toolchains("@llvm_toolchains//:all") |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| # kepler-formal | ||
|
|
||
| To bump kepler-formal, change the version in `MODULE.bazel`. | ||
|
|
||
| `build_openroad.sh --local` installs kepler-formal into | ||
| `tools/install/kepler-formal/bin/kepler-formal` from this folder: | ||
|
|
||
| ```shell | ||
| cd etc/kepler-formal | ||
| bazelisk run //:install -- "$(pwd)/../../tools/install/kepler-formal" | ||
| ``` | ||
|
|
||
| ORFS is not a Bazel project. This folder only pins kepler-formal; the | ||
| install is kepler-formal's own `//:install` target. | ||
|
|
||
| That target installs only kepler-formal's own license. `build_openroad.sh` | ||
| then runs `install_licenses.sh` with the same prefix, which copies the | ||
| license notices of every module linked into the binary or shipped in its | ||
| runfiles to `share/kepler-formal/licenses/<module>/`: | ||
|
|
||
| ```shell | ||
| ./install_licenses.sh "$(pwd)/../../tools/install/kepler-formal" | ||
| ``` | ||
|
|
||
| ## How this maps to `DependencyInstaller.sh` | ||
|
|
||
| `DependencyInstaller.sh` downloads a pinned CMake from Kitware when the | ||
| one the OS ships is too old, and checks it against a checksum. Bazel | ||
| does the same for kepler-formal and every library it needs, from the | ||
| [Bazel Central Registry](https://registry.bazel.build/), which keeps the | ||
| URL, the checksum and the build file of each version: | ||
|
|
||
| | `DependencyInstaller.sh`, `build_openroad.sh` | Here | | ||
| | --- | --- | | ||
| | oneTBB and capnproto from the OS, or built from a pinned tarball | `bazel_dep` versions in kepler-formal's `MODULE.bazel` | | ||
| | A pinned CMake when the OS's is too old | bazelisk runs the Bazel named in `.bazelversion` | | ||
| | `gcc-toolset-13` on EL8, because GCC 8 is too old | A pinned clang is downloaded on x86-64 Linux; elsewhere the host compiler is used, `gcc-toolset-13` on EL8, which Yosys still needs | | ||
| | `tools/kepler-formal` and the submodules inside it | The version in `MODULE.bazel`; sources are checked against their checksums and cached in `~/.cache/bazel` | | ||
| | An RPATH that points at the install's `lib/` | The binary finds its libraries next to itself, in `bin/kepler-formal.runfiles/` | |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| #!/usr/bin/env bash | ||
| # Usage: install_licenses.sh <prefix> | ||
| # | ||
| # Copies the license notices of every module that goes into the | ||
| # kepler-formal binary and its runfiles (naja, yaml-cpp, spdlog, kissat, | ||
| # the embedded Python, the statically linked libc++, ...) into | ||
| # <prefix>/share/kepler-formal/licenses/<repository>/. kepler-formal's | ||
| # //:install ships only its own LICENSE.rst and LICENSES/. | ||
| # | ||
| # The modules are the repositories cquery finds in the binary's target | ||
| # configuration; build tools such as bison run in the exec configuration | ||
| # and are left out. Run it after `bazelisk run //:install`, from this | ||
| # folder, so that the repositories are fetched. | ||
| set -euo pipefail | ||
|
|
||
| if [[ $# -ne 1 ]]; then | ||
| echo "Usage: $0 <prefix>" >&2 | ||
| exit 1 | ||
| fi | ||
| dest="$(cd "$1" && pwd)/share/kepler-formal/licenses" | ||
| binary=@kepler-formal//src/bin:kepler-formal | ||
|
|
||
| cd "$(dirname "$0")" | ||
| external="$(bazelisk info output_base)/external" | ||
| config="$(bazelisk cquery "${binary}" | awk '{print $NF}')" | ||
| repos="$(bazelisk cquery --consistent_labels "deps(${binary})" \ | ||
| | awk -v c="${config}" '$NF == c' \ | ||
| | sed -n 's|^@@\([^/]*\)//.*|\1|p' | sort -u)" | ||
|
|
||
| rm -rf "${dest}" | ||
| count=0 | ||
| for repo in ${repos}; do | ||
| [[ -n "${repo}" ]] || continue | ||
| # Some modules unpack into a subdirectory (zlib-1.3.2/, slang-12.0/), | ||
| # and the llvm-project one keeps libc++'s notice in libcxx/. The | ||
| # embedded Python keeps its own in lib/python3.X/. | ||
| files="$(cd "${external}/${repo}" && find . -maxdepth 3 \ | ||
| \( \( -iname 'LICENSE*' -o -iname 'LICENCE*' -o -iname 'COPYING*' \ | ||
| -o -iname 'NOTICE*' -o -iname 'COPYRIGHT*' \) \ | ||
| \( -path './*' -a ! -path './*/*/*' \ | ||
| -o -path './lib/python*/LICENSE.txt' \) \) \ | ||
| -print -prune)" | ||
| [[ -n "${files}" ]] || continue | ||
| mkdir -p "${dest}/${repo}" | ||
| while IFS= read -r f; do | ||
| (cd "${external}/${repo}" && cp -rL --parents "${f}" "${dest}/${repo}/") | ||
| done <<< "${files}" | ||
| count=$((count + 1)) | ||
| done | ||
| if [[ ${count} -eq 0 ]]; then | ||
| echo "[ERROR] no license notices found for ${binary} in ${external}" >&2 | ||
| exit 1 | ||
| fi | ||
| echo "Installed the license notices of ${count} modules in ${dest}" |
Submodule kepler-formal
deleted from
f70c2e
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.
Uh oh!
There was an error while loading. Please reload this page.