Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
5 changes: 5 additions & 0 deletions python/private/get_local_runtime_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@
# The platform-specific filename suffix for library files.
# Includes the dot, e.g. `.so`
"SHLIB_SUFFIX",
# Debian has a "multiarch" layout that has libs for different archs
# in slightly other locations. The MULTIARCH sysconfig varible tells
# which directory under `LIBDIR` these exist in, if any.
# See https://wiki.debian.org/Python/MultiArch
"MULTIARCH",
]
data.update(zip(config_vars, sysconfig.get_config_vars(*config_vars)))
print(json.dumps(data))
6 changes: 6 additions & 0 deletions python/private/local_runtime_repo.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ def _local_runtime_repo_impl(rctx):
# In some cases, the same value is returned for multiple keys. Not clear why.
shared_lib_names = {v: None for v in shared_lib_names}.keys()
shared_lib_dir = info["LIBDIR"]
multiarch = info["MULTIARCH"]

# The specific files are symlinked instead of the whole directory
# because it can point to a directory that has more than just
Expand All @@ -141,6 +142,11 @@ def _local_runtime_repo_impl(rctx):
repo_utils.watch(rctx, origin)
rctx.symlink(origin, "lib/" + name)

origin_multiarch = rctx.path("{}/{}/{}".format(shared_lib_dir, multiarch, name))
if origin_multiarch.exists:
repo_utils.watch(rctx, origin)
rctx.symlink(origin, "lib/{}/{}".format(multiarch, name))

rctx.file("WORKSPACE", "")
rctx.file("MODULE.bazel", "")
rctx.file("REPO.bazel", "")
Expand Down