bazel: use pkg_tar for the install procedure#9656
bazel: use pkg_tar for the install procedure#9656maliberty merged 1 commit intoThe-OpenROAD-Project:masterfrom
Conversation
There was a problem hiding this comment.
Code Review
This pull request refactors the installation process to use pkg_tar for creating a distributable tarball. This is a good improvement that makes packaging more robust. The changes in the Bazel build files are correct, and the updated install.sh script correctly handles the new tar-based installation and adds support for custom installation paths. I've found one minor issue in the installation script that could cause it to fail, and I've provided a suggestion for a fix.
bazel/install.sh
Outdated
| if [ -e openroad.repo_mapping ]; then | ||
| chmod u+w openroad.repo_mapping | ||
| fi | ||
| rm -r openroad.repo_mapping |
There was a problem hiding this comment.
This block for removing openroad.repo_mapping is brittle. The rm -r command on line 25 will cause the script to fail if openroad.repo_mapping does not exist, because set -e is active.
This can be simplified and made more robust by using rm -rf, which is idempotent and handles files, directories, and non-existent paths without error. This is also consistent with its use on the next line.
| if [ -e openroad.repo_mapping ]; then | |
| chmod u+w openroad.repo_mapping | |
| fi | |
| rm -r openroad.repo_mapping | |
| rm -rf openroad.repo_mapping |
|
clang-tidy review says "All clean, LGTM! 👍" |
|
clang-tidy review says "All clean, LGTM! 👍" |
|
Do you need to remove the repo mapping file? |
It will work also if I do not delete that file. But the relevant repo_mapping file is in |
|
The approach looks good — using One request: the custom install path usage instructions are currently buried in comments inside # Run this from bazel build directory with
# bazelisk run --//:platform=gui //:install
# If you want to install to another location, e.g. /tmp, then do
# bazelisk run --//:platform=gui //:install -- /tmpThese should go into ## Build and install with Bazel
Build OpenROAD with GUI support and install into ../install/OpenROAD/bin
bazelisk run --//:platform=gui //:install
To install to a custom location:
bazelisk run --//:platform=gui //:install -- /tmp/myinstall
To embed the real git version string, add `--config=release`:
bazelisk run --config=release --//:platform=gui //:install
See [Bazel](Bazel.md) for more details on testing, profiling and build configurations.Then remove the usage comments from |
|
Good idea! I adapted the description in |
|
clang-tidy review says "All clean, LGTM! 👍" |
BUILD.bazel
Outdated
| # This can be untarred and run standalone | ||
| # This includes | ||
| # ./openroad.runfiles/_main/openroad | ||
| # which is again the binary. |
There was a problem hiding this comment.
remove these comments, these days you can ask e.g. Claude to explain what is going on and it will read the README.md and these comments are only going to be out of date....
There was a problem hiding this comment.
Thanks for your review! I removed the comments.
I updated the install procedure to use the pkg_tar module. The install works as before, but now you can also install optionally to another location. Closes: The-OpenROAD-Project#9635 Signed-off-by: Friedrich Beckmann <friedrich.beckmann@tha.de>
|
@fredowski FYI, this project prefers not force pushing because then the review history is preserved. This makes the commit history very messy, but it is more information. Perhaps in this day and age of AI, that is information that can be used to train an automatic reviewer 😄 |
|
@fredowski and perhaps reading a messy git history automatically with AI to answer questions for hoomans will pay off... |
|
clang-tidy review says "All clean, LGTM! 👍" |
|
O.k. - yes the history vanishes with the squashing... |
|
Thanks everybody for reviewing the code and spending your time on this topic! |
|
😌 |
I updated the install procedure to use the pkg_tar module. The install works as before, but now you
can also install optionally to another location.
Closes: #9635