Skip to content

Commit 1344328

Browse files
committed
Fix clippy_repository
1 parent c10adb3 commit 1344328

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

rs/experimental/toolchains/module_extension.bzl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,7 @@ def _toolchains_impl(mctx):
205205
version = base_version,
206206
iso_date = iso_date,
207207
sha256 = _sha_for("clippy", base_version, iso_date, exec_triple),
208+
rustc_repo_build_file = "@rustc_{}_{}//:BUILD.bazel".format(triple_suffix, version_key),
208209
)
209210

210211
if version in versions:

rs/private/clippy_repository.bzl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,14 @@ def _clippy_repository_impl(rctx):
77
download_and_extract(rctx, "clippy", "clippy-preview", exec_triple)
88
rctx.file("BUILD.bazel", BUILD_for_clippy(exec_triple))
99

10+
rustc_repo_root = rctx.path(rctx.attr.rustc_repo_build_file).dirname
11+
rctx.symlink(rustc_repo_root.get_child("lib"), "lib")
12+
1013
return rctx.repo_metadata(reproducible = True)
1114

1215
clippy_repository = repository_rule(
1316
implementation = _clippy_repository_impl,
14-
attrs = RUST_REPOSITORY_COMMON_ATTR,
17+
attrs = {
18+
"rustc_repo_build_file": attr.label(allow_single_file = True, mandatory = True),
19+
} | RUST_REPOSITORY_COMMON_ATTR,
1520
)

0 commit comments

Comments
 (0)