Skip to content

Commit

Permalink
0.3.1: switch rust edition, use bzlmod for build
Browse files Browse the repository at this point in the history
  • Loading branch information
amkartashov committed Aug 16, 2024
1 parent 556560a commit 10bedf6
Show file tree
Hide file tree
Showing 9 changed files with 14,243 additions and 57 deletions.
2 changes: 2 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Enable Bzlmod for every Bazel command
common --enable_bzlmod
1 change: 0 additions & 1 deletion .bazelversion

This file was deleted.

13 changes: 4 additions & 9 deletions BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
load("@rules_rust//rust:rust.bzl", "rust_binary", "rust_library")
load("@crates//:defs.bzl", "all_crate_deps")
load("@rules_rust//rust:defs.bzl", "rust_binary", "rust_library")

rust_library(
name = "restarter_lib",
srcs = ["src/lib.rs"],
crate_name = "restarter",
deps = [
"//cargo:env_logger",
"//cargo:libc",
"//cargo:log",
"//cargo:serde_json",
"//cargo:signal_hook",
],
deps = all_crate_deps(normal = True)
)

rust_binary(
Expand All @@ -24,6 +19,6 @@ rust_binary(
],
deps = [
":restarter_lib",
"//cargo:log",
"@crates//:log",
],
)
2 changes: 1 addition & 1 deletion Cargo.lock

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

25 changes: 1 addition & 24 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "restarter"
version = "0.3.0"
version = "0.3.1"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand All @@ -18,26 +18,3 @@ serde_json = "1.0.64"
#codegen-units = 1 # Reduce number of codegen units to increase optimizations.
#panic = 'abort' # Abort on panic
#strip = 'symbols'

[package.metadata.raze]
# The path at which to write output files.
#
# `cargo raze` will generate Bazel-compatible BUILD files into this path.
# This can either be a relative path (e.g. "foo/bar"), relative to this
# Cargo.toml file; or relative to the Bazel workspace root (e.g. "//foo/bar").
workspace_path = "//cargo"

# This causes aliases for dependencies to be rendered in the BUILD
# file located next to this `Cargo.toml` file.
package_aliases_dir = "cargo"

# The set of targets to generate BUILD rules for.
targets = [
"x86_64-apple-darwin",
"x86_64-unknown-linux-gnu",
]

# The two acceptable options are "Remote" and "Vendored" which
# is used to indicate whether the user is using a non-vendored or
# vendored set of dependencies.
genmode = "Remote"
19 changes: 19 additions & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
module(name = "restarter", version = "1.0")
bazel_dep(name = "rules_rust", version = "0.48.0")

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

register_toolchains("@rust_toolchains//:all")

crate = use_extension(
"@rules_rust//crate_universe:extension.bzl",
"crate",
)
crate.from_cargo(
name = "crates",
cargo_lockfile = "//:Cargo.lock",
manifests = ["//:Cargo.toml"],
)
use_repo(crate, "crates")
14,214 changes: 14,214 additions & 0 deletions MODULE.bazel.lock

Large diffs are not rendered by default.

22 changes: 0 additions & 22 deletions WORKSPACE

This file was deleted.

2 changes: 2 additions & 0 deletions WORKSPACE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# This file marks the root of the Bazel workspace.
# See MODULE.bazel for external dependencies setup.

0 comments on commit 10bedf6

Please sign in to comment.