Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: not cross-compiling when musl from gnu #1267

Merged
merged 1 commit into from
Nov 12, 2020

Conversation

davidhewitt
Copy link
Member

Fixes #1264

This patch allows compiling for musl on linux (and possibly a few other cases, I tried to write a general patch which was reasonable).

I think as long as the extension module is statically linked against libc (e.g. such as in the musl case) then there is no issue loading such an extension module. I was able to test locally that building a musl extension module worked fine.

@davidhewitt davidhewitt force-pushed the build-for-musl branch 2 times, most recently from aae6837 to cfa586c Compare November 10, 2020 08:37
@kngwyu
Copy link
Member

kngwyu commented Nov 10, 2020

So we cannot use PYO3_CROSS_LIB_DIR in this setting?
I'm not familiar with cross-compiling, but isn't this hurt some generality?
E.g., we use PY_MAJOR_VERSION and Py_ENABLE_SHARED from PYO3_CROSS_LIB_DIR.

@davidhewitt
Copy link
Member Author

We don't need PYO3_CROSS_LIB_DIR in this setting at all - we can use the normal PYO3_PYTHON (or PATH) in this case and extract the build configuration using get_config_from_interpreter.

The extension module statically linked with musl libc can be run with the normal system python - so it's not really a cross-compile. Just linking against a different libc.

@kngwyu
Copy link
Member

kngwyu commented Nov 10, 2020

Ah, that makes sense, thanks.

@davidhewitt davidhewitt merged commit fb02a58 into PyO3:master Nov 12, 2020
@davidhewitt davidhewitt deleted the build-for-musl branch August 10, 2021 07:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Building with maturin in manylinux fails because of missing PYO3_CROSS_LIB_DIR
2 participants