build: add Bazel Rust workflow

This commit was merged in pull request #2.
This commit is contained in:
2026-08-31 17:50:12 -04:00
parent ba4fbb984a
commit 97cca46f4e
19 changed files with 2088 additions and 1 deletions

13
src/machoke/BUILD Normal file
View File

@@ -0,0 +1,13 @@
load("@rules_rust//rust:defs.bzl", "rust_binary", "rust_library")
rust_library(
name = "machoke_lib",
crate_name = "machoke",
srcs = ["lib.rs"],
)
rust_binary(
name = "machoke",
srcs = ["main.rs"],
deps = [":machoke_lib"],
)

7
src/machoke/Cargo.lock generated Normal file
View File

@@ -0,0 +1,7 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 4
[[package]]
name = "machoke"
version = "0.1.0"

13
src/machoke/Cargo.toml Normal file
View File

@@ -0,0 +1,13 @@
[package]
name = "machoke"
version = "0.1.0"
edition = "2024"
[lib]
path = "lib.rs"
[[bin]]
name = "machoke"
path = "main.rs"
[dependencies]

3
src/machoke/lib.rs Normal file
View File

@@ -0,0 +1,3 @@
pub fn greeting() -> &'static str {
"Hello from machoke"
}

3
src/machoke/main.rs Normal file
View File

@@ -0,0 +1,3 @@
fn main() {
println!("{}", machoke::greeting());
}