Skip to content
Merged
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
9 changes: 9 additions & 0 deletions .github/workflows/jit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ jobs:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Install dependencies
run: |
sudo ./.github/workflows/posix-deps-apt.sh
- name: Build tier two interpreter
run: |
./configure --enable-experimental-jit=interpreter --with-pydebug
Expand Down Expand Up @@ -152,6 +155,9 @@ jobs:
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: '3.11'
- name: Install dependencies
run: |
sudo ./.github/workflows/posix-deps-apt.sh
- name: Build
run: |
sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" ./llvm.sh ${{ env.LLVM_VERSION }}
Expand Down Expand Up @@ -188,6 +194,9 @@ jobs:
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: '3.11'
- name: Install dependencies
run: |
sudo ./.github/workflows/posix-deps-apt.sh
- name: Build
run: |
sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" ./llvm.sh ${{ env.LLVM_VERSION }}
Expand Down
27 changes: 26 additions & 1 deletion Doc/whatsnew/3.15.rst
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ Summary -- Release highlights
<whatsnew315-unpacking-in-comprehensions>`
* :pep:`686`: :ref:`Python now uses UTF-8 as the default encoding
<whatsnew315-utf8-default>`
* :pep:`829`: :ref:`Package startup configuration files <whatsnew315-startup-files>`
* :pep:`728`: :ref:`TypedDict with typed extra items <whatsnew315-typeddict>`
* :pep:`747`: :ref:`Annotating type forms with TypeForm
<whatsnew315-typeform>`
Expand All @@ -94,7 +95,6 @@ Summary -- Release highlights
* :ref:`Improved error messages <whatsnew315-improved-error-messages>`
* :ref:`The official Windows 64-bit binaries now use the tail-calling interpreter
<whatsnew315-windows-tail-calling-interpreter>`
* :pep:`829`: Package Startup Configuration Files

New features
============
Expand Down Expand Up @@ -452,6 +452,31 @@ agen() for x in a)``.

(Contributed by Adam Hartz in :gh:`143055`.)

.. _whatsnew315-startup-files:

:pep:`829`: Package startup configuration files
-----------------------------------------------

Loaded by the :mod:`site` module when ``-S`` is not given, :ref:`.pth files <site-pth-files>`
can contain lines that both extend :data:`sys.path` and execute arbitrary code
when the line starts with ``import`` (followed by a space or tab). The latter
functionality can be problematic, since it is difficult to know exactly what
gets executed when Python starts up.

As a step towards improving the ability to audit pre-start executable code,
Python 3.15 introduces :ref:`.start files <site-start-files>` which contain entry point
specifications of the form ``pkg.mod:callable`` where ``pkg.mod`` is the
import path to the given callable. When Python starts up, the callable is
located and called with no arguments.

``import`` lines in :file:`.pth` files are silently deprecated. When a
matching :file:`.start` file is found, ``import`` lines in :file:`.pth` files
are ignored. There is no change to :data:`sys.path` extension lines in
:file:`.pth` files.

(Contributed by Barry Warsaw in :gh:`148641`.)


.. _whatsnew315-abi3t:

:pep:`803` -- Stable ABI for Free-Threaded Builds
Expand Down
17 changes: 13 additions & 4 deletions Lib/test/test_gdb/test_jit.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,18 @@
import sys
import unittest

from test.support import import_helper

from .util import setup_module, DebuggerTests


_testinternalcapi = import_helper.import_module("_testinternalcapi")
NATIVE_JIT_ENABLED = (
hasattr(sys, "_jit")
and sys._jit.is_enabled()
and _testinternalcapi.get_jit_backend() == "jit"
)

JIT_SAMPLE_SCRIPT = os.path.join(os.path.dirname(__file__), "gdb_jit_sample.py")
# In batch GDB, break in builtin_id() while it is running under JIT,
# then repeatedly "finish" until the selected frame is the JIT executor.
Expand Down Expand Up @@ -62,14 +71,14 @@ def setUpModule():
# Python/jit_unwind.c, and the synthetic EH-frame is only implemented for
# x86_64 and AArch64 (a #error fires otherwise). Skip cleanly on other
# platforms or architectures instead of producing timeouts / empty backtraces.
# is_enabled() implies is_available() and also implies that the runtime has
# JIT execution active; interpreter-only tier 2 builds don't hit this path.
# sys._jit.is_enabled() is true for --enable-experimental-jit=interpreter,
# but these tests need native JIT code and a py::jit:executor frame.
@unittest.skipUnless(sys.platform == "linux",
"GDB JIT interface is only implemented for Linux + ELF")
@unittest.skipUnless(platform.machine() in ("x86_64", "aarch64"),
"GDB JIT CFI emitter only supports x86_64 and AArch64")
@unittest.skipUnless(hasattr(sys, "_jit") and sys._jit.is_enabled(),
"requires a JIT-enabled build with JIT execution active")
@unittest.skipUnless(NATIVE_JIT_ENABLED,
"requires native JIT execution active")
class JitBacktraceTests(DebuggerTests):
def get_stack_trace(self, **kwargs):
# These tests validate the JIT-relevant part of the backtrace via
Expand Down
Loading