Fixup the bazel build when used without bzlmod
As currently we do not use bzlmod when building on Windows
This commit is contained in:
parent
295f6e2afb
commit
2fd155e55d
|
@ -1,5 +1,8 @@
|
||||||
filegroup(
|
filegroup(
|
||||||
name = "bin_dir",
|
name = "bin_dir",
|
||||||
srcs = glob(["bin/**/*", "libexec/**/*"]),
|
srcs = glob([
|
||||||
|
"bin/**/*",
|
||||||
|
"libexec/**/*",
|
||||||
|
]),
|
||||||
visibility = ["//visibility:public"],
|
visibility = ["//visibility:public"],
|
||||||
)
|
)
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
load("@rules_erlang//:erlang_app.bzl", "erlang_app")
|
load("@rules_erlang//:erlang_app.bzl", "erlang_app")
|
||||||
|
|
||||||
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_description = "Erlang distribution proxy to simulate network failures",
|
||||||
app_module = "inet_tcp_proxy_dist_app",
|
app_module = "inet_tcp_proxy_dist_app",
|
||||||
|
app_name = "inet_tcp_proxy_dist",
|
||||||
|
app_version = "0.1.0",
|
||||||
)
|
)
|
||||||
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
load("@rules_erlang//:erlang_app.bzl", "erlang_app")
|
||||||
|
|
||||||
|
erlang_app(
|
||||||
|
app_name = "jose",
|
||||||
|
erlc_opts = [
|
||||||
|
"+deterministic",
|
||||||
|
"+debug_info",
|
||||||
|
],
|
||||||
|
stamp = 0,
|
||||||
|
)
|
20
BUILD.ranch
20
BUILD.ranch
|
@ -1,14 +1,17 @@
|
||||||
load("@rules_erlang//:app_file.bzl", "app_file")
|
load("@rules_erlang//:app_file.bzl", "app_file")
|
||||||
load("@rules_erlang//:erlang_app_info.bzl", "erlang_app_info")
|
load("@rules_erlang//:erlang_app_info.bzl", "erlang_app_info")
|
||||||
load("@rules_erlang//:erlang_app.bzl", "DEFAULT_ERLC_OPTS")
|
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",
|
name = "beam_files",
|
||||||
hdrs = glob(["include/**/*.hrl", "src/**/*.hrl"]),
|
|
||||||
srcs = glob(["src/**/*.erl"]),
|
srcs = glob(["src/**/*.erl"]),
|
||||||
erlc_opts = DEFAULT_ERLC_OPTS,
|
hdrs = glob([
|
||||||
|
"include/**/*.hrl",
|
||||||
|
"src/**/*.hrl",
|
||||||
|
]),
|
||||||
dest = "ebin",
|
dest = "ebin",
|
||||||
|
erlc_opts = DEFAULT_ERLC_OPTS,
|
||||||
)
|
)
|
||||||
|
|
||||||
genrule(
|
genrule(
|
||||||
|
@ -27,9 +30,12 @@ app_file(
|
||||||
|
|
||||||
erlang_app_info(
|
erlang_app_info(
|
||||||
name = "erlang_app",
|
name = "erlang_app",
|
||||||
app_name = "ranch",
|
|
||||||
app = ":app_file",
|
|
||||||
hdrs = glob(["include/**/*.hrl"]),
|
hdrs = glob(["include/**/*.hrl"]),
|
||||||
beam = [":beam_files", ":appup"],
|
app = ":app_file",
|
||||||
|
app_name = "ranch",
|
||||||
|
beam = [
|
||||||
|
":beam_files",
|
||||||
|
":appup",
|
||||||
|
],
|
||||||
visibility = ["//visibility:public"],
|
visibility = ["//visibility:public"],
|
||||||
)
|
)
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
load("@rules_erlang//:erlang_app.bzl", "erlang_app")
|
load("@rules_erlang//:erlang_app.bzl", "erlang_app")
|
||||||
|
|
||||||
erlang_app(
|
erlang_app(
|
||||||
app_name = "trust_store_http",
|
|
||||||
app_description = "Trust store HTTP server",
|
app_description = "Trust store HTTP server",
|
||||||
app_module = "trust_store_http_app",
|
app_module = "trust_store_http_app",
|
||||||
|
app_name = "trust_store_http",
|
||||||
app_version = "1.0.0",
|
app_version = "1.0.0",
|
||||||
extra_apps = [
|
extra_apps = [
|
||||||
"ssl",
|
"ssl",
|
||||||
|
|
|
@ -137,14 +137,13 @@ erlang_package.hex_package(
|
||||||
erlang_package.git_package(
|
erlang_package.git_package(
|
||||||
repository = "rabbitmq/osiris",
|
repository = "rabbitmq/osiris",
|
||||||
branch = "main",
|
branch = "main",
|
||||||
patch_cmds = ["""
|
patch_cmds = ["""VERSION=$(git rev-parse HEAD)
|
||||||
VERSION=$(git rev-parse HEAD)
|
|
||||||
echo "Injecting ${VERSION} into Makefile..."
|
echo "Injecting ${VERSION} into Makefile..."
|
||||||
sed -i"_orig" -E '/PROJECT_VERSION/ s/[0-9]+\\.[0-9]+\\.[0-9]+/'${VERSION}'/' Makefile
|
sed -i"_orig" -E '/PROJECT_VERSION/ s/[0-9]+\\.[0-9]+\\.[0-9]+/'${VERSION}'/' Makefile
|
||||||
echo "Injecting ${VERSION} into BUILD.bazel..."
|
echo "Injecting ${VERSION} into BUILD.bazel..."
|
||||||
sed -i"_orig" -E '/VERSION/ s/[0-9]+\\.[0-9]+\\.[0-9]+/'${VERSION}'/' 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
|
||||||
"""],
|
"""],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,7 @@ def elixir_toolchain_external():
|
||||||
elixir_constraint,
|
elixir_constraint,
|
||||||
],
|
],
|
||||||
toolchain = ":elixir_external",
|
toolchain = ":elixir_external",
|
||||||
toolchain_type = Label("@rabbitmq-server//bazel/elixir:toolchain_type"),
|
toolchain_type = Label("//bazel/elixir:toolchain_type"),
|
||||||
visibility = ["//visibility:public"],
|
visibility = ["//visibility:public"],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -69,7 +69,7 @@ def elixir_toolchain_from_http_archive(
|
||||||
elixir_constraint,
|
elixir_constraint,
|
||||||
],
|
],
|
||||||
toolchain = ":elixir{}".format(name_suffix),
|
toolchain = ":elixir{}".format(name_suffix),
|
||||||
toolchain_type = Label("@rabbitmq-server//bazel/elixir:toolchain_type"),
|
toolchain_type = Label("//bazel/elixir:toolchain_type"),
|
||||||
visibility = ["//visibility:public"],
|
visibility = ["//visibility:public"],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -78,7 +78,7 @@ def elixir_toolchain_from_github_release(
|
||||||
version = None,
|
version = None,
|
||||||
sha256 = None):
|
sha256 = None):
|
||||||
[major, minor, patch] = version.split(".")
|
[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)
|
url = "https://github.com/elixir-lang/elixir/archive/refs/tags/v{}.tar.gz".format(version)
|
||||||
elixir_toolchain_from_http_archive(
|
elixir_toolchain_from_http_archive(
|
||||||
name_suffix = name_suffix,
|
name_suffix = name_suffix,
|
||||||
|
|
|
@ -131,6 +131,7 @@ erlang_app(
|
||||||
ref = "2b1d66b5f4fbe33cb198149a8cb23895a2c877ea",
|
ref = "2b1d66b5f4fbe33cb198149a8cb23895a2c877ea",
|
||||||
version = "2b1d66b5f4fbe33cb198149a8cb23895a2c877ea",
|
version = "2b1d66b5f4fbe33cb198149a8cb23895a2c877ea",
|
||||||
sha256 = "7816f39d00655f2605cfac180755e97e268dba86c2f71037998ff63792ca727b",
|
sha256 = "7816f39d00655f2605cfac180755e97e268dba86c2f71037998ff63792ca727b",
|
||||||
|
build_file = rabbitmq_workspace + "//:BUILD.jose",
|
||||||
)
|
)
|
||||||
|
|
||||||
hex_pm_erlang_app(
|
hex_pm_erlang_app(
|
||||||
|
@ -154,6 +155,16 @@ erlang_app(
|
||||||
name = "osiris",
|
name = "osiris",
|
||||||
branch = "main",
|
branch = "main",
|
||||||
remote = "https://github.com/rabbitmq/osiris.git",
|
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(
|
hex_pm_erlang_app(
|
||||||
|
|
Loading…
Reference in New Issue