Put the logic to when to use zipfs in one place,
set `USE_ZIPFS_INIT` define with that value and
use it for `#ifdef` ranges.
With that, also `#ifdef`-out the `GetProgramLocation()`, which is not
needed in the zipfs case.
Signed-off-by: Henner Zeller <h.zeller@acm.org>
- Extract shared transitive-depset helpers into bazel/swig_common.bzl;
tcl_wrap_cc and python_wrap_cc had identical copy-pasted helpers.
Providers stay distinct so deps type safety is preserved.
- Delete empty bazel/build_helper.bzl (never loaded anywhere).
- Remove dead .tcl/.py endswith filter in tcl_encode_or.bzl; the
attr.label_list(allow_files=[".tcl", ".py"]) already enforces it.
- Deduplicate -Wall/-Wextra/-Wno-sign-compare/-Wno-unused-parameter
in OPENROAD_COPTS; these are already set globally via .bazelrc.
- Add missing doc= for runtime_header attr; drop stale "for google3"
docstring and obsolete/incorrect narration comments.
Signed-off-by: Matt Liberty <mliberty@precisioninno.com>
install.sh deleted openroad.runfiles/_main which contains the Tcl
resource files (init.tcl, tclreadline, etc.) needed by the Bazel-built
binary. Remove that rm so the runfiles tree stays intact after install.
Add an install smoke test that extracts the packaging tarball and
verifies the binary can evaluate a Tcl expression — catches regressions
like this automatically.
Validate: bazelisk test //test/install/...
Fixes#10115
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* For Tcl9, all relevant system tcl files, the tcl library and
readline library, are packed in a zip file, compiled into the
binary mounted on the virtual filesystem //zipfs:/
* On Tcl 8, which does not allow to do that quite yet, we
take the same directory structure (unpacked), and use them
via runfiles as before; however, since this is now a single
directory the runfile symbolic links are reduced to one.
Default for now is to use the runfile method, as we're still on
Tcl8; The code is prepared for Tcl9, awaiting some changes in
STA to be merged, then we can change the default.
Fixes: #9962#9980
Signed-off-by: Henner Zeller <h.zeller@acm.org>
readlink -f resolves through symlinks, losing the .runfiles sibling
directory that py_console_script_binary needs. Use the same cd/pwd
pattern as tcl_tidy.sh which resolves the directory without following
the symlink.
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
The only Posix compatible way to call bash is via `/usr/bin/env`
as bash might be installed in different locations on the system.
`/bin/bash` is not a Posix-required location for that binary
(only `/bin/sh` is).
Use `set -o noglob` instead of `bash -f` for improved readability.
Signed-off-by: Henner Zeller <h.zeller@acm.org>
fix_lint was an alias for tidy_tcl (tclfmt only), so developers
who ran it before pushing were still surprised by tclint CI
failures like line-length.
Replace the alias with a script that delegates to tcl_tidy.sh
and tcl_lint_test.sh (DRY), shows git status, and exits with
a clear error if lint violations remain unfixed.
Update docs with POLA rationale and naming convention for
umbrella and per-language targets.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
- Tests were scanning 0 files because BUILD_WORKSPACE_DIRECTORY is
unset in test context. Resolve workspace from tclint.toml symlink.
- fix_lint failed because readlink -f resolved through runfiles
symlinks. Use directory-based path resolution instead.
- All three scripts now use git ls-files to avoid broken symlinks
in gitignored directories like tmp/.
- Add tmp/ to tclint.toml excludes, fix leading whitespace.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
This was implicit in the olden days, but these days we should
be explicit to be compatible with future bazel versions.
Signed-off-by: Henner Zeller <h.zeller@acm.org>
Expose tclint and tclfmt as py_console_script_binary targets from the
pip-managed tclint package. Add wrapper shell scripts that invoke these
tools against the workspace root.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
Add tclint==0.7.0 to pip requirements for Bazel-managed TCL linting
and formatting. This is the same version used by the GitHub Actions
workflow.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
Use expand_template and copy_file from bazel_skylib instead of
genrule with sed/cat in the OpenMP overlay BUILD file. This avoids
depending on host shell tools and sets a better example for
contributors who copy existing patterns.
Remaining hermeticity nits for later:
- BUILD.bazel OpenRoadVersion genrule uses grep/cut/printf
- src/sta StaConfig genrule uses echo -e (fix pending in sta repo)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
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
Signed-off-by: Friedrich Beckmann <friedrich.beckmann@tha.de>
I extended the mechanism that is used to supply the defines for
the python module. Now tha linker options are set in one place.
Signed-off-by: Friedrich Beckmann <friedrich.beckmann@tha.de>
Step 1 from 2.
That way, we can use it from here and remove the reference
in `WORKSPACE`.
After
https://github.com/The-OpenROAD-Project/OpenSTA/pull/296
is merged, we can (step 2) update that submodule, and
with it remove the WORKSPACE reference.
Signed-off-by: Henner Zeller <h.zeller@acm.org>
The tcl_lang package does not provide the default tcl library
files like init.tcl with the tclsh. That is different compared
to the rules_hdl version. tcl_lang provides the library files
via tcl_core. I derived the path and set TCL_LIBRARY such that
tclsh finds the right init.tcl file.
Closes: #9524
Signed-off-by: Friedrich Beckmann <friedrich.beckmann@tha.de>
The bazel build comes with tcl files in the runtime environment.
When the binary is called directly with TCL_LIBRARY set
to another tcl version, then that one is used. If the versions
differ like 8.6.12 vs 8.6.16, then the tcl shell does not work.
This patch makes sure that the TCL_LIBRARY variable is
always overwritten to use the bazel runtime environment
with the correct tcl init files.
The original behaviour resulted in regression test
failures because the TCL_LIBRARY variable was
set to the system (ubuntu) version which was 8.6.12 while
openroad uses 8.6.16.
Signed-off-by: Friedrich Beckmann <friedrich.beckmann@tha.de>
At least after migrating to bcr version of tcl the
regression works without this setting. Also some short
test on the openroad cmdline version works.
Signed-off-by: Friedrich Beckmann <friedrich.beckmann@tha.de>