@@ -16,9 +16,10 @@ js_binary(
1616"""
1717
1818load ("@aspect_bazel_lib//lib:copy_to_bin.bzl" , "COPY_FILE_TO_BIN_TOOLCHAINS" )
19- load ("@aspect_bazel_lib//lib:directory_path.bzl" , "DirectoryPathInfo" )
19+ load ("@aspect_bazel_lib//lib:directory_path.bzl" , _LegacyDirectoryPathInfo = "DirectoryPathInfo" )
2020load ("@aspect_bazel_lib//lib:expand_make_vars.bzl" , "expand_locations" , "expand_variables" )
2121load ("@aspect_bazel_lib//lib:windows_utils.bzl" , "create_windows_native_launcher_script" )
22+ load ("@bazel_lib//lib:directory_path.bzl" , "DirectoryPathInfo" )
2223load (":bash.bzl" , "BASH_INITIALIZE_RUNFILES" )
2324load (":js_helpers.bzl" , "LOG_LEVELS" , "envs_for_log_level" , "gather_runfiles" )
2425
@@ -107,10 +108,10 @@ _ATTRS = {
107108 This is the module referenced by the `require.main` property in the runtime.
108109
109110 This must be a target that provides a single file or a `DirectoryPathInfo`
110- from `@aspect_bazel_lib //lib::directory_path.bzl`.
111+ from `@bazel_lib //lib::directory_path.bzl`.
111112
112113 See https://github.com/bazel-contrib/bazel-lib/blob/main/docs/directory_path.md
113- for more info on creating a target that provides a `DirectoryPathInfo `.
114+ for more info on creating a target that provides a `Info `.
114115 """ ,
115116 mandatory = True ,
116117 ),
@@ -507,11 +508,12 @@ def _create_launcher(ctx, log_prefix_rule_set, log_prefix_rule, fixed_args = [],
507508 else :
508509 nodeinfo = ctx .toolchains ["@rules_nodejs//nodejs:toolchain_type" ].nodeinfo
509510
510- if DirectoryPathInfo in ctx .attr .entry_point :
511- entry_point = ctx .attr .entry_point [DirectoryPathInfo ].directory
511+ directory_path_provider = DirectoryPathInfo if DirectoryPathInfo in ctx .attr .entry_point else _LegacyDirectoryPathInfo
512+ if directory_path_provider in ctx .attr .entry_point :
513+ entry_point = ctx .attr .entry_point [directory_path_provider ].directory
512514 entry_point_path = "/" .join ([
513- ctx .attr .entry_point [DirectoryPathInfo ].directory .short_path ,
514- ctx .attr .entry_point [DirectoryPathInfo ].path ,
515+ ctx .attr .entry_point [directory_path_provider ].directory .short_path ,
516+ ctx .attr .entry_point [directory_path_provider ].path ,
515517 ])
516518 else :
517519 if len (ctx .files .entry_point ) != 1 :
0 commit comments