Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/proto_with_toolchain/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
.DS_Store
/proto/.DS_Store
/proto/grpc_server/.DS_Store
/proto/proto_bindings/.DS_Store
/proto/proto_bindings/.DS_Store
3 changes: 3 additions & 0 deletions examples/ring_example/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/bazel-*
.DS_Store
deterministic_test_store/*
10 changes: 10 additions & 0 deletions examples/ring_example/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
load("@rules_rust//rust:defs.bzl", "rust_binary")

rust_binary(
name = "ring_demo",
srcs = ["src/main.rs"],
deps = [
"@crates//:ring",
],
edition = "2021",
)
147 changes: 147 additions & 0 deletions examples/ring_example/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions examples/ring_example/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[package]
name = "ring_example"
version = "0.1.0"
edition = "2021"

[dependencies]
ring = "0.17.4"
44 changes: 44 additions & 0 deletions examples/ring_example/MODULE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
"""Ring example using crate_universe from_cargo API"""

module(
name = "ring_example",
version = "0.0.0",
)

###############################################################################
# B A Z E L C E N T R A L R E G I S T R Y
###############################################################################

bazel_dep(name = "rules_rust", version = "0.0.0")
local_path_override(
module_name = "rules_rust",
path = "../..",
)

bazel_dep(name = "platforms", version = "0.0.11")

###############################################################################
# T O O L C H A I N S
###############################################################################

rust = use_extension("@rules_rust//rust:extensions.bzl", "rust")
use_repo(rust, "rust_toolchains")

register_toolchains("@rust_toolchains//:all")

###############################################################################
# C R A T E U N I V E R S E
###############################################################################

crate = use_extension(
"@rules_rust//crate_universe:extensions.bzl",
"crate",
)
crate.from_cargo(
name = "crates",
cargo_lockfile = "//:Cargo.lock",
manifests = [
"//:Cargo.toml",
],
)
use_repo(crate, "crates")
Loading