-
-
Notifications
You must be signed in to change notification settings - Fork 499
python: refactor & update. #6822
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
Conversation
|
Any updates? |
|
This patch is a big change, I'm not sure if it is reliable. @SirLynix And idea? |
| add_configs("builtin_hashlib_hashes", {description = "Builtin hash modules. (md5, sha1, sha2, sha3, blake2)", default = nil, type = "string"}) -- 3.9 | ||
| add_configs("ssl_default_suites", {description = "Override default cipher suites string. (python, openssl)", default = nil, type = "string"}) -- 3.7, 3.10 | ||
| add_configs("lto", {description = "Enable Link-Time-Optimization in any build.", default = nil, values = {true, false, "full", "thin", "no", "yes"}}) | ||
| add_configs("ensurepip", {description = "'install' or 'upgrade' using bundled pip", default = nil, values = {true, false, "upgrade", "install", "no"}}) -- 3.6 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it should be enabled by default to not break retrocompatibility
|
|
||
| on_load("@windows", "@msys", "@cygwin", function (package) | ||
|
|
||
| on_load("windows", "msys", "mingw", "cygwin", function (package) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why changing from host platforms to target platforms?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I understand correctly, using @ actually breaks cross-compilation, and ensurepip is disabled by default for the same reason. Often we may only need to use CPython's API without a full Python environment.
Is there any way to achieve both ends?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't break cross compilation, it makes it target a host architecture. @linux means you target the linux host, even if it builds for Android or for Windows using mingw.
This is because the python package is about having a running python interpreter able to execute python programs such as meson, on the host.
I think we should make a different package for cpython API or anything the program links to
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if use python as cli program. we should use @host , please do not modify it.
Even for cross-compilation, it will always use the python on the host instead of the python of the cross-compilation platform, otherwise python will not run.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see what you mean. But the purpose of cross-compilation is not to "run on the host", but to generate code for other platforms.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should create another package focused on users who only need the CPython API, how about libpython?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cross compile libpython? This will be a big job, as many of its dependent libraries will need to enable cross-compilation support.
If you want to do it, you can add libpython package to do it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm, it does it now at least on windows (precompiled), linux, macosx and bsd. As for android, iphoneos and wasm it is indeed temporarily disabled due to some dependency issues (see line 170).
I will make another pull request later and then close this one.
|
|
||
| on_load("@macosx", "@linux", "@bsd", function (package) | ||
| local version = package:version() | ||
| on_load("macosx", "linux", "bsd", function (package) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same
| on_fetch("fetch") | ||
|
|
||
| on_install("@windows|x86", "@windows|x64", "@msys", "@cygwin", function (package) | ||
| on_install("windows|x86", "windows|x64", "msys", "mingw", "cygwin", function (package) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same
| on_install("@macosx", "@bsd", "@linux", function (package) | ||
| local version = package:version() | ||
| --- android, iphoneos, wasm unsupported: dependencies not resolved. | ||
| on_install("macosx", "linux", "bsd", function (package) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same
ensurepipis enabled.