From 12b8ae4da15f31a289a5c9862940a06dd5a84e19 Mon Sep 17 00:00:00 2001 From: Cronet Mainline Eng Date: Fri, 14 Jun 2024 12:59:19 +0900 Subject: Import Cronet version 126.0.6423.0 FolderOrigin-RevId: /tmp/copybara-origin/src Change-Id: Ib37cbc097e05ce205b4c198b65877e69b7141b02 --- third_party/re2/src/.github/workflows/pages.yml | 2 +- third_party/re2/src/.github/workflows/python.yml | 14 +++++--- third_party/re2/src/.github/workflows/release.yml | 39 +++++++++++++++++++++++ third_party/re2/src/BUILD.bazel | 2 ++ third_party/re2/src/MODULE.bazel | 10 +++--- third_party/re2/src/python/setup.py | 7 +++- third_party/re2/src/re2Config.cmake.in | 2 -- 7 files changed, 63 insertions(+), 13 deletions(-) create mode 100644 third_party/re2/src/.github/workflows/release.yml (limited to 'third_party/re2') diff --git a/third_party/re2/src/.github/workflows/pages.yml b/third_party/re2/src/.github/workflows/pages.yml index 5bff8306c..85e54d876 100644 --- a/third_party/re2/src/.github/workflows/pages.yml +++ b/third_party/re2/src/.github/workflows/pages.yml @@ -38,4 +38,4 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4.1.1 - - uses: actions/deploy-pages@v4.0.4 + - uses: actions/deploy-pages@v4.0.5 diff --git a/third_party/re2/src/.github/workflows/python.yml b/third_party/re2/src/.github/workflows/python.yml index 7d9048c09..7f97adc23 100644 --- a/third_party/re2/src/.github/workflows/python.yml +++ b/third_party/re2/src/.github/workflows/python.yml @@ -80,6 +80,9 @@ jobs: BAZELISK_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} BAZEL_CPU: darwin_${{ matrix.arch.bazel-name }} PLAT_NAME: macosx-${{ matrix.os }}.0-${{ matrix.arch.python-name }} + # Force a specific target version of macOS. + # Otherwise, `delocate` renames the wheels! + MACOSX_DEPLOYMENT_TARGET: ${{ matrix.os }}.0 # Stop macOS from reporting the system version as 10.x. # Otherwise, Python refuses to install the built wheel! SYSTEM_VERSION_COMPAT: 0 @@ -91,7 +94,7 @@ jobs: - uses: bazel-contrib/setup-bazel@0.8.1 with: bazelisk-version: '1.x' - - uses: actions/setup-python@v5.0.0 + - uses: actions/setup-python@v5.1.0 with: python-version: ${{ matrix.ver }} - name: Prepare Python ${{ matrix.ver }} environment @@ -147,7 +150,7 @@ jobs: ARCHITECTURE=${{ matrix.arch.name }} echo "architecture=${ARCHITECTURE,,}" >> "${GITHUB_ENV}" shell: bash - - uses: actions/setup-python@v5.0.0 + - uses: actions/setup-python@v5.1.0 with: python-version: ${{ matrix.ver }} architecture: ${{ env.architecture }} @@ -181,13 +184,17 @@ jobs: - wheel-linux - wheel-macos - wheel-windows + permissions: + contents: read + # Required for PyPI publishing. + id-token: write runs-on: ubuntu-latest steps: - uses: actions/checkout@v4.1.1 # Stash the timestamp for the commit SHA that triggered the workflow. - run: echo "timestamp=$(git log -1 --pretty=%ct)" >> "${GITHUB_ENV}" shell: bash - - uses: actions/setup-python@v5.0.0 + - uses: actions/setup-python@v5.1.0 with: python-version: '3.x' - name: Prepare Python 3.x environment @@ -221,5 +228,4 @@ jobs: - if: inputs.build >= 1 uses: pypa/gh-action-pypi-publish@v1.8.14 with: - password: ${{ secrets.PYPI_API_TOKEN }} packages-dir: python/dist diff --git a/third_party/re2/src/.github/workflows/release.yml b/third_party/re2/src/.github/workflows/release.yml new file mode 100644 index 000000000..dd150a3a5 --- /dev/null +++ b/third_party/re2/src/.github/workflows/release.yml @@ -0,0 +1,39 @@ +name: Release +on: + push: + tags: ['**'] +permissions: + contents: read +jobs: + create: + permissions: + # Required to create the release + # and upload the release assets. + contents: write + # Required for Sigstore signing. + id-token: write + runs-on: ubuntu-latest + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + steps: + - uses: actions/checkout@v4.1.1 + - run: | + gh release create "${GITHUB_REF_NAME}" \ + --generate-notes --latest --verify-tag \ + --repo "${GITHUB_REPOSITORY}" + gh release download "${GITHUB_REF_NAME}" \ + --archive tar.gz \ + --repo "${GITHUB_REPOSITORY}" + gh release download "${GITHUB_REF_NAME}" \ + --archive zip \ + --repo "${GITHUB_REPOSITORY}" + shell: bash + - uses: sigstore/gh-action-sigstore-python@v2.1.1 + with: + # N.B. This is a whitespace-separated string! + inputs: '*.tar.gz *.zip' + - run: | + gh release upload "${GITHUB_REF_NAME}" \ + *.tar.gz *.zip *.sigstore \ + --repo "${GITHUB_REPOSITORY}" + shell: bash diff --git a/third_party/re2/src/BUILD.bazel b/third_party/re2/src/BUILD.bazel index 169c4d754..a1664761f 100644 --- a/third_party/re2/src/BUILD.bazel +++ b/third_party/re2/src/BUILD.bazel @@ -58,6 +58,7 @@ cc_library( # WebAssembly support for threads is... fraught at every level. "@platforms//cpu:wasm32": [], "@platforms//cpu:wasm64": [], + "@platforms//os:emscripten": [], "@platforms//os:wasi": [], "@platforms//os:windows": [], "//conditions:default": ["-pthread"], @@ -70,6 +71,7 @@ cc_library( # WebAssembly support for threads is... fraught at every level. "@platforms//cpu:wasm32": [], "@platforms//cpu:wasm64": [], + "@platforms//os:emscripten": [], "@platforms//os:wasi": [], "@platforms//os:windows": [], "//conditions:default": ["-pthread"], diff --git a/third_party/re2/src/MODULE.bazel b/third_party/re2/src/MODULE.bazel index 423572761..583cbdca2 100644 --- a/third_party/re2/src/MODULE.bazel +++ b/third_party/re2/src/MODULE.bazel @@ -6,16 +6,16 @@ module( name = "re2", - version = "2024-03-01", + version = "2024-04-01", compatibility_level = 1, ) -bazel_dep(name = "platforms", version = "0.0.8") -bazel_dep(name = "apple_support", version = "1.14.0") +bazel_dep(name = "platforms", version = "0.0.9") +bazel_dep(name = "apple_support", version = "1.15.1") bazel_dep(name = "rules_cc", version = "0.0.9") -bazel_dep(name = "abseil-cpp", version = "20240116.1") +bazel_dep(name = "abseil-cpp", version = "20240116.2") bazel_dep(name = "rules_python", version = "0.31.0") -bazel_dep(name = "pybind11_bazel", version = "2.11.1.bzl.3") +bazel_dep(name = "pybind11_bazel", version = "2.12.0") # This is a temporary hack for `x64_x86_windows`. # TODO(junyer): Remove whenever no longer needed. diff --git a/third_party/re2/src/python/setup.py b/third_party/re2/src/python/setup.py index 93de80376..8b40c238d 100644 --- a/third_party/re2/src/python/setup.py +++ b/third_party/re2/src/python/setup.py @@ -61,6 +61,11 @@ class BuildExt(setuptools.command.build_ext.build_ext): cmd.append(f'--extra_toolchains=@local_config_cc//:cc-toolchain-{cpu}') except KeyError: pass + try: + ver = os.environ['MACOSX_DEPLOYMENT_TARGET'] + cmd.append(f'--macos_minimum_os={ver}') + except KeyError: + pass # Register the local Python toolchains with highest priority. self.generate_python_toolchains() cmd.append('--extra_toolchains=//python/toolchains:all') @@ -187,7 +192,7 @@ ext_module = setuptools.Extension( setuptools.setup( name='google-re2', - version='1.1', + version='1.1.20240401', description='RE2 Python bindings', long_description=long_description, long_description_content_type='text/plain', diff --git a/third_party/re2/src/re2Config.cmake.in b/third_party/re2/src/re2Config.cmake.in index 6a177c615..be7b6bc64 100644 --- a/third_party/re2/src/re2Config.cmake.in +++ b/third_party/re2/src/re2Config.cmake.in @@ -6,8 +6,6 @@ include(CMakeFindDependencyMacro) -set_and_check(re2_INCLUDE_DIR ${PACKAGE_PREFIX_DIR}/@CMAKE_INSTALL_INCLUDEDIR@) - if(UNIX) set(THREADS_PREFER_PTHREAD_FLAG ON) find_dependency(Threads REQUIRED) -- cgit v1.2.3