@@ -117,21 +117,6 @@ def _get_entry_point_file(ctx):
117117 return ctx .attr .entry_point [DirectoryFilePathInfo ].directory
118118 fail ("entry_point must either be a file, or provide DirectoryFilePathInfo" )
119119
120- def _write_loader_script (ctx ):
121- substitutions = {}
122- substitutions ["TEMPLATED_entry_point_path" ] = _ts_to_js (_to_manifest_path (ctx , _get_entry_point_file (ctx )))
123- if DirectoryFilePathInfo in ctx .attr .entry_point :
124- substitutions ["TEMPLATED_entry_point_main" ] = ctx .attr .entry_point [DirectoryFilePathInfo ].path
125- else :
126- substitutions ["TEMPLATED_entry_point_main" ] = ""
127-
128- ctx .actions .expand_template (
129- template = ctx .file ._loader_template ,
130- output = ctx .outputs .loader_script ,
131- substitutions = substitutions ,
132- is_executable = True ,
133- )
134-
135120# Avoid using non-normalized paths (workspace/../other_workspace/path)
136121def _to_manifest_path (ctx , file ):
137122 if file .short_path .startswith ("../" ):
@@ -208,8 +193,6 @@ def _nodejs_binary_impl(ctx, data = [], runfiles = [], expanded_args = []):
208193 node_modules_root = "build_bazel_rules_nodejs/node_modules"
209194 _write_require_patch_script (ctx , data , node_modules_root )
210195
211- _write_loader_script (ctx )
212-
213196 # Provide the target name as an environment variable avaiable to all actions for the
214197 # runfiles helpers to use.
215198 env_vars = "export BAZEL_TARGET=%s\n " % ctx .label
276259 runfiles = runfiles [:]
277260 runfiles .extend (node_tool_files )
278261 runfiles .extend (ctx .files ._bash_runfile_helper )
279- runfiles .append (ctx .outputs .loader_script )
280262 runfiles .append (ctx .outputs .require_patch_script )
281263
282264 # First replace any instances of "$(rlocation " with "$$(rlocation " to preserve
@@ -331,7 +313,6 @@ if (process.cwd() !== __dirname) {
331313 "TEMPLATED_expected_exit_code" : str (expected_exit_code ),
332314 "TEMPLATED_lcov_merger_script" : _to_manifest_path (ctx , ctx .file ._lcov_merger_script ),
333315 "TEMPLATED_link_modules_script" : _to_manifest_path (ctx , ctx .file ._link_modules_script ),
334- "TEMPLATED_loader_script" : _to_manifest_path (ctx , ctx .outputs .loader_script ),
335316 "TEMPLATED_modules_manifest" : _to_manifest_path (ctx , node_modules_manifest ),
336317 "TEMPLATED_node_patches_script" : _to_manifest_path (ctx , ctx .file ._node_patches_script ),
337318 "TEMPLATED_require_patch_script" : _to_manifest_path (ctx , ctx .outputs .require_patch_script ),
@@ -378,7 +359,6 @@ if (process.cwd() !== __dirname) {
378359 runfiles = ctx .runfiles (
379360 transitive_files = depset (runfiles ),
380361 files = node_tool_files + [
381- ctx .outputs .loader_script ,
382362 ctx .outputs .require_patch_script ,
383363 ] + ctx .files ._source_map_support_files +
384364
@@ -608,10 +588,6 @@ Predefined genrule variables are not supported in this context.
608588 default = Label ("//internal/linker:index.js" ),
609589 allow_single_file = True ,
610590 ),
611- "_loader_template" : attr .label (
612- default = Label ("//internal/node:loader.cjs" ),
613- allow_single_file = True ,
614- ),
615591 "toolchain" : attr .label (),
616592 "_node_args" : attr .label (default = "@rules_nodejs//nodejs:default_args" ),
617593 "_node_patches_script" : attr .label (
@@ -642,7 +618,6 @@ Predefined genrule variables are not supported in this context.
642618
643619_NODEJS_EXECUTABLE_OUTPUTS = {
644620 "launcher_sh" : "%{name}.sh" ,
645- "loader_script" : "%{name}_loader.cjs" ,
646621 "require_patch_script" : "%{name}_require_patch.cjs" ,
647622}
648623
0 commit comments