diff --git a/go/private/sdk.bzl b/go/private/sdk.bzl index 156bb255..619c5395 100644 --- a/go/private/sdk.bzl +++ b/go/private/sdk.bzl @@ -129,6 +129,8 @@ def _go_download_sdk_impl(ctx): "sdks": ctx.attr.sdks, "urls": ctx.attr.urls, "version": version, + "patch": ctx.attr.patch, + "patch_strip": ctx.attr.patch_strip, "strip_prefix": ctx.attr.strip_prefix, } return None @@ -144,6 +146,7 @@ go_download_sdk_rule = repository_rule( ), "urls": attr.string_list(default = ["https://dl.google.com/go/{}"]), "version": attr.string(), + "patch": attr.label(default = None), "strip_prefix": attr.string(default = "go"), "patches": attr.label_list( doc = "A list of patches to apply to the SDK after downloading it", @@ -432,6 +435,8 @@ def _remote_sdk(ctx, urls, strip_prefix, sha256): sha256 = sha256, auth = auth, ) + if ctx.attr.patch: + ctx.patch(ctx.attr.patch, strip = ctx.attr.patch_strip) def _local_sdk(ctx, path): for entry in ctx.path(path).readdir():