buildbarn / bb-storage

Storage daemon, capable of storing data for the Remote Execution protocol
Apache License 2.0
137 stars 91 forks source link

Creating buildbarn storage image doesn't work on bazel 7 #185

Open ericlchen1 opened 8 months ago

ericlchen1 commented 8 months ago

Running the suggested command to create a buildbarn storage image doesn't work bazel run --platforms=@io_bazel_rules_go//go/toolchain:linux_amd64 //cmd/bb_storage:bb_storage_container

Bazelisk automatically downloads Bazel 7 which was recently released and doesn't seem to be compatible with bb-storage. I suggest adding a .bazelversion file with 6.4.0 until compatibility with Bazel 7 is done.

stagnation commented 8 months ago

Hi, I took a quick look.

The main errors comes form rules_docker and platform transitions/providers. rules_docker is deprecated and the status of bazel7 and bzlmodule support is unclear. But there is a workaround flag: --@io_bazel_rules_docker//transitions:enable=false that removes most of the build errors. https://github.com/bazelbuild/rules_docker/issues/2275

This will build, but I did not verify that the images work properly.

Then it seems that we need to update protobuf and rules_js. Those updates are simple enough and we can commit that soon:

diff --git a/WORKSPACE b/WORKSPACE
index 8e13aa6..9ee9cb0 100644
--- a/WORKSPACE
+++ b/WORKSPACE
@@ -97,9 +97,8 @@ switched_rules_by_language(

 http_archive(
     name = "com_google_protobuf",
-    sha256 = "a700a49470d301f1190a487a923b5095bf60f08f4ae4cac9f5f7c36883d17971",
-    strip_prefix = "protobuf-23.4",
-    urls = ["https://github.com/protocolbuffers/protobuf/releases/download/v23.4/protobuf-23.4.tar.gz"],
+    strip_prefix = "protobuf-25.2",
+    urls = ["https://github.com/protocolbuffers/protobuf/releases/download/v25.2/protobuf-25.2.tar.gz"],
 )

 load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps")
@@ -163,9 +162,9 @@ http_archive(

 http_archive(
     name = "aspect_rules_js",
-    sha256 = "00e7b97b696af63812df0ca9e9dbd18579f3edd3ab9a56f227238b8405e4051c",
-    strip_prefix = "rules_js-1.23.0",
-    url = "https://github.com/aspect-build/rules_js/releases/download/v1.23.0/rules_js-v1.23.0.tar.gz",
+    sha256 = "76a04ef2120ee00231d85d1ff012ede23963733339ad8db81f590791a031f643",
+    strip_prefix = "rules_js-1.34.1",
+    url = "https://github.com/aspect-build/rules_js/releases/download/v1.34.1/rules_js-v1.34.1.tar.gz",
 )
stagnation commented 6 months ago

@minor-fixes added the .bazelignore file: https://github.com/buildbarn/bb-storage/pull/195 I haven't had any time to verify the docker images in the draft PR #186.