Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] main from google:main #72

Closed
wants to merge 21 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
731086c
Try using `p0deje/setup-bazel` everywhere.
junyer Feb 13, 2024
b4c6fe0
Bump version of `p0deje/setup-bazel` to address warnings.
junyer Feb 13, 2024
ed9fc26
Update @apple_support to version 1.12.0.
junyer Feb 15, 2024
2aa303b
Update @pybind11_bazel to version 2.11.1.bzl.2.
junyer Feb 16, 2024
d00d1e9
Avoid `invalid escape sequence` errors on Windows.
junyer Feb 16, 2024
477b9f9
Clean up uses of `repo_name` in `MODULE.bazel`.
junyer Feb 18, 2024
6bb550b
Disable warning for missing-field-initializers as well for clang.
Feb 18, 2024
0ff0fab
Fix an ancient bug in prefix factoring.
junyer Feb 19, 2024
f9550c3
Fix more ancient bugs around Latin-1 handling.
junyer Feb 19, 2024
2d866a3
Prepare to tag release `2024-03-01`.
junyer Feb 29, 2024
45c9985
Update @pybind11_bazel to version 2.11.1.bzl.3.
junyer Mar 2, 2024
8695a63
Disable MSYS/MSYS2 path conversion, which interferes with Bazel.
junyer Mar 4, 2024
dbf15a2
Use try-import to load an optional user-specific user.bazelrc
hzeller Mar 2, 2024
27536b0
Delete an old comment.
junyer Mar 7, 2024
ddb3414
Add Clang 18 to the build matrix.
junyer Mar 11, 2024
108914d
`p0deje/setup-bazel` has been transferred to `bazel-contrib`.
junyer Mar 11, 2024
58f6cdd
doc/mksyntaxgo: use standard generated Go header
alexandear Mar 15, 2024
5c5c8ed
Fix the link to the Python wrapper.
junyer Mar 17, 2024
db46d1e
Bump versions of actions to latest releases.
junyer Mar 17, 2024
1250a99
Raise `re2.error` instead of crashing.
junyer Mar 17, 2024
6598a8e
Make compiling a no-op if it's attempted before adding any patterns.
junyer Mar 18, 2024
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
7 changes: 3 additions & 4 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,13 @@ build --features=layering_check
build --features=parse_headers

# Abseil requires C++14 at minimum.
# Previously, the flag was set via `BAZEL_CXXOPTS`. On macOS, we also had to set
# `BAZEL_USE_CPP_ONLY_TOOLCHAIN` since Bazel wouldn't respect the former without
# the latter. However, the latter stopped Bazel from using Xcode and `-framework
# Foundation`, which CCTZ (vendored into Abseil) requires.
build --enable_platform_specific_config
build:linux --cxxopt=-std=c++14
build:macos --cxxopt=-std=c++14
build:windows --cxxopt=/std:c++14

# Print test logs for failed tests.
test --test_output=errors

# https://bazel.build/configure/best-practices#bazelrc-file
try-import %workspace%/user.bazelrc
37 changes: 19 additions & 18 deletions .github/bazel.sh
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
#!/bin/bash
set -eux

bazel clean
bazel build --compilation_mode=dbg -- //:all
bazel test --compilation_mode=dbg -- //:all \
-//:dfa_test \
-//:exhaustive1_test \
-//:exhaustive2_test \
-//:exhaustive3_test \
-//:exhaustive_test \
-//:random_test
# Disable MSYS/MSYS2 path conversion, which interferes with Bazel.
export MSYS_NO_PATHCONV='1'
export MSYS2_ARG_CONV_EXCL='*'

bazel clean
bazel build --compilation_mode=opt -- //:all
bazel test --compilation_mode=opt -- //:all \
-//:dfa_test \
-//:exhaustive1_test \
-//:exhaustive2_test \
-//:exhaustive3_test \
-//:exhaustive_test \
-//:random_test
for compilation_mode in dbg opt
do
bazel clean
bazel build --compilation_mode=${compilation_mode} -- \
//:re2 \
//python:re2
bazel test --compilation_mode=${compilation_mode} -- \
//:all \
-//:dfa_test \
-//:exhaustive1_test \
-//:exhaustive2_test \
-//:exhaustive3_test \
-//:exhaustive_test \
-//:random_test \
//python:all
done

exit 0
13 changes: 6 additions & 7 deletions .github/cmake.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
#!/bin/bash
set -eux

cmake . -D CMAKE_BUILD_TYPE=Debug -D RE2_BUILD_TESTING=ON "$@"
cmake --build . --config Debug --clean-first
ctest -C Debug --output-on-failure -E 'dfa|exhaustive|random'

cmake . -D CMAKE_BUILD_TYPE=Release -D RE2_BUILD_TESTING=ON "$@"
cmake --build . --config Release --clean-first
ctest -C Release --output-on-failure -E 'dfa|exhaustive|random'
for CMAKE_BUILD_TYPE in Debug Release
do
cmake . -D CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -D RE2_BUILD_TESTING=ON "$@"
cmake --build . --config ${CMAKE_BUILD_TYPE} --clean-first
ctest -C ${CMAKE_BUILD_TYPE} --output-on-failure -E 'dfa|exhaustive|random'
done

exit 0
6 changes: 4 additions & 2 deletions .github/workflows/ci-bazel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ jobs:
env:
BAZELISK_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
- uses: bazelbuild/setup-bazelisk@v3
- uses: actions/checkout@v4.1.1
- uses: bazel-contrib/setup-bazel@0.8.1
with:
bazelisk-version: '1.x'
- run: .github/bazel.sh
shell: bash
6 changes: 3 additions & 3 deletions .github/workflows/ci-cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
matrix:
build_shared_libs: [OFF, ON]
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4.1.1
- name: Install CMake
run: |
apt update -y
Expand All @@ -35,7 +35,7 @@ jobs:
matrix:
build_shared_libs: [OFF, ON]
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4.1.1
- name: Install Abseil, GoogleTest and Benchmark
run: |
brew update
Expand All @@ -50,7 +50,7 @@ jobs:
matrix:
build_shared_libs: [OFF, ON]
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4.1.1
- name: Install Abseil, GoogleTest and Benchmark
run: |
vcpkg update
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
# (The other two flags are the default provided for CXXFLAGS in Makefile.)
CXXFLAGS: -O3 -g -std=c++${{ matrix.ver }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4.1.1
- name: Install Abseil, GoogleTest and Benchmark
run: |
brew update
Expand All @@ -34,12 +34,12 @@ jobs:
strategy:
fail-fast: false
matrix:
ver: [15, 16, 17]
ver: [16, 17, 18]
env:
CC: clang-${{ matrix.ver }}
CXX: clang++-${{ matrix.ver }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4.1.1
- name: Install Clang ${{ matrix.ver }}
run: |
# Avoid `Conflicts: python3-lldb-x.y` between packages.
Expand All @@ -65,7 +65,7 @@ jobs:
CC: gcc-${{ matrix.ver }}
CXX: g++-${{ matrix.ver }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4.1.1
- name: Install Abseil, GoogleTest and Benchmark
run: |
sudo apt update -y
Expand Down
12 changes: 7 additions & 5 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,13 @@ jobs:
# Bazel fails if the username is unknown.
USER: runner
steps:
- uses: actions/checkout@v4
- uses: bazelbuild/setup-bazelisk@v3
- uses: actions/checkout@v4.1.1
- uses: bazel-contrib/setup-bazel@0.8.1
with:
bazelisk-version: '1.x'
- run: app/build.sh
shell: bash
- uses: actions/upload-pages-artifact@v3
- uses: actions/upload-pages-artifact@v3.0.1
with:
path: app/deploy
deploy:
Expand All @@ -35,5 +37,5 @@ jobs:
environment: github-pages
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/deploy-pages@v4
- uses: actions/checkout@v4.1.1
- uses: actions/deploy-pages@v4.0.4
4 changes: 2 additions & 2 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ jobs:
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/github-script@v7
- uses: actions/checkout@v4.1.1
- uses: actions/github-script@v7.0.1
with:
script: |
const fs = require('fs');
Expand Down
41 changes: 21 additions & 20 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,13 @@ jobs:
# Bazel fails if the username is unknown.
USER: runner
steps:
- uses: actions/checkout@v4
- 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: bazelbuild/setup-bazelisk@v3
- uses: bazel-contrib/setup-bazel@0.8.1
with:
bazelisk-version: '1.x'
- name: Prepare Python ${{ matrix.ver }} environment
run: |
"${PYTHON}" -m pip install --upgrade pip
Expand All @@ -56,7 +58,7 @@ jobs:
"${PYTHON}" re2_test.py
shell: bash
working-directory: python
- uses: actions/upload-artifact@v4
- uses: actions/upload-artifact@v4.3.1
with:
name: ${{ hashFiles('python/google_re2-*.whl') }}
path: python/google_re2-*.whl
Expand All @@ -82,12 +84,14 @@ jobs:
# Otherwise, Python refuses to install the built wheel!
SYSTEM_VERSION_COMPAT: 0
steps:
- uses: actions/checkout@v4
- 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: bazelbuild/setup-bazelisk@v3
- uses: actions/setup-python@v5
- uses: bazel-contrib/setup-bazel@0.8.1
with:
bazelisk-version: '1.x'
- uses: actions/setup-python@v5.0.0
with:
python-version: ${{ matrix.ver }}
- name: Prepare Python ${{ matrix.ver }} environment
Expand All @@ -111,7 +115,7 @@ jobs:
python re2_test.py
shell: bash
working-directory: python
- uses: actions/upload-artifact@v4
- uses: actions/upload-artifact@v4.3.1
with:
name: ${{ hashFiles('python/google_re2-*.whl') }}
path: python/google_re2-*.whl
Expand All @@ -131,22 +135,19 @@ jobs:
BAZEL_CPU: ${{ matrix.arch.bazel-name }}_windows
PLAT_NAME: ${{ matrix.arch.python-name }}
steps:
- uses: actions/checkout@v4
- 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
# Avoid the Chocolatey install of Bazel getting in the way;
# `bazelbuild/setup-bazelisk` doesn't work for some reason.
- run: |
choco uninstall -y bazel
choco install -y bazelisk
shell: bash
- uses: bazel-contrib/setup-bazel@0.8.1
with:
bazelisk-version: '1.x'
# Lowercase the architecture name for `actions/setup-python`.
- run: |
ARCHITECTURE=${{ matrix.arch.name }}
echo "architecture=${ARCHITECTURE,,}" >> "${GITHUB_ENV}"
shell: bash
- uses: actions/setup-python@v5
- uses: actions/setup-python@v5.0.0
with:
python-version: ${{ matrix.ver }}
architecture: ${{ env.architecture }}
Expand All @@ -170,7 +171,7 @@ jobs:
python re2_test.py
shell: bash
working-directory: python
- uses: actions/upload-artifact@v4
- uses: actions/upload-artifact@v4.3.1
with:
name: ${{ hashFiles('python/google_re2-*.whl') }}
path: python/google_re2-*.whl
Expand All @@ -182,11 +183,11 @@ jobs:
- wheel-windows
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- 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
- uses: actions/setup-python@v5.0.0
with:
python-version: '3.x'
- name: Prepare Python 3.x environment
Expand All @@ -202,7 +203,7 @@ jobs:
python -m build --sdist
shell: bash
working-directory: python
- uses: actions/download-artifact@v4
- uses: actions/download-artifact@v4.1.4
with:
path: python
- name: Set build number to ${{ inputs.build }}
Expand All @@ -218,7 +219,7 @@ jobs:
shell: bash
working-directory: python
- if: inputs.build >= 1
uses: pypa/gh-action-pypi-publish@release/v1
uses: pypa/gh-action-pypi-publish@v1.8.14
with:
password: ${{ secrets.PYPI_API_TOKEN }}
packages-dir: python/dist
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
core
obj/
benchlog.*
user.bazelrc
Loading