Fixup config drift causing the Windows Actions to fail

This commit is contained in:
Rin Kuryloski 2022-09-28 10:23:35 +02:00
parent 76b79fba09
commit ad043228f2
4 changed files with 26 additions and 17 deletions

View File

@ -3,6 +3,9 @@ on:
schedule:
- cron: '0 2 * * *'
workflow_dispatch:
push:
paths:
- .github/workflows/test-windows.yaml
jobs:
test:
name: Test Windows
@ -28,11 +31,9 @@ jobs:
#! path: "/home/runner/repo-cache/"
#! key: repo-cache
- name: CONFIGURE BAZEL
id: configure
shell: bash
run: |
ERL_PATH="$(which erl)"
IEX_PATH="$(which iex)"
sed -i"_orig" 's/build --experimental_enable_bzlmod//' .bazelrc
cat << EOF >> user.bazelrc
startup --output_user_root=C:/tmp
startup --windows_enable_symlinks
@ -48,10 +49,6 @@ jobs:
build:buildbuddy --disk_cache=
build:buildbuddy --noexperimental_remote_cache_compression
build:buildbuddy --noexperimental_remote_cache_async
build --@rules_erlang//:erlang_version=${{ matrix.erlang_version }}
build --@rules_erlang//:erlang_home="${ERL_PATH/\/bin\/erl/}"
build --//:elixir_home="${IEX_PATH/\/bin\/iex/}"
EOF
bazelisk info release
@ -60,6 +57,7 @@ jobs:
run: |
bazelisk test //... ^
--config=buildbuddy ^
--noexperimental_enable_bzlmod ^
--test_tag_filters=-aws,-docker,-bats,-starts-background-broker ^
--build_tests_only ^
--verbose_failures

View File

@ -25,7 +25,7 @@ bazel_dep(
bazel_dep(
name = "rules_erlang",
version = "3.7.0",
version = "3.7.1",
)
erlang_config = use_extension(

View File

@ -105,14 +105,14 @@ load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
git_repository(
name = "rbe",
commit = "e96d11e9b2ca5bc7e7256957e718d268ddf3be35", # linux-rbe branch
branch = "linux-rbe",
remote = "https://github.com/rabbitmq/rbe-erlang-platform.git",
)
git_repository(
name = "rules_erlang",
remote = "https://github.com/rabbitmq/rules_erlang.git",
tag = "3.7.0",
tag = "3.7.1",
)
load(

View File

@ -1,10 +1,10 @@
load(
"@rules_erlang//:util.bzl",
"msys2_path",
"path_join",
)
ELIXIR_HOME_ENV_VAR = "ELIXIR_HOME"
DEFAULT_IEX_PATH = "/usr/local/bin/iex"
_DEFAULT_EXTERNAL_ELIXIR_PACKAGE_NAME = "external"
_ELIXIR_VERSION_UNKNOWN = "UNKNOWN"
@ -118,16 +118,27 @@ elixir_config = repository_rule(
],
)
def _is_windows(repository_ctx):
return repository_ctx.os.name.lower().find("windows") != -1
def _default_elixir_dict(repository_ctx):
if ELIXIR_HOME_ENV_VAR in repository_ctx.os.environ:
elixir_home = repository_ctx.os.environ[ELIXIR_HOME_ENV_VAR]
else:
if repository_ctx.os.name.find("windows") > 0:
iex_path = repository_ctx.which("iex.exe")
if _is_windows(repository_ctx):
if ELIXIR_HOME_ENV_VAR in repository_ctx.os.environ:
elixir_home = repository_ctx.os.environ[ELIXIR_HOME_ENV_VAR]
iex_path = elixir_home + "\\bin\\iex"
else:
iex_path = repository_ctx.which("iex")
if iex_path == None:
iex_path = repository_ctx.path("C:/Program Files (x86)/Elixir/bin/iex")
elixir_home = str(iex_path.dirname.dirname)
elixir_home = msys2_path(elixir_home)
elif ELIXIR_HOME_ENV_VAR in repository_ctx.os.environ:
elixir_home = repository_ctx.os.environ[ELIXIR_HOME_ENV_VAR]
iex_path = path_join(elixir_home, "bin", "elixir")
else:
iex_path = repository_ctx.which("iex")
if iex_path == None:
iex_path = repository_ctx.path(DEFAULT_IEX_PATH)
iex_path = repository_ctx.path("/usr/local/bin/iex")
elixir_home = str(iex_path.dirname.dirname)
version = repository_ctx.execute(