summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRin Kuryloski <kuryloskip@vmware.com>2022-06-15 11:51:58 +0200
committerGitHub <noreply@github.com>2022-06-15 11:51:58 +0200
commit843911919d53f8b6996b606643c1e33d5b878bf0 (patch)
tree928dc5ac9729da3a403f267c6f8f8eac56e3607e
parent295f6e2afbc56313c81d29a33cccd144237fa13d (diff)
parent2fd155e55d90be321269347d966d88cfdfc45359 (diff)
downloadrabbitmq-server-git-843911919d53f8b6996b606643c1e33d5b878bf0.tar.gz
Merge pull request #5051 from rabbitmq/nobzlmod-build-fixes
Fixup the bazel build when used without bzlmod
-rw-r--r--BUILD.bats5
-rw-r--r--BUILD.inet_tcp_proxy4
-rw-r--r--BUILD.jose10
-rw-r--r--BUILD.ranch20
-rw-r--r--BUILD.trust_store_http2
-rw-r--r--MODULE.bazel7
-rw-r--r--bazel/elixir/elixir.bzl6
-rw-r--r--workspace_helpers.bzl11
8 files changed, 47 insertions, 18 deletions
diff --git a/BUILD.bats b/BUILD.bats
index ed50b3c253..1fe48bc154 100644
--- a/BUILD.bats
+++ b/BUILD.bats
@@ -1,5 +1,8 @@
filegroup(
name = "bin_dir",
- srcs = glob(["bin/**/*", "libexec/**/*"]),
+ srcs = glob([
+ "bin/**/*",
+ "libexec/**/*",
+ ]),
visibility = ["//visibility:public"],
)
diff --git a/BUILD.inet_tcp_proxy b/BUILD.inet_tcp_proxy
index f7470869c8..eab7e2e2d5 100644
--- a/BUILD.inet_tcp_proxy
+++ b/BUILD.inet_tcp_proxy
@@ -1,8 +1,8 @@
load("@rules_erlang//:erlang_app.bzl", "erlang_app")
erlang_app(
- app_name = "inet_tcp_proxy_dist",
- app_version = "0.1.0",
app_description = "Erlang distribution proxy to simulate network failures",
app_module = "inet_tcp_proxy_dist_app",
+ app_name = "inet_tcp_proxy_dist",
+ app_version = "0.1.0",
)
diff --git a/BUILD.jose b/BUILD.jose
new file mode 100644
index 0000000000..9321fd00bc
--- /dev/null
+++ b/BUILD.jose
@@ -0,0 +1,10 @@
+load("@rules_erlang//:erlang_app.bzl", "erlang_app")
+
+erlang_app(
+ app_name = "jose",
+ erlc_opts = [
+ "+deterministic",
+ "+debug_info",
+ ],
+ stamp = 0,
+)
diff --git a/BUILD.ranch b/BUILD.ranch
index 5baffd6385..55f02b0a7d 100644
--- a/BUILD.ranch
+++ b/BUILD.ranch
@@ -1,14 +1,17 @@
load("@rules_erlang//:app_file.bzl", "app_file")
load("@rules_erlang//:erlang_app_info.bzl", "erlang_app_info")
load("@rules_erlang//:erlang_app.bzl", "DEFAULT_ERLC_OPTS")
-load("@rules_erlang//:erlc.bzl", "erlc")
+load("@rules_erlang//:erlang_bytecode.bzl", "erlang_bytecode")
-erlc(
+erlang_bytecode(
name = "beam_files",
- hdrs = glob(["include/**/*.hrl", "src/**/*.hrl"]),
srcs = glob(["src/**/*.erl"]),
- erlc_opts = DEFAULT_ERLC_OPTS,
+ hdrs = glob([
+ "include/**/*.hrl",
+ "src/**/*.hrl",
+ ]),
dest = "ebin",
+ erlc_opts = DEFAULT_ERLC_OPTS,
)
genrule(
@@ -27,9 +30,12 @@ app_file(
erlang_app_info(
name = "erlang_app",
- app_name = "ranch",
- app = ":app_file",
hdrs = glob(["include/**/*.hrl"]),
- beam = [":beam_files", ":appup"],
+ app = ":app_file",
+ app_name = "ranch",
+ beam = [
+ ":beam_files",
+ ":appup",
+ ],
visibility = ["//visibility:public"],
)
diff --git a/BUILD.trust_store_http b/BUILD.trust_store_http
index efe4f97add..7e0f7869bd 100644
--- a/BUILD.trust_store_http
+++ b/BUILD.trust_store_http
@@ -1,9 +1,9 @@
load("@rules_erlang//:erlang_app.bzl", "erlang_app")
erlang_app(
- app_name = "trust_store_http",
app_description = "Trust store HTTP server",
app_module = "trust_store_http_app",
+ app_name = "trust_store_http",
app_version = "1.0.0",
extra_apps = [
"ssl",
diff --git a/MODULE.bazel b/MODULE.bazel
index fd53a01423..eac03c90d1 100644
--- a/MODULE.bazel
+++ b/MODULE.bazel
@@ -137,14 +137,13 @@ erlang_package.hex_package(
erlang_package.git_package(
repository = "rabbitmq/osiris",
branch = "main",
- patch_cmds = ["""
-VERSION=$(git rev-parse HEAD)
+ patch_cmds = ["""VERSION=$(git rev-parse HEAD)
echo "Injecting ${VERSION} into Makefile..."
sed -i"_orig" -E '/PROJECT_VERSION/ s/[0-9]+\\.[0-9]+\\.[0-9]+/'${VERSION}'/' Makefile
echo "Injecting ${VERSION} into BUILD.bazel..."
sed -i"_orig" -E '/VERSION/ s/[0-9]+\\.[0-9]+\\.[0-9]+/'${VERSION}'/' BUILD.bazel
-
-sed -i"_orig2" -E 's/ct_sharded\\.bzl/ct.bzl/' BUILD.bazel
+""",
+"""sed -i"_orig2" -E 's/ct_sharded\\.bzl/ct.bzl/' BUILD.bazel
"""],
)
diff --git a/bazel/elixir/elixir.bzl b/bazel/elixir/elixir.bzl
index b533c83e64..8d6fbb25d1 100644
--- a/bazel/elixir/elixir.bzl
+++ b/bazel/elixir/elixir.bzl
@@ -32,7 +32,7 @@ def elixir_toolchain_external():
elixir_constraint,
],
toolchain = ":elixir_external",
- toolchain_type = Label("@rabbitmq-server//bazel/elixir:toolchain_type"),
+ toolchain_type = Label("//bazel/elixir:toolchain_type"),
visibility = ["//visibility:public"],
)
@@ -69,7 +69,7 @@ def elixir_toolchain_from_http_archive(
elixir_constraint,
],
toolchain = ":elixir{}".format(name_suffix),
- toolchain_type = Label("@rabbitmq-server//bazel/elixir:toolchain_type"),
+ toolchain_type = Label("//bazel/elixir:toolchain_type"),
visibility = ["//visibility:public"],
)
@@ -78,7 +78,7 @@ def elixir_toolchain_from_github_release(
version = None,
sha256 = None):
[major, minor, patch] = version.split(".")
- elixir_constraint = Label("@rabbitmq-server//bazel/platforms:elixir_{}_{}".format(major, minor))
+ elixir_constraint = Label("//bazel/platforms:elixir_{}_{}".format(major, minor))
url = "https://github.com/elixir-lang/elixir/archive/refs/tags/v{}.tar.gz".format(version)
elixir_toolchain_from_http_archive(
name_suffix = name_suffix,
diff --git a/workspace_helpers.bzl b/workspace_helpers.bzl
index 13f4be02f9..10a3efd4b9 100644
--- a/workspace_helpers.bzl
+++ b/workspace_helpers.bzl
@@ -131,6 +131,7 @@ erlang_app(
ref = "2b1d66b5f4fbe33cb198149a8cb23895a2c877ea",
version = "2b1d66b5f4fbe33cb198149a8cb23895a2c877ea",
sha256 = "7816f39d00655f2605cfac180755e97e268dba86c2f71037998ff63792ca727b",
+ build_file = rabbitmq_workspace + "//:BUILD.jose",
)
hex_pm_erlang_app(
@@ -154,6 +155,16 @@ erlang_app(
name = "osiris",
branch = "main",
remote = "https://github.com/rabbitmq/osiris.git",
+ patch_cmds = [
+ """VERSION=$(git rev-parse HEAD)
+echo "Injecting ${VERSION} into Makefile..."
+sed -i"_orig" -E '/PROJECT_VERSION/ s/[0-9]+\\.[0-9]+\\.[0-9]+/'${VERSION}'/' Makefile
+echo "Injecting ${VERSION} into BUILD.bazel..."
+sed -i"_orig" -E '/VERSION/ s/[0-9]+\\.[0-9]+\\.[0-9]+/'${VERSION}'/' BUILD.bazel
+""",
+ """sed -i"_orig2" -E 's/ct_sharded\\.bzl/ct.bzl/' BUILD.bazel
+""",
+ ],
)
hex_pm_erlang_app(