Skip to content

Commit a3f59cc

Browse files
committed
Merge remote-tracking branch 'upstream/main' into tsan
2 parents fd6ca6d + 3e66171 commit a3f59cc

31 files changed

+3537
-1678
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ Tools/wasm/config.site-wasm32-emscripten @freakboy3742 @emmatyping
176176
Tools/wasm/emscripten @freakboy3742 @emmatyping
177177

178178
# WebAssembly (WASI)
179+
Platforms/WASI @brettcannon @emmatyping @savannahostrowski
179180
Tools/wasm/wasi-env @brettcannon @emmatyping @savannahostrowski
180181
Tools/wasm/wasi.py @brettcannon @emmatyping @savannahostrowski
181182
Tools/wasm/wasi @brettcannon @emmatyping @savannahostrowski

.github/workflows/reusable-wasi.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,14 @@ jobs:
4747
- name: "Runner image version"
4848
run: echo "IMAGE_OS_VERSION=${ImageOS}-${ImageVersion}" >> "$GITHUB_ENV"
4949
- name: "Configure build Python"
50-
run: python3 Tools/wasm/wasi configure-build-python -- --config-cache --with-pydebug
50+
run: python3 Platforms/WASI configure-build-python -- --config-cache --with-pydebug
5151
- name: "Make build Python"
52-
run: python3 Tools/wasm/wasi make-build-python
52+
run: python3 Platforms/WASI make-build-python
5353
- name: "Configure host"
5454
# `--with-pydebug` inferred from configure-build-python
55-
run: python3 Tools/wasm/wasi configure-host -- --config-cache
55+
run: python3 Platforms/WASI configure-host -- --config-cache
5656
- name: "Make host"
57-
run: python3 Tools/wasm/wasi make-host
57+
run: python3 Platforms/WASI make-host
5858
- name: "Display build info"
5959
run: make --directory "${CROSS_BUILD_WASI}" pythoninfo
6060
- name: "Test"

Doc/using/windows.rst

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,8 @@ is also an unambiguous ``pymanager`` command. Scripted installs that are
126126
intending to use Python install manager should consider using ``pymanager``, due
127127
to the lower chance of encountering a conflict with existing installs. The only
128128
difference between the two commands is when running without any arguments:
129-
``py`` will install and launch your default interpreter, while ``pymanager``
130-
will display help (``pymanager exec ...`` provides equivalent behaviour to
131-
``py ...``).
129+
``py`` will launch your default interpreter, while ``pymanager`` will display
130+
help (``pymanager exec ...`` provides equivalent behaviour to ``py ...``).
132131

133132
Each of these commands also has a windowed version that avoids creating a
134133
console window. These are ``pyw``, ``pythonw`` and ``pymanagerw``. A ``python3``
@@ -187,12 +186,11 @@ that virtual environment. In this scenario, the ``python`` command was likely
187186
already overridden and none of these checks occurred. However, this behaviour
188187
ensures that the ``py`` command can be used interchangeably.
189188

190-
When you launch either ``python`` or ``py`` but do not have any runtimes
191-
installed, and the requested version is the default, it will be installed
192-
automatically and then launched. Otherwise, the requested version will be
193-
installed if automatic installation is configured (most likely by setting
194-
``PYTHON_MANAGER_AUTOMATIC_INSTALL`` to ``true``), or if the ``py exec`` or
195-
``pymanager exec`` forms of the command were used.
189+
When no runtimes are installed, any launch command will try to install the
190+
requested version and launch it. However, after any version is installed, only
191+
the ``py exec ...`` and ``pymanager exec ...`` commands will install if the
192+
requested version is absent. Other forms of commands will display an error and
193+
direct you to use ``py install`` first.
196194

197195

198196
Command help
@@ -301,6 +299,14 @@ To launch the runtime, directly execute the main executable (typically
301299
302300
$> py install ... [-t=|--target=<PATH>] <TAG>
303301
302+
The ``py exec`` command will install the requested runtime if it is not already
303+
present. This is controlled by the ``automatic_install`` configuration
304+
(:envvar:`PYTHON_MANAGER_AUTOMATIC_INSTALL`), and is enabled by default.
305+
If no runtimes are available at all, all launch commands will do an automatic
306+
install if the configuration setting allows. This is to ensure a good experience
307+
for new users, but should not generally be relied on rather than using the
308+
``py exec`` command or explicit install commands.
309+
304310

305311
.. _pymanager-offline:
306312

@@ -426,9 +432,11 @@ customization.
426432
By default, :file:`%TEMP%`.
427433

428434
* - ``automatic_install``
429-
- ``PYTHON_MANAGER_AUTOMATIC_INSTALL``
430-
- True to allow automatic installs when using ``py exec`` to launch.
431-
Other commands will not automatically install.
435+
- .. envvar:: PYTHON_MANAGER_AUTOMATIC_INSTALL
436+
- True to allow automatic installs when using ``py exec`` to launch (or
437+
``py`` when no runtimes are installed yet).
438+
Other commands will not automatically install, regardless of this
439+
setting.
432440
By default, true.
433441

434442
* - ``include_unmanaged``
@@ -777,7 +785,7 @@ Troubleshooting
777785

778786
If your Python install manager does not seem to be working correctly, please
779787
work through these tests and fixes to see if it helps. If not, please report an
780-
issue at `our bug tracker <https://github.com/python/cpython/issues>`_,
788+
issue at `our bug tracker <https://github.com/python/pymanager/issues>`_,
781789
including any relevant log files (written to your :file:`%TEMP%` directory by
782790
default).
783791

Include/internal/pycore_optimizer.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,8 @@ extern JitOptRef _Py_uop_sym_new_truthiness(JitOptContext *ctx, JitOptRef value,
205205
extern bool _Py_uop_sym_is_compact_int(JitOptRef sym);
206206
extern JitOptRef _Py_uop_sym_new_compact_int(JitOptContext *ctx);
207207
extern void _Py_uop_sym_set_compact_int(JitOptContext *ctx, JitOptRef sym);
208+
extern JitOptRef _Py_uop_sym_new_predicate(JitOptContext *ctx, JitOptRef lhs_ref, JitOptRef rhs_ref, JitOptPredicateKind kind);
209+
extern void _Py_uop_sym_apply_predicate_narrowing(JitOptContext *ctx, JitOptRef sym, bool branch_is_true);
208210

209211
extern void _Py_uop_abstractcontext_init(JitOptContext *ctx);
210212
extern void _Py_uop_abstractcontext_fini(JitOptContext *ctx);

Include/internal/pycore_optimizer_types.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ typedef enum _JitSymType {
4040
JIT_SYM_TUPLE_TAG = 8,
4141
JIT_SYM_TRUTHINESS_TAG = 9,
4242
JIT_SYM_COMPACT_INT = 10,
43+
JIT_SYM_PREDICATE_TAG = 11,
4344
} JitSymType;
4445

4546
typedef struct _jit_opt_known_class {
@@ -72,6 +73,18 @@ typedef struct {
7273
uint16_t value;
7374
} JitOptTruthiness;
7475

76+
typedef enum {
77+
JIT_PRED_IS,
78+
JIT_PRED_IS_NOT,
79+
} JitOptPredicateKind;
80+
81+
typedef struct {
82+
uint8_t tag;
83+
uint8_t kind;
84+
uint16_t lhs;
85+
uint16_t rhs;
86+
} JitOptPredicate;
87+
7588
typedef struct {
7689
uint8_t tag;
7790
} JitOptCompactInt;
@@ -84,6 +97,7 @@ typedef union _jit_opt_symbol {
8497
JitOptTuple tuple;
8598
JitOptTruthiness truthiness;
8699
JitOptCompactInt compact;
100+
JitOptPredicate predicate;
87101
} JitOptSymbol;
88102

89103
// This mimics the _PyStackRef API

0 commit comments

Comments
 (0)