Skip to content

Commit 4d6ae08

Browse files
authored
fix(pystar): Use py_internal for runfiles_enabled, declare_shareable_artifact, share_native_deps (#1443)
These are restricted use APIs, so they have to go through py_internal. They aren't caught by CI because tests don't currently cover their code paths; fixing that will be done in a separate change. Work towards #1069
1 parent 21b54b2 commit 4d6ae08

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

python/private/common/py_executable.bzl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,7 @@ def _get_native_deps_details(ctx, *, semantics, cc_details, is_test):
488488
return struct(dso = None, runfiles = ctx.runfiles())
489489

490490
dso = ctx.actions.declare_file(semantics.get_native_deps_dso_name(ctx))
491-
share_native_deps = ctx.fragments.cpp.share_native_deps()
491+
share_native_deps = py_internal.share_native_deps(ctx)
492492
cc_feature_config = cc_configure_features(
493493
ctx,
494494
cc_toolchain = cc_details.cc_toolchain,
@@ -571,7 +571,7 @@ def _create_shared_native_deps_dso(
571571
features = requested_features,
572572
is_test_target_partially_disabled_thin_lto = is_test and partially_disabled_thin_lto,
573573
)
574-
return ctx.actions.declare_shareable_artifact("_nativedeps/%x.so" % dso_hash)
574+
return py_internal.declare_shareable_artifact(ctx, "_nativedeps/%x.so" % dso_hash)
575575

576576
# This is a minimal version of NativeDepsHelper.getSharedNativeDepsPath, see
577577
# com.google.devtools.build.lib.rules.nativedeps.NativeDepsHelper#getSharedNativeDepsPath

python/private/common/py_executable_bazel.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ def _create_windows_exe_launcher(
332332
launch_info.add("binary_type=Python")
333333
launch_info.add(ctx.workspace_name, format = "workspace_name=%s")
334334
launch_info.add(
335-
"1" if ctx.configuration.runfiles_enabled() else "0",
335+
"1" if py_internal.runfiles_enabled(ctx) else "0",
336336
format = "symlink_runfiles_enabled=%s",
337337
)
338338
launch_info.add(python_binary_path, format = "python_bin_path=%s")

0 commit comments

Comments
 (0)