Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions frida/_frida/extension.c
Original file line number Diff line number Diff line change
Expand Up @@ -6018,6 +6018,10 @@ PyInit__frida (void)

module = PyModule_Create (&PyFrida_moduledef);

#ifdef Py_GIL_DISABLED
PyUnstable_Module_SetGIL (module, Py_MOD_GIL_NOT_USED);
#endif

PyModule_AddStringConstant (module, "__version__", frida_version_string ());

PYFRIDA_REGISTER_TYPE (GObject, G_TYPE_OBJECT);
Expand Down
2 changes: 1 addition & 1 deletion frida/_frida/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ elif host_os_family != 'windows'
endif

extension = python.extension_module('_frida', 'extension.c',
limited_api: '3.7',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like a regression, unless I'm missing something?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that you ask, maybe that is no longer needed?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason we have it is so we can build a single binary (per OS/ABI combo) that works on older Python runtimes even when the build machine has a newer Python; without accidentally regressing on the range of versions supported.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason we have it is so we can build a single binary (per OS/ABI combo) that works on older Python runtimes even when the build machine has a newer Python; without accidentally regressing on the range of versions supported.

Just to be sure, can you run workflows on your side to catch whatever regression that may arise from this PR?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's no point; I went through some pain to transition frida-python to the limited API, because it solved some long-standing issues. Nothing changed there. We cannot drop this.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair enough: https://peps.python.org/pep-0803/ means that free-threaded wheels will have stable ABI starting in 3.15...

limited_api: '3.7'
c_args: frida_component_cflags,
link_args: extra_link_args,
dependencies: [python_dep, frida_core_dep, os_deps],
Expand Down
2 changes: 0 additions & 2 deletions setup.cfg

This file was deleted.

6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import shutil
import subprocess
import sys
import sysconfig
from pathlib import Path
from typing import Iterator

Expand All @@ -13,7 +14,6 @@
SOURCE_ROOT = Path(__file__).resolve().parent
FRIDA_EXTENSION = os.environ.get("FRIDA_EXTENSION", None)


def main():
setup(
name="frida",
Expand All @@ -24,7 +24,7 @@ def main():
author="Frida Developers",
author_email="oleavr@frida.re",
url="https://frida.re",
install_requires=["typing_extensions; python_version<'3.11'"],
install_requires=["typing_extensions"],
python_requires=">=3.7",
license="wxWindows Library Licence, Version 3.1",
keywords="frida debugger dynamic instrumentation inject javascript windows macos linux ios iphone ipad android qnx",
Expand Down Expand Up @@ -56,7 +56,7 @@ def main():
Extension(
name="frida._frida",
sources=["frida/_frida/extension.c"],
py_limited_api=True,
py_limited_api=not(bool(sysconfig.get_config_var("Py_GIL_DISABLED"))),
)
],
cmdclass={"build_ext": FridaPrebuiltExt if FRIDA_EXTENSION is not None else FridaDemandBuiltExt},
Expand Down