forked from bazelbuild/rules_sass
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move resolved_toolchain into the main workspace (bazelbuild#48)
- Loading branch information
Showing
4 changed files
with
42 additions
and
29 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
"""This module implements an alias rule to the resolved toolchain. | ||
""" | ||
|
||
DOC = """\ | ||
Exposes a concrete toolchain which is the result of Bazel resolving the | ||
toolchain for the execution or target platform. | ||
Workaround for https://github.com/bazelbuild/bazel/issues/14009 | ||
""" | ||
|
||
# Forward all the providers | ||
def _resolved_toolchain_impl(ctx): | ||
toolchain_info = ctx.toolchains["//mylang:toolchain_type"] | ||
return [ | ||
toolchain_info, | ||
toolchain_info.default, | ||
toolchain_info.mylanginfo, | ||
toolchain_info.template_variables, | ||
] | ||
|
||
# Copied from java_toolchain_alias | ||
# https://cs.opensource.google/bazel/bazel/+/master:tools/jdk/java_toolchain_alias.bzl | ||
resolved_toolchain = rule( | ||
implementation = _resolved_toolchain_impl, | ||
toolchains = ["//mylang:toolchain_type"], | ||
incompatible_use_toolchain_transition = True, | ||
doc = DOC, | ||
) |
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