make monarch build compatible for both conda and uv #1822
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary:
The Problem
Basically currently the monarch wheel cannot be installed by
uv:Root Cause
The root cause is
.sofilesuvinstalls Python in a different location (~/.local/share/uv/python/...), and therefore the baked-in paths don't exist in uv environmentsProper Fix
There are workaround for
uvinstallation, e.g. setLD_LIBRARY_PATHto point touv's Python library directory, but I think we should do a proper fix to the monarch build since ChatGPT said "Best practice is not to link extensions against libpython on Unix; the loader resolves Python symbols from the running interpreter. PyO3’s extension-module feature exists to avoid linking to libpython altogether. Manylinux guidance and PyO3 docs echo this." https://github.com/pypa/manylinux/issues/69?utm_source=chatgpt.comThis diff is an attempt to use
extension-modulefeature and roughly does two thingsrpathfromsetup.pyAppendix
Workaround by setting
LD_LIBRARY_PATHDifferential Revision: D86537232