forked from bazelbuild/rules_rust
-
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.
Migrate rules_rust to the new Starlark C++ toolchain API (bazelbuild#133
) This is needed for rules_rust to be forward compatible with Bazel 0.20. Tracking issues for migration: * bazelbuild/bazel#6380 * bazelbuild/bazel#6434 Fixes bazelbuild#131.
- Loading branch information
Showing
4 changed files
with
72 additions
and
20 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
load("@bazel_skylib//lib:versions.bzl", "versions") | ||
|
||
def _store_bazel_version(repository_ctx): | ||
bazel_version = versions.get(); | ||
if versions.is_at_most("0.17.0", bazel_version): | ||
fail("Bazel %s is too old to use with rules_rust, please use at least Bazel 0.17.1, preferably newer." % bazel_version) | ||
repository_ctx.file("BUILD", "exports_files(['def.bzl'])") | ||
repository_ctx.file("def.bzl", "BAZEL_VERSION='" + bazel_version + "'") | ||
|
||
bazel_version = repository_rule( | ||
implementation = _store_bazel_version, | ||
) |