Skip to content

Commit be85711

Browse files
committed
Repoint packages in expanded prebundles
1 parent ef6ae37 commit be85711

3 files changed

Lines changed: 32 additions & 5 deletions

File tree

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Fixed
2+
^^^^^
3+
4+
* Fixed Docker installs leaving dangling package links in expanded Isaac Sim prebundles.

source/isaaclab/isaaclab/cli/commands/install.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1062,10 +1062,14 @@ def _repoint_prebundle_packages() -> None:
10621062
print_debug("No pip_prebundle directories found under Isaac Sim.")
10631063
return
10641064

1065+
# Extras are expanded as wheel trees nested below pip_prebundle.
1066+
package_roots = prebundle_dirs | {
1067+
path for prebundle_dir in prebundle_dirs for path in prebundle_dir.glob("*[[]*[]]/*") if path.is_dir()
1068+
}
10651069
repointed = 0
1066-
for prebundle_dir in prebundle_dirs:
1070+
for package_root in package_roots:
10671071
for pkg_name in _PREBUNDLE_REPOINT_PACKAGES:
1068-
prebundled = prebundle_dir / pkg_name
1072+
prebundled = package_root / pkg_name
10691073
venv_pkg = site_packages / pkg_name
10701074

10711075
if not venv_pkg.exists():
@@ -1118,9 +1122,9 @@ def _repoint_prebundle_packages() -> None:
11181122
# env package into the prebundle, which is a real directory by design.
11191123
if use_symlinks and (site_packages / "torch").exists():
11201124
shadowing = [
1121-
prebundle_dir / "torch"
1122-
for prebundle_dir in prebundle_dirs
1123-
if (prebundle_dir / "torch").is_dir() and not (prebundle_dir / "torch").is_symlink()
1125+
package_root / "torch"
1126+
for package_root in package_roots
1127+
if (package_root / "torch").is_dir() and not (package_root / "torch").is_symlink()
11241128
]
11251129
if shadowing:
11261130
raise RuntimeError(

source/isaaclab/test/cli/test_install_commands.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -930,6 +930,25 @@ def test_repoints_across_multiple_prebundle_dirs(self, tmp_path):
930930
for pb in (pb1, pb2):
931931
assert (pb / "torch").is_symlink(), f"torch in {pb} should be repointed"
932932

933+
def test_repoints_package_inside_expanded_extra_bundle(self, tmp_path):
934+
"""Expanded extras bundles must not retain file links into a replaced package."""
935+
isaacsim_path, prebundle = self._sim_with_prebundle(tmp_path / "sim", ["newton"])
936+
shared_init = prebundle / "newton" / "legacy" / "__init__.py"
937+
shared_init.parent.mkdir()
938+
shared_init.write_text("")
939+
bundled_newton = prebundle / "newton[sim]" / "newton-wheel" / "newton"
940+
bundled_init = bundled_newton / "legacy" / "__init__.py"
941+
bundled_init.parent.mkdir(parents=True)
942+
bundled_init.symlink_to(shared_init)
943+
site_pkgs = _make_site_packages(tmp_path / "env", ["newton"])
944+
945+
with self._patch(isaacsim_path, site_pkgs, str(tmp_path / "env" / "bin" / "python")):
946+
_repoint_prebundle_packages()
947+
948+
assert (prebundle / "newton").resolve() == (site_pkgs / "newton").resolve()
949+
assert bundled_newton.is_symlink()
950+
assert bundled_newton.resolve() == (site_pkgs / "newton").resolve()
951+
933952
# ---- Windows: copy instead of symlink -----------------------------------
934953

935954
def test_copies_package_on_windows_instead_of_symlinking(self, tmp_path):

0 commit comments

Comments
 (0)