Skip to content

Commit 331f599

Browse files
authored
Merge pull request #73 from rabbitmq/always-define-external-erlang
Always generate an external erlang in @erlang_config
2 parents c222d0e + 285685c commit 331f599

File tree

4 files changed

+13
-4
lines changed

4 files changed

+13
-4
lines changed

.bazelrc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,4 @@ build --incompatible_strict_action_env
44
build --flag_alias=erlang_home=//:erlang_home
55
build --flag_alias=erlang_version=//:erlang_version
66

7-
build --extra_toolchains=@erlang_config//external:toolchain
8-
97
try-import %workspace%/user.bazelrc

MODULE.bazel

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,7 @@ use_repo(
3434
erlang_config_extension,
3535
"erlang_config",
3636
)
37+
38+
register_toolchains(
39+
"@erlang_config//external:toolchain",
40+
)

repositories/erlang_config.bzl

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ ERLANG_HOME_ENV_VAR = "ERLANG_HOME"
77
DEFAULT_ERL_PATH = "/usr/bin/erl"
88

99
_DEFAULT_EXTERNAL_ERLANG_PACKAGE_NAME = "external"
10+
_ERLANG_VERSION_UNKNOWN = "UNKNOWN"
1011

1112
INSTALLATION_TYPE_EXTERNAL = "external"
1213
INSTALLATION_TYPE_INTERNAL = "internal"
@@ -136,7 +137,14 @@ def _default_erlang_dict(repository_ctx):
136137
),
137138
}
138139
else:
139-
return {}
140+
return {
141+
_DEFAULT_EXTERNAL_ERLANG_PACKAGE_NAME: struct(
142+
type = INSTALLATION_TYPE_EXTERNAL,
143+
version = _ERLANG_VERSION_UNKNOWN,
144+
major = _ERLANG_VERSION_UNKNOWN.lower(),
145+
erlang_home = erlang_home,
146+
),
147+
}
140148

141149
def _build_file_content(erlang_installations):
142150
external_installations = {

test/MODULE.bazel

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,5 @@ use_repo(
2727
)
2828

2929
register_toolchains(
30-
"@erlang_config//external:toolchain",
3130
"@erlang_config//internal:toolchain",
3231
)

0 commit comments

Comments
 (0)