Skip to content

Fix build failure on Python 3.14t without --enable-shared#1487

Open
leveretconey wants to merge 1 commit into
meta-pytorch:mainfrom
leveretconey:build
Open

Fix build failure on Python 3.14t without --enable-shared#1487
leveretconey wants to merge 1 commit into
meta-pytorch:mainfrom
leveretconey:build

Conversation

@leveretconey

Copy link
Copy Markdown

Free-threaded Python (3.13t+) uses mimalloc, whose initial-exec TLS is incompatible with shared libraries loaded via dlopen(). When Python is built without --enable-shared (the default), linking ${Python3_LIBRARIES} pulls in the static libpython3.14t.a and triggers a link error.

On Linux/macOS, extension modules don't need to link libpython — symbols resolve from the interpreter at runtime. Only Windows requires it (DLL import library).

This is consistent with how PyTorch handles it in torch/CMakeLists.txt (only links Python libraries on MSVC), and also consistent with pybind_ops in this repo which already avoids linking ${Python3_LIBRARIES}.

@pytorch-bot

pytorch-bot Bot commented Jun 16, 2026

Copy link
Copy Markdown

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/meta-pytorch/torchcodec/1487

Note: Links to docs will display an error until the docs builds have been completed.

⏳ No Failures, 3 Pending

As of commit 01aafaa with merge base 8bbce65 (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Jun 16, 2026
@leveretconey

Copy link
Copy Markdown
Author

rebased latest main because new commits fixed ci failures

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

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant