diff --git a/WORKSPACE b/WORKSPACE index 050864d..fd116fe 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -58,7 +58,11 @@ go_dependencies() ### Rust Setup load("@rules_rust//rust:repositories.bzl", "rules_rust_dependencies", "rust_register_toolchains") rules_rust_dependencies() -rust_register_toolchains() +rust_register_toolchains( + versions=["1.78.0"], + # Specifies the Rust edition to use for the registered toolchains + edition = "2021", +) ### Docker Setup load("@rules_oci//oci:dependencies.bzl", "rules_oci_dependencies") @@ -127,8 +131,6 @@ opentelemetry_cpp_deps() load("@io_opentelemetry_cpp//bazel:extra_deps.bzl", "opentelemetry_extra_deps") opentelemetry_extra_deps() - - load("@aspect_bazel_lib//lib:repositories.bzl", "aspect_bazel_lib_dependencies") # aspect_bazel_lib depends on bazel_skylib diff --git a/experimental/hello-rust/.gitignore b/experimental/hello-rust/.gitignore new file mode 100644 index 0000000..ea8c4bf --- /dev/null +++ b/experimental/hello-rust/.gitignore @@ -0,0 +1 @@ +/target diff --git a/experimental/hello-rust/BUILD b/experimental/hello-rust/BUILD new file mode 100644 index 0000000..a668ac5 --- /dev/null +++ b/experimental/hello-rust/BUILD @@ -0,0 +1,9 @@ +package(default_visibility = ["//visibility:public"]) + +load("@rules_rust//rust:defs.bzl", "rust_binary") + +rust_binary( + name = "hello_world", + srcs = ["src/main.rs"], + deps = [], +) diff --git a/experimental/hello-rust/README.md b/experimental/hello-rust/README.md new file mode 100644 index 0000000..6b6569e --- /dev/null +++ b/experimental/hello-rust/README.md @@ -0,0 +1,10 @@ +## Rust Example + +### Init a project +``` +cargo new hello_world +``` + +### References +- [bazel rust](https://bazelbuild.github.io/rules_rust/) +- [rust lang](https://doc.rust-lang.org/cargo/getting-started/first-steps.html) diff --git a/experimental/hello-rust/src/main.rs b/experimental/hello-rust/src/main.rs new file mode 100644 index 0000000..e7a11a9 --- /dev/null +++ b/experimental/hello-rust/src/main.rs @@ -0,0 +1,3 @@ +fn main() { + println!("Hello, world!"); +}