Description
What happened?
Issue Description
When attempting to leverage the aspect_rules_py
ruleset in our repo, we found that some third party dependencies in the NVIDIA isaacsim/isaaclab/omni ecosystem break on transitive imports. I have created a minimal repro to demonstrate the exact failure here: https://github.com/kwlzn/bazel_plus_isaaclab
when either the py_binary
or py_test
rules in this repo are invoked, we see a transitive import failure on the carb
package during a from isaaclab.app import AppLauncher
:
$ bazel run //:isaaclab_bin
INFO: Analyzed target //:isaaclab_bin (255 packages loaded, 75746 targets configured).
...
INFO: Running command line: bazel-bin/isaaclab_bin
⚠ Conflicting symlinks found when attempting to create venv. More than one package provides the file at these paths
╭─[1:174]
1 │ /home/kwilson/.cache/bazel/_bazel_kwilson/a4b81d9365baf8af8de81d0c7c631c5e/execroot/_main/bazel-out/k8-fastbuild/bin/isaaclab_bin.runfiles/.isaaclab_bin.venv/lib/python3.10/site-packages/isaacsim/__init__.py
· ─────────────────┬────────────────
· ╰── Existing file in virtual environment
2 │ /home/kwilson/.cache/bazel/_bazel_kwilson/a4b81d9365baf8af8de81d0c7c631c5e/execroot/_main/bazel-out/k8-fastbuild/bin/isaaclab_bin.runfiles/rules_python~~pip~pypi_isaac_310_isaacsim_app/site-packages/isaacsim/__init__.py
· ─────────────────┬────────────────
· ╰── Next file to link
╰────
help: Set `package_collisions = "ignore"` on the binary or test rule to ignore this warning
Traceback (most recent call last):
File "/home/kwilson/.cache/bazel/_bazel_kwilson/a4b81d9365baf8af8de81d0c7c631c5e/execroot/_main/bazel-out/k8-fastbuild/bin/isaaclab_bin.runfiles/_main/isaaclab.py", line 3, in <module>
from isaaclab.app import AppLauncher
File "/home/kwilson/.cache/bazel/_bazel_kwilson/a4b81d9365baf8af8de81d0c7c631c5e/execroot/_main/bazel-out/k8-fastbuild/bin/isaaclab_bin.runfiles/.isaaclab_bin.venv/lib/python3.10/site-packages/isaaclab/__init__.py", line 49, in <module>
bootstrap_kernel()
File "/home/kwilson/.cache/bazel/_bazel_kwilson/a4b81d9365baf8af8de81d0c7c631c5e/execroot/_main/bazel-out/k8-fastbuild/bin/isaaclab_bin.runfiles/.isaaclab_bin.venv/lib/python3.10/site-packages/isaaclab/__init__.py", line 22, in bootstrap_kernel
import carb
ModuleNotFoundError: No module named 'carb'
carb
is definitely included in the venv contents, but does not appear to be properly setup for imports:
$ ls bazel-bin/isaaclab_bin.runfiles/.isaaclab_bin.venv/lib/python3.10/site-packages/omni/kernel/py/carb
audio dictionary __init__.py profiler windowing.cpython-310-x86_64-linux-gnu.so
_carb.cpython-310-x86_64-linux-gnu.so eventdispatcher input.cpython-310-x86_64-linux-gnu.so settings windowing.pyi
_carb.pyi events input.pyi tokens
datasource imgui.py l10n.cpython-310-x86_64-linux-gnu.so variant
$ source bazel-bin/isaaclab_bin.runfiles/.isaaclab_bin.venv/bin/activate
(.isaaclab_bin.venv)
$ python3
Python 3.10.16 (main, Dec 6 2024, 19:59:16) [Clang 18.1.8 ] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from isaaclab.app import AppLauncher
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/kwilson/.cache/bazel/_bazel_kwilson/a4b81d9365baf8af8de81d0c7c631c5e/execroot/_main/bazel-out/k8-fastbuild/bin/isaaclab_bin.runfiles/.isaaclab_bin.venv/lib/python3.10/site-packages/isaaclab/__init__.py", line 49, in <module>
bootstrap_kernel()
File "/home/kwilson/.cache/bazel/_bazel_kwilson/a4b81d9365baf8af8de81d0c7c631c5e/execroot/_main/bazel-out/k8-fastbuild/bin/isaaclab_bin.runfiles/.isaaclab_bin.venv/lib/python3.10/site-packages/isaaclab/__init__.py", line 22, in bootstrap_kernel
import carb
ModuleNotFoundError: No module named 'carb'
>>>
Expected Result
the from isaaclab.app import AppLauncher
import should be able to import all of it's transitive deps, as demonstrated in this uv
-based reproduction:
$ OMNI_KIT_ACCEPT_EULA=YES \
uv run \
--with=torch==2.5.1+cu121 \
--extra-index-url=https://download.pytorch.org/whl/cu121 \
--with="isaacsim[rl,extscache]==4.5.0" \
--with "isaaclab[isaacsim,all]==2.0.2" \
--extra-index-url https://pypi.nvidia.com \
--python=python3.10 \
python3
Python 3.10.16 (main, Feb 12 2025, 14:50:02) [Clang 19.1.6 ] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from isaaclab.app import AppLauncher
>>> import carb
>>> carb.__file__
'/home/kwilson/.cache/uv/archive-v0/2t2CSki83eVP_Ola6IgSA/lib/python3.10/site-packages/omni/kernel/py/carb/__init__.py'
Version
Development (host) and target OS/architectures: Ubuntu 24.x
Output of bazel --version
: 7.6.0
Version of the Aspect rules, or other relevant rules from your
WORKSPACE
or MODULE.bazel
file: 1.3.2 (latest)
Language(s) and/or frameworks involved: python 3.10
How to reproduce
git clone https://github.com/kwlzn/bazel_plus_isaaclab
cd bazel_plus_isaaclab
bazel run //:isaaclab_bin
Any other information?
No response