mirror of
https://github.com/hanzoai/visor.git
synced 2026-09-24 17:04:14 +00:00
Specifically, build using bazel WORKSPACE. Bazel modules is still not used and requires further migration. This updates some dependencies to make them compatible with Bazel 8, which in turn requires explicitly adding some new dependencies to support new versions. In some cases existing patches no longer applied and had to be updated. A new patch was added to remove windows toolchains from coral-crosstools, because that functionality requires lots of bazel intrinsics that are no longer defined. At least on my machine, when //vdso:vdso was a dependency (not targetted explicitly), the Gold linker specified in `vdso_linker_option` failed to be found (bazel build //vdso worked); however this led me to discover that the Gold linker is deprecated, hence using it is removed entirely. To make the repo compatible with bazelisk out of the box, a bazelversion file has been added.
100 lines
4.2 KiB
Diff
100 lines
4.2 KiB
Diff
diff --git a/go/private/actions/archive.bzl b/go/private/actions/archive.bzl
|
|
index ab56991c..ebe43ca2 100644
|
|
--- a/go/private/actions/archive.bzl
|
|
+++ b/go/private/actions/archive.bzl
|
|
@@ -219,6 +219,7 @@ def emit_archive(go, source = None, _recompile_suffix = "", recompile_internal_d
|
|
data = data,
|
|
direct = direct,
|
|
libs = depset(direct = [out_lib], transitive = [a.libs for a in direct]),
|
|
+ export_files = depset(direct = [out_export], transitive = [a.export_files for a in direct]),
|
|
transitive = depset([data], transitive = [a.transitive for a in direct]),
|
|
x_defs = x_defs,
|
|
cgo_deps = depset(transitive = [cgo_deps] + [a.cgo_deps for a in direct]),
|
|
diff --git a/go/private/rules/binary.bzl b/go/private/rules/binary.bzl
|
|
index 064831bb..3ca16253 100644
|
|
--- a/go/private/rules/binary.bzl
|
|
+++ b/go/private/rules/binary.bzl
|
|
@@ -157,6 +157,7 @@ def _go_binary_impl(ctx):
|
|
providers = [
|
|
archive,
|
|
OutputGroupInfo(
|
|
+ export_files = archive.export_files,
|
|
cgo_exports = archive.cgo_exports,
|
|
compilation_outputs = [archive.data.file],
|
|
nogo_fix = [nogo_diagnostics] if nogo_diagnostics else [],
|
|
diff --git a/go/private/rules/library.bzl b/go/private/rules/library.bzl
|
|
index 68a1d3b9..53c38cb2 100644
|
|
--- a/go/private/rules/library.bzl
|
|
+++ b/go/private/rules/library.bzl
|
|
@@ -64,6 +64,8 @@ def _go_library_impl(ctx):
|
|
extensions = ["go"],
|
|
),
|
|
OutputGroupInfo(
|
|
+ export_files = archive.export_files,
|
|
+ libs = archive.libs,
|
|
cgo_exports = archive.cgo_exports,
|
|
compilation_outputs = [archive.data.file],
|
|
nogo_fix = [nogo_diagnostics] if nogo_diagnostics else [],
|
|
@@ -214,9 +216,23 @@ def _go_tool_library_impl(ctx):
|
|
go_info = new_go_info(go, ctx.attr)
|
|
archive = go.archive(go, go_info)
|
|
|
|
+ validation_output = archive.data._validation_output
|
|
+ nogo_diagnostics = archive.data._nogo_diagnostics
|
|
+
|
|
return [
|
|
go_info,
|
|
archive,
|
|
+ DefaultInfo(
|
|
+ files = depset([archive.data.export_file]),
|
|
+ ),
|
|
+ OutputGroupInfo(
|
|
+ export_files = archive.export_files,
|
|
+ libs = archive.libs,
|
|
+ cgo_exports = archive.cgo_exports,
|
|
+ compilation_outputs = [archive.data.file],
|
|
+ nogo_fix = [nogo_diagnostics] if nogo_diagnostics else [],
|
|
+ _validation = [validation_output] if validation_output else [],
|
|
+ ),
|
|
]
|
|
|
|
go_tool_library = rule(
|
|
diff --git a/go/private/rules/test.bzl b/go/private/rules/test.bzl
|
|
index dcb4eb63..660505b4 100644
|
|
--- a/go/private/rules/test.bzl
|
|
+++ b/go/private/rules/test.bzl
|
|
@@ -215,6 +215,8 @@ def _go_test_impl(ctx):
|
|
),
|
|
OutputGroupInfo(
|
|
compilation_outputs = [internal_archive.data.file],
|
|
+ export_files = internal_archive.export_files,
|
|
+ libs = internal_archive.libs,
|
|
nogo_fix = nogo_diagnosticss,
|
|
_validation = validation_outputs,
|
|
),
|
|
@@ -723,6 +725,7 @@ def _recompile_external_deps(go, external_go_info, internal_archive, library_lab
|
|
data = arc_data,
|
|
direct = deps,
|
|
libs = depset(direct = [arc_data.file], transitive = [a.libs for a in deps]),
|
|
+ export_files = depset(direct = [arc_data.export_file], transitive = [a.export_files for a in deps]),
|
|
transitive = depset(direct = [arc_data], transitive = [a.transitive for a in deps]),
|
|
x_defs = go_info.x_defs,
|
|
cgo_deps = depset(transitive = [arc_data._cgo_deps] + [a.cgo_deps for a in deps]),
|
|
diff --git a/proto/def.bzl b/proto/def.bzl
|
|
index 7b70b83c..5c120de5 100644
|
|
--- a/proto/def.bzl
|
|
+++ b/proto/def.bzl
|
|
@@ -154,10 +154,11 @@ def _go_proto_library_impl(ctx):
|
|
if valid_archive:
|
|
archive = go.archive(go, go_info)
|
|
output_groups["compilation_outputs"] = [archive.data.file]
|
|
+ output_groups["export_files"] = archive.export_files
|
|
providers.extend([
|
|
archive,
|
|
DefaultInfo(
|
|
- files = depset([archive.data.file]),
|
|
+ files = depset([archive.data.export_file]),
|
|
runfiles = archive.runfiles,
|
|
),
|
|
])
|