Skip to content

Commit 005a342

Browse files
oharboeclaude
andcommitted
bump: update orfs, openroad, qt-bazel in submodules
Apply the same dependency bumps to gallery, chisel, and sby submodules: orfs, openroad, qt-bazel commits, remove upstreamed patch, add openroad-remove-initrunfiles.patch. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
1 parent b668763 commit 005a342

6 files changed

Lines changed: 441 additions & 15 deletions

File tree

chisel/MODULE.bazel

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,9 @@ single_version_override(
3636
bazel_dep(name = "orfs")
3737
git_override(
3838
module_name = "orfs",
39-
commit = "f40d2f346e67ffe309a4f49b1897a560cf20c747",
39+
commit = "74271e42b301df0b3b84fb14d42282f9e8491cee",
4040
patch_strip = 1,
4141
patches = [
42-
"//patches:0001-build-remove-stale-merge_lib.py-preprocessLib.py-fro.patch",
4342
"//patches:0002-build-add-all-PDKs-and-export-variables.yaml.patch",
4443
"//patches:0035-fix-remove-non-root-overrides-from-MODULE.bazel.patch",
4544
],
@@ -57,17 +56,20 @@ use_repo(orfs, "gnumake")
5756
bazel_dep(name = "openroad")
5857
git_override(
5958
module_name = "openroad",
60-
commit = "df79404cd806cc435b3c3b53678ebf2441c31313",
59+
commit = "d22045c978d037f7a5788c08f359aec471800c01",
6160
init_submodules = True,
6261
patch_strip = 1,
63-
patches = ["//:openroad-visibility.patch"],
62+
patches = [
63+
"//:openroad-visibility.patch",
64+
"//:openroad-remove-initrunfiles.patch",
65+
],
6466
remote = "https://github.com/The-OpenROAD-Project/OpenROAD.git",
6567
)
6668

6769
bazel_dep(name = "qt-bazel")
6870
git_override(
6971
module_name = "qt-bazel",
70-
commit = "df022f4ebaa4130713692fffd2f519d49e9d0b97",
72+
commit = "886104974c2fd72439f2c33b5deebf0fe4649df7",
7173
remote = "https://github.com/The-OpenROAD-Project/qt_bazel_prebuilts",
7274
)
7375

Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
diff --git a/bazel/BUILD b/bazel/BUILD
2+
index a15adee..66f99d2 100644
3+
--- a/bazel/BUILD
4+
+++ b/bazel/BUILD
5+
@@ -124,18 +124,12 @@ cc_library(
6+
}),
7+
)
8+
9+
-# shim old library as it is still referenced in src/sta, implementing the
10+
-# old behavior.
11+
+# Stub library kept for src/sta:opensta compatibility.
12+
+# Tcl setup is now handled by //bazel:tcl_library_init.
13+
cc_library(
14+
name = "runfiles",
15+
srcs = ["InitRunFiles.cpp"],
16+
- data = [":tcl_resources_dir"],
17+
visibility = ["//visibility:public"],
18+
- deps = [
19+
- "@rules_cc//cc/runfiles",
20+
- "@tcl_lang//:tcl",
21+
- ],
22+
- alwayslink = True,
23+
)
24+
25+
# small build test to check if "bazel build //src/sta:StaTclInitVar" works
26+
diff --git a/bazel/InitRunFiles.cpp b/bazel/InitRunFiles.cpp
27+
index 0651774..ece50b0 100644
28+
--- a/bazel/InitRunFiles.cpp
29+
+++ b/bazel/InitRunFiles.cpp
30+
@@ -1,86 +1,3 @@
31+
-// SPDX-License-Identifier: BSD-3-Clause
32+
-// Copyright (c) 2026, The OpenROAD Authors
33+
-
34+
-// This file to go away as soon as we use the tcl_library_init initialization
35+
-// in OpenSTA.
36+
-
37+
-#include <unistd.h> // readlink()
38+
-
39+
-#include <climits>
40+
-#include <cstdlib>
41+
-#include <filesystem>
42+
-#include <iostream>
43+
-#include <memory>
44+
-#include <optional>
45+
-#include <string>
46+
-#include <system_error>
47+
-
48+
-#if defined(__APPLE__)
49+
-#include <mach-o/dyld.h>
50+
-#include <sys/param.h>
51+
-#endif
52+
-
53+
-#include "rules_cc/cc/runfiles/runfiles.h"
54+
-
55+
-namespace {
56+
-// Avoid adding any dependencies like boost.filesystem
57+
-// Returns path to running binary if possible, otherwise nullopt.
58+
-static std::optional<std::string> GetProgramLocation()
59+
-{
60+
-#if defined(_WIN32)
61+
- char result[MAX_PATH + 1] = {'\0'};
62+
- auto path_len = GetModuleFileNameA(NULL, result, MAX_PATH);
63+
-#elif defined(__APPLE__)
64+
- char result[MAXPATHLEN + 1] = {'\0'};
65+
- uint32_t path_len = MAXPATHLEN;
66+
- if (_NSGetExecutablePath(result, &path_len) != 0) {
67+
- path_len = readlink(result, result, MAXPATHLEN);
68+
- }
69+
-#else
70+
- char result[PATH_MAX + 1] = {'\0'};
71+
- ssize_t path_len = readlink("/proc/self/exe", result, PATH_MAX);
72+
-#endif
73+
- if (path_len > 0) {
74+
- return result;
75+
- }
76+
- return std::nullopt;
77+
-}
78+
-
79+
-std::string GetTclLibraryBaseLocation()
80+
-{
81+
- using rules_cc::cc::runfiles::Runfiles;
82+
- std::string error;
83+
- std::unique_ptr<Runfiles> runfiles(Runfiles::Create(
84+
- *GetProgramLocation(), BAZEL_CURRENT_REPOSITORY, &error));
85+
- if (!runfiles) {
86+
- std::cerr << "[Warning] Failed to create bazel runfiles: " << error << "\n";
87+
- return "";
88+
- }
89+
-
90+
- std::error_code ec;
91+
- for (const std::string loc : {"openroad", "opensta", "_main"}) {
92+
- const std::string check_loc = loc + "/bazel/tcl_resources_dir";
93+
- const std::string path = runfiles->Rlocation(check_loc);
94+
- if (!path.empty() && std::filesystem::exists(path, ec)) {
95+
- return path;
96+
- }
97+
- }
98+
- return "";
99+
-}
100+
-
101+
-class BazelInitializer
102+
-{
103+
- public:
104+
- BazelInitializer()
105+
- {
106+
- const std::string lib_mount_point = GetTclLibraryBaseLocation();
107+
- if (!lib_mount_point.empty()) {
108+
- const std::string tcl_path = lib_mount_point + "/library";
109+
- setenv("TCL_LIBRARY", tcl_path.c_str(), true);
110+
- }
111+
- }
112+
-};
113+
-
114+
-// Provide via global constructor.
115+
-static BazelInitializer bazel_initializer;
116+
-} // namespace
117+
+// Intentionally empty: tcl_library_init now handles Tcl setup.
118+
+// This file is kept because src/sta:opensta still references
119+
+// //bazel:runfiles in its srcs.
120+
diff --git a/bazel/tcl_library_init.cc b/bazel/tcl_library_init.cc
121+
index 4be9671..8306978 100644
122+
--- a/bazel/tcl_library_init.cc
123+
+++ b/bazel/tcl_library_init.cc
124+
@@ -35,6 +35,16 @@ static std::optional<std::string> TclLibraryMountPoint(Tcl_Interp* interp)
125+
return Tcl_GetStringResult(interp);
126+
#else
127+
using rules_cc::cc::runfiles::Runfiles;
128+
+
129+
+ // Clear inherited RUNFILES_* env vars: when OpenROAD is invoked by
130+
+ // a build system that previously ran another Bazel binary (e.g. a
131+
+ // Python wrapper), those variables point to the *other* binary's
132+
+ // runfiles tree. Runfiles::Create() checks env vars first, so it
133+
+ // would resolve paths in the wrong tree. Unsetting forces it to
134+
+ // fall back to Tcl_GetNameOfExecutable(), which is always correct.
135+
+ unsetenv("RUNFILES_DIR");
136+
+ unsetenv("RUNFILES_MANIFEST_FILE");
137+
+
138+
std::string error;
139+
std::unique_ptr<Runfiles> runfiles(Runfiles::Create(
140+
Tcl_GetNameOfExecutable(), BAZEL_CURRENT_REPOSITORY, &error));

gallery/MODULE.bazel

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,9 @@ single_version_override(
3434
bazel_dep(name = "orfs")
3535
git_override(
3636
module_name = "orfs",
37-
commit = "f40d2f346e67ffe309a4f49b1897a560cf20c747",
37+
commit = "74271e42b301df0b3b84fb14d42282f9e8491cee",
3838
patch_strip = 1,
3939
patches = [
40-
"//patches:0001-build-remove-stale-merge_lib.py-preprocessLib.py-fro.patch",
4140
"//patches:0002-build-add-all-PDKs-and-export-variables.yaml.patch",
4241
"//patches:0035-fix-remove-non-root-overrides-from-MODULE.bazel.patch",
4342
],
@@ -56,17 +55,20 @@ use_repo(orfs, "gnumake")
5655
bazel_dep(name = "openroad")
5756
git_override(
5857
module_name = "openroad",
59-
commit = "df79404cd806cc435b3c3b53678ebf2441c31313",
58+
commit = "d22045c978d037f7a5788c08f359aec471800c01",
6059
init_submodules = True,
6160
patch_strip = 1,
62-
patches = ["//:openroad-visibility.patch"],
61+
patches = [
62+
"//:openroad-visibility.patch",
63+
"//:openroad-remove-initrunfiles.patch",
64+
],
6365
remote = "https://github.com/The-OpenROAD-Project/OpenROAD.git",
6466
)
6567

6668
bazel_dep(name = "qt-bazel")
6769
git_override(
6870
module_name = "qt-bazel",
69-
commit = "df022f4ebaa4130713692fffd2f519d49e9d0b97",
71+
commit = "886104974c2fd72439f2c33b5deebf0fe4649df7",
7072
remote = "https://github.com/The-OpenROAD-Project/qt_bazel_prebuilts",
7173
)
7274

Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
diff --git a/bazel/BUILD b/bazel/BUILD
2+
index a15adee..66f99d2 100644
3+
--- a/bazel/BUILD
4+
+++ b/bazel/BUILD
5+
@@ -124,18 +124,12 @@ cc_library(
6+
}),
7+
)
8+
9+
-# shim old library as it is still referenced in src/sta, implementing the
10+
-# old behavior.
11+
+# Stub library kept for src/sta:opensta compatibility.
12+
+# Tcl setup is now handled by //bazel:tcl_library_init.
13+
cc_library(
14+
name = "runfiles",
15+
srcs = ["InitRunFiles.cpp"],
16+
- data = [":tcl_resources_dir"],
17+
visibility = ["//visibility:public"],
18+
- deps = [
19+
- "@rules_cc//cc/runfiles",
20+
- "@tcl_lang//:tcl",
21+
- ],
22+
- alwayslink = True,
23+
)
24+
25+
# small build test to check if "bazel build //src/sta:StaTclInitVar" works
26+
diff --git a/bazel/InitRunFiles.cpp b/bazel/InitRunFiles.cpp
27+
index 0651774..ece50b0 100644
28+
--- a/bazel/InitRunFiles.cpp
29+
+++ b/bazel/InitRunFiles.cpp
30+
@@ -1,86 +1,3 @@
31+
-// SPDX-License-Identifier: BSD-3-Clause
32+
-// Copyright (c) 2026, The OpenROAD Authors
33+
-
34+
-// This file to go away as soon as we use the tcl_library_init initialization
35+
-// in OpenSTA.
36+
-
37+
-#include <unistd.h> // readlink()
38+
-
39+
-#include <climits>
40+
-#include <cstdlib>
41+
-#include <filesystem>
42+
-#include <iostream>
43+
-#include <memory>
44+
-#include <optional>
45+
-#include <string>
46+
-#include <system_error>
47+
-
48+
-#if defined(__APPLE__)
49+
-#include <mach-o/dyld.h>
50+
-#include <sys/param.h>
51+
-#endif
52+
-
53+
-#include "rules_cc/cc/runfiles/runfiles.h"
54+
-
55+
-namespace {
56+
-// Avoid adding any dependencies like boost.filesystem
57+
-// Returns path to running binary if possible, otherwise nullopt.
58+
-static std::optional<std::string> GetProgramLocation()
59+
-{
60+
-#if defined(_WIN32)
61+
- char result[MAX_PATH + 1] = {'\0'};
62+
- auto path_len = GetModuleFileNameA(NULL, result, MAX_PATH);
63+
-#elif defined(__APPLE__)
64+
- char result[MAXPATHLEN + 1] = {'\0'};
65+
- uint32_t path_len = MAXPATHLEN;
66+
- if (_NSGetExecutablePath(result, &path_len) != 0) {
67+
- path_len = readlink(result, result, MAXPATHLEN);
68+
- }
69+
-#else
70+
- char result[PATH_MAX + 1] = {'\0'};
71+
- ssize_t path_len = readlink("/proc/self/exe", result, PATH_MAX);
72+
-#endif
73+
- if (path_len > 0) {
74+
- return result;
75+
- }
76+
- return std::nullopt;
77+
-}
78+
-
79+
-std::string GetTclLibraryBaseLocation()
80+
-{
81+
- using rules_cc::cc::runfiles::Runfiles;
82+
- std::string error;
83+
- std::unique_ptr<Runfiles> runfiles(Runfiles::Create(
84+
- *GetProgramLocation(), BAZEL_CURRENT_REPOSITORY, &error));
85+
- if (!runfiles) {
86+
- std::cerr << "[Warning] Failed to create bazel runfiles: " << error << "\n";
87+
- return "";
88+
- }
89+
-
90+
- std::error_code ec;
91+
- for (const std::string loc : {"openroad", "opensta", "_main"}) {
92+
- const std::string check_loc = loc + "/bazel/tcl_resources_dir";
93+
- const std::string path = runfiles->Rlocation(check_loc);
94+
- if (!path.empty() && std::filesystem::exists(path, ec)) {
95+
- return path;
96+
- }
97+
- }
98+
- return "";
99+
-}
100+
-
101+
-class BazelInitializer
102+
-{
103+
- public:
104+
- BazelInitializer()
105+
- {
106+
- const std::string lib_mount_point = GetTclLibraryBaseLocation();
107+
- if (!lib_mount_point.empty()) {
108+
- const std::string tcl_path = lib_mount_point + "/library";
109+
- setenv("TCL_LIBRARY", tcl_path.c_str(), true);
110+
- }
111+
- }
112+
-};
113+
-
114+
-// Provide via global constructor.
115+
-static BazelInitializer bazel_initializer;
116+
-} // namespace
117+
+// Intentionally empty: tcl_library_init now handles Tcl setup.
118+
+// This file is kept because src/sta:opensta still references
119+
+// //bazel:runfiles in its srcs.
120+
diff --git a/bazel/tcl_library_init.cc b/bazel/tcl_library_init.cc
121+
index 4be9671..8306978 100644
122+
--- a/bazel/tcl_library_init.cc
123+
+++ b/bazel/tcl_library_init.cc
124+
@@ -35,6 +35,16 @@ static std::optional<std::string> TclLibraryMountPoint(Tcl_Interp* interp)
125+
return Tcl_GetStringResult(interp);
126+
#else
127+
using rules_cc::cc::runfiles::Runfiles;
128+
+
129+
+ // Clear inherited RUNFILES_* env vars: when OpenROAD is invoked by
130+
+ // a build system that previously ran another Bazel binary (e.g. a
131+
+ // Python wrapper), those variables point to the *other* binary's
132+
+ // runfiles tree. Runfiles::Create() checks env vars first, so it
133+
+ // would resolve paths in the wrong tree. Unsetting forces it to
134+
+ // fall back to Tcl_GetNameOfExecutable(), which is always correct.
135+
+ unsetenv("RUNFILES_DIR");
136+
+ unsetenv("RUNFILES_MANIFEST_FILE");
137+
+
138+
std::string error;
139+
std::unique_ptr<Runfiles> runfiles(Runfiles::Create(
140+
Tcl_GetNameOfExecutable(), BAZEL_CURRENT_REPOSITORY, &error));

sby/MODULE.bazel

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,9 @@ single_version_override(
4040
bazel_dep(name = "orfs")
4141
git_override(
4242
module_name = "orfs",
43-
commit = "f40d2f346e67ffe309a4f49b1897a560cf20c747",
43+
commit = "74271e42b301df0b3b84fb14d42282f9e8491cee",
4444
patch_strip = 1,
4545
patches = [
46-
"//patches:0001-build-remove-stale-merge_lib.py-preprocessLib.py-fro.patch",
4746
"//patches:0002-build-add-all-PDKs-and-export-variables.yaml.patch",
4847
"//patches:0035-fix-remove-non-root-overrides-from-MODULE.bazel.patch",
4948
],
@@ -53,17 +52,20 @@ git_override(
5352
bazel_dep(name = "openroad")
5453
git_override(
5554
module_name = "openroad",
56-
commit = "df79404cd806cc435b3c3b53678ebf2441c31313",
55+
commit = "d22045c978d037f7a5788c08f359aec471800c01",
5756
init_submodules = True,
5857
patch_strip = 1,
59-
patches = ["//:openroad-visibility.patch"],
58+
patches = [
59+
"//:openroad-visibility.patch",
60+
"//:openroad-remove-initrunfiles.patch",
61+
],
6062
remote = "https://github.com/The-OpenROAD-Project/OpenROAD.git",
6163
)
6264

6365
bazel_dep(name = "qt-bazel")
6466
git_override(
6567
module_name = "qt-bazel",
66-
commit = "df022f4ebaa4130713692fffd2f519d49e9d0b97",
68+
commit = "886104974c2fd72439f2c33b5deebf0fe4649df7",
6769
remote = "https://github.com/The-OpenROAD-Project/qt_bazel_prebuilts",
6870
)
6971

0 commit comments

Comments
 (0)