Skip to content

Commit

Permalink
Merge branch 'main' into debug_check
Browse files Browse the repository at this point in the history
  • Loading branch information
iritkatriel authored Jul 26, 2024
2 parents fcfc38b + d9efa45 commit 0b83c7a
Show file tree
Hide file tree
Showing 42 changed files with 901 additions and 806 deletions.
45 changes: 27 additions & 18 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -249,27 +249,38 @@ jobs:
arch: ${{ matrix.arch }}

build_macos:
name: 'macOS'
needs: check_source
if: needs.check_source.outputs.run_tests == 'true'
uses: ./.github/workflows/reusable-macos.yml
with:
config_hash: ${{ needs.check_source.outputs.config_hash }}
# Cirrus and macos-14 are M1, macos-13 is default GHA Intel.
# Cirrus used for upstream, macos-14 for forks.
os-matrix: '["ghcr.io/cirruslabs/macos-runner:sonoma", "macos-14", "macos-13"]'

build_macos_free_threading:
name: 'macOS (free-threading)'
name: >-
macOS
${{ fromJSON(matrix.free-threading) && '(free-threading)' || '' }}
needs: check_source
if: needs.check_source.outputs.run_tests == 'true'
strategy:
fail-fast: false
matrix:
# Cirrus and macos-14 are M1, macos-13 is default GHA Intel.
# macOS 13 only runs tests against the GIL-enabled CPython.
# Cirrus used for upstream, macos-14 for forks.
os:
- ghcr.io/cirruslabs/macos-runner:sonoma
- macos-14
- macos-13
is-fork: # only used for the exclusion trick
- ${{ github.repository_owner != 'python' }}
free-threading:
- false
- true
exclude:
- os: ghcr.io/cirruslabs/macos-runner:sonoma
is-fork: true
- os: macos-14
is-fork: false
- os: macos-13
free-threading: true
uses: ./.github/workflows/reusable-macos.yml
with:
config_hash: ${{ needs.check_source.outputs.config_hash }}
free-threading: true
# Cirrus and macos-14 are M1.
# Cirrus used for upstream, macos-14 for forks.
os-matrix: '["ghcr.io/cirruslabs/macos-runner:sonoma", "macos-14"]'
free-threading: ${{ matrix.free-threading }}
os: ${{ matrix.os }}

build_ubuntu:
name: >-
Expand Down Expand Up @@ -596,7 +607,6 @@ jobs:
- check-docs
- check_generated_files
- build_macos
- build_macos_free_threading
- build_ubuntu
- build_ubuntu_ssltests
- build_wasi
Expand Down Expand Up @@ -632,7 +642,6 @@ jobs:
&& '
check_generated_files,
build_macos,
build_macos_free_threading,
build_ubuntu,
build_ubuntu_ssltests,
build_wasi,
Expand Down
22 changes: 6 additions & 16 deletions .github/workflows/reusable-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@ on:
required: false
type: boolean
default: false
os-matrix:
required: false
os:
description: OS to run the job
required: true
type: string

jobs:
build_macos:
name: build and test (${{ matrix.os }})
name: build and test (${{ inputs.os }})
timeout-minutes: 60
env:
HOMEBREW_NO_ANALYTICS: 1
Expand All @@ -23,18 +24,7 @@ jobs:
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: 1
PYTHONSTRICTEXTENSIONBUILD: 1
TERM: linux
strategy:
fail-fast: false
matrix:
os: ${{fromJson(inputs.os-matrix)}}
is-fork:
- ${{ github.repository_owner != 'python' }}
exclude:
- os: "ghcr.io/cirruslabs/macos-runner:sonoma"
is-fork: true
- os: "macos-14"
is-fork: false
runs-on: ${{ matrix.os }}
runs-on: ${{ inputs.os }}
steps:
- uses: actions/checkout@v4
- name: Runner image version
Expand All @@ -43,7 +33,7 @@ jobs:
uses: actions/cache@v4
with:
path: config.cache
key: ${{ github.job }}-${{ matrix.os }}-${{ env.IMAGE_VERSION }}-${{ inputs.config_hash }}
key: ${{ github.job }}-${{ inputs.os }}-${{ env.IMAGE_VERSION }}-${{ inputs.config_hash }}
- name: Install Homebrew dependencies
run: brew install pkg-config [email protected] xz gdbm tcl-tk
- name: Configure CPython
Expand Down
9 changes: 0 additions & 9 deletions Doc/library/dis.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1109,15 +1109,6 @@ iterations of the loop.
empty dictionary pre-sized to hold *count* items.


.. opcode:: BUILD_CONST_KEY_MAP (count)

The version of :opcode:`BUILD_MAP` specialized for constant keys. Pops the
top element on the stack which contains a tuple of keys, then starting from
``STACK[-2]``, pops *count* values to form values in the built dictionary.

.. versionadded:: 3.6


.. opcode:: BUILD_STRING (count)

Concatenates *count* strings from the stack and pushes the resulting string
Expand Down
4 changes: 4 additions & 0 deletions Include/cpython/bytesobject.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,7 @@ static inline Py_ssize_t PyBytes_GET_SIZE(PyObject *op) {
return Py_SIZE(self);
}
#define PyBytes_GET_SIZE(self) PyBytes_GET_SIZE(_PyObject_CAST(self))

/* _PyBytes_Join(sep, x) is like sep.join(x). sep must be PyBytesObject*,
x must be an iterable object. */
PyAPI_FUNC(PyObject*) _PyBytes_Join(PyObject *sep, PyObject *x);
4 changes: 0 additions & 4 deletions Include/internal/pycore_bytesobject.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@ extern PyObject* _PyBytes_FromHex(
PyAPI_FUNC(PyObject*) _PyBytes_DecodeEscape(const char *, Py_ssize_t,
const char *, const char **);

/* _PyBytes_Join(sep, x) is like sep.join(x). sep must be PyBytesObject*,
x must be an iterable object. */
extern PyObject* _PyBytes_Join(PyObject *sep, PyObject *x);


// Substring Search.
//
Expand Down
15 changes: 5 additions & 10 deletions Include/internal/pycore_opcode_metadata.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

33 changes: 33 additions & 0 deletions Include/internal/pycore_stackref.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ extern "C" {
#include "pycore_object_deferred.h"

#include <stddef.h>
#include <stdbool.h>

/*
This file introduces a new API for handling references on the stack, called
Expand Down Expand Up @@ -237,6 +238,38 @@ _PyObjectStack_FromStackRefStack(PyObject **dst, const _PyStackRef *src, size_t
}
}

// StackRef type checks

static inline bool
PyStackRef_GenCheck(_PyStackRef stackref)
{
return PyGen_Check(PyStackRef_AsPyObjectBorrow(stackref));
}

static inline bool
PyStackRef_BoolCheck(_PyStackRef stackref)
{
return PyBool_Check(PyStackRef_AsPyObjectBorrow(stackref));
}

static inline bool
PyStackRef_LongCheck(_PyStackRef stackref)
{
return PyLong_Check(PyStackRef_AsPyObjectBorrow(stackref));
}

static inline bool
PyStackRef_ExceptionInstanceCheck(_PyStackRef stackref)
{
return PyExceptionInstance_Check(PyStackRef_AsPyObjectBorrow(stackref));
}


static inline bool
PyStackRef_FunctionCheck(_PyStackRef stackref)
{
return PyFunction_Check(PyStackRef_AsPyObjectBorrow(stackref));
}

#ifdef __cplusplus
}
Expand Down
Loading

0 comments on commit 0b83c7a

Please sign in to comment.