Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion conda_recipes/maya-2027/recipe/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,23 @@ mkdir -p $PREFIX/bin
ln -r -s $PREFIX/$MAYA_ROOT/bin/maya$MAYA_VERSION $PREFIX/bin/maya$MAYA_VERSION
ln -r -s $PREFIX/$MAYA_ROOT/bin/maya$MAYA_VERSION $PREFIX/bin/maya
ln -r -s $PREFIX/$MAYA_ROOT/bin/mayapy.bin $PREFIX/bin/mayapy.bin
ln -r -s $PREFIX/$MAYA_ROOT/bin/mayapy $PREFIX/bin/mayapy
ln -r -s $PREFIX/$MAYA_ROOT/bin/Render $PREFIX/bin/Render

# Expose mayapy through a wrapper script instead of a symlink.
#
# Autodesk's bin/mayapy looks for Maya's libraries in ../lib relative to the directory it
# was invoked from, so exec'ing a symlink in $PREFIX/bin sends the lookup to $PREFIX/lib,
# where mayapy can silently load another package's libpython3.13 (the maya-openjd adaptor
# stack installs one) and crash. Exec'ing the real path keeps the lookup inside the
# 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.

#!/bin/sh
exec "$PREFIX/$MAYA_ROOT/bin/mayapy" "\$@"
EOF
chmod +x $PREFIX/bin/mayapy

# Use thin client licensing configuration to use the ProductInformation.pit from the Arnold installation.
#
# To learn more, see the Autodesk article "Thin Client Licensing for Maya and MotionBuilder"
Expand Down
Loading