File tree Expand file tree Collapse file tree 6 files changed +55
-2
lines changed Expand file tree Collapse file tree 6 files changed +55
-2
lines changed Original file line number Diff line number Diff line change 1+ load ("//private:beam_transition.bzl" , "beam_transition" )
2+
13ErlangAppInfo = provider (
24 doc = "Compiled Erlang Application" ,
35 fields = {
@@ -62,10 +64,16 @@ erlang_app_info = rule(
6264 "extra_apps" : attr .string_list (),
6365 "hdrs" : attr .label_list (allow_files = True ),
6466 "app" : attr .label (allow_files = [".app" ]),
65- "beam" : attr .label_list (allow_files = [".beam" , ".appup" ]),
67+ "beam" : attr .label_list (
68+ allow_files = [".beam" , ".appup" ],
69+ cfg = beam_transition ,
70+ ),
6671 "priv" : attr .label_list (allow_files = True ),
6772 "license_files" : attr .label_list (allow_files = True ),
6873 "srcs" : attr .label_list (allow_files = True ),
6974 "deps" : attr .label_list (providers = [ErlangAppInfo ]),
75+ "_allowlist_function_transition" : attr .label (
76+ default = "@bazel_tools//tools/allowlists/function_transition_allowlist" ,
77+ ),
7078 },
7179)
Original file line number Diff line number Diff line change 1+ def _impl (settings , attr ):
2+ _ignore = (settings , attr )
3+
4+ # print("_impl")
5+ # print("settings", settings)
6+ # print("attr", attr)
7+ return {
8+ "arm" : {"//command_line_option:cpu" : "arm" },
9+ "x86" : {"//command_line_option:cpu" : "x86" },
10+ "k8" : {"//command_line_option:cpu" : "k8" },
11+ }
12+
13+ beam_transition = transition (
14+ implementation = _impl ,
15+ inputs = [],
16+ outputs = ["//command_line_option:cpu" ],
17+ )
Original file line number Diff line number Diff line change 11load ("//:erlang_app_info.bzl" , "ErlangAppInfo" )
22load ("//:util.bzl" , "path_join" )
3+ load (":beam_transition.bzl" , "beam_transition" )
34load (":erlang_bytecode.bzl" , "unique_dirnames" )
45load (":util.bzl" , "erl_libs_contents" )
56load (
@@ -132,6 +133,7 @@ erlang_bytecode = rule(
132133 ),
133134 "beam" : attr .label_list (
134135 allow_files = [".beam" ],
136+ cfg = beam_transition ,
135137 ),
136138 "deps" : attr .label_list (
137139 providers = [ErlangAppInfo ],
@@ -142,6 +144,9 @@ erlang_bytecode = rule(
142144 "outs" : attr .output_list (
143145 mandatory = True ,
144146 ),
147+ "_allowlist_function_transition" : attr .label (
148+ default = "@bazel_tools//tools/allowlists/function_transition_allowlist" ,
149+ ),
145150 },
146151 toolchains = ["//tools:toolchain_type" ],
147152)
Original file line number Diff line number Diff line change 1212 "//:util.bzl" ,
1313 "path_join" ,
1414)
15+ load (
16+ ":beam_transition.bzl" ,
17+ "beam_transition" ,
18+ )
1519load (
1620 ":util.bzl" ,
1721 "additional_file_dest_relative_path" ,
@@ -117,8 +121,14 @@ escript_archive = rule(
117121 default = DEFAULT_HEADERS ,
118122 ),
119123 "srcs" : attr .label_list (allow_files = [".erl" ]),
120- "beam" : attr .label_list (allow_files = [".beam" ]),
124+ "beam" : attr .label_list (
125+ allow_files = [".beam" ],
126+ cfg = beam_transition ,
127+ ),
121128 "app" : attr .label (providers = [ErlangAppInfo ]),
129+ "_allowlist_function_transition" : attr .label (
130+ default = "@bazel_tools//tools/allowlists/function_transition_allowlist" ,
131+ ),
122132 },
123133 toolchains = ["//tools:toolchain_type" ],
124134 executable = True ,
Original file line number Diff line number Diff line change 33 "erlang_dirs" ,
44 "maybe_install_erlang" ,
55)
6+ load (
7+ ":beam_transition.bzl" ,
8+ "beam_transition" ,
9+ )
610
711def _impl (ctx ):
812 out = ctx .actions .declare_file (ctx .attr .out if ctx .attr .out != "" else ctx .label .name )
@@ -63,8 +67,12 @@ escript_flat = rule(
6367 ),
6468 "beam" : attr .label (
6569 allow_single_file = [".beam" ],
70+ cfg = beam_transition ,
6671 ),
6772 "out" : attr .string (),
73+ "_allowlist_function_transition" : attr .label (
74+ default = "@bazel_tools//tools/allowlists/function_transition_allowlist" ,
75+ ),
6876 },
6977 toolchains = ["//tools:toolchain_type" ],
7078)
Original file line number Diff line number Diff line change 44 "path_join" ,
55 "windows_path" ,
66)
7+ load (":beam_transition.bzl" , "beam_transition" )
78load (":util.bzl" , "erl_libs_contents2" )
89load (
910 "//tools:erlang_toolchain.bzl" ,
@@ -178,6 +179,7 @@ eunit_test = rule(
178179 "is_windows" : attr .bool (mandatory = True ),
179180 "compiled_suites" : attr .label_list (
180181 allow_files = [".beam" ],
182+ cfg = beam_transition ,
181183 ),
182184 "eunit_mods" : attr .string_list (),
183185 "target" : attr .label (providers = [ErlangAppInfo ]),
@@ -187,6 +189,9 @@ eunit_test = rule(
187189 "deps" : attr .label_list (providers = [ErlangAppInfo ]),
188190 "tools" : attr .label_list (),
189191 "test_env" : attr .string_dict (),
192+ "_allowlist_function_transition" : attr .label (
193+ default = "@bazel_tools//tools/allowlists/function_transition_allowlist" ,
194+ ),
190195 },
191196 toolchains = ["//tools:toolchain_type" ],
192197 test = True ,
You can’t perform that action at this time.
0 commit comments