@@ -66,25 +66,12 @@ def emit_archive(go, source = None, _recompile_suffix = ""):
66
66
runfiles = source .runfiles
67
67
data_files = runfiles .files
68
68
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 )
88
75
89
76
importmap = "main" if source .library .is_main else source .library .importmap
90
77
importpath , _ = effective_importpath_pkgpath (source .library )
0 commit comments