Skip to content

Commit 64a6fda

Browse files
committed
Use an incoming transition only on erlang_bytecode2
1 parent b4b0370 commit 64a6fda

File tree

5 files changed

+28
-18
lines changed

5 files changed

+28
-18
lines changed

erlang_app_info.bzl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,14 @@ erlang_app_info = rule(
6666
"app": attr.label(allow_files = [".app"]),
6767
"beam": attr.label_list(
6868
allow_files = [".beam", ".appup"],
69-
cfg = beam_transition,
69+
# cfg = beam_transition,
7070
),
7171
"priv": attr.label_list(allow_files = True),
7272
"license_files": attr.label_list(allow_files = True),
7373
"srcs": attr.label_list(allow_files = True),
7474
"deps": attr.label_list(providers = [ErlangAppInfo]),
75-
"_allowlist_function_transition": attr.label(
76-
default = "@bazel_tools//tools/allowlists/function_transition_allowlist",
77-
),
75+
# "_allowlist_function_transition": attr.label(
76+
# default = "@bazel_tools//tools/allowlists/function_transition_allowlist",
77+
# ),
7878
},
7979
)

private/erlang_bytecode2.bzl

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,15 @@ ErlcOptsInfo = provider(
1616
},
1717
)
1818

19+
def _transition_impl(settings, attr):
20+
return {"//command_line_option:cpu": "beam"}
21+
22+
transition = transition(
23+
implementation = _transition_impl,
24+
inputs = [],
25+
outputs = ["//command_line_option:cpu"],
26+
)
27+
1928
def _impl(ctx):
2029
if len(ctx.attr.outs) == 0:
2130
fail("attr outs must not be empty")
@@ -122,6 +131,7 @@ fi
122131

123132
erlang_bytecode = rule(
124133
implementation = _impl,
134+
cfg = transition,
125135
attrs = {
126136
"app_name": attr.string(),
127137
"hdrs": attr.label_list(
@@ -133,7 +143,7 @@ erlang_bytecode = rule(
133143
),
134144
"beam": attr.label_list(
135145
allow_files = [".beam"],
136-
cfg = beam_transition,
146+
# cfg = beam_transition,
137147
),
138148
"deps": attr.label_list(
139149
providers = [ErlangAppInfo],

private/escript_archive.bzl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,12 +123,12 @@ escript_archive = rule(
123123
"srcs": attr.label_list(allow_files = [".erl"]),
124124
"beam": attr.label_list(
125125
allow_files = [".beam"],
126-
cfg = beam_transition,
126+
# cfg = beam_transition,
127127
),
128128
"app": attr.label(providers = [ErlangAppInfo]),
129-
"_allowlist_function_transition": attr.label(
130-
default = "@bazel_tools//tools/allowlists/function_transition_allowlist",
131-
),
129+
# "_allowlist_function_transition": attr.label(
130+
# default = "@bazel_tools//tools/allowlists/function_transition_allowlist",
131+
# ),
132132
},
133133
toolchains = ["//tools:toolchain_type"],
134134
executable = True,

private/escript_flat.bzl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ halt().
3131
body = body,
3232
))
3333

34-
(erlang_home, erlang_release_dir, runfiles) = erlang_dirs(ctx)
34+
(erlang_home, _, runfiles) = erlang_dirs(ctx)
3535

3636
inputs = depset(
3737
direct = ctx.files.src + ctx.files.beam,
@@ -67,12 +67,12 @@ escript_flat = rule(
6767
),
6868
"beam": attr.label(
6969
allow_single_file = [".beam"],
70-
cfg = beam_transition,
70+
# cfg = beam_transition,
7171
),
7272
"out": attr.string(),
73-
"_allowlist_function_transition": attr.label(
74-
default = "@bazel_tools//tools/allowlists/function_transition_allowlist",
75-
),
73+
# "_allowlist_function_transition": attr.label(
74+
# default = "@bazel_tools//tools/allowlists/function_transition_allowlist",
75+
# ),
7676
},
7777
toolchains = ["//tools:toolchain_type"],
7878
)

private/eunit.bzl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ eunit_test = rule(
179179
"is_windows": attr.bool(mandatory = True),
180180
"compiled_suites": attr.label_list(
181181
allow_files = [".beam"],
182-
cfg = beam_transition,
182+
# cfg = beam_transition,
183183
),
184184
"eunit_mods": attr.string_list(),
185185
"target": attr.label(providers = [ErlangAppInfo]),
@@ -189,9 +189,9 @@ eunit_test = rule(
189189
"deps": attr.label_list(providers = [ErlangAppInfo]),
190190
"tools": attr.label_list(),
191191
"test_env": attr.string_dict(),
192-
"_allowlist_function_transition": attr.label(
193-
default = "@bazel_tools//tools/allowlists/function_transition_allowlist",
194-
),
192+
# "_allowlist_function_transition": attr.label(
193+
# default = "@bazel_tools//tools/allowlists/function_transition_allowlist",
194+
# ),
195195
},
196196
toolchains = ["//tools:toolchain_type"],
197197
test = True,

0 commit comments

Comments
 (0)