Skip to content

Commit 400a3d0

Browse files
committed
Update
[ghstack-poisoned]
1 parent 58f5e85 commit 400a3d0

1 file changed

Lines changed: 13 additions & 7 deletions

File tree

setup.py

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -652,9 +652,9 @@ def __init__(
652652
modpath: The dotted path of the python module that maps to the
653653
extension.
654654
"""
655-
assert "/" not in modpath, (
656-
f"modpath must be a dotted python module path: saw '{modpath}'"
657-
)
655+
assert (
656+
"/" not in modpath
657+
), f"modpath must be a dotted python module path: saw '{modpath}'"
658658
full_src = src
659659
if src_dir is None and _is_windows():
660660
src_dir = "%BUILD_TYPE%/"
@@ -1308,6 +1308,10 @@ def run(self): # noqa C901
13081308
),
13091309
# Install the CUDA delegate beside them when it is built. The CUDA
13101310
# runtime itself is not bundled; it comes from the environment.
1311+
# Gated on the shared runtime as well, because the versioned file name
1312+
# below only exists in a shared build. Without it the target is a static
1313+
# archive, the glob matches nothing, and the wheel build fails rather
1314+
# than skipping the file.
13111315
BuiltFile(
13121316
src_dir="%CMAKE_CACHE_DIR%/backends/cuda/",
13131317
src_name=(
@@ -1317,13 +1321,15 @@ def run(self): # noqa C901
13171321
"executorch/lib/libexecutorch_cuda_backend.so."
13181322
f"{get_runtime_soname_major()}"
13191323
),
1320-
dependent_cmake_flags=["EXECUTORCH_BUILD_CUDA"],
1324+
dependent_cmake_flags=[
1325+
"EXECUTORCH_BUILD_SHARED",
1326+
"EXECUTORCH_BUILD_CUDA",
1327+
],
13211328
),
13221329
# The CUDA delegate and the AOTI shim both call into this for stream
13231330
# handling, so an application that links either from the wheel cannot
1324-
# resolve it unless this ships too. Gated on CUDA alone, matching the
1325-
# shim: the target is always built shared, so requiring the shared
1326-
# runtime here would ship the shim without the library it needs.
1331+
# resolve it unless this ships too. Gated the same way as the delegate,
1332+
# since both carry a versioned file name only in a shared build.
13271333
BuiltFile(
13281334
src_dir="%CMAKE_CACHE_DIR%/extension/cuda/",
13291335
src_name=(

0 commit comments

Comments
 (0)