Skip to content

Commit

Permalink
Again bump rules_erlang
Browse files Browse the repository at this point in the history
  • Loading branch information
HoloRin committed Jun 8, 2022
1 parent 712c2ce commit 0b676e9
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 21 deletions.
2 changes: 1 addition & 1 deletion MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ bazel_dep(name = "rules_erlang", version = "3.0.1")
git_override(
module_name = "rules_erlang",
remote = "https://github.com/rabbitmq/rules_erlang.git",
commit = "5d3189d34323a0d5d86a96dc57815dad9cd982cb",
commit = "ff558e15ab6dc90e9d7e4aabebb5b519447c3318",
)

erlang_package = use_extension(
Expand Down
2 changes: 1 addition & 1 deletion WORKSPACE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ git_repository(

git_repository(
name = "rules_erlang",
commit = "5d3189d34323a0d5d86a96dc57815dad9cd982cb",
commit = "ff558e15ab6dc90e9d7e4aabebb5b519447c3318",
remote = "https://github.com/rabbitmq/rules_erlang.git",
)

Expand Down
6 changes: 3 additions & 3 deletions bazel/elixir/elixir_build.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ load(
load(
"@rules_erlang//tools:erlang_toolchain.bzl",
"erlang_dirs",
"maybe_symlink_erlang",
"maybe_install_erlang",
)

ElixirInfo = provider(
Expand Down Expand Up @@ -61,7 +61,7 @@ fi
outputs = [release_dir, build_dir, version_file],
command = """set -euo pipefail
{maybe_symlink_erlang}
{maybe_install_erlang}
export PATH="{erlang_home}"/bin:${{PATH}}
Expand All @@ -83,7 +83,7 @@ cp -r lib $ABS_RELEASE_DIR/
$ABS_RELEASE_DIR/bin/iex --version > $ABS_VERSION_FILE
""".format(
maybe_symlink_erlang = maybe_symlink_erlang(ctx),
maybe_install_erlang = maybe_install_erlang(ctx),
erlang_home = erlang_home,
archive_path = downloaded_archive.path,
strip_prefix = strip_prefix,
Expand Down
2 changes: 1 addition & 1 deletion bazel/elixir/elixir_toolchain.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def elixir_dirs(ctx, short_path = False):
p = info.release_dir.short_path if short_path else info.release_dir.path
return (p, ctx.runfiles([info.release_dir, info.version_file]))

def maybe_symlink_erlang(ctx, short_path = False):
def maybe_copy_erlang(ctx, short_path = False):
info = _build_info(ctx)
release_dir = info.release_dir
if release_dir == None:
Expand Down
6 changes: 3 additions & 3 deletions bazel/elixir/iex_eval.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ load(
":elixir_toolchain.bzl",
"elixir_dirs",
"erlang_dirs",
"maybe_symlink_erlang",
"maybe_copy_erlang",
)

def _impl(ctx):
Expand All @@ -16,7 +16,7 @@ def _impl(ctx):

script = """set -euo pipefail
{maybe_symlink_erlang}
{maybe_copy_erlang}
if [[ "{elixir_home}" == /* ]]; then
ABS_ELIXIR_HOME="{elixir_home}"
Expand All @@ -31,7 +31,7 @@ export OUTS="{outs}"
${{ABS_ELIXIR_HOME}}/bin/iex --eval "$1"
""".format(
maybe_symlink_erlang = maybe_symlink_erlang(ctx),
maybe_copy_erlang = maybe_copy_erlang(ctx),
erlang_home = erlang_home,
elixir_home = elixir_home,
srcs = ctx.configuration.host_path_separator.join([src.path for src in ctx.files.srcs]),
Expand Down
6 changes: 3 additions & 3 deletions bazel/mix/mix_app.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ load(
"//bazel/elixir:elixir_toolchain.bzl",
"elixir_dirs",
"erlang_dirs",
"maybe_symlink_erlang",
"maybe_copy_erlang",
)

def find_mix_exs(files):
Expand Down Expand Up @@ -60,7 +60,7 @@ def _impl(ctx):

script = """set -euo pipefail
{maybe_symlink_erlang}
{maybe_copy_erlang}
if [[ "{elixir_home}" == /* ]]; then
ABS_ELIXIR_HOME="{elixir_home}"
Expand Down Expand Up @@ -92,7 +92,7 @@ fi
# is not used, and bazel does not allow them
find ${{MIX_BUILD_PATH}} -type l -delete
""".format(
maybe_symlink_erlang = maybe_symlink_erlang(ctx),
maybe_copy_erlang = maybe_copy_erlang(ctx),
package = ctx.label.package,
erlang_home = erlang_home,
elixir_home = elixir_home,
Expand Down
6 changes: 3 additions & 3 deletions deps/rabbitmq_cli/rabbitmqctl.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ load(
"//bazel/elixir:elixir_toolchain.bzl",
"elixir_dirs",
"erlang_dirs",
"maybe_symlink_erlang",
"maybe_install_erlang",
)

def _impl(ctx):
Expand Down Expand Up @@ -47,7 +47,7 @@ def _impl(ctx):
export LANG="en_US.UTF-8"
export LC_ALL="en_US.UTF-8"
{maybe_symlink_erlang}
{maybe_install_erlang}
if [[ "{elixir_home}" == /* ]]; then
ABS_ELIXIR_HOME="{elixir_home}"
Expand Down Expand Up @@ -78,7 +78,7 @@ if [ -n "$(ls ${{MIX_BUILD_PATH}}/lib/{app_name}/ebin)" ]; then
cp ${{MIX_BUILD_PATH}}/lib/{app_name}/ebin/* ${{ABS_EBIN_DIR}}
fi
""".format(
maybe_symlink_erlang = maybe_symlink_erlang(ctx),
maybe_install_erlang = maybe_install_erlang(ctx),
erlang_home = erlang_home,
elixir_home = elixir_home,
home = home.path,
Expand Down
6 changes: 3 additions & 3 deletions deps/rabbitmq_cli/rabbitmqctl_test.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ load(
"//bazel/elixir:elixir_toolchain.bzl",
"elixir_dirs",
"erlang_dirs",
"maybe_symlink_erlang",
"maybe_install_erlang",
)

def _impl(ctx):
Expand All @@ -40,7 +40,7 @@ def _impl(ctx):
export LANG="en_US.UTF-8"
export LC_ALL="en_US.UTF-8"
{maybe_symlink_erlang}
{maybe_install_erlang}
if [[ "{elixir_home}" == /* ]]; then
ABS_ELIXIR_HOME="{elixir_home}"
Expand Down Expand Up @@ -96,7 +96,7 @@ set -x
--max-failures 1 \\
${{TEST_FILE}}
""".format(
maybe_symlink_erlang = maybe_symlink_erlang(ctx, short_path = True),
maybe_install_erlang = maybe_install_erlang(ctx, short_path = True),
erlang_home = erlang_home,
elixir_home = elixir_home,
package_dir = package_dir,
Expand Down
4 changes: 2 additions & 2 deletions dist.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ load("@rules_erlang//:ct.bzl", "additional_file_dest_relative_path")
load(
"@rules_erlang//tools:erlang_toolchain.bzl",
"erlang_dirs",
"maybe_symlink_erlang",
"maybe_install_erlang",
)
load(
":rabbitmq_home.bzl",
Expand Down Expand Up @@ -85,7 +85,7 @@ def _plugins_dir(ctx, plugins):
commands = [
"set -euo pipefail",
"",
maybe_symlink_erlang(ctx),
maybe_install_erlang(ctx),
]

for plugin in plugins:
Expand Down
1 change: 0 additions & 1 deletion rabbitmq_run.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ load(
load(
"@rules_erlang//tools:erlang_toolchain.bzl",
"erlang_dirs",
"maybe_symlink_erlang",
)
load(
":rabbitmq_home.bzl",
Expand Down

0 comments on commit 0b676e9

Please sign in to comment.