From c9af94bed09b0495071ef2ae35d62f9029ced17a Mon Sep 17 00:00:00 2001 From: ohmayr Date: Wed, 1 Apr 2026 22:23:00 +0000 Subject: [PATCH] chore: enable python-crc32c kokoro presubmits --- .kokoro/presubmit/linux/presubmit-linux.cfg | 4 +--- .kokoro/presubmit/osx/presubmit-osx-slcn.cfg | 3 +-- .kokoro/presubmit/osx/presubmit-osx.cfg | 3 +-- .../windows/presubmit-windows-google-crc32c.cfg | 3 +-- packages/google-crc32c/scripts/bypass.bat | 7 ------- packages/google-crc32c/scripts/bypass.sh | 11 ----------- packages/google-crc32c/scripts/manylinux/build.sh | 3 +-- packages/google-crc32c/scripts/osx/build.sh | 3 +-- .../google-crc32c/scripts/osx/build_python_wheel.sh | 8 ++------ packages/google-crc32c/scripts/windows/build.bat | 8 ++------ 10 files changed, 10 insertions(+), 43 deletions(-) delete mode 100644 packages/google-crc32c/scripts/bypass.bat delete mode 100644 packages/google-crc32c/scripts/bypass.sh diff --git a/.kokoro/presubmit/linux/presubmit-linux.cfg b/.kokoro/presubmit/linux/presubmit-linux.cfg index ee331e079f5d..a725ad012410 100644 --- a/.kokoro/presubmit/linux/presubmit-linux.cfg +++ b/.kokoro/presubmit/linux/presubmit-linux.cfg @@ -6,6 +6,4 @@ action { regex: "**/*sponge_log.xml" } } - -# Bypass the trampoline entirely and run our dummy script natively -build_file: "google-cloud-python/packages/google-crc32c/scripts/bypass.sh" \ No newline at end of file +build_file: "google-cloud-python/packages/google-crc32c/scripts/manylinux/build.sh" \ No newline at end of file diff --git a/.kokoro/presubmit/osx/presubmit-osx-slcn.cfg b/.kokoro/presubmit/osx/presubmit-osx-slcn.cfg index b0d3c471cc53..fc516d14c7bf 100644 --- a/.kokoro/presubmit/osx/presubmit-osx-slcn.cfg +++ b/.kokoro/presubmit/osx/presubmit-osx-slcn.cfg @@ -7,5 +7,4 @@ action { } } -# Reuse the exact same bash script we used for Linux! -build_file: "google-cloud-python/packages/google-crc32c/scripts/bypass.sh" \ No newline at end of file +build_file: "google-cloud-python/packages/google-crc32c/scripts/osx/build.sh" \ No newline at end of file diff --git a/.kokoro/presubmit/osx/presubmit-osx.cfg b/.kokoro/presubmit/osx/presubmit-osx.cfg index b0d3c471cc53..fc516d14c7bf 100644 --- a/.kokoro/presubmit/osx/presubmit-osx.cfg +++ b/.kokoro/presubmit/osx/presubmit-osx.cfg @@ -7,5 +7,4 @@ action { } } -# Reuse the exact same bash script we used for Linux! -build_file: "google-cloud-python/packages/google-crc32c/scripts/bypass.sh" \ No newline at end of file +build_file: "google-cloud-python/packages/google-crc32c/scripts/osx/build.sh" \ No newline at end of file diff --git a/.kokoro/presubmit/windows/presubmit-windows-google-crc32c.cfg b/.kokoro/presubmit/windows/presubmit-windows-google-crc32c.cfg index ebcd16aba79e..9eb3fc4e0edb 100644 --- a/.kokoro/presubmit/windows/presubmit-windows-google-crc32c.cfg +++ b/.kokoro/presubmit/windows/presubmit-windows-google-crc32c.cfg @@ -7,5 +7,4 @@ action { } } -# Reuse the exact same bash script we used for Linux! -build_file: "google-cloud-python/packages/google-crc32c/scripts/bypass.bat" \ No newline at end of file +build_file: "google-cloud-python/packages/google-crc32c/scripts/windows/build.bat" \ No newline at end of file diff --git a/packages/google-crc32c/scripts/bypass.bat b/packages/google-crc32c/scripts/bypass.bat deleted file mode 100644 index 9cd005f6290c..000000000000 --- a/packages/google-crc32c/scripts/bypass.bat +++ /dev/null @@ -1,7 +0,0 @@ -@echo off -echo Bypassing C-extension tests for Phase 1 migration. - -:: Generate the dummy sponge log so Kokoro parses a green checkmark -echo ^^^^^^ > sponge_log.xml - -exit /b 0 \ No newline at end of file diff --git a/packages/google-crc32c/scripts/bypass.sh b/packages/google-crc32c/scripts/bypass.sh deleted file mode 100644 index 720f3017f94f..000000000000 --- a/packages/google-crc32c/scripts/bypass.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -# 1. Print a message to the raw Kokoro build log -echo "Bypassing C-extension tests for Phase 1 migration." -echo "Tests will be wired into internal infrastructure in a follow-up PR." - -# 2. Generate a fake Sponge Log so Kokoro doesn't throw a 404 error -echo '' > sponge_log.xml - -# 3. Exit successfully -exit 0 \ No newline at end of file diff --git a/packages/google-crc32c/scripts/manylinux/build.sh b/packages/google-crc32c/scripts/manylinux/build.sh index 91397c8eba00..484e2a4160c8 100755 --- a/packages/google-crc32c/scripts/manylinux/build.sh +++ b/packages/google-crc32c/scripts/manylinux/build.sh @@ -28,8 +28,7 @@ sudo apt-get install -y python3.12 cd $REPO_ROOT # Add directory as safe to avoid "detected dubious ownership" fatal issue1 -git config --global --add safe.directory $REPO_ROOT -git config --global --add safe.directory $REPO_ROOT/google_crc32c +git config --global --add safe.directory '*' git submodule update --init --recursive diff --git a/packages/google-crc32c/scripts/osx/build.sh b/packages/google-crc32c/scripts/osx/build.sh index 7000337c70b4..075ffcc26193 100755 --- a/packages/google-crc32c/scripts/osx/build.sh +++ b/packages/google-crc32c/scripts/osx/build.sh @@ -32,8 +32,7 @@ export CRC32C_INSTALL_PREFIX="${REPO_ROOT}/usr" cd ${REPO_ROOT} # Add directory as safe to avoid "detected dubious ownership" fatal issue -git config --global --add safe.directory $REPO_ROOT -git config --global --add safe.directory $REPO_ROOT/google_crc32c +git config --global --add safe.directory '*' git submodule update --init --recursive ${OSX_DIR}/build_c_lib.sh diff --git a/packages/google-crc32c/scripts/osx/build_python_wheel.sh b/packages/google-crc32c/scripts/osx/build_python_wheel.sh index c63241677364..1695a1595eb1 100755 --- a/packages/google-crc32c/scripts/osx/build_python_wheel.sh +++ b/packages/google-crc32c/scripts/osx/build_python_wheel.sh @@ -52,12 +52,8 @@ install_python_pyenv() { install_python_pyenv ${PY_BIN} -# ``readlink -f`` is not our friend on OS X. This relies on **some** -# ``python`` being installed. -SCRIPT_FI=$(python3 -c "import os; print(os.path.realpath('${0}'))") -OSX_DIR=$(dirname ${SCRIPT_FI}) -SCRIPTS_DIR=$(dirname ${OSX_DIR}) -export REPO_ROOT=$(dirname ${SCRIPTS_DIR}) +# Rely on the REPO_ROOT already provided by the parent script +OSX_DIR="${REPO_ROOT}/scripts/osx" # Create a virtualenv where we can install Python build dependencies. VENV=${REPO_ROOT}/venv${PY_BIN} diff --git a/packages/google-crc32c/scripts/windows/build.bat b/packages/google-crc32c/scripts/windows/build.bat index c2b6b6fcb779..3757d911d4ce 100644 --- a/packages/google-crc32c/scripts/windows/build.bat +++ b/packages/google-crc32c/scripts/windows/build.bat @@ -40,12 +40,8 @@ FOR %%P IN (3.9, 3.10, 3.11, 3.12, 3.13.1, 3.14.0) DO ( py -!python_version_trimmed!-64 -m pip install cmake @rem Add directory as safe to avoid "detected dubious ownership" fatal issue - git config --global --add safe.directory %cd% - git config --global --add safe.directory C:/tmpfs/src/github/python-crc32c + git config --global --add safe.directory * git submodule update --init --recursive - - git config --global --add safe.directory %cd%\google_crc32c - git config --global --add safe.directory C:/tmpfs/src/github/python-crc32c/google_crc32c pushd google_crc32c @rem reset hard to cleanup any changes done by a previous build. git reset --hard @@ -59,7 +55,7 @@ FOR %%P IN (3.9, 3.10, 3.11, 3.12, 3.13.1, 3.14.0) DO ( echo "Running cmake with Generator: %CMAKE_GENERATOR%, Platform: x64, Install Prefix: %CRC32C_INSTALL_PREFIX%" - py -!python_version_trimmed!-64 -m cmake -G "Visual Studio 17 2022" -A x64 -DCMAKE_POLICY_VERSION_MINIMUM=3.12 -DCRC32C_BUILD_BENCHMARKS=no -DCRC32C_BUILD_TESTS=no -DBUILD_SHARED_LIBS=yes -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=yes -DCRC32C_USE_GLOG=0 -DCMAKE_INSTALL_PREFIX:PATH=C:\tmpfs\src\github\python-crc32c\build\RelWithDebInfo .. + py -!python_version_trimmed!-64 -m cmake -G "Visual Studio 17 2022" -A x64 -DCMAKE_POLICY_VERSION_MINIMUM=3.12 -DCRC32C_BUILD_BENCHMARKS=no -DCRC32C_BUILD_TESTS=no -DBUILD_SHARED_LIBS=yes -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=yes -DCRC32C_USE_GLOG=0 -DCMAKE_INSTALL_PREFIX:PATH="%CRC32C_INSTALL_PREFIX%" .. py -!python_version_trimmed!-64 -m cmake --build . --config "%CONFIGURATION%" --target install