Skip to content

Commit

Permalink
Migrate thrift and scrooge rules cfg from host to exec
Browse files Browse the repository at this point in the history
  • Loading branch information
Vaidas Pilkauskas committed Oct 5, 2020
1 parent 0f93bc7 commit bdc6952
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
8 changes: 3 additions & 5 deletions thrift/thrift.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,11 @@ def _thrift_library_impl(ctx):

if len(found_prefixes) == 0:
fail(
"could not find prefix from available prefixes: {prefixes} in the common prefix: {common_prefix}"
.format(prefixes = ",".join(prefixes), common_prefix = common_prefix),
"could not find prefix from available prefixes: {prefixes} in the common prefix: {common_prefix}".format(prefixes = ",".join(prefixes), common_prefix = common_prefix),
)
elif len(found_prefixes) > 1:
fail(
"Too many not prefixes found, matched: {found_prefixes} in the common prefix: {common_prefix}"
.format(
"Too many not prefixes found, matched: {found_prefixes} in the common prefix: {common_prefix}".format(
found_prefixes = ",".join(found_prefixes),
common_prefix = common_prefix,
),
Expand Down Expand Up @@ -164,7 +162,7 @@ thrift_library = rule(
"external_jars": attr.label_list(allow_files = [".jar"]),
"_zipper": attr.label(
executable = True,
cfg = "host",
cfg = "exec",
default = Label("@bazel_tools//tools/zip:zipper"),
allow_files = True,
),
Expand Down
8 changes: 6 additions & 2 deletions twitter_scrooge/twitter_scrooge.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ def _scrooge_java_aspect_impl(target, ctx):
common_attrs = {
"_pluck_scrooge_scala": attr.label(
executable = True,
cfg = "host",
cfg = "exec",
default = Label("//src/scala/scripts:scrooge_worker"),
allow_files = True,
),
Expand Down Expand Up @@ -491,6 +491,7 @@ scrooge_scala_aspect = aspect(
default = Label(
"@io_bazel_rules_scala//src/java/io/bazel/rulesscala/scalac",
),
cfg = "exec",
),
},
),
Expand All @@ -508,7 +509,10 @@ scrooge_java_aspect = aspect(
common_attrs,
{
"_java_toolchain": attr.label(default = Label("@bazel_tools//tools/jdk:current_java_toolchain")),
"_host_javabase": attr.label(default = Label("@bazel_tools//tools/jdk:current_java_runtime"), cfg = "host"),
"_host_javabase": attr.label(
default = Label("@bazel_tools//tools/jdk:current_java_runtime"),
cfg = "exec",
),
},
),
required_aspect_providers = common_aspect_providers,
Expand Down

0 comments on commit bdc6952

Please sign in to comment.