Update rulegen to apply Bazel 7 attr fix

This commit is contained in:
Adam Liddell 2023-12-14 15:07:22 +00:00
parent e7349ceb6c
commit 60b8b27460
8 changed files with 125 additions and 96 deletions

View File

@ -37,20 +37,21 @@ def c_proto_library(name, **kwargs): # buildifier: disable=function-docstring
deps = PROTO_DEPS + kwargs.get("deps", []),
hdrs = [name_pb + "_hdrs"],
includes = [name_pb],
alwayslink = kwargs.get("alwayslink"),
copts = kwargs.get("copts"),
defines = kwargs.get("defines"),
include_prefix = kwargs.get("include_prefix"),
linkopts = kwargs.get("linkopts"),
linkstatic = kwargs.get("linkstatic"),
local_defines = kwargs.get("local_defines"),
nocopts = kwargs.get("nocopts"),
strip_include_prefix = kwargs.get("strip_include_prefix"),
**{
k: v
for (k, v) in kwargs.items()
if k in bazel_build_rule_common_attrs
} # Forward Bazel common args
if k in bazel_build_rule_common_attrs + [
"alwayslink",
"copts",
"defines",
"include_prefix",
"linkopts",
"linkstatic",
"local_defines",
"nocopts",
"strip_include_prefix",
]
},
)
PROTO_DEPS = [

View File

@ -37,20 +37,21 @@ def cpp_grpc_library(name, **kwargs): # buildifier: disable=function-docstring
deps = GRPC_DEPS + kwargs.get("deps", []),
hdrs = [name_pb + "_hdrs"],
includes = [name_pb] if kwargs.get("output_mode", "PREFIXED") == "PREFIXED" else ["."],
alwayslink = kwargs.get("alwayslink"),
copts = kwargs.get("copts"),
defines = kwargs.get("defines"),
include_prefix = kwargs.get("include_prefix"),
linkopts = kwargs.get("linkopts"),
linkstatic = kwargs.get("linkstatic"),
local_defines = kwargs.get("local_defines"),
nocopts = kwargs.get("nocopts"),
strip_include_prefix = kwargs.get("strip_include_prefix"),
**{
**{
k: v
for (k, v) in kwargs.items()
if k in bazel_build_rule_common_attrs
} # Forward Bazel common args
if k in bazel_build_rule_common_attrs + [
"alwayslink",
"copts",
"defines",
"include_prefix",
"linkopts",
"linkstatic",
"local_defines",
"nocopts",
"strip_include_prefix",
]
},
)
GRPC_DEPS = [

View File

@ -51,7 +51,7 @@ def cpp_proto_library(name, **kwargs): # buildifier: disable=function-docstring
"nocopts",
"strip_include_prefix",
]
} # Forward Bazel common args
},
)
PROTO_DEPS = [

View File

@ -36,20 +36,21 @@ def objc_grpc_library(name, **kwargs): # buildifier: disable=function-docstring
srcs = [name_pb],
deps = GRPC_DEPS + kwargs.get("deps", []),
includes = [name_pb],
alwayslink = kwargs.get("alwayslink"),
copts = kwargs.get("copts"),
defines = kwargs.get("defines"),
include_prefix = kwargs.get("include_prefix"),
linkopts = kwargs.get("linkopts"),
linkstatic = kwargs.get("linkstatic"),
local_defines = kwargs.get("local_defines"),
nocopts = kwargs.get("nocopts"),
strip_include_prefix = kwargs.get("strip_include_prefix"),
**{
k: v
for (k, v) in kwargs.items()
if k in bazel_build_rule_common_attrs
} # Forward Bazel common args
if k in bazel_build_rule_common_attrs + [
"alwayslink",
"copts",
"defines",
"include_prefix",
"linkopts",
"linkstatic",
"local_defines",
"nocopts",
"strip_include_prefix",
]
},
)
GRPC_DEPS = [

View File

@ -37,20 +37,21 @@ def objc_proto_library(name, **kwargs): # buildifier: disable=function-docstrin
deps = PROTO_DEPS + kwargs.get("deps", []),
hdrs = [name_pb + "_hdrs"],
includes = [name_pb],
alwayslink = kwargs.get("alwayslink"),
copts = kwargs.get("copts"),
defines = kwargs.get("defines"),
include_prefix = kwargs.get("include_prefix"),
linkopts = kwargs.get("linkopts"),
linkstatic = kwargs.get("linkstatic"),
local_defines = kwargs.get("local_defines"),
nocopts = kwargs.get("nocopts"),
strip_include_prefix = kwargs.get("strip_include_prefix"),
**{
k: v
for (k, v) in kwargs.items()
if k in bazel_build_rule_common_attrs
} # Forward Bazel common args
if k in bazel_build_rule_common_attrs + [
"alwayslink",
"copts",
"defines",
"include_prefix",
"linkopts",
"linkstatic",
"local_defines",
"nocopts",
"strip_include_prefix",
]
},
)
PROTO_DEPS = [

View File

@ -32,16 +32,21 @@ def {{ .Rule.Name }}(name, **kwargs): # buildifier: disable=function-docstring
deps = PROTO_DEPS + kwargs.get("deps", []),
hdrs = [name_pb + "_hdrs"],
includes = [name_pb],
alwayslink = kwargs.get("alwayslink"),
copts = kwargs.get("copts"),
defines = kwargs.get("defines"),
include_prefix = kwargs.get("include_prefix"),
linkopts = kwargs.get("linkopts"),
linkstatic = kwargs.get("linkstatic"),
local_defines = kwargs.get("local_defines"),
nocopts = kwargs.get("nocopts"),
strip_include_prefix = kwargs.get("strip_include_prefix"),
{{ .Common.LibraryArgsForwardingSnippet }}
**{
k: v
for (k, v) in kwargs.items()
if k in bazel_build_rule_common_attrs + [
"alwayslink",
"copts",
"defines",
"include_prefix",
"linkopts",
"linkstatic",
"local_defines",
"nocopts",
"strip_include_prefix",
]
},
)
PROTO_DEPS = [

View File

@ -34,16 +34,21 @@ var cppProtoLibraryRuleTemplate = mustTemplate(cppLibraryRuleTemplateString + `
deps = PROTO_DEPS + kwargs.get("deps", []),
hdrs = [name_pb + "_hdrs"],
includes = [name_pb] if kwargs.get("output_mode", "PREFIXED") == "PREFIXED" else ["."],
alwayslink = kwargs.get("alwayslink"),
copts = kwargs.get("copts"),
defines = kwargs.get("defines"),
include_prefix = kwargs.get("include_prefix"),
linkopts = kwargs.get("linkopts"),
linkstatic = kwargs.get("linkstatic"),
local_defines = kwargs.get("local_defines"),
nocopts = kwargs.get("nocopts"),
strip_include_prefix = kwargs.get("strip_include_prefix"),
{{ .Common.LibraryArgsForwardingSnippet }}
**{
k: v
for (k, v) in kwargs.items()
if k in bazel_build_rule_common_attrs + [
"alwayslink",
"copts",
"defines",
"include_prefix",
"linkopts",
"linkstatic",
"local_defines",
"nocopts",
"strip_include_prefix",
]
},
)
PROTO_DEPS = [
@ -58,16 +63,21 @@ var cppGrpcLibraryRuleTemplate = mustTemplate(cppLibraryRuleTemplateString + `
deps = GRPC_DEPS + kwargs.get("deps", []),
hdrs = [name_pb + "_hdrs"],
includes = [name_pb] if kwargs.get("output_mode", "PREFIXED") == "PREFIXED" else ["."],
alwayslink = kwargs.get("alwayslink"),
copts = kwargs.get("copts"),
defines = kwargs.get("defines"),
include_prefix = kwargs.get("include_prefix"),
linkopts = kwargs.get("linkopts"),
linkstatic = kwargs.get("linkstatic"),
local_defines = kwargs.get("local_defines"),
nocopts = kwargs.get("nocopts"),
strip_include_prefix = kwargs.get("strip_include_prefix"),
{{ .Common.LibraryArgsForwardingSnippet }}
**{
k: v
for (k, v) in kwargs.items()
if k in bazel_build_rule_common_attrs + [
"alwayslink",
"copts",
"defines",
"include_prefix",
"linkopts",
"linkstatic",
"local_defines",
"nocopts",
"strip_include_prefix",
]
},
)
GRPC_DEPS = [

View File

@ -34,16 +34,21 @@ var objcProtoLibraryRuleTemplate = mustTemplate(objcLibraryRuleTemplateString +
deps = PROTO_DEPS + kwargs.get("deps", []),
hdrs = [name_pb + "_hdrs"],
includes = [name_pb],
alwayslink = kwargs.get("alwayslink"),
copts = kwargs.get("copts"),
defines = kwargs.get("defines"),
include_prefix = kwargs.get("include_prefix"),
linkopts = kwargs.get("linkopts"),
linkstatic = kwargs.get("linkstatic"),
local_defines = kwargs.get("local_defines"),
nocopts = kwargs.get("nocopts"),
strip_include_prefix = kwargs.get("strip_include_prefix"),
{{ .Common.LibraryArgsForwardingSnippet }}
**{
k: v
for (k, v) in kwargs.items()
if k in bazel_build_rule_common_attrs + [
"alwayslink",
"copts",
"defines",
"include_prefix",
"linkopts",
"linkstatic",
"local_defines",
"nocopts",
"strip_include_prefix",
]
},
)
PROTO_DEPS = [
@ -57,16 +62,21 @@ var objcGrpcLibraryRuleTemplate = mustTemplate(objcLibraryRuleTemplateString + `
srcs = [name_pb],
deps = GRPC_DEPS + kwargs.get("deps", []),
includes = [name_pb],
alwayslink = kwargs.get("alwayslink"),
copts = kwargs.get("copts"),
defines = kwargs.get("defines"),
include_prefix = kwargs.get("include_prefix"),
linkopts = kwargs.get("linkopts"),
linkstatic = kwargs.get("linkstatic"),
local_defines = kwargs.get("local_defines"),
nocopts = kwargs.get("nocopts"),
strip_include_prefix = kwargs.get("strip_include_prefix"),
{{ .Common.LibraryArgsForwardingSnippet }}
**{
k: v
for (k, v) in kwargs.items()
if k in bazel_build_rule_common_attrs + [
"alwayslink",
"copts",
"defines",
"include_prefix",
"linkopts",
"linkstatic",
"local_defines",
"nocopts",
"strip_include_prefix",
]
},
)
GRPC_DEPS = [