-
Notifications
You must be signed in to change notification settings - Fork 1
Make it work on more platforms #16
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -287,7 +287,7 @@ sed -e 's/[ ]*#.*//' -e '/^[ ]*$/d' | | |
| libs= | ||
| # depends on the headers through cpython-sys | ||
| rule="$objs: cpython-sys \$(srcdir)/Cargo.toml \$(srcdir)/Cargo.lock \$(srcdir)/$srcdir/$manifest $prefixed_srcs \$(PYTHON_HEADERS)" | ||
| rule="$rule; cargo build --lib --locked --package ${mods} --profile \$(CARGO_PROFILE)" | ||
| rule="$rule; CARGO_TARGET_DIR=\$(abs_builddir)/target PYTHON_BUILD_DIR=\$(abs_builddir) cargo build --lib --locked --package ${mods} --profile \$(CARGO_PROFILE) --manifest-path \$(srcdir)/Cargo.toml" | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We need this because some platforms build CPython outside the main source tree |
||
| echo "$rule" >>$rulesf | ||
| for mod in $mods | ||
| do | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,6 +3,7 @@ | |
| from __future__ import annotations | ||
|
|
||
| import _imp | ||
| import os | ||
| import os.path | ||
| import sys | ||
| import sysconfig | ||
|
|
@@ -14,6 +15,7 @@ | |
|
|
||
| SRC_DIR = os.path.dirname(os.path.dirname(os.path.dirname(__file__))) | ||
| STDLIB_PATH = os.path.join(SRC_DIR, 'Lib') | ||
| MODULES_PATH = os.path.join(SRC_DIR, 'Modules') | ||
|
|
||
| IGNORE = { | ||
| '__init__', | ||
|
|
@@ -84,6 +86,19 @@ def list_modules_setup_extensions(names: set[str]) -> None: | |
| names.update(checker.list_module_names(all=True)) | ||
|
|
||
|
|
||
| def list_rust_modules(names: set[str]) -> None: | ||
| if not os.path.isdir(MODULES_PATH): | ||
| return | ||
| for entry in os.scandir(MODULES_PATH): | ||
| if not entry.is_dir(): | ||
| continue | ||
| if entry.name == "cpython-sys": | ||
| continue | ||
| cargo_toml = os.path.join(entry.path, "Cargo.toml") | ||
| if os.path.isfile(cargo_toml): | ||
| names.add(entry.name) | ||
|
Comment on lines
+89
to
+99
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We don’t actually need this in this PR, but we’ll eventually need something like it
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this should be fine! We can always modify it later as needed. |
||
|
|
||
|
|
||
| # List frozen modules of the PyImport_FrozenModules list (Python/frozen.c). | ||
| # Use the "./Programs/_testembed list_frozen" command. | ||
| def list_frozen(names: set[str]) -> None: | ||
|
|
@@ -109,6 +124,7 @@ def list_modules() -> set[str]: | |
|
|
||
| list_builtin_modules(names) | ||
| list_modules_setup_extensions(names) | ||
| list_rust_modules(names) | ||
| list_packages(names) | ||
| list_python_modules(names) | ||
| list_frozen(names) | ||
|
|
||
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.
A temporary work around to make it build for free-threaded build