Skip to content

fix(maya-2027): make mayapy load Maya's own libpython - #280

Open
andrew-fenton wants to merge 1 commit into
aws-deadline:mainlinefrom
andrew-fenton:fix/maya-2027
Open

fix(maya-2027): make mayapy load Maya's own libpython#280
andrew-fenton wants to merge 1 commit into
aws-deadline:mainlinefrom
andrew-fenton:fix/maya-2027

Conversation

@andrew-fenton

Copy link
Copy Markdown
Contributor

What was the problem/requirement? (What/Why)

mayapy from the maya-2027 package segfaults when the conda environment also contains another Python 3.13 which any job using the maya-openjd adaptor does, since it pulls in conda-forge python. In turntable_with_maya_arnold, PrepareSceneFile died with exit code -11 i.e.SIGSEGV.

Autodesk's bin/mayapy is a launcher script that sets LD_LIBRARY_PATH to ../lib relative 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/lib instead of Maya's own lib, so Maya loaded conda's libpython3.13.so.1.0 and 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 real bin/mayapy, keeping the launcher's library lookup inside the Maya installation. bin/maya and bin/Render resolve symlinks themselves and are unchanged.

What is the impact of this change?

Adaptor-based Maya 2027 jobs now run. $PREFIX/bin/mayapy becomes a script rather than a symlink, at the cost of one extra exec. 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-2027 and re-ran turntable_with_maya_arnold with maya=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.sh records why mayapy isn't a symlink.

Signed-off-by: Andrew Fenton <afento@amazon.com>
@github-actions github-actions Bot added the waiting-on-maintainers Waiting on the maintainers to review. label Aug 13, 2026
@andrew-fenton
andrew-fenton marked this pull request as ready for review August 13, 2026 01:03
@andrew-fenton
andrew-fenton requested a review from a team as a code owner August 13, 2026 01:03
# installation.
#
# Do not revert to a symlink. bin/maya and bin/Render resolve symlinks themselves.
cat > $PREFIX/bin/mayapy <<EOF

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

waiting-on-maintainers Waiting on the maintainers to review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant