-
Notifications
You must be signed in to change notification settings - Fork 424
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Exercise crates_vendor in bzlmod hello_world example
- Loading branch information
Showing
9 changed files
with
192 additions
and
44 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/bazel-* |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,10 @@ | ||
load("@rules_rust//crate_universe:defs.bzl", "crates_vendor") | ||
|
||
crates_vendor( | ||
name = "vendor", | ||
cargo_lockfile = "//third-party:Cargo.lock", | ||
generate_build_scripts = True, | ||
manifests = ["//third-party:Cargo.toml"], | ||
mode = "remote", | ||
tags = ["manual"], | ||
) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 @@ | ||
[workspace] | ||
[package] | ||
name = "third-party" | ||
version = "0.0.0" | ||
edition = "2021" | ||
publish = false | ||
|
||
[lib] | ||
path = "/dev/null" | ||
|
||
[dependencies] | ||
anyhow = "1.0.77" |
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,14 @@ | ||
"""Module extensions for using vendored crates with bzlmod""" | ||
|
||
load("//third-party/crates:defs.bzl", _crate_repositories = "crate_repositories") | ||
|
||
def _crate_repositories_impl(module_ctx): | ||
direct_deps = _crate_repositories() | ||
return module_ctx.extension_metadata( | ||
root_module_direct_deps = [repo.repo for repo in direct_deps], | ||
root_module_direct_dev_deps = [], | ||
) | ||
|
||
crate_repositories = module_extension( | ||
implementation = _crate_repositories_impl, | ||
) |