From f1dbbf336f655f479058db121bb3d66434a9311e Mon Sep 17 00:00:00 2001 From: James Xin Date: Tue, 16 Sep 2025 16:43:24 -0700 Subject: [PATCH 01/13] CI: test-pie CI on mac 2nd fix Signed-off-by: James Xin --- .github/workflows/php.yml | 3 ++- .github/workflows/setup-php-extension/action.yml | 14 +++++++++++++- .github/workflows/test-pie.yml | 1 + 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 0e0543d7..cc9a743b 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -219,7 +219,8 @@ jobs: - name: Install shared dependencies uses: ./.github/workflows/install-shared-dependencies with: - target: x86_64-apple-darwin + # "macos-latest" is actually an ARM runner, hence using the ARM target for mac here + target: aarch64-apple-darwin github-token: ${{ secrets.GITHUB_TOKEN }} engine-version: ${{ matrix.engine.version }} diff --git a/.github/workflows/setup-php-extension/action.yml b/.github/workflows/setup-php-extension/action.yml index d63a43c6..0b7f0e8b 100644 --- a/.github/workflows/setup-php-extension/action.yml +++ b/.github/workflows/setup-php-extension/action.yml @@ -10,6 +10,18 @@ inputs: description: Whether to install composer dependencies required: false default: "true" + target: + description: "Specified target for rust toolchain, ex. x86_64-apple-darwin" + type: string + required: false + defalt: "x86_64-unknown-linux-gnu" + options: + - x86_64-unknown-linux-gnu + - aarch64-unknown-linux-gnu + - x86_64-apple-darwin + - aarch64-apple-darwin + - aarch64-unknown-linux-musl + - x86_64-unknown-linux-musl runs: using: composite @@ -17,7 +29,7 @@ runs: - name: Install shared dependencies uses: ./.github/workflows/install-shared-dependencies with: - target: x86_64-unknown-linux-gnu + target: ${{ inputs.target }} github-token: ${{ github.token }} engine-version: "7.2.5" diff --git a/.github/workflows/test-pie.yml b/.github/workflows/test-pie.yml index 22ddf390..84fe3b1c 100644 --- a/.github/workflows/test-pie.yml +++ b/.github/workflows/test-pie.yml @@ -58,6 +58,7 @@ jobs: with: php-version: ${{ matrix.php }} install-composer-deps: "true" + target: ${{ matrix.host.TARGET }} - name: Create manual Composer repository run: | From b4071d16b207668a8f6b83fc8fd55f9902b22c9d Mon Sep 17 00:00:00 2001 From: James Xin Date: Tue, 16 Sep 2025 18:26:09 -0700 Subject: [PATCH 02/13] fix setup-php-extension for mac Signed-off-by: James Xin --- .../workflows/setup-php-extension/action.yml | 31 ++++++++++--------- .github/workflows/test-pie.yml | 1 + 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/.github/workflows/setup-php-extension/action.yml b/.github/workflows/setup-php-extension/action.yml index 0b7f0e8b..bc928b37 100644 --- a/.github/workflows/setup-php-extension/action.yml +++ b/.github/workflows/setup-php-extension/action.yml @@ -22,6 +22,14 @@ inputs: - aarch64-apple-darwin - aarch64-unknown-linux-musl - x86_64-unknown-linux-musl + os: + description: "The current operating system" + required: true + type: string + options: + - amazon-linux + - macos + - ubuntu runs: using: composite @@ -29,6 +37,7 @@ runs: - name: Install shared dependencies uses: ./.github/workflows/install-shared-dependencies with: + os: ${{ inputs.os }} target: ${{ inputs.target }} github-token: ${{ github.token }} engine-version: "7.2.5" @@ -40,7 +49,8 @@ runs: extensions: none tools: pie, jq - - name: Install system dependencies + - name: Install system dependencies for Ubuntu + if: inputs.os == 'ubuntu' shell: bash env: PHP_VERSION: ${{ inputs.php-version }} @@ -51,20 +61,13 @@ runs: "php${PHP_VERSION}-curl" \ "php${PHP_VERSION}-xml" \ build-essential \ - autoconf \ - automake \ - libtool \ - pkg-config \ - libssl-dev \ - clang-format \ - protobuf-c-compiler \ - libprotobuf-c-dev \ - libprotobuf-c1 + clang-format - - name: Install Rust and protoc - uses: ./.github/workflows/install-rust-and-protoc - with: - github-token: ${{ github.token }} + - name: Install system dependencies for macOS + if: inputs.os == 'macos' + shell: bash + run: | + brew install clang-format - name: Install cbindgen shell: bash diff --git a/.github/workflows/test-pie.yml b/.github/workflows/test-pie.yml index 84fe3b1c..939839b5 100644 --- a/.github/workflows/test-pie.yml +++ b/.github/workflows/test-pie.yml @@ -59,6 +59,7 @@ jobs: php-version: ${{ matrix.php }} install-composer-deps: "true" target: ${{ matrix.host.TARGET }} + os: ${{ matrix.host.OS }} - name: Create manual Composer repository run: | From ad4c0ca2388995445df1af44776a0deadd7236be Mon Sep 17 00:00:00 2001 From: James Xin Date: Tue, 16 Sep 2025 18:47:56 -0700 Subject: [PATCH 03/13] fix install-zig for mac Signed-off-by: James Xin --- .github/workflows/install-zig/action.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/install-zig/action.yml b/.github/workflows/install-zig/action.yml index c3ebf511..eb709dda 100644 --- a/.github/workflows/install-zig/action.yml +++ b/.github/workflows/install-zig/action.yml @@ -6,7 +6,9 @@ runs: - name: Install zig shell: bash run: | - if [[ `cat /etc/os-release | grep "Amazon Linux"` ]]; then + if [[ "$OSTYPE" == "darwin"* ]]; then + echo "macOS detected, pip3 already available" + elif [[ `cat /etc/os-release | grep "Amazon Linux"` ]]; then yum install -y python3-pip else sudo apt install -y python3-pip From 6682665f5c55fe0a3b42040cc2c35e1025ce523e Mon Sep 17 00:00:00 2001 From: James Xin Date: Wed, 17 Sep 2025 03:17:34 -0700 Subject: [PATCH 04/13] restore install-rust-and-protoc and skip mkdir in /root/ on mac Signed-off-by: James Xin --- .github/workflows/setup-php-extension/action.yml | 5 +++++ .github/workflows/test-pie.yml | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/setup-php-extension/action.yml b/.github/workflows/setup-php-extension/action.yml index bc928b37..90fc90ae 100644 --- a/.github/workflows/setup-php-extension/action.yml +++ b/.github/workflows/setup-php-extension/action.yml @@ -69,6 +69,11 @@ runs: run: | brew install clang-format + - name: Install Rust and protoc + uses: ./.github/workflows/install-rust-and-protoc + with: + github-token: ${{ github.token }} + - name: Install cbindgen shell: bash run: cargo install cbindgen diff --git a/.github/workflows/test-pie.yml b/.github/workflows/test-pie.yml index 939839b5..799cd3bb 100644 --- a/.github/workflows/test-pie.yml +++ b/.github/workflows/test-pie.yml @@ -109,7 +109,10 @@ jobs: # Initialize composer config directories and fix permissions mkdir -p "$HOME/.config/composer" - sudo mkdir -p /root/.config/composer + # Skip root directory creation on macOS due to SIP + if [[ "${{ matrix.host.OS }}" != "macos" ]]; then + sudo mkdir -p /root/.config/composer + fi # Make sure root can read the user's composer config sudo chmod -R 755 "$HOME/.config/composer" From bf6acc0ef526b342b56695001843451a591f2a5b Mon Sep 17 00:00:00 2001 From: James Xin Date: Wed, 17 Sep 2025 03:35:03 -0700 Subject: [PATCH 05/13] restore all apt install Signed-off-by: James Xin --- .github/workflows/setup-php-extension/action.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/setup-php-extension/action.yml b/.github/workflows/setup-php-extension/action.yml index 90fc90ae..ca0993f9 100644 --- a/.github/workflows/setup-php-extension/action.yml +++ b/.github/workflows/setup-php-extension/action.yml @@ -61,7 +61,15 @@ runs: "php${PHP_VERSION}-curl" \ "php${PHP_VERSION}-xml" \ build-essential \ - clang-format + autoconf \ + automake \ + libtool \ + pkg-config \ + libssl-dev \ + clang-format \ + protobuf-c-compiler \ + libprotobuf-c-dev \ + libprotobuf-c1 - name: Install system dependencies for macOS if: inputs.os == 'macos' From 2ef3eca42346bfba7e24a0babad1f694bf22606a Mon Sep 17 00:00:00 2001 From: James Xin Date: Wed, 17 Sep 2025 03:50:02 -0700 Subject: [PATCH 06/13] additional brew install for mac Signed-off-by: James Xin --- .github/workflows/setup-php-extension/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/setup-php-extension/action.yml b/.github/workflows/setup-php-extension/action.yml index ca0993f9..59c3b9ea 100644 --- a/.github/workflows/setup-php-extension/action.yml +++ b/.github/workflows/setup-php-extension/action.yml @@ -75,7 +75,7 @@ runs: if: inputs.os == 'macos' shell: bash run: | - brew install clang-format + brew install autoconf automake libtool pkg-config protobuf-c clang-format - name: Install Rust and protoc uses: ./.github/workflows/install-rust-and-protoc From 5bdc15ddc5d7d2a3fba9ccdc20deb86036c3ba84 Mon Sep 17 00:00:00 2001 From: James Xin Date: Wed, 17 Sep 2025 04:20:38 -0700 Subject: [PATCH 07/13] additional http server check Signed-off-by: James Xin --- .github/json_matrices/build-matrix.json | 2 + .github/workflows/test-pie.yml | 26 +++++++- .vscode/launch.json | 32 --------- .vscode/settings.json | 86 ------------------------- .vscode/tasks.json | 41 ------------ 5 files changed, 27 insertions(+), 160 deletions(-) delete mode 100644 .vscode/launch.json delete mode 100644 .vscode/settings.json delete mode 100644 .vscode/tasks.json diff --git a/.github/json_matrices/build-matrix.json b/.github/json_matrices/build-matrix.json index cfca4b2e..8135974d 100644 --- a/.github/json_matrices/build-matrix.json +++ b/.github/json_matrices/build-matrix.json @@ -26,6 +26,8 @@ "ARCH": "arm64", "TARGET": "aarch64-apple-darwin", "PACKAGE_MANAGERS": ["pypi", "npm", "maven", "pkg_go_dev"], + "comment": "Making mac always run for in-PR testing, to be removed", + "run": "always", "languages": ["python", "node", "java", "go", "dotnet", "php"] }, { diff --git a/.github/workflows/test-pie.yml b/.github/workflows/test-pie.yml index 799cd3bb..283813ce 100644 --- a/.github/workflows/test-pie.yml +++ b/.github/workflows/test-pie.yml @@ -99,7 +99,20 @@ jobs: # Start HTTP server cd web && python3 -m http.server 8000 & echo $! > ../server.pid - sleep 3 + + # Wait for server to be ready with proper health check + echo "Waiting for HTTP server to start..." + for i in {1..30}; do + if curl -s http://localhost:8000/packages.json >/dev/null 2>&1; then + echo "HTTP server is ready" + break + fi + if [ $i -eq 30 ]; then + echo "HTTP server failed to start after 30 seconds" + exit 1 + fi + sleep 1 + done - name: Test PIE with manual repository run: | @@ -122,6 +135,17 @@ jobs: sudo chown -R root:root "$HOME/.config/composer" || true fi + # Verify HTTP server is accessible before proceeding + echo "=== Verifying HTTP server accessibility ===" + curl -v http://localhost:8000/packages.json || { + echo "ERROR: Cannot access local HTTP server" + echo "Server process status:" + ps aux | grep "python.*http.server" || echo "No HTTP server process found" + echo "Port 8000 status:" + lsof -i :8000 || echo "Port 8000 not in use" + exit 1 + } + # Add local repository pie repository:add composer http://localhost:8000 diff --git a/.vscode/launch.json b/.vscode/launch.json deleted file mode 100644 index 7f53347c..00000000 --- a/.vscode/launch.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "version": "0.2.0", - "configurations": [ - { - // Use IntelliSense to find out which attributes exist for C# debugging - // Use hover for the description of the existing attributes - // For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md - "name": ".NET Core Launch (console)", - "type": "coreclr", - "request": "launch", - "preLaunchTask": "build", - // If you have changed target frameworks, make sure to update the program path. - "program": "${workspaceFolder}/csharp/tests/bin/Debug/net6.0/tests.dll", - "args": [], - "cwd": "${workspaceFolder}/csharp/tests", - // For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console - "console": "internalConsole", - "stopAtEntry": false - }, - { - "name": "C# benchmark Launch (console)", - "type": "coreclr", - "request": "launch", - "preLaunchTask": "build", - "program": "${workspaceFolder}/benchmarks/csharp/bin/Debug/net8.0/csharp_benchmark.dll", - "args": [], - "cwd": "${workspaceFolder}/benchmarks/csharp", - "console": "internalConsole", - "stopAtEntry": true - } - ] -} diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index 13f59ede..00000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,86 +0,0 @@ -{ - "editor.insertSpaces": true, - "editor.tabSize": 4, - "editor.codeActionsOnSave": { - "source.organizeImports": "always" - }, - "rust-analyzer.procMacro.ignored": { - "napi-derive": [ - "napi" - ] - }, - "editor.formatOnSave": true, - "files.insertFinalNewline": true, - "files.trimFinalNewlines": true, - "python.formatting.provider": "black", - "rust-analyzer.linkedProjects": [ - "glide-core/Cargo.toml", - "python/Cargo.toml", - "node/rust-client/Cargo.toml", - "logger_core/Cargo.toml", - "csharp/rust/Cargo.toml", - "glide-core/redis-rs/Cargo.toml", - "benchmarks/rust/Cargo.toml", - "java/Cargo.toml", - "ffi/Cargo.toml", - ], - "rust-analyzer.runnableEnv": { - "REDISRS_SERVER_TYPE": "tcp" - }, - "python.testing.pytestArgs": [ - "python" - ], - "python.testing.unittestEnabled": false, - "python.testing.pytestEnabled": true, - "[github-actions-workflow]": { - "editor.defaultFormatter": "esbenp.prettier-vscode" - }, - "yaml.schemas": { - "https://json.schemastore.org/github-workflow.json": [ - "*.github/workflows/*.yaml", - "*.github/workflows/*.yml", - ], - "https://json.schemastore.org/github-action.json": [ - "action.yaml", - "action.yml", - ] - }, - "[yaml]": { - "editor.tabSize": 4, - "editor.defaultFormatter": "redhat.vscode-yaml" - }, - "python.linting.flake8Enabled": false, - "python.linting.enabled": true, - "python.linting.flake8Args": [ - "--extend-ignore=E203", - "--max-line-length=127" - ], - "python.formatting.blackArgs": [ - "--target-version", - "py36" - ], - "isort.args": [ - "--profile", - "black" - ], - "rust-analyzer.cargo.features": "all", - "rust-analyzer.procMacro.enable": true, - "rust-analyzer.cargo.buildScripts.enable": true, - "dotnet.defaultSolution": "csharp/csharp.sln", - "java.compile.nullAnalysis.mode": "automatic", - "java.configuration.updateBuildConfiguration": "interactive", - "files.associations": { - "**/frontmatter.json": "jsonc", - "**/.frontmatter/config/*.json": "jsonc", - "iosfwd": "cpp", - "__node_handle": "c", - "valkey_glide_cluster_arginfo.h": "c" - }, - "php.validate.enable": true, - "php.validate.executablePath": "/usr/bin/php", - "phpcs.enable": true, - "phpcs.executablePath": "/usr/local/bin/phpcs", - "phpcs.standard": "PSR12", - "php-cs-fixer.executablePath": "/usr/local/bin/php-cs-fixer", - "php-cs-fixer.onsave": true -} diff --git a/.vscode/tasks.json b/.vscode/tasks.json deleted file mode 100644 index f5f11a93..00000000 --- a/.vscode/tasks.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "version": "2.0.0", - "tasks": [ - { - "label": "build", - "command": "dotnet", - "type": "process", - "args": [ - "build", - "${workspaceFolder}/csharp/tests/tests.csproj", - "/property:GenerateFullPaths=true", - "/consoleloggerparameters:NoSummary" - ], - "problemMatcher": "$msCompile" - }, - { - "label": "publish", - "command": "dotnet", - "type": "process", - "args": [ - "publish", - "${workspaceFolder}/csharp/tests/tests.csproj", - "/property:GenerateFullPaths=true", - "/consoleloggerparameters:NoSummary" - ], - "problemMatcher": "$msCompile" - }, - { - "label": "watch", - "command": "dotnet", - "type": "process", - "args": [ - "watch", - "run", - "--project", - "${workspaceFolder}/csharp/tests/tests.csproj" - ], - "problemMatcher": "$msCompile" - } - ] -} \ No newline at end of file From 7001397414705569bba5333e9faefd350ce5da73 Mon Sep 17 00:00:00 2001 From: James Xin Date: Wed, 17 Sep 2025 04:38:56 -0700 Subject: [PATCH 08/13] check alt path for .so file on mac Signed-off-by: James Xin --- .github/workflows/test-pie.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/test-pie.yml b/.github/workflows/test-pie.yml index 283813ce..8dadc7c1 100644 --- a/.github/workflows/test-pie.yml +++ b/.github/workflows/test-pie.yml @@ -230,6 +230,20 @@ jobs: php-config --extension-dir ls -la $(php-config --extension-dir) | grep valkey || echo "valkey_glide.so not found in extension directory" + # Check if PIE installed to a different location (macOS Homebrew specific) + if [[ "${{ matrix.host.OS }}" == "macos" ]]; then + echo "=== Checking alternative extension locations ===" + find /opt/homebrew/lib/php -name "valkey_glide.so" 2>/dev/null || echo "No valkey_glide.so found in /opt/homebrew/lib/php" + + # If found in alternative location, create symlink + ALT_SO=$(find /opt/homebrew/lib/php -name "valkey_glide.so" 2>/dev/null | head -1) + if [ -n "$ALT_SO" ] && [ ! -f "$(php-config --extension-dir)/valkey_glide.so" ]; then + echo "Found extension at: $ALT_SO" + echo "Creating symlink to: $(php-config --extension-dir)/valkey_glide.so" + sudo ln -sf "$ALT_SO" "$(php-config --extension-dir)/valkey_glide.so" + fi + fi + echo "=== Looking for built extension in PIE working directory ===" PIE_WORK_DIR=$(find "$HOME/.config/pie" -name "valkey-glide-php" -type d | head -1) if [ -n "$PIE_WORK_DIR" ]; then From daa497f8fe0aa50bf7181a70be1a3950bea50eb6 Mon Sep 17 00:00:00 2001 From: James Xin Date: Tue, 4 Nov 2025 09:27:35 -0800 Subject: [PATCH 09/13] install to PHP extension directory Signed-off-by: James Xin --- .github/workflows/run-php-tests/action.yml | 20 +++----------------- .github/workflows/test-pie.yml | 8 ++++++++ 2 files changed, 11 insertions(+), 17 deletions(-) diff --git a/.github/workflows/run-php-tests/action.yml b/.github/workflows/run-php-tests/action.yml index 5c6e7689..1a6e30c8 100644 --- a/.github/workflows/run-php-tests/action.yml +++ b/.github/workflows/run-php-tests/action.yml @@ -80,17 +80,9 @@ runs: # Debug: Check if extension is loaded and classes exist echo "=== Extension Debug Info ===" echo "Extension path: $EXTENSION_PATH" + echo "Loading extension by name: $EXTENSION_PATH" - # Check if this is a file path or extension name - if [[ -f "$EXTENSION_PATH" ]]; then - echo "Loading extension from file: $EXTENSION_PATH" - EXTENSION_ARG="extension=$EXTENSION_PATH" - else - echo "Loading extension by name: $EXTENSION_PATH" - EXTENSION_ARG="extension=$EXTENSION_PATH" - fi - - php -n -d "$EXTENSION_ARG" -r " + php -n -d "extension=$EXTENSION_PATH" -r " echo 'Extension loaded: ' . (extension_loaded('valkey_glide') ? 'YES' : 'NO') . PHP_EOL; echo 'Extension version: ' . phpversion('valkey_glide') . PHP_EOL; echo 'Extension functions: ' . PHP_EOL; @@ -104,16 +96,10 @@ runs: } } echo 'ClientConstructorMock exists: ' . (class_exists('ClientConstructorMock') ? 'YES' : 'NO') . PHP_EOL; - if (class_exists('ClientConstructorMock')) { - echo 'ClientConstructorMock methods: ' . PHP_EOL; - foreach (get_class_methods('ClientConstructorMock') as \$method) { - echo ' - ' . \$method . PHP_EOL; - } - } " # Run tests using extension loading - php -n -d "$EXTENSION_ARG" tests/TestValkeyGlide.php + php -n -d "extension=$EXTENSION_PATH" tests/TestValkeyGlide.php - name: Run integration tests shell: bash diff --git a/.github/workflows/test-pie.yml b/.github/workflows/test-pie.yml index 8dadc7c1..8f11841a 100644 --- a/.github/workflows/test-pie.yml +++ b/.github/workflows/test-pie.yml @@ -244,6 +244,14 @@ jobs: fi fi + # If extension was built but not installed, install it manually + PIE_SO=$(find "$HOME/.config/pie" -name "valkey_glide.so" -type f 2>/dev/null | head -1) + if [ -n "$PIE_SO" ] && [ ! -f "$(php-config --extension-dir)/valkey_glide.so" ]; then + echo "Installing extension from: $PIE_SO" + sudo cp "$PIE_SO" "$(php-config --extension-dir)/valkey_glide.so" + echo "Extension installed to: $(php-config --extension-dir)/valkey_glide.so" + fi + echo "=== Looking for built extension in PIE working directory ===" PIE_WORK_DIR=$(find "$HOME/.config/pie" -name "valkey-glide-php" -type d | head -1) if [ -n "$PIE_WORK_DIR" ]; then From c9670f14c6058c8ca91fae5538e2552ed2c1b271 Mon Sep 17 00:00:00 2001 From: James Xin Date: Tue, 4 Nov 2025 13:42:32 -0800 Subject: [PATCH 10/13] find extension in pecl directory Signed-off-by: James Xin --- .github/workflows/run-php-tests/action.yml | 45 ++++++++++++++-------- 1 file changed, 28 insertions(+), 17 deletions(-) diff --git a/.github/workflows/run-php-tests/action.yml b/.github/workflows/run-php-tests/action.yml index 1a6e30c8..89385d5d 100644 --- a/.github/workflows/run-php-tests/action.yml +++ b/.github/workflows/run-php-tests/action.yml @@ -77,29 +77,40 @@ runs: env: EXTENSION_PATH: ${{ inputs.extension-path }} run: | - # Debug: Check if extension is loaded and classes exist + # Find the actual .so file location + SO_FILE="" + + # Check common locations + if [[ -f "$EXTENSION_PATH" ]]; then + SO_FILE="$EXTENSION_PATH" + elif [[ -f "$(php-config --extension-dir)/${EXTENSION_PATH}.so" ]]; then + SO_FILE="$(php-config --extension-dir)/${EXTENSION_PATH}.so" + else + # Search for the extension in common PHP directories + for dir in /opt/homebrew/lib/php/pecl /opt/homebrew/Cellar/php*/*/pecl /usr/lib/php; do + FOUND=$(find "$dir" -name "${EXTENSION_PATH}.so" 2>/dev/null | head -1) + if [[ -n "$FOUND" ]]; then + SO_FILE="$FOUND" + break + fi + done + fi + + if [[ -z "$SO_FILE" ]]; then + echo "ERROR: Extension .so file not found" + exit 1 + fi + echo "=== Extension Debug Info ===" - echo "Extension path: $EXTENSION_PATH" - echo "Loading extension by name: $EXTENSION_PATH" + echo "Found extension at: $SO_FILE" - php -n -d "extension=$EXTENSION_PATH" -r " + php -n -d "extension=$SO_FILE" -r " echo 'Extension loaded: ' . (extension_loaded('valkey_glide') ? 'YES' : 'NO') . PHP_EOL; - echo 'Extension version: ' . phpversion('valkey_glide') . PHP_EOL; - echo 'Extension functions: ' . PHP_EOL; - foreach (get_extension_funcs('valkey_glide') as \$func) { - echo ' - ' . \$func . PHP_EOL; - } - echo 'All declared classes: ' . PHP_EOL; - foreach (get_declared_classes() as \$class) { - if (strpos(\$class, 'Valkey') !== false || strpos(\$class, 'Client') !== false || strpos(\$class, 'Mock') !== false) { - echo ' - ' . \$class . PHP_EOL; - } - } echo 'ClientConstructorMock exists: ' . (class_exists('ClientConstructorMock') ? 'YES' : 'NO') . PHP_EOL; " - # Run tests using extension loading - php -n -d "extension=$EXTENSION_PATH" tests/TestValkeyGlide.php + # Run tests + php -n -d "extension=$SO_FILE" tests/TestValkeyGlide.php - name: Run integration tests shell: bash From 8fee23694ac5402e8ae9eda35d97f43c4049332c Mon Sep 17 00:00:00 2001 From: James Xin Date: Tue, 4 Nov 2025 14:09:56 -0800 Subject: [PATCH 11/13] install latest protobuf on mac Signed-off-by: James Xin --- .github/workflows/build-php-wrapper/action.yml | 3 +-- .github/workflows/run-php-tests/action.yml | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-php-wrapper/action.yml b/.github/workflows/build-php-wrapper/action.yml index 8407c4ec..db894a79 100644 --- a/.github/workflows/build-php-wrapper/action.yml +++ b/.github/workflows/build-php-wrapper/action.yml @@ -56,7 +56,7 @@ runs: if: ${{ inputs.os == 'macos' }} shell: bash run: | - brew install autoconf automake libtool pkg-config protobuf@3 openssl clang-format + brew install autoconf automake libtool pkg-config protobuf openssl clang-format - name: Install protobuf compiler (Ubuntu) if: ${{ inputs.os == 'ubuntu' }} @@ -73,7 +73,6 @@ runs: if: ${{ inputs.os == 'macos' }} shell: bash run: | - echo 'export PATH="/opt/homebrew/opt/protobuf@3/bin:$PATH"' >> $GITHUB_ENV # Install protobuf-c brew install protobuf-c diff --git a/.github/workflows/run-php-tests/action.yml b/.github/workflows/run-php-tests/action.yml index 89385d5d..35ae6021 100644 --- a/.github/workflows/run-php-tests/action.yml +++ b/.github/workflows/run-php-tests/action.yml @@ -79,7 +79,7 @@ runs: run: | # Find the actual .so file location SO_FILE="" - + # Check common locations if [[ -f "$EXTENSION_PATH" ]]; then SO_FILE="$EXTENSION_PATH" From ca4f0546ee444f1586101f3d43e6511fe47ec8a2 Mon Sep 17 00:00:00 2001 From: James Xin Date: Tue, 4 Nov 2025 14:52:18 -0800 Subject: [PATCH 12/13] install composer as a tool of setup-php Signed-off-by: James Xin --- .github/workflows/build-php-wrapper/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-php-wrapper/action.yml b/.github/workflows/build-php-wrapper/action.yml index db894a79..38c13313 100644 --- a/.github/workflows/build-php-wrapper/action.yml +++ b/.github/workflows/build-php-wrapper/action.yml @@ -25,7 +25,7 @@ runs: with: php-version: ${{ inputs.php-version }} extensions: tokenizer, json, ctype, iconv, mbstring - tools: none + tools: composer env: runner: self-hosted From 48ffe59db92e846e76231dd9735180305fc14fbe Mon Sep 17 00:00:00 2001 From: James Xin Date: Wed, 5 Nov 2025 01:06:13 -0800 Subject: [PATCH 13/13] remove temp always run tag on arm mac Signed-off-by: James Xin --- .github/json_matrices/build-matrix.json | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/json_matrices/build-matrix.json b/.github/json_matrices/build-matrix.json index 8135974d..cfca4b2e 100644 --- a/.github/json_matrices/build-matrix.json +++ b/.github/json_matrices/build-matrix.json @@ -26,8 +26,6 @@ "ARCH": "arm64", "TARGET": "aarch64-apple-darwin", "PACKAGE_MANAGERS": ["pypi", "npm", "maven", "pkg_go_dev"], - "comment": "Making mac always run for in-PR testing, to be removed", - "run": "always", "languages": ["python", "node", "java", "go", "dotnet", "php"] }, {