Skip to content

Commit

Permalink
add rest of files
Browse files Browse the repository at this point in the history
  • Loading branch information
DolceTriade committed Jan 3, 2024
1 parent 58b4f78 commit d914687
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 8 deletions.
6 changes: 4 additions & 2 deletions WORKSPACE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -154,10 +154,12 @@ load("@rules_rust//tools/rust_analyzer:deps.bzl", "rust_analyzer_dependencies")

rust_analyzer_dependencies()


register_toolchains("//nix/rust:rust_analyzer_toolchain")

register_toolchains("//nix/rust:rustfmt_toolchain")

register_toolchains("//nix/rust:wasm_bindgen_toolchain")

register_toolchains("@rules_rust//rust/private/dummy_cc_toolchain:dummy_cc_wasm32_toolchain")

http_archive(
Expand Down Expand Up @@ -231,4 +233,4 @@ oci_pull(
"linux/amd64",
"linux/arm64",
],
)
)
27 changes: 24 additions & 3 deletions blade/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
load("@rules_rust//rust:defs.bzl", "rust_binary", "rust_shared_library")
load("@rules_rust//wasm_bindgen/rules_js:defs.bzl", "js_rust_wasm_bindgen")
load("@rules_oci//oci:defs.bzl", "oci_image", "oci_tarball")
load("@rules_oci//oci:defs.bzl", "oci_image", "oci_push", "oci_tarball")
load("@rules_pkg//:pkg.bzl", "pkg_tar")
load("//nix/bazel:runfiles.bzl", "runfiles")

Expand Down Expand Up @@ -123,12 +123,12 @@ oci_image(
name = "blade_image",
base = "@distroless_base",
entrypoint = ["/app/blade/blade"],
workdir = "/app/blade/blade.runfiles/blade",
tags = ["noosx"],
tars = [
":blade_tar",
"@oci_base//:closure.tar",
],
tags = ["noosx"],
workdir = "/app/blade/blade.runfiles/blade",
)

oci_tarball(
Expand All @@ -137,3 +137,24 @@ oci_tarball(
repo_tags = ["ghcr.io/dolcetriade/blade:latest"],
tags = ["noosx"],
)

genrule(
name = "tags",
outs = ["tags.txt"],
cmd = """
s=$$(cat bazel-out/stable-status.txt | grep BUILD_EMBED_LABEL | awk '{print $$2}')
if [[ -n $$s ]]; then
echo $$s > $@
else
echo 0.0.0 > $@
fi
""",
stamp = 1,
)

oci_push(
name = "blade_push",
image = ":blade_image",
remote_tags = ":tags",
repository = "ghcr.io/dolcetriade/blade",
)
2 changes: 1 addition & 1 deletion blade/bytestream/proto/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ rust_prost_library(
name = "bytestream_proto",
proto = "@googleapis//google/bytestream:bytestream_proto",
visibility = ["//visibility:public"],
)
)
2 changes: 1 addition & 1 deletion blade/state/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ rust_library(
"@wasm_crate//:serde",
],
"//conditions:default": [
"//blade/bytestream",
"@crate//:anyhow",
"@crate//:cfg-if",
"@crate//:futures",
"@crate//:serde",
"@crate//:tokio",
"//blade/bytestream",
],
}),
)
2 changes: 1 addition & 1 deletion nix/bazel/runfiles.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -117,4 +117,4 @@ runfiles = rule(
doc = "If set, exclude files that contain this substr.",
),
},
)
)

0 comments on commit d914687

Please sign in to comment.