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
7 changes: 6 additions & 1 deletion ptodsl/ptoas_wheel_bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,12 @@ def _candidate_wheel_python_roots(wrapper: Path, module_file: str | None = None)
candidates: list[Path] = []

if module_file:
candidates.append(Path(module_file).resolve().parent)
module_path = Path(module_file).resolve()
candidates.append(module_path.parent)
# Editable installs import this bootstrap from the repository while
# the generated runtime overlay lives under build/python.
repo_root = module_path.parent.parent
candidates.append(repo_root / "build" / "python")

for scheme_name in ("purelib", "platlib"):
scheme_path = sysconfig.get_path(scheme_name)
Expand Down
14 changes: 14 additions & 0 deletions tools/ptoas/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,20 @@ add_custom_target(ptoas_runtime_staging ALL
VERBATIM
)

# Editable Python installs resolve the wheel bootstrap from build/python. Keep
# a wheel-shaped runtime overlay there so the same launcher contract works for
# both regular and editable installations.
if(TARGET PTODSLPackage)
add_custom_command(TARGET ptoas_runtime_staging POST_BUILD
COMMAND ${CMAKE_COMMAND} -E remove_directory
"${CMAKE_BINARY_DIR}/python/ptoas/_runtime"
COMMAND ${CMAKE_COMMAND} -E copy_directory
"${PTOAS_BUILD_RUNTIME_STAGING_DIR}"
"${CMAKE_BINARY_DIR}/python/ptoas/_runtime"
VERBATIM
)
endif()

if(TARGET PTODSLPackage)
# The build-tree launcher imports ptoas._runtime_entry from build/python.
# Keep that package staging coupled to every runtime staging entrypoint,
Expand Down
Loading