fix(maya-2027): make mayapy load Maya's own libpython - #280
Conversation
Signed-off-by: Andrew Fenton <afento@amazon.com>
cd25f42 to
710f7f6
Compare
| # installation. | ||
| # | ||
| # Do not revert to a symlink. bin/maya and bin/Render resolve symlinks themselves. | ||
| cat > $PREFIX/bin/mayapy <<EOF |
There was a problem hiding this comment.
The same latent crash exists in maya-2026, which still creates the plain symlink (conda_recipes/maya-2026/recipe/build.sh:67: ln -r -s $PREFIX/$MAYA_ROOT/bin/mayapy $PREFIX/bin/mayapy). If the failure mode described here is real — Autodesk’s bin/mayapy resolving ../lib from the invocation directory and picking up maya-openjd’s libpython3.13 out of $PREFIX/lib — then any queue environment that combines maya-2026 with the adaptor stack hits it too, and the symptom (silent crash) is hard to attribute.
Note that maya-2025 is not affected for a different reason: it has no $PREFIX/bin/mayapy at all and instead prepends $MAYA_LOCATION/bin to PATH in its activate.d script, so mayapy is always invoked from its real directory.
Worth either applying this wrapper to maya-2026 as well, or confirming it is unaffected.
What was the problem/requirement? (What/Why)
mayapyfrom themaya-2027package segfaults when the conda environment also contains another Python 3.13 which any job using themaya-openjdadaptor does, since it pulls in conda-forgepython. Inturntable_with_maya_arnold,PrepareSceneFiledied with exit code-11i.e.SIGSEGV.Autodesk's
bin/mayapyis a launcher script that setsLD_LIBRARY_PATHto../librelative to the directory it was invoked from, without resolving symlinks. Reached through the symlink this recipe created at$PREFIX/bin/mayapy, it pointed at$PREFIX/libinstead of Maya's ownlib, so Maya loaded conda'slibpython3.13.so.1.0and its stdlib extensions bound to a foreign CPython build. Maya 2026 bundles Python 3.11, so the sonames never collided there.What was the solution? (How)
Replace the symlink with a wrapper that
execs Maya's realbin/mayapy, keeping the launcher's library lookup inside the Maya installation.bin/mayaandbin/Renderresolve symlinks themselves and are unchanged.What is the impact of this change?
Adaptor-based Maya 2027 jobs now run.
$PREFIX/bin/mayapybecomes a script rather than a symlink, at the cost of one extraexec. No RPATHs, activation scripts, or other packages change, and conda's Python is still used by the adaptor daemon in its own process.How was this change tested?
Rebuilt
maya-2027and re-ranturntable_with_maya_arnoldwithmaya=2027 maya-mtoa=2027 maya-openjd=0.15.13 ffmpeg; the step that previously segfaulted now completes.Was this change documented?
A comment above the wrapper in
build.shrecords whymayapyisn't a symlink.