Repository navigation
Fixes M1 3.0 GA Issues - #5343
Conversation
22e54cd to
e14e0f8
Compare
e14e0f8 to
44cb989
Compare
Greptile SummaryThis PR fixes several M1 3.0 GA issues: it rewrites the Windows/Linux launcher scripts to auto-source
Confidence Score: 4/5Safe to merge after revisiting the The core bug fixes are correct and well-scoped. One P1 finding exists in
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["isaaclab.bat / isaaclab.sh"] --> B{VIRTUAL_ENV set?}
B -- yes --> E[use venv python]
B -- no --> C{CONDA_PREFIX set?}
C -- yes --> F[use conda python]
C -- no --> D{_isaac_sim symlink present?}
D -- yes --> G["source setup_conda_env.*\nuse _isaac_sim/python.*"]
D -- no --> H[fallback: system python]
E & F & G & H --> I["python -c 'from isaaclab.cli import cli; cli()'"]
I --> J{needs_kit?}
J -- yes --> K{omni.kit importable?}
K -- yes --> L[AppLauncher.launch]
K -- no --> M["_escape_for_cmd_exe\n(wrap .bat in cmd.exe /c)\n+ detailed error hint"]
J -- no --> N[kitless: Newton/OvPhysX path]
Reviews (1): Last reviewed commit: "Source _isaac_sim env from launchers and..." | Re-trigger Greptile |
| **/.ruff_cache/ | ||
|
|
||
| # Dev-time files, generated stuff | ||
| **/__* |
There was a problem hiding this comment.
Overly broad pattern silently ignores new
__init__.py files
The pattern **/__* matches any untracked file or directory starting with __ at any depth, which includes __init__.py, __main__.py, __all__, etc. Any new Python package added after this commit whose __init__.py hasn't been staged yet will be silently git-ignored, causing mysterious import failures that are hard to diagnose.
Consider scoping this more narrowly to only the generated/dev-time files you intend to ignore:
| **/__* | |
| **/__autosummary__/ | |
| **/__generated__/ |
Or, if the intent is to catch auto-generated init files specifically, use **/__pycache__/ (already present) and a more targeted pattern like **/__*__/ for double-underscore-wrapped directories only.
| @@ -167,8 +164,7 @@ def _escape_for_cmd_exe(cmd: list[str] | tuple[str, ...]) -> str | list[str]: | |||
| else: | |||
| parts.append(s) | |||
There was a problem hiding this comment.
Arguments containing embedded double-quotes produce malformed quoting
When an argument contains a double-quote character and one of the _CMD_METACHARACTERS (or a space/tab), the wrapping f'"{s}"' produces a broken quoted string. For example, the argument foo"<bar becomes "foo"<bar", which cmd.exe /c would misparse: the quote closes after foo, leaving <bar" unquoted and the < again acting as a redirect.
In practice, pip version-specifiers never embed double quotes, so this is unlikely to trigger today. But the escaper should handle this robustly. The standard cmd.exe escaping for an embedded double-quote inside a "-delimited field is to double it (""):
if any(c in s for c in _CMD_METACHARACTERS) or " " in s or "\t" in s:
parts.append('"' + s.replace('"', '""') + '"')
else:
parts.append(s)| export PYTHONPATH="$ISAACLAB_PATH/source/isaaclab:$PYTHONPATH" | ||
|
|
||
| # If a local Isaac Sim binary is present, source its env setup so that | ||
| # PYTHONPATH/PATH/EXP_PATH are correct without depending on a conda | ||
| # activate.d hook (those don't fire reliably under e.g. `conda run`). | ||
| if [ -f "$ISAACLAB_PATH/_isaac_sim/setup_conda_env.sh" ]; then | ||
| # shellcheck disable=SC1091 | ||
| . "$ISAACLAB_PATH/_isaac_sim/setup_conda_env.sh" >/dev/null 2>&1 || true | ||
| fi |
There was a problem hiding this comment.
setup_conda_env.sh may overwrite the already-set PYTHONPATH
PYTHONPATH is exported on line 29 so source/isaaclab is importable. Then setup_conda_env.sh is sourced on lines 34-37. If that script does export PYTHONPATH=... (unconditional assignment rather than prepend), the source/isaaclab entry is silently dropped and the subsequent from isaaclab.cli import cli call fails.
The typical pattern is to source first and then prepend:
| export PYTHONPATH="$ISAACLAB_PATH/source/isaaclab:$PYTHONPATH" | |
| # If a local Isaac Sim binary is present, source its env setup so that | |
| # PYTHONPATH/PATH/EXP_PATH are correct without depending on a conda | |
| # activate.d hook (those don't fire reliably under e.g. `conda run`). | |
| if [ -f "$ISAACLAB_PATH/_isaac_sim/setup_conda_env.sh" ]; then | |
| # shellcheck disable=SC1091 | |
| . "$ISAACLAB_PATH/_isaac_sim/setup_conda_env.sh" >/dev/null 2>&1 || true | |
| fi | |
| # If a local Isaac Sim binary is present, source its env setup so that | |
| # PYTHONPATH/PATH/EXP_PATH are correct without depending on a conda | |
| # activate.d hook (those don't fire reliably under e.g. `conda run`). | |
| if [ -f "$ISAACLAB_PATH/_isaac_sim/setup_conda_env.sh" ]; then | |
| # shellcheck disable=SC1091 | |
| . "$ISAACLAB_PATH/_isaac_sim/setup_conda_env.sh" >/dev/null 2>&1 || true | |
| fi | |
| # Add source/isaaclab to PYTHONPATH so we can import isaaclab.cli. | |
| # Done after sourcing setup_conda_env.sh so our entry is not overwritten. | |
| export PYTHONPATH="$ISAACLAB_PATH/source/isaaclab:$PYTHONPATH" |
There was a problem hiding this comment.
🤖 Isaac Lab Review Bot
Summary
This PR fixes Windows .bat invocation issues with cmd.exe metacharacters, adds pre-release tag support to the docs version selector, and improves error messaging when Isaac Sim is not detected. The implementation is straightforward and addresses the documented NVBug issues correctly.
Architecture Impact
No cross-module impact — changes are self-contained:
_escape_for_cmd_exe()change affects only Windows .bat/.cmd invocations viarun_command()- Launcher scripts (
isaaclab.sh/isaaclab.bat) changes are entry-point additions that source existing Isaac Sim env setup scripts sim_launcher.pyadds user-facing diagnostic output only- Regex changes in docs version whitelist are isolated to sphinx-multiversion configuration
Implementation Verdict
Ship it — Clean implementation, no issues found. The changes are minimal, targeted, and address specific bugs without introducing regressions.
Test Coverage
This PR fixes infrastructure/tooling issues (Windows shell escaping, env sourcing, docs config) that are inherently difficult to unit test:
- Windows metacharacter fix: Would require Windows CI environment to test properly. The fix is a well-understood pattern (
cmd.exe /c "...") for handling this class of issues. - Env sourcing in launchers: These are setup scripts that run before tests execute — they bootstrap the test environment itself.
- Docs regex change: Validated by visual inspection; CI docs build passes.
- Improved error hint: Informational output only; no behavioral change to test.
Given the nature of these fixes (tooling, platform-specific edge cases, diagnostics), the lack of new unit tests is acceptable. The pre-commit checks pass, and the existing test suite exercises the core functionality.
CI Status
4 failing jobs, but failures are unrelated to this PR:
isaaclab_tasks [1/3],[2/3]:ValueError: Unable to compare versions for packaging>=20.0: need=20.0 found=None— apackaginglibrary metadata issue in existing Cartpole-RGB-TheiaTiny tests, not caused by these changes.environments_training: Same underlying issue.test-skillgen: Separate test infrastructure issue.
All failures occur in existing tests that do not touch the modified files. The failing tests also fail on develop.
Findings
No issues to flag. The implementation is correct:
-
_escape_for_cmd_exereturn type change: The function signature changed fromstr | list[str]tolist[str], now returning["cmd.exe", "/c", " ".join(parts)]for .bat/.cmd files. This is correct —subprocess.run()handles both list and string commands, and wrapping incmd.exe /cis the canonical way to prevent metacharacter interpretation on Windows. -
Launcher env sourcing: Adding
source setup_conda_env.sh/call setup_conda_env.batbefore CLI execution correctly handles theconda runedge case where activate.d hooks do not fire. The|| true/>NULensures the launcher does not fail if the script is absent or errors. -
Docs regex update:
(-[A-Za-z0-9.]+)?$correctly matches optional pre-release suffixes like-beta,-rc1,-alpha.1. The regex is anchored and non-greedy as expected. -
Improved Isaac Sim error hint: The
extra_hintlogic correctly detects when_isaac_simexists butomni.kitis not importable, providing actionable guidance for Win11/conda users.
# Description Fixes 3.0 GA M1 issues. Code changes in this PR fix: - NVBug 5985028 (also fixes 5984996) - Win11 isaaclab.bat install + Sim-binary detection on conda. - NVBug 5992915 - docs version selector now picks up pre-release tags like v3.0.0-beta. Triaged separately (no code changes needed in this PR): - NVBug 5974917 - hf-xet pip metadata error: fixed via PR#4992 plus Artifactory cache purge. - NVBug 5994306 - Docker image not found: already fixed in PR#5189 (ISAACSIM_VERSION=6.0.0-dev2). - NVBug 5974684 - pip [newton] warp-lang conflict: already aligned (warp-lang==1.12.0 in tools/wheel_builder/res/python_packages.toml). Needs next-rc-wheel re-verify. - NVBug 5983721 - pip pillow conflict: already aligned (pillow==12.1.1 in tools/wheel_builder/res/python_packages.toml). Needs next-rc-wheel re-verify. - NVBug 5983082 - duplicate of 5979273 (Isaac Sim sensors.rtx Windows DLL chain). - NVBug 5627823 - VDR docs feedback: item 1 already fixed on develop via -u/--uv; remaining items split into follow-ups. This should complete M1 issues. ## Type of change - Bug fix (non-breaking change which fixes an issue) ## Checklist - [x] I have read and understood the contribution guidelines - [x] I have run the pre-commit checks with ./isaaclab.sh --format - [ ] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] I have updated the changelog and the corresponding version in the extension's config/extension.toml file - [x] I have added my name to the CONTRIBUTORS.md or my name already exists there
When isaaclab.bat is invoked via `conda run`, the activate.d hooks that source setup_conda_env.bat are not fired on Windows. PR isaac-sim#5343 added a direct `call` to setup_conda_env.bat from isaaclab.bat, but this silently fails when setup_conda_env.bat uses setlocal/endlocal internally, discarding its own env changes before returning. Additionally, batch-level env changes cannot satisfy the Python 3.8+ DLL loading requirement: os.add_dll_directory() must be called from within the Python process itself, not just via PATH. Fix on two levels: 1. isaaclab.bat: add belt-and-suspenders `for /f cmd /c "call && set"` approach alongside the existing direct `call`. A fresh cmd subprocess captures the resulting env vars and applies them to the parent session even when setup_conda_env.bat uses setlocal. 2. sim_launcher.py: add _try_setup_isaacsim_env_windows() helper that fires when omni.kit is not found on Windows with a local _isaac_sim present. Applies setup_conda_env.bat env changes (PYTHONPATH, PATH, os.add_dll_directory) directly inside the running Python process. Entirely wrapped in try/except -- zero impact on working setups, Linux, or pip-installed Isaac Sim. Addresses NVBug 5984996.
…5980) ## Summary - Removes the `**/__*` rule from `.gitignore` (introduced in #5343), which matched every untracked path component starting with `__` at any depth — silently ignoring all new `__init__.py` / `__init__.pyi` files. - Any Python package added after #5343 had its init files dropped from `git add`, causing import failures on a clean checkout that are hard to trace back to `.gitignore`. On the current `develop` working tree this already hides **199** untracked `__init__.py` / `__init__.pyi` files under newly added `isaaclab_tasks` subpackages. - No loss of coverage: the pattern's only concrete target, `__pycache__/`, is already handled by the pre-existing `**/__pycache__/` rule (line 20). ## 1. Problem The `# Dev-time files, generated stuff` block added `**/__*` as a catch-all. Git applies `.gitignore` to untracked files, so while already-tracked init files are unaffected, every *new* package's `__init__.py` is silently ignored: ``` $ git check-ignore -v source/isaaclab_tasks/isaaclab_tasks/core/__init__.py .gitignore:84:**/__* source/isaaclab_tasks/isaaclab_tasks/core/__init__.py ``` This produces "module not found" failures after a clean checkout that give no hint they originate from `.gitignore`. ## 2. Fix Remove the `**/__*` line and its comment. The block's only real target was `__pycache__/`, which `**/__pycache__/` already covers. ```diff # Ruff cache **/.ruff_cache/ -# Dev-time files, generated stuff -**/__* - # Isaac Lab CI environments in native mode **/_isaaclab_install_ci_* ``` ## 3. Verification ``` # new package init files are tracked again: $ git check-ignore -v source/isaaclab_tasks/isaaclab_tasks/core/__init__.py (no output — not ignored) # __pycache__ is still ignored via the existing rule: $ git check-ignore -v foo/__pycache__/bar.pyc .gitignore:20:**/__pycache__/ foo/__pycache__/bar.pyc ``` Dev-infra/tooling change with no user-facing effect, so no changelog fragment is added (the changelog gate only requires fragments for managed packages touched under `source/`).
Description
Fixes 3.0 GA M1 issues.
Code changes in this PR fix:
Triaged separately (no code changes needed in this PR):
This should complete M1 issues.
Type of change
Checklist