-
Notifications
You must be signed in to change notification settings - Fork 15.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Creates a protoc release zip (#9188)
* Creates a protoc release zip Mimics what we're doing manually today but powered by Bazel. * don't special case this. * Addressing feedback. * adding comment about _cc_toolchain
- Loading branch information
Showing
6 changed files
with
108 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
""" | ||
Generates package naming variables for use with rules_pkg. | ||
""" | ||
|
||
load("@rules_pkg//:providers.bzl", "PackageVariablesInfo") | ||
load("@bazel_tools//tools/cpp:toolchain_utils.bzl", "find_cpp_toolchain") | ||
load(":protobuf_version.bzl", "PROTOBUF_VERSION") | ||
|
||
def _package_naming_impl(ctx): | ||
values = {} | ||
values["version"] = PROTOBUF_VERSION | ||
|
||
# infer from the current cpp toolchain. | ||
toolchain = find_cpp_toolchain(ctx) | ||
values["cpu"] = toolchain.cpu | ||
|
||
return PackageVariablesInfo(values = values) | ||
|
||
|
||
package_naming = rule( | ||
implementation = _package_naming_impl, | ||
attrs = { | ||
# Necessary data dependency for find_cpp_toolchain. | ||
"_cc_toolchain": attr.label(default = Label("@bazel_tools//tools/cpp:current_cc_toolchain")), | ||
}, | ||
toolchains = ["@bazel_tools//tools/cpp:toolchain_type"], | ||
incompatible_use_toolchain_transition = True, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,6 @@ load( | |
"feature", | ||
"flag_group", | ||
"flag_set", | ||
"tool", | ||
"tool_path", | ||
) | ||
|
||
|