scikit-build-core icon indicating copy to clipboard operation
scikit-build-core copied to clipboard

Configuration of platform tag

Open mryzhov opened this issue 1 year ago • 4 comments

Hello,

We build project on x86_64 machine for arm64 target and wheel platform tag will be set to x86_64 but we need to set it to aarch64

Is it possible to set manually in the configuration the platform tag (https://packaging.python.org/en/latest/specifications/platform-compatibility-tags/) or use environment variables for that?

Thanks, Mikhail

mryzhov avatar Jan 09 '24 12:01 mryzhov

For some platforms, see https://scikit-build-core.readthedocs.io/en/latest/crosscompile.html. If it's linux, that's tricky, and something we can work on. Biggest issue for linux is that it's really hard to cross-compile C/C++; you are generally stuck with the (really, really old) compilers that matches the age of manylinux, rather than getting the (nearly) latest compilers that the manylinux images provide with the special RHEL patches to build against an old GLIBC. These older compilers have pretty bad support for special architectures, too; NumPy was unable to use them, for example, even though they did all the rest of the work, the old compiler was just buggy on ARM and they required a newer one to avoid the bugs.

henryiii avatar Jan 15 '24 17:01 henryiii

@henryiii thank you for your answer. I did manage to set the platform tag by setting _PYTHON_HOST_PLATFORM=linux_aarch64 and it solved my problem, the wheels were generated with right platform tag (aarch64). So this issue doesn't block us anymore

mryzhov avatar Jan 17 '24 09:01 mryzhov

Eventually I'm hoping that the cross-compiling PEP work (starting with PEP 720) will enable a nicer, more standard interface for this.

henryiii avatar Jan 17 '24 15:01 henryiii

Sorry, mentioned wrong issue. Let us know if anything comes up!

henryiii avatar Jan 19 '24 03:01 henryiii