Skip to content

Commit 5d939db

Browse files
committed
Bump version to 3.21.3
1 parent bd0540e commit 5d939db

File tree

1 file changed

+41
-43
lines changed

1 file changed

+41
-43
lines changed

protobuf_javascript_release.bzl

Lines changed: 41 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,55 @@
11
"""Generates package naming variables for use with rules_pkg."""
22

3-
load("@rules_pkg//:providers.bzl", "PackageVariablesInfo")
43
load("@bazel_tools//tools/cpp:toolchain_utils.bzl", "find_cpp_toolchain")
4+
load("@rules_pkg//:providers.bzl", "PackageVariablesInfo")
55

6-
_PROTOBUF_JAVASCRIPT_VERSION = "3.21.2"
7-
6+
_PROTOBUF_JAVASCRIPT_VERSION = "3.21.3"
87

98
def _package_naming_impl(ctx):
10-
values = {}
11-
values["version"] = _PROTOBUF_JAVASCRIPT_VERSION
12-
13-
if ctx.attr.platform != "":
14-
values["platform"] = ctx.attr.platform
15-
return PackageVariablesInfo(values=values)
16-
17-
# infer from the current cpp toolchain.
18-
toolchain = find_cpp_toolchain(ctx)
19-
cpu = toolchain.cpu
20-
system_name = toolchain.target_gnu_system_name
21-
22-
# rename cpus to match what we want artifacts to be
23-
if cpu == "systemz":
24-
cpu = "s390_64"
25-
elif cpu == "aarch64":
26-
cpu = "aarch_64"
27-
elif cpu == "ppc64":
28-
cpu = "ppcle_64"
29-
30-
# use the system name to determine the os and then create platform names
31-
if "apple" in system_name:
32-
values["platform"] = "osx-" + cpu
33-
elif "linux" in system_name:
34-
values["platform"] = "linux-" + cpu
35-
elif "mingw" in system_name:
36-
if cpu == "x86_64":
37-
values["platform"] = "win64"
9+
values = {}
10+
values["version"] = _PROTOBUF_JAVASCRIPT_VERSION
11+
12+
if ctx.attr.platform != "":
13+
values["platform"] = ctx.attr.platform
14+
return PackageVariablesInfo(values = values)
15+
16+
# infer from the current cpp toolchain.
17+
toolchain = find_cpp_toolchain(ctx)
18+
cpu = toolchain.cpu
19+
system_name = toolchain.target_gnu_system_name
20+
21+
# rename cpus to match what we want artifacts to be
22+
if cpu == "systemz":
23+
cpu = "s390_64"
24+
elif cpu == "aarch64":
25+
cpu = "aarch_64"
26+
elif cpu == "ppc64":
27+
cpu = "ppcle_64"
28+
29+
# use the system name to determine the os and then create platform names
30+
if "apple" in system_name:
31+
values["platform"] = "osx-" + cpu
32+
elif "linux" in system_name:
33+
values["platform"] = "linux-" + cpu
34+
elif "mingw" in system_name:
35+
if cpu == "x86_64":
36+
values["platform"] = "win64"
37+
else:
38+
values["platform"] = "win32"
3839
else:
39-
values["platform"] = "win32"
40-
else:
41-
values["platform"] = "unknown"
42-
43-
return PackageVariablesInfo(values=values)
40+
values["platform"] = "unknown"
4441

42+
return PackageVariablesInfo(values = values)
4543

4644
package_naming = rule(
47-
implementation=_package_naming_impl,
48-
attrs={
45+
implementation = _package_naming_impl,
46+
attrs = {
4947
# Necessary data dependency for find_cpp_toolchain.
50-
"_cc_toolchain":
51-
attr.label(
52-
default=Label("@bazel_tools//tools/cpp:current_cc_toolchain"),),
48+
"_cc_toolchain": attr.label(
49+
default = Label("@bazel_tools//tools/cpp:current_cc_toolchain"),
50+
),
5351
"platform": attr.string(),
5452
},
55-
toolchains=["@bazel_tools//tools/cpp:toolchain_type"],
56-
incompatible_use_toolchain_transition=True,
53+
toolchains = ["@bazel_tools//tools/cpp:toolchain_type"],
54+
incompatible_use_toolchain_transition = True,
5755
)

0 commit comments

Comments
 (0)