Skip to content

Commit

Permalink
Merge branch 'main' into fix/ubsan/socket-111178
Browse files Browse the repository at this point in the history
  • Loading branch information
picnixz authored Jan 18, 2025
2 parents 4675afd + d5e9aa6 commit 54665bf
Show file tree
Hide file tree
Showing 242 changed files with 5,488 additions and 2,443 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -231,10 +231,14 @@ jobs:
name: >-
Ubuntu
${{ fromJSON(matrix.free-threading) && '(free-threading)' || '' }}
${{ fromJSON(matrix.bolt) && '(bolt)' || '' }}
needs: check_source
if: needs.check_source.outputs.run_tests == 'true'
strategy:
matrix:
bolt:
- false
- true
free-threading:
- false
- true
Expand All @@ -246,9 +250,16 @@ jobs:
exclude:
- os: ubuntu-24.04-aarch64
is-fork: true
# Do not test BOLT with free-threading, to conserve resources
- bolt: true
free-threading: true
# BOLT currently crashes during instrumentation on aarch64
- os: ubuntu-24.04-aarch64
bolt: true
uses: ./.github/workflows/reusable-ubuntu.yml
with:
config_hash: ${{ needs.check_source.outputs.config_hash }}
bolt-optimizations: ${{ matrix.bolt }}
free-threading: ${{ matrix.free-threading }}
os: ${{ matrix.os }}

Expand Down
15 changes: 15 additions & 0 deletions .github/workflows/reusable-ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ on:
config_hash:
required: true
type: string
bolt-optimizations:
description: Whether to enable BOLT optimizations
required: false
type: boolean
default: false
free-threading:
description: Whether to use free-threaded mode
required: false
Expand Down Expand Up @@ -34,6 +39,12 @@ jobs:
run: echo "::add-matcher::.github/problem-matchers/gcc.json"
- name: Install dependencies
run: sudo ./.github/workflows/posix-deps-apt.sh
- name: Install Clang and BOLT
if: ${{ fromJSON(inputs.bolt-optimizations) }}
run: |
sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" ./llvm.sh 19
sudo apt-get install bolt-19
echo PATH="$(llvm-config-19 --bindir):$PATH" >> $GITHUB_ENV
- name: Configure OpenSSL env vars
run: |
echo "MULTISSL_DIR=${GITHUB_WORKSPACE}/multissl" >> "$GITHUB_ENV"
Expand Down Expand Up @@ -73,14 +84,18 @@ jobs:
key: ${{ github.job }}-${{ runner.os }}-${{ env.IMAGE_VERSION }}-${{ inputs.config_hash }}
- name: Configure CPython out-of-tree
working-directory: ${{ env.CPYTHON_BUILDDIR }}
# `test_unpickle_module_race` writes to the source directory, which is
# read-only during builds — so we exclude it from profiling with BOLT.
run: >-
PROFILE_TASK='-m test --pgo --ignore test_unpickle_module_race'
../cpython-ro-srcdir/configure
--config-cache
--with-pydebug
--enable-slower-safety
--enable-safety
--with-openssl="$OPENSSL_DIR"
${{ fromJSON(inputs.free-threading) && '--disable-gil' || '' }}
${{ fromJSON(inputs.bolt-optimizations) && '--enable-bolt' || '' }}
- name: Build CPython out-of-tree
if: ${{ inputs.free-threading }}
working-directory: ${{ env.CPYTHON_BUILDDIR }}
Expand Down
4 changes: 2 additions & 2 deletions Doc/c-api/sys.rst
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ Operating System Utilities
The caller must hold the GIL.
.. versionadded:: next
.. versionadded:: 3.14
.. c:function:: int Py_fclose(FILE *file)
Expand All @@ -246,7 +246,7 @@ Operating System Utilities
In either case, any further access (including another call to
:c:func:`Py_fclose`) to the stream results in undefined behavior.
.. versionadded:: next
.. versionadded:: 3.14
.. _systemfunctions:
Expand Down
4 changes: 2 additions & 2 deletions Doc/glossary.rst
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ Glossary
:keyword:`yield` expression.

Each :keyword:`yield` temporarily suspends processing, remembering the
location execution state (including local variables and pending
execution state (including local variables and pending
try-statements). When the *asynchronous generator iterator* effectively
resumes with another awaitable returned by :meth:`~object.__anext__`, it
picks up where it left off. See :pep:`492` and :pep:`525`.
Expand Down Expand Up @@ -564,7 +564,7 @@ Glossary
An object created by a :term:`generator` function.

Each :keyword:`yield` temporarily suspends processing, remembering the
location execution state (including local variables and pending
execution state (including local variables and pending
try-statements). When the *generator iterator* resumes, it picks up where
it left off (in contrast to functions which start fresh on every
invocation).
Expand Down
2 changes: 1 addition & 1 deletion Doc/library/asyncio-eventloop.rst
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ an event loop:

Set *loop* as the current event loop for the current OS thread.

.. deprecated:: next
.. deprecated:: 3.14
The :func:`set_event_loop` function is deprecated and will be removed
in Python 3.16.

Expand Down
12 changes: 6 additions & 6 deletions Doc/library/asyncio-policy.rst
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ for the current process:

Return the current process-wide policy.

.. deprecated:: next
.. deprecated:: 3.14
The :func:`get_event_loop_policy` function is deprecated and
will be removed in Python 3.16.

Expand All @@ -58,7 +58,7 @@ for the current process:

If *policy* is set to ``None``, the default policy is restored.

.. deprecated:: next
.. deprecated:: 3.14
The :func:`set_event_loop_policy` function is deprecated and
will be removed in Python 3.16.

Expand Down Expand Up @@ -95,7 +95,7 @@ The abstract event loop policy base class is defined as follows:

This method should never return ``None``.

.. deprecated:: next
.. deprecated:: 3.14
The :class:`AbstractEventLoopPolicy` class is deprecated and
will be removed in Python 3.16.

Expand All @@ -121,7 +121,7 @@ asyncio ships with the following built-in policies:
The :meth:`get_event_loop` method of the default asyncio policy now
raises a :exc:`RuntimeError` if there is no set event loop.

.. deprecated:: next
.. deprecated:: 3.14
The :class:`DefaultEventLoopPolicy` class is deprecated and
will be removed in Python 3.16.

Expand All @@ -133,7 +133,7 @@ asyncio ships with the following built-in policies:

.. availability:: Windows.

.. deprecated:: next
.. deprecated:: 3.14
The :class:`WindowsSelectorEventLoopPolicy` class is deprecated and
will be removed in Python 3.16.

Expand All @@ -145,7 +145,7 @@ asyncio ships with the following built-in policies:

.. availability:: Windows.

.. deprecated:: next
.. deprecated:: 3.14
The :class:`WindowsProactorEventLoopPolicy` class is deprecated and
will be removed in Python 3.16.

Expand Down
8 changes: 4 additions & 4 deletions Doc/library/calendar.rst
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ interpreted as prescribed by the ISO 8601 standard. Year 0 is 1 BC, year -1 is
on the first weekday as specified in the constructor or set by the
:meth:`setfirstweekday` method.

.. versionchanged:: next
.. versionchanged:: 3.14
If *highlight_day* is given, this date is highlighted in color.
This can be :ref:`controlled using environment variables
<using-on-controlling-color>`.
Expand Down Expand Up @@ -201,7 +201,7 @@ interpreted as prescribed by the ISO 8601 standard. Year 0 is 1 BC, year -1 is
on the first weekday as specified in the constructor or set by the
:meth:`setfirstweekday` method.

.. versionchanged:: next
.. versionchanged:: 3.14
If *highlight_day* is given, this date is highlighted in color.
This can be :ref:`controlled using environment variables
<using-on-controlling-color>`.
Expand Down Expand Up @@ -229,7 +229,7 @@ interpreted as prescribed by the ISO 8601 standard. Year 0 is 1 BC, year -1 is
:meth:`setfirstweekday` method. The earliest year for which a calendar
can be generated is platform-dependent.

.. versionchanged:: next
.. versionchanged:: 3.14
If *highlight_day* is given, this date is highlighted in color.
This can be :ref:`controlled using environment variables
<using-on-controlling-color>`.
Expand Down Expand Up @@ -727,7 +727,7 @@ The following options are accepted:
The number of months printed per row.
Defaults to 3.

.. versionchanged:: next
.. versionchanged:: 3.14
By default, today's date is highlighted in color and can be
:ref:`controlled using environment variables <using-on-controlling-color>`.

Expand Down
2 changes: 1 addition & 1 deletion Doc/library/ctypes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2233,7 +2233,7 @@ Utility functions

.. audit-event:: ctypes.memoryview_at address,size,readonly

.. versionadded:: next
.. versionadded:: 3.14


.. _ctypes-data-types:
Expand Down
2 changes: 1 addition & 1 deletion Doc/library/faulthandler.rst
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ Fault handler state
The dump now mentions if a garbage collector collection is running
if *all_threads* is true.

.. versionchanged:: next
.. versionchanged:: 3.14
Only the current thread is dumped if the :term:`GIL` is disabled to
prevent the risk of data races.

Expand Down
4 changes: 3 additions & 1 deletion Doc/library/importlib.rst
Original file line number Diff line number Diff line change
Expand Up @@ -380,13 +380,15 @@ ABC hierarchy::

.. class:: ResourceLoader

*Superseded by TraversableResources*

An abstract base class for a :term:`loader` which implements the optional
:pep:`302` protocol for loading arbitrary resources from the storage
back-end.

.. deprecated:: 3.7
This ABC is deprecated in favour of supporting resource loading
through :class:`importlib.resources.abc.ResourceReader`.
through :class:`importlib.resources.abc.TraversableResources`.

.. abstractmethod:: get_data(path)

Expand Down
4 changes: 2 additions & 2 deletions Doc/library/os.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5424,7 +5424,7 @@ operating system.

Scheduling policy for tasks with deadline constraints.

.. versionadded:: next
.. versionadded:: 3.14

.. data:: SCHED_IDLE

Expand All @@ -5434,7 +5434,7 @@ operating system.

Alias for :data:`SCHED_OTHER`.

.. versionadded:: next
.. versionadded:: 3.14

.. data:: SCHED_SPORADIC

Expand Down
2 changes: 1 addition & 1 deletion Doc/library/pyexpat.rst
Original file line number Diff line number Diff line change
Expand Up @@ -945,7 +945,7 @@ The ``errors`` module has the following attributes:

The parser was tried to be stopped or suspended before it started.

.. versionadded:: next
.. versionadded:: 3.14


.. rubric:: Footnotes
Expand Down
2 changes: 1 addition & 1 deletion Doc/library/re.rst
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,7 @@ character ``'$'``.
Word boundaries are determined by the current locale
if the :py:const:`~re.LOCALE` flag is used.

.. versionchanged:: next
.. versionchanged:: 3.14
``\B`` now matches empty input string.

.. index:: single: \d; in regular expressions
Expand Down
2 changes: 1 addition & 1 deletion Doc/library/socket.rst
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,7 @@ Constants

Constant to enable duplicate address and port bindings with load balancing.

.. versionadded:: next
.. versionadded:: 3.14

.. availability:: FreeBSD >= 12.0

Expand Down
2 changes: 1 addition & 1 deletion Doc/library/ssl.rst
Original file line number Diff line number Diff line change
Expand Up @@ -938,7 +938,7 @@ Constants

Whether the OpenSSL library has built-in support for TLS-PHA.

.. versionadded:: next
.. versionadded:: 3.14

.. data:: CHANNEL_BINDING_TYPES

Expand Down
13 changes: 10 additions & 3 deletions Doc/library/string.rst
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,18 @@ The constants defined in this module are:
String of ASCII characters which are considered punctuation characters
in the ``C`` locale: ``!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~``.


.. data:: printable

String of ASCII characters which are considered printable. This is a
combination of :const:`digits`, :const:`ascii_letters`, :const:`punctuation`,
and :const:`whitespace`.
String of ASCII characters which are considered printable by Python.
This is a combination of :const:`digits`, :const:`ascii_letters`,
:const:`punctuation`, and :const:`whitespace`.

.. note::

By design, :meth:`string.printable.isprintable() <str.isprintable>`
returns :const:`False`. In particular, ``string.printable`` is not
printable in the POSIX sense (see :manpage:`LC_CTYPE <locale(5)>`).


.. data:: whitespace
Expand Down
2 changes: 1 addition & 1 deletion Doc/library/sys.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

This module provides access to some variables used or maintained by the
interpreter and to functions that interact strongly with the interpreter. It is
always available.
always available. Unless explicitly noted otherwise, all variables are read-only.


.. data:: abiflags
Expand Down
10 changes: 7 additions & 3 deletions Doc/library/threading.rst
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,13 @@ since it is impossible to detect the termination of alien threads.
This method will raise a :exc:`RuntimeError` if called more than once
on the same thread object.

If supported, set the operating system thread name to
:attr:`threading.Thread.name`. The name can be truncated depending on the
operating system thread name limits.

.. versionchanged:: 3.14
Set the operating system thread name.

.. method:: run()

Method representing the thread's activity.
Expand Down Expand Up @@ -443,9 +450,6 @@ since it is impossible to detect the termination of alien threads.
running thread is renamed. (Setting the *name* attribute of a
different thread only updates the Python Thread object.)

.. versionchanged:: 3.14
Set the operating system thread name.

.. method:: getName()
setName()

Expand Down
Loading

0 comments on commit 54665bf

Please sign in to comment.