Skip to content

fix(benchmarks/libero) fix server python path error when using uv - #33

Merged
1 commit merged into
OpenWAM-Official:mainfrom
seveirbian:benchmarks-server-python-path-bug
Sep 17, 2026
Merged

1 commit merged into
OpenWAM-Official:mainfrom
seveirbian:benchmarks-server-python-path-bug

Conversation

@seveirbian

Copy link
Copy Markdown
Contributor

fix server python path bug when using uv or venv.

@wayrise wayrise left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving — this is a correct fix for a real bug, and it hits the setup path the repo itself documents.

run_eval.sh defaults SERVER_PYTHON=python and expands it with command -v, which inside an activated environment yields .venv/bin/python. That is a symlink for both uv venv and the stdlib python3 -m venv .venv shown in the README (symlinks are the POSIX default). .resolve() followed it to the base interpreter, and launching the base interpreter directly means there is no pyvenv.cfg beside it, so CPython never activates the venv and deploy.py starts without the venv's site-packages. .absolute() keeps the symlink path intact, and it also makes this line consistent with libero_python / libero_path right below.

No regressions that I can find: _preflight uses is_file(), which follows symlinks either way; _start_servers inherits the full environment with cwd=REPO_ROOT and sets no PYTHONHOME; and server_python is never written to manifest.json, so resume signatures and existing manifests are unaffected.

Two follow-ups, neither blocking:

  1. benchmarks/libero-plus/scheduler.py:1269 still has the identical args.server_python = args.server_python.expanduser().resolve(). That block is otherwise a copy of the one you changed (the only other difference is the num_trials default), and benchmarks/libero-plus/run_eval.sh carries the same SERVER_PYTHON:-python default, so the same bug is reachable there. It is the only other occurrence in the repo. Worth folding into this PR so the sibling benchmark doesn't silently keep it.

  2. The new line now sits above the comment that explains libero_python:

args.server_python = args.server_python.expanduser().absolute()
# Preserve the public default aliases in logs and manifests instead of
# exposing an implementation-specific physical environment directory.
args.libero_python = args.libero_python.expanduser().absolute()

That comment is about keeping alias paths readable in logs and manifests, which isn't the reason here — server_python never reaches the manifest. Moving the line below the comment and extending it, or adding a short note about venv detection, would stop someone from "cleaning" it back to .resolve() later.

@wayrise

wayrise commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

Thanks for catching this — I've taken the follow-ups off your plate rather than sending you back around for them.

#35 carries your commit unchanged and adds the benchmarks/libero-plus/scheduler.py fix and the comment note on top, so merging it will close this PR with your authorship intact. Nothing needed from you here.

While I was in there I also confirmed the failure mode on Linux: with a stdlib venv, .resolve() rewrites .venv/bin/python to /usr/bin/python3.12, and a module present only in the venv then raises ModuleNotFoundError, while .absolute() keeps sys.prefix pointing at the venv. Your diagnosis was exactly right.

@SCreatorX SCreatorX closed this pull request by merging all changes into OpenWAM-Official:main in 7c5861e Sep 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants