Skip to content

Commit 4068712

Browse files
authored
Bumping minimal Bazel version to 5.1.0 (#3286)
1 parent dce2ea5 commit 4068712

File tree

3 files changed

+8
-21
lines changed

3 files changed

+8
-21
lines changed

.bazelci/presubmit.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
tasks:
33
ubuntu1804_bazel400:
44
platform: ubuntu1804
5-
bazel: 4.2.1 # test minimum supported version of bazel
5+
bazel: 5.1.0 # test minimum supported version of bazel
66
shell_commands:
77
- tests/core/cgo/generate_imported_dylib.sh
88
build_targets:

go/private/actions/archive.bzl

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -66,25 +66,12 @@ def emit_archive(go, source = None, _recompile_suffix = ""):
6666
runfiles = source.runfiles
6767
data_files = runfiles.files
6868

69-
# After bazel version 5.0.0, starlark introduced a new API called merge_all().
70-
# There is a recommendation in the release notes to use merge_all() if we hit
71-
# the depth limit because of using merge() in a loop; we saw some repositories
72-
# hitting this issue after upgrading to 5.0.0. To keep it backward compatible,
73-
# we will fall back to the old logic if the array doesn't have merge_all().
74-
# TODO: remove this check after the MINIMUM_BAZEL_VERSION becomes >= 5.0.0
75-
# https://blog.bazel.build/2022/01/19/bazel-5.0.html#starlark-build-language
76-
if hasattr(runfiles, "merge_all"):
77-
files = []
78-
for a in direct:
79-
files.append(a.runfiles)
80-
if a.source.mode != go.mode:
81-
fail("Archive mode does not match {} is {} expected {}".format(a.data.label, mode_string(a.source.mode), mode_string(go.mode)))
82-
runfiles.merge_all(files)
83-
else:
84-
for a in direct:
85-
runfiles = runfiles.merge(a.runfiles)
86-
if a.source.mode != go.mode:
87-
fail("Archive mode does not match {} is {} expected {}".format(a.data.label, mode_string(a.source.mode), mode_string(go.mode)))
69+
files = []
70+
for a in direct:
71+
files.append(a.runfiles)
72+
if a.source.mode != go.mode:
73+
fail("Archive mode does not match {} is {} expected {}".format(a.data.label, mode_string(a.source.mode), mode_string(go.mode)))
74+
runfiles.merge_all(files)
8875

8976
importmap = "main" if source.library.is_main else source.library.importmap
9077
importpath, _ = effective_importpath_pkgpath(source.library)

go/private/common.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ def get_versioned_shared_lib_extension(path):
199199
# something like 1.2.3, or so.1.2, or dylib.1.2, or foo.1.2
200200
return ""
201201

202-
MINIMUM_BAZEL_VERSION = "4.2.1"
202+
MINIMUM_BAZEL_VERSION = "5.1.0"
203203

204204
def as_list(v):
205205
"""Returns a list, tuple, or depset as a list."""

0 commit comments

Comments
 (0)