Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion python/private/cc/py_extension_macro.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ def py_extension(
"//conditions:default": [],
})
user_link_flags = user_link_flags + select({
labels.PLATFORMS_OS_WINDOWS: ["$(locations " + _PY_CC_LIBS_ACTUAL_BASE_TARGET + ")"],
labels.PLATFORMS_OS_WINDOWS: ["$(locations " + _PY_CC_LIBS_ACTUAL_CANONICAL_TARGET + ")"],
"//conditions:default": [],
})
additional_linker_inputs = additional_linker_inputs + select({
Expand Down
4 changes: 2 additions & 2 deletions python/private/current_py_cc_libs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ def _current_py_cc_libs_impl(ctx):
data_runfiles = p.data_runfiles

cc_infos = [p for p in py_cc_toolchain.libs.providers_map.values() if hasattr(p, "linking_context")]
if cc_infos:
cc_info = cc_infos[0]
cc_infos += [p for p in py_cc_toolchain.headers.providers_map.values() if hasattr(p, "linking_context")]
for cc_info in cc_infos:
for input in cc_info.linking_context.linker_inputs.to_list():
for lib in input.libraries:
if lib.static_library:
Expand Down
7 changes: 6 additions & 1 deletion python/private/get_local_runtime_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,12 @@ def _get_python_library_info(base_executable) -> dict[str, Any]:
#
# See: https://docs.python.org/3/extending/windows.html
# https://learn.microsoft.com/en-us/windows/win32/dlls/dynamic-link-library-creation
interface_path = os.path.join(root_dir, libname[:-3] + "lib")
lib_filename = libname[:-3] + "lib"
for s_dir in search_directories:
candidate = os.path.join(s_dir, lib_filename)
if os.path.exists(candidate):
interface_path = candidate
break
elif libname.endswith(".so"):
# It's possible, though unlikely, that interface stubs (.ifso) exist.
interface_path = os.path.join(root_dir, libname[:-2] + "ifso")
Expand Down
12 changes: 6 additions & 6 deletions python/private/pypi/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,12 @@ bzl_library(
deps = ["//python/private:envsubst"],
)

bzl_library(
name = "index_sources",
srcs = ["index_sources.bzl"],
deps = [":hash"],
)

bzl_library(
name = "argparse",
srcs = ["argparse.bzl"],
Expand All @@ -542,12 +548,6 @@ bzl_library(
srcs = ["hash.bzl"],
)

bzl_library(
name = "index_sources",
srcs = ["index_sources.bzl"],
deps = [":hash"],
)

bzl_library(
name = "labels",
srcs = ["labels.bzl"],
Expand Down
15 changes: 2 additions & 13 deletions tests/integration/local_toolchains/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@
# limitations under the License.

load("@bazel_skylib//rules:common_settings.bzl", "string_flag")
load("@rules_cc//cc:cc_library.bzl", "cc_library")
load("@rules_python//python:py_test.bzl", "py_test")
load(":py_extension.bzl", "py_extension")
load("@rules_python//python/cc:py_extension.bzl", "py_extension")

py_test(
name = "local_runtime_test",
Expand Down Expand Up @@ -60,24 +59,14 @@ string_flag(
)

# Build rules to generate a python extension.
cc_library(
name = "echo_ext_cc",
testonly = True,
srcs = ["echo_ext.cc"],
deps = [
"@rules_python//python/cc:current_py_cc_headers",
],
alwayslink = True,
)

py_extension(
name = "echo_ext",
testonly = True,
srcs = ["echo_ext.cc"],
copts = select({
"@rules_cc//cc/compiler:msvc-cl": [],
"//conditions:default": ["-fvisibility=hidden"],
}),
deps = [":echo_ext_cc"],
)

py_test(
Expand Down
154 changes: 0 additions & 154 deletions tests/integration/local_toolchains/py_extension.bzl

This file was deleted.