also looking at this
chore(deps): update all non-major dependencies
#185
10 files
+301
-78
| @@ -130,7 +130,7 @@ jobs: | ||
| 130 | 130 | |
| 131 | 131 | - name: Setup PHP and Composer (if needed) |
| 132 | 132 | if: ${{ hashFiles('composer.json') != '' }} |
| 133 | uses: shivammathur/setup-php@v2 | |
| 133 | uses: shivammathur/setup-php@2.35.5 | |
| 134 | 134 | with: |
| 135 | 135 | php-version: '8.4' |
| 136 | 136 | tools: composer |
| @@ -248,7 +248,7 @@ jobs: | ||
| 248 | 248 | |
| 249 | 249 | - name: Setup PHP and Composer (if needed) |
| 250 | 250 | if: ${{ hashFiles('composer.json') != '' }} |
| 251 | uses: shivammathur/setup-php@v2 | |
| 251 | uses: shivammathur/setup-php@2.35.5 | |
| 252 | 252 | with: |
| 253 | 253 | php-version: '8.4' |
| 254 | 254 | tools: composer |
| @@ -21,10 +21,10 @@ jobs: | ||
| 21 | 21 | - uses: actions/checkout@v4 |
| 22 | 22 | |
| 23 | 23 | - name: Install Bun |
| 24 | uses: oven-sh/setup-bun@v2 | |
| 24 | uses: oven-sh/setup-bun@v2.0.2 | |
| 25 | 25 | |
| 26 | 26 | - name: Use cached node_modules |
| 27 | uses: actions/cache@v4 | |
| 27 | uses: actions/cache@v4.3.0 | |
| 28 | 28 | with: |
| 29 | 29 | path: node_modules |
| 30 | 30 | key: node-modules-${{ hashFiles('**/bun.lock') }} |
| @@ -44,10 +44,10 @@ jobs: | ||
| 44 | 44 | - uses: actions/checkout@v4 |
| 45 | 45 | |
| 46 | 46 | - name: Install Bun |
| 47 | uses: oven-sh/setup-bun@v2 | |
| 47 | uses: oven-sh/setup-bun@v2.0.2 | |
| 48 | 48 | |
| 49 | 49 | - name: Use cached node_modules |
| 50 | uses: actions/cache@v4 | |
| 50 | uses: actions/cache@v4.3.0 | |
| 51 | 51 | with: |
| 52 | 52 | path: node_modules |
| 53 | 53 | key: node-modules-${{ hashFiles('**/bun.lock') }} |
| @@ -67,10 +67,10 @@ jobs: | ||
| 67 | 67 | - uses: actions/checkout@v4 |
| 68 | 68 | |
| 69 | 69 | - name: Install Bun |
| 70 | uses: oven-sh/setup-bun@v2 | |
| 70 | uses: oven-sh/setup-bun@v2.0.2 | |
| 71 | 71 | |
| 72 | 72 | - name: Use cached node_modules |
| 73 | uses: actions/cache@v4 | |
| 73 | uses: actions/cache@v4.3.0 | |
| 74 | 74 | with: |
| 75 | 75 | path: node_modules |
| 76 | 76 | key: node-modules-${{ hashFiles('**/bun.lock') }} |
| @@ -93,10 +93,10 @@ jobs: | ||
| 93 | 93 | - uses: actions/checkout@v4 |
| 94 | 94 | |
| 95 | 95 | - name: Install Bun |
| 96 | uses: oven-sh/setup-bun@v2 | |
| 96 | uses: oven-sh/setup-bun@v2.0.2 | |
| 97 | 97 | |
| 98 | 98 | - name: Use cached node_modules |
| 99 | uses: actions/cache@v4 | |
| 99 | uses: actions/cache@v4.3.0 | |
| 100 | 100 | with: |
| 101 | 101 | path: node_modules |
| 102 | 102 | key: node-modules-${{ hashFiles('**/bun.lock') }} |
| @@ -9,13 +9,13 @@ on: | ||
| 9 | 9 | workflow_dispatch: |
| 10 | 10 | inputs: |
| 11 | 11 | php_version: |
| 12 | description: 'PHP version to build (leave empty for auto-detection)' | |
| 12 | description: PHP version to build (leave empty for auto-detection) | |
| 13 | 13 | required: false |
| 14 | 14 | type: string |
| 15 | 15 | php_config: |
| 16 | description: 'PHP build configuration' | |
| 16 | description: PHP build configuration | |
| 17 | 17 | required: true |
| 18 | default: 'laravel-mysql' | |
| 18 | default: laravel-mysql | |
| 19 | 19 | type: choice |
| 20 | 20 | options: |
| 21 | 21 | - laravel-mysql |
| @@ -26,7 +26,7 @@ on: | ||
| 26 | 26 | - wordpress |
| 27 | 27 | - full-stack |
| 28 | 28 | force_rebuild: |
| 29 | description: 'Force rebuild even if no updates' | |
| 29 | description: Force rebuild even if no updates | |
| 30 | 30 | required: false |
| 31 | 31 | default: false |
| 32 | 32 | type: boolean |
| @@ -117,19 +117,23 @@ jobs: | ||
| 117 | 117 | - full-stack |
| 118 | 118 | os: |
| 119 | 119 | - ubuntu-latest |
| 120 | - macos-13 | |
| 121 | - macos-latest | |
| 120 | - macos-14 | |
| 121 | - macos-15 | |
| 122 | - macos-15-intel | |
| 122 | 123 | - windows-latest |
| 123 | 124 | include: |
| 124 | 125 | - os: ubuntu-latest |
| 125 | 126 | platform: linux |
| 126 | 127 | arch: x86_64 |
| 127 | - os: macos-13 | |
| 128 | - os: macos-14 | |
| 128 | 129 | platform: darwin |
| 129 | 130 | arch: x86_64 |
| 130 | - os: macos-latest | |
| 131 | - os: macos-15 | |
| 131 | 132 | platform: darwin |
| 132 | 133 | arch: arm64 |
| 134 | - os: macos-15-intel | |
| 135 | platform: darwin | |
| 136 | arch: x86_64 | |
| 133 | 137 | - os: windows-latest |
| 134 | 138 | platform: win32 |
| 135 | 139 | arch: x86_64 |
| @@ -165,11 +169,87 @@ jobs: | ||
| 165 | 169 | - name: Install build dependencies (macOS) |
| 166 | 170 | if: matrix.platform == 'darwin' |
| 167 | 171 | run: | |
| 168 | # Fallback to Homebrew for reliable CI builds | |
| 169 | brew install autoconf automake libtool pkg-config bison re2c libxml2 openssl curl libpng jpeg freetype oniguruma libzip postgresql readline bzip2 gmp openldap libxslt icu4c libsodium zlib gettext | |
| 170 | # Set up environment for Homebrew tools | |
| 171 | echo "/opt/homebrew/bin:/usr/local/bin:$PATH" >> $GITHUB_PATH | |
| 172 | echo "PKG_CONFIG_PATH=/opt/homebrew/lib/pkgconfig:/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH" >> $GITHUB_ENV | |
| 172 | # macOS: Let Launchpad handle all dependencies | |
| 173 | echo "📦 macOS build will use Launchpad for all dependencies" | |
| 174 | echo "🚀 Installing PHP dependencies via Launchpad first..." | |
| 175 | ||
| 176 | # Pre-install dependencies to ensure they're available | |
| 177 | echo "🔧 Pre-installing dependencies via Launchpad..." | |
| 178 | bun run launchpad install php --deps-only | |
| 179 | ||
| 180 | # Wait for dependencies to be fully installed | |
| 181 | echo "⏳ Waiting for dependency installation to complete..." | |
| 182 | sleep 10 | |
| 183 | ||
| 184 | # Debug: Check what was actually installed | |
| 185 | echo "🔍 Checking installed dependencies..." | |
| 186 | echo "📁 .local directory structure (first level):" | |
| 187 | find "$HOME/.local" -maxdepth 2 -type d | sort | head -20 | |
| 188 | ||
| 189 | echo "🔍 Looking for pkg-config specifically..." | |
| 190 | find "$HOME/.local" -name "*pkg*" -type f 2>/dev/null | head -10 || echo "No pkg-related files found" | |
| 191 | ||
| 192 | echo "🔍 Looking for freedesktop.org directory..." | |
| 193 | find "$HOME/.local" -path "*freedesktop*" -type d 2>/dev/null | head -5 || echo "No freedesktop.org directories found" | |
| 194 | ||
| 195 | # Debug: Check if pkg-config is available | |
| 196 | echo "🔍 Checking for pkg-config..." | |
| 197 | if command -v pkg-config >/dev/null 2>&1; then | |
| 198 | echo "✅ pkg-config found: $(which pkg-config)" | |
| 199 | echo "📋 pkg-config version: $(pkg-config --version)" | |
| 200 | else | |
| 201 | echo "❌ pkg-config not found in PATH" | |
| 202 | echo "🔍 Searching for pkg-config in .local..." | |
| 203 | find "$HOME/.local" -name "pkg-config" -type f 2>/dev/null || echo "No pkg-config found in .local" | |
| 204 | fi | |
| 205 | ||
| 206 | # Debug: Check if ICU libraries are available | |
| 207 | echo "🔍 Checking for ICU libraries..." | |
| 208 | if [ -d "$HOME/.local/unicode.org" ]; then | |
| 209 | echo "✅ ICU libraries found at: $HOME/.local/unicode.org" | |
| 210 | ls -la "$HOME/.local/unicode.org/" | |
| 211 | if [ -f "$HOME/.local/unicode.org"/*/lib/pkgconfig/icu-uc.pc ]; then | |
| 212 | echo "✅ ICU pkgconfig files found" | |
| 213 | find "$HOME/.local/unicode.org" -name "*.pc" -type f | head -5 | |
| 214 | else | |
| 215 | echo "❌ ICU pkgconfig files not found" | |
| 216 | fi | |
| 217 | else | |
| 218 | echo "❌ ICU libraries not found" | |
| 219 | fi | |
| 220 | ||
| 221 | # Debug: Check libxml2 libraries | |
| 222 | echo "🔍 Checking for libxml2 libraries..." | |
| 223 | if [ -d "$HOME/.local/gnome.org/libxml2" ]; then | |
| 224 | echo "✅ libxml2 libraries found at: $HOME/.local/gnome.org/libxml2" | |
| 225 | ls -la "$HOME/.local/gnome.org/libxml2/" | |
| 226 | if [ -f "$HOME/.local/gnome.org/libxml2"/*/lib/pkgconfig/libxml-2.0.pc ]; then | |
| 227 | echo "✅ libxml2 pkgconfig files found" | |
| 228 | find "$HOME/.local/gnome.org/libxml2" -name "libxml-2.0.pc" -type f | |
| 229 | else | |
| 230 | echo "❌ libxml2 pkgconfig files not found" | |
| 231 | fi | |
| 232 | else | |
| 233 | echo "❌ libxml2 libraries not found" | |
| 234 | fi | |
| 235 | ||
| 236 | # Debug: Check PATH and PKG_CONFIG_PATH | |
| 237 | echo "🔍 Environment check:" | |
| 238 | echo "PATH includes unicode.org: $(echo $PATH | grep -o unicode.org || echo 'NO')" | |
| 239 | echo "PATH includes freedesktop.org: $(echo $PATH | grep -o freedesktop.org || echo 'NO')" | |
| 240 | echo "PKG_CONFIG_PATH: ${PKG_CONFIG_PATH:-'NOT SET'}" | |
| 241 | ||
| 242 | # Debug: Check if Launchpad environment script exists | |
| 243 | echo "🔍 Checking for Launchpad environment..." | |
| 244 | if [ -f "$HOME/.local/launchpad.sh" ]; then | |
| 245 | echo "✅ Launchpad environment script found" | |
| 246 | echo "📋 Sourcing environment to check paths..." | |
| 247 | source "$HOME/.local/launchpad.sh" | |
| 248 | echo "PATH after sourcing: ${PATH:0:200}..." | |
| 249 | echo "PKG_CONFIG_PATH after sourcing: ${PKG_CONFIG_PATH:-'NOT SET'}" | |
| 250 | else | |
| 251 | echo "❌ Launchpad environment script not found" | |
| 252 | fi | |
| 173 | 253 | |
| 174 | 254 | - name: Install build dependencies (Windows) |
| 175 | 255 | if: matrix.platform == 'win32' |
| @@ -181,7 +261,66 @@ jobs: | ||
| 181 | 261 | # Install additional dependencies needed for PHP extensions |
| 182 | 262 | echo "Windows build dependencies installed for PHP compilation" |
| 183 | 263 | |
| 264 | - name: Setup Launchpad Environment (macOS) | |
| 265 | if: matrix.platform == 'darwin' | |
| 266 | shell: bash | |
| 267 | run: | | |
| 268 | # Find and setup Launchpad environment variables | |
| 269 | echo "🔧 Setting up Launchpad environment for macOS build..." | |
| 270 | ||
| 271 | # Store original PATH to preserve system tools | |
| 272 | echo "ORIGINAL_PATH=$PATH" >> $GITHUB_ENV | |
| 273 | ||
| 274 | # Find all Launchpad binary directories that should be added to PATH | |
| 275 | LAUNCHPAD_PATHS="" | |
| 276 | ||
| 277 | # Find pkg-config binary - search broadly first | |
| 278 | echo "🔍 Searching for pkg-config binary..." | |
| 279 | PKG_CONFIG_BINARY=$(find "$HOME/.local" -name "pkg-config" -type f 2>/dev/null | head -1) | |
| 280 | if [ -n "$PKG_CONFIG_BINARY" ]; then | |
| 281 | PKG_CONFIG_DIR=$(dirname "$PKG_CONFIG_BINARY") | |
| 282 | echo "✅ Found pkg-config at: $PKG_CONFIG_DIR" | |
| 283 | LAUNCHPAD_PATHS="$PKG_CONFIG_DIR" | |
| 284 | else | |
| 285 | echo "❌ pkg-config binary not found in .local" | |
| 286 | echo "🔍 Checking if pkg-config exists in system PATH..." | |
| 287 | if command -v pkg-config >/dev/null 2>&1; then | |
| 288 | echo "✅ pkg-config found in system PATH: $(which pkg-config)" | |
| 289 | else | |
| 290 | echo "❌ pkg-config not found anywhere" | |
| 291 | fi | |
| 292 | fi | |
| 293 | ||
| 294 | # Find other essential Launchpad tools that might override system tools | |
| 295 | # We'll be more selective to avoid overriding system tools | |
| 296 | SED_BINARY=$(find "$HOME/.local" -path "*/gnu.org/sed/*/bin/sed" -type f 2>/dev/null | head -1) | |
| 297 | if [ -n "$SED_BINARY" ]; then | |
| 298 | SED_DIR=$(dirname "$SED_BINARY") | |
| 299 | echo "✅ Found sed at: $SED_DIR" | |
| 300 | # Only add sed if we have other tools too, to avoid conflicts | |
| 301 | if [ -n "$LAUNCHPAD_PATHS" ]; then | |
| 302 | LAUNCHPAD_PATHS="$LAUNCHPAD_PATHS:$SED_DIR" | |
| 303 | fi | |
| 304 | fi | |
| 305 | ||
| 306 | # Set the combined Launchpad paths (these will be prepended to PATH later) | |
| 307 | if [ -n "$LAUNCHPAD_PATHS" ]; then | |
| 308 | echo "LAUNCHPAD_BINARY_PATHS=$LAUNCHPAD_PATHS" >> $GITHUB_ENV | |
| 309 | echo "✅ Launchpad binary paths: $LAUNCHPAD_PATHS" | |
| 310 | else | |
| 311 | echo "LAUNCHPAD_BINARY_PATHS=" >> $GITHUB_ENV | |
| 312 | echo "❌ No Launchpad binary paths found - PATH will not be modified" | |
| 313 | fi | |
| 314 | ||
| 315 | # Setup comprehensive PKG_CONFIG_PATH | |
| 316 | PKG_PATHS=$(find "$HOME/.local" -name "pkgconfig" -type d 2>/dev/null | tr '\n' ':') | |
| 317 | if [ -n "$PKG_PATHS" ]; then | |
| 318 | echo "LAUNCHPAD_PKG_CONFIG_PATH=$PKG_PATHS" >> $GITHUB_ENV | |
| 319 | echo "✅ PKG_CONFIG_PATH setup with $(echo "$PKG_PATHS" | tr ':' '\n' | wc -l) directories" | |
| 320 | fi | |
| 321 | ||
| 184 | 322 | - name: Build PHP |
| 323 | shell: bash | |
| 185 | 324 | env: |
| 186 | 325 | PHP_VERSION: ${{ matrix.php_version }} |
| 187 | 326 | PHP_CONFIG: ${{ matrix.config }} |
| @@ -189,16 +328,83 @@ jobs: | ||
| 189 | 328 | TARGET_ARCH: ${{ matrix.arch }} |
| 190 | 329 | BUILD_DIR: ${{ github.workspace }}/build |
| 191 | 330 | OUTPUT_DIR: ${{ github.workspace }}/binaries |
| 192 | run: bun run scripts/build-php.ts | |
| 331 | # Environment for all platforms - will handle PATH logic in shell script | |
| 332 | PKG_CONFIG_PATH: ${{ matrix.platform == 'darwin' && env.LAUNCHPAD_PKG_CONFIG_PATH || env.PKG_CONFIG_PATH }} | |
| 333 | run: | | |
| 334 | # Setup PATH for macOS with Launchpad tools | |
| 335 | if [ "$" = "darwin" ]; then | |
| 336 | echo "🔧 Setting up macOS environment..." | |
| 337 | ||
| 338 | # Preserve original PATH | |
| 339 | ORIGINAL_PATH="$PATH" | |
| 340 | echo "✅ Original PATH: ${ORIGINAL_PATH:0:100}..." | |
| 341 | ||
| 342 | # Add Launchpad binary paths to PATH if they exist | |
| 343 | if [ -n "${LAUNCHPAD_BINARY_PATHS:-}" ] && [ "${LAUNCHPAD_BINARY_PATHS}" != "NOT SET" ]; then | |
| 344 | export PATH="$LAUNCHPAD_BINARY_PATHS:$ORIGINAL_PATH" | |
| 345 | echo "✅ Updated PATH with Launchpad binaries: ${LAUNCHPAD_BINARY_PATHS}" | |
| 346 | else | |
| 347 | echo "❌ No Launchpad binary paths found - using original PATH" | |
| 348 | fi | |
| 349 | ||
| 350 | echo "✅ Final PATH: ${PATH:0:100}..." | |
| 351 | echo "✅ PKG_CONFIG_PATH: ${PKG_CONFIG_PATH:-'NOT SET'}" | |
| 352 | ||
| 353 | # Verify essential system tools are available | |
| 354 | echo "🔧 Checking essential system tools..." | |
| 355 | for tool in curl tar gzip grep tr find wc head; do | |
| 356 | if command -v $tool >/dev/null 2>&1; then | |
| 357 | echo "✅ $tool: $(which $tool)" | |
| 358 | else | |
| 359 | echo "❌ $tool: NOT FOUND" | |
| 360 | fi | |
| 361 | done | |
| 362 | ||
| 363 | # Verify pkg-config is accessible | |
| 364 | echo "🔧 Checking pkg-config..." | |
| 365 | if command -v pkg-config >/dev/null 2>&1; then | |
| 366 | echo "✅ pkg-config is accessible: $(which pkg-config)" | |
| 367 | echo "✅ pkg-config version: $(pkg-config --version)" | |
| 368 | ||
| 369 | # Test libxml-2.0 specifically | |
| 370 | if pkg-config --exists libxml-2.0; then | |
| 371 | echo "✅ libxml-2.0 package found via pkg-config" | |
| 372 | echo "📋 libxml-2.0 cflags: $(pkg-config --cflags libxml-2.0)" | |
| 373 | else | |
| 374 | echo "❌ libxml-2.0 package not found via pkg-config" | |
| 375 | echo "🔍 Available packages: $(pkg-config --list-all | head -10)" | |
| 376 | fi | |
| 377 | else | |
| 378 | echo "❌ pkg-config not accessible" | |
| 379 | echo "🔍 Searching for pkg-config in .local..." | |
| 380 | find "$HOME/.local" -name "pkg-config" -type f 2>/dev/null | head -3 || echo "No pkg-config binaries found" | |
| 381 | fi | |
| 382 | fi | |
| 383 | ||
| 384 | # Run the build script with properly configured environment | |
| 385 | bun run scripts/build-php.ts | |
| 193 | 386 | |
| 194 | 387 | - name: Create tarball (Unix) |
| 195 | 388 | if: matrix.platform != 'win32' |
| 196 | 389 | run: | |
| 390 | # Ensure binaries directory exists and check for builds | |
| 391 | if [ ! -d "binaries" ]; then | |
| 392 | echo "❌ Binaries directory not found" | |
| 393 | ls -la | |
| 394 | exit 1 | |
| 395 | fi | |
| 396 | ||
| 197 | 397 | cd binaries |
| 198 | 398 | BINARY_NAME="php-$-$-$-$" |
| 399 | ||
| 400 | echo "🔍 Looking for binary directory: $BINARY_NAME" | |
| 401 | ls -la | |
| 402 | ||
| 199 | 403 | if [ -d "$BINARY_NAME" ]; then |
| 200 | # Create metadata file | |
| 201 | echo '{"php_version":"$","platform":"$","arch":"$","config":"$","built_at":"'$(date -u +%Y-%m-%dT%H:%M:%SZ)'"}' > "$BINARY_NAME/metadata.json" | |
| 404 | # Create metadata file if it doesn't exist | |
| 405 | if [ ! -f "$BINARY_NAME/metadata.json" ]; then | |
| 406 | echo '{"php_version":"$","platform":"$","arch":"$","config":"$","built_at":"'$(date -u +%Y-%m-%dT%H:%M:%SZ)'"}' > "$BINARY_NAME/metadata.json" | |
| 407 | fi | |
| 202 | 408 | |
| 203 | 409 | # Create tarball |
| 204 | 410 | tar -czf "$BINARY_NAME.tar.gz" "$BINARY_NAME" |
| @@ -206,24 +412,39 @@ jobs: | ||
| 206 | 412 | ls -lh "$BINARY_NAME.tar.gz" |
| 207 | 413 | else |
| 208 | 414 | echo "❌ Binary directory not found: $BINARY_NAME" |
| 415 | echo "Available directories:" | |
| 416 | ls -la | |
| 209 | 417 | exit 1 |
| 210 | 418 | fi |
| 211 | 419 | |
| 212 | 420 | - name: Create tarball (Windows) |
| 213 | 421 | if: matrix.platform == 'win32' |
| 214 | 422 | run: | |
| 423 | # Ensure binaries directory exists and check for builds | |
| 424 | if (-not (Test-Path -Path "binaries" -PathType Container)) { | |
| 425 | Write-Host "❌ Binaries directory not found" | |
| 426 | Get-ChildItem | |
| 427 | exit 1 | |
| 428 | } | |
| 429 | ||
| 215 | 430 | cd binaries |
| 216 | 431 | $BINARY_NAME = "php-$-$-$-$" |
| 432 | ||
| 433 | Write-Host "🔍 Looking for binary directory: $BINARY_NAME" | |
| 434 | Get-ChildItem | |
| 435 | ||
| 217 | 436 | if (Test-Path -Path $BINARY_NAME -PathType Container) { |
| 218 | # Create metadata file | |
| 219 | $metadata = @{ | |
| 220 | php_version = "${{ matrix.php_version }}" | |
| 221 | platform = "$" | |
| 222 | arch = "$" | |
| 223 | config = "$" | |
| 224 | built_at = (Get-Date -Format "yyyy-MM-ddTHH:mm:ssZ") | |
| 225 | } | ConvertTo-Json | |
| 226 | $metadata | Out-File -FilePath "$BINARY_NAME\metadata.json" -Encoding UTF8 | |
| 437 | # Create metadata file if it doesn't exist | |
| 438 | if (-not (Test-Path -Path "$BINARY_NAME\metadata.json")) { | |
| 439 | $metadata = @{ | |
| 440 | php_version = "$" | |
| 441 | platform = "$" | |
| 442 | arch = "$" | |
| 443 | config = "$" | |
| 444 | built_at = (Get-Date -Format "yyyy-MM-ddTHH:mm:ssZ") | |
| 445 | } | ConvertTo-Json | |
| 446 | $metadata | Out-File -FilePath "$BINARY_NAME\metadata.json" -Encoding UTF8 | |
| 447 | } | |
| 227 | 448 | |
| 228 | 449 | # Create zip archive (Windows equivalent of tarball) |
| 229 | 450 | Compress-Archive -Path $BINARY_NAME -DestinationPath "$BINARY_NAME.zip" -Force |
| @@ -231,6 +452,8 @@ jobs: | ||
| 231 | 452 | Get-ChildItem "$BINARY_NAME.zip" | Format-List Name, Length |
| 232 | 453 | } else { |
| 233 | 454 | Write-Host "❌ Binary directory not found: $BINARY_NAME" |
| 455 | Write-Host "Available directories:" | |
| 456 | Get-ChildItem | |
| 234 | 457 | exit 1 |
| 235 | 458 | } |
| 236 | 459 | |
formatting only · 8 hidden lines
| @@ -243,7 +466,7 @@ jobs: formatting only | ||
| 243 | 466 | binaries/$BINARY_NAME/bin/php --version |
| 244 | 467 | echo "📋 All available extensions:" |
| 245 | 468 | binaries/$BINARY_NAME/bin/php -m |
| 246 | ||
| 469 | ||
| 247 | 470 | # Define essential extensions that MUST be present |
| 248 | 471 | REQUIRED_EXTENSIONS=( |
| 249 | 472 | "Core" "date" "hash" "json" "pcre" "Reflection" "SPL" "standard" |
formatting only · 12 hidden lines
| @@ -252,10 +475,10 @@ jobs: formatting only | ||
| 252 | 475 | "curl" "openssl" "zip" "zlib" "calendar" "ftp" "pcntl" "posix" |
| 253 | 476 | "shmop" "sockets" "exif" "bcmath" "bz2" "gettext" "readline" |
| 254 | 477 | ) |
| 255 | ||
| 478 | ||
| 256 | 479 | # Define Zend extensions that need special checking |
| 257 | 480 | ZEND_EXTENSIONS=("opcache") |
| 258 | ||
| 481 | ||
| 259 | 482 | # Test each required extension |
| 260 | 483 | echo "🧪 Testing essential extensions..." |
| 261 | 484 | MISSING_EXTENSIONS=() |
formatting only · 8 hidden lines
| @@ -268,7 +491,7 @@ jobs: formatting only | ||
| 268 | 491 | MISSING_EXTENSIONS+=("$ext") |
| 269 | 492 | fi |
| 270 | 493 | done |
| 271 | ||
| 494 | ||
| 272 | 495 | # Test Zend extensions separately |
| 273 | 496 | for ext in "${ZEND_EXTENSIONS[@]}"; do |
| 274 | 497 | EXT_LOADED=$(binaries/$BINARY_NAME/bin/php -r "echo function_exists('opcache_get_status') ? '1' : '0';") |
formatting only · 16 hidden lines
| @@ -279,14 +502,14 @@ jobs: formatting only | ||
| 279 | 502 | MISSING_EXTENSIONS+=("$ext") |
| 280 | 503 | fi |
| 281 | 504 | done |
| 282 | ||
| 505 | ||
| 283 | 506 | # Check if any essential extensions are missing |
| 284 | 507 | if [ ${#MISSING_EXTENSIONS[@]} -gt 0 ]; then |
| 285 | 508 | echo "❌ Critical extensions missing: ${MISSING_EXTENSIONS[*]}" |
| 286 | 509 | echo "This build is incomplete and will cause issues with Composer and Laravel." |
| 287 | 510 | exit 1 |
| 288 | 511 | fi |
| 289 | ||
| 512 | ||
| 290 | 513 | # Test phar extension functionality specifically |
| 291 | 514 | echo "🧪 Testing phar extension functionality..." |
| 292 | 515 | PHAR_LOADED=$(binaries/$BINARY_NAME/bin/php -r 'echo extension_loaded("phar") ? "1" : "0";') |
formatting only · 8 hidden lines
| @@ -294,7 +517,7 @@ jobs: formatting only | ||
| 294 | 517 | echo "✅ Phar extension is loaded" |
| 295 | 518 | # Test phar creation (essential for Composer) |
| 296 | 519 | echo "🧪 Testing phar creation..." |
| 297 | echo '<?php | |
| 520 | echo '<?php | |
| 298 | 521 | if (extension_loaded("phar")) { |
| 299 | 522 | try { |
| 300 | 523 | $phar = new Phar("test.phar"); |
formatting only · 8 hidden lines
| @@ -316,7 +539,7 @@ jobs: formatting only | ||
| 316 | 539 | echo "❌ Phar extension not loaded - this will break Composer!" |
| 317 | 540 | exit 1 |
| 318 | 541 | fi |
| 319 | ||
| 542 | ||
| 320 | 543 | # Test Composer compatibility |
| 321 | 544 | echo "🧪 Testing Composer compatibility..." |
| 322 | 545 | echo '<?php |
formatting only · 8 hidden lines
| @@ -325,7 +548,7 @@ jobs: formatting only | ||
| 325 | 548 | "iconv", "mb_strlen", "filter_var", "hash", "json_encode", |
| 326 | 549 | "curl_init", "openssl_get_cert_locations", "file_get_contents" |
| 327 | 550 | ]; |
| 328 | ||
| 551 | ||
| 329 | 552 | foreach ($required_functions as $func) { |
| 330 | 553 | if (function_exists($func)) { |
| 331 | 554 | echo "✅ Function $func: Available\n"; |
formatting only · 8 hidden lines
| @@ -334,7 +557,7 @@ jobs: formatting only | ||
| 334 | 557 | exit(1); |
| 335 | 558 | } |
| 336 | 559 | } |
| 337 | ||
| 560 | ||
| 338 | 561 | // Test essential classes |
| 339 | 562 | $required_classes = ["Phar", "DOMDocument", "XMLReader", "ZipArchive"]; |
| 340 | 563 | foreach ($required_classes as $class) { |
formatting only · 14 hidden lines
| @@ -345,12 +568,12 @@ jobs: formatting only | ||
| 345 | 568 | exit(1); |
| 346 | 569 | } |
| 347 | 570 | } |
| 348 | ||
| 571 | ||
| 349 | 572 | echo "✅ All Composer compatibility checks passed\n"; |
| 350 | 573 | ?>' > test_composer_compat.php |
| 351 | 574 | binaries/$BINARY_NAME/bin/php test_composer_compat.php |
| 352 | 575 | rm test_composer_compat.php |
| 353 | ||
| 576 | ||
| 354 | 577 | echo "✅ All PHP binary tests passed successfully!" |
| 355 | 578 | else |
| 356 | 579 | echo "❌ PHP binary not found" |
formatting only · 30 hidden lines
| @@ -365,25 +588,25 @@ jobs: formatting only | ||
| 365 | 588 | $phpExeBin = "binaries\$BINARY_NAME\bin\php.exe" |
| 366 | 589 | $PHP = if (Test-Path -Path $phpExeRoot -PathType Leaf) { $phpExeRoot } elseif (Test-Path -Path $phpExeBin -PathType Leaf) { $phpExeBin } else { $null } |
| 367 | 590 | Write-Host "Checking for binary at: $PHP" |
| 368 | ||
| 591 | ||
| 369 | 592 | # List all files in the binary directory to verify structure |
| 370 | 593 | Write-Host "📂 Binary directory structure:" |
| 371 | 594 | Get-ChildItem -Path "binaries\$BINARY_NAME" -Recurse | Format-Table Name, Length, LastWriteTime |
| 372 | ||
| 595 | ||
| 373 | 596 | # Check if the PHP binary exists |
| 374 | 597 | if ($PHP -and (Test-Path -Path $PHP -PathType Leaf)) { |
| 375 | 598 | Write-Host "✅ PHP binary exists at expected location" |
| 376 | ||
| 599 | ||
| 377 | 600 | # Get file size to verify it's a real binary (not just a placeholder) |
| 378 | 601 | $fileSize = (Get-Item $PHP).Length |
| 379 | 602 | Write-Host "📊 PHP binary size: $fileSize bytes" |
| 380 | ||
| 603 | ||
| 381 | 604 | # Test PHP version and extensions |
| 382 | 605 | Write-Host "🧪 Testing PHP binary..." |
| 383 | 606 | & $PHP --version |
| 384 | 607 | Write-Host "📋 All available extensions:" |
| 385 | 608 | & $PHP -m |
| 386 | ||
| 609 | ||
| 387 | 610 | # Define essential extensions that MUST be present |
| 388 | 611 | $REQUIRED_EXTENSIONS = @( |
| 389 | 612 | "Core", "date", "hash", "json", "pcre", "Reflection", "SPL", "standard", |
formatting only · 12 hidden lines
| @@ -392,10 +615,10 @@ jobs: formatting only | ||
| 392 | 615 | "curl", "openssl", "zip", "zlib", "calendar", "ftp", |
| 393 | 616 | "shmop", "sockets", "exif", "bcmath", "bz2", "gettext", "readline" |
| 394 | 617 | ) |
| 395 | ||
| 618 | ||
| 396 | 619 | # Define Zend extensions that need special checking |
| 397 | 620 | $ZEND_EXTENSIONS = @("opcache") |
| 398 | ||
| 621 | ||
| 399 | 622 | # Test each required extension |
| 400 | 623 | Write-Host "🧪 Testing essential extensions..." |
| 401 | 624 | $MISSING_EXTENSIONS = @() |
formatting only · 8 hidden lines
| @@ -408,7 +631,7 @@ jobs: formatting only | ||
| 408 | 631 | $MISSING_EXTENSIONS += $ext |
| 409 | 632 | } |
| 410 | 633 | } |
| 411 | ||
| 634 | ||
| 412 | 635 | # Test Zend extensions separately |
| 413 | 636 | foreach ($ext in $ZEND_EXTENSIONS) { |
| 414 | 637 | $extLoaded = & $PHP -r "echo function_exists('opcache_get_status') ? '1' : '0';" |
formatting only · 16 hidden lines
| @@ -419,14 +642,14 @@ jobs: formatting only | ||
| 419 | 642 | $MISSING_EXTENSIONS += $ext |
| 420 | 643 | } |
| 421 | 644 | } |
| 422 | ||
| 645 | ||
| 423 | 646 | # Check if any essential extensions are missing |
| 424 | 647 | if ($MISSING_EXTENSIONS.Count -gt 0) { |
| 425 | 648 | Write-Host "❌ Critical extensions missing: $($MISSING_EXTENSIONS -join ', ')" |
| 426 | 649 | Write-Host "This build is incomplete and will cause issues with Composer and Laravel." |
| 427 | 650 | exit 1 |
| 428 | 651 | } |
| 429 | ||
| 652 | ||
| 430 | 653 | # Test phar extension functionality specifically |
| 431 | 654 | Write-Host "🧪 Testing phar extension functionality..." |
| 432 | 655 | $pharLoaded = & $PHP -r 'echo extension_loaded("phar") ? "1" : "0";' |
formatting only · 26 hidden lines
| @@ -445,22 +668,22 @@ jobs: formatting only | ||
| 445 | 668 | Write-Host "❌ Phar extension not loaded - this will break Composer!" |
| 446 | 669 | exit 1 |
| 447 | 670 | } |
| 448 | ||
| 671 | ||
| 449 | 672 | # Test Composer compatibility |
| 450 | 673 | Write-Host "🧪 Testing Composer compatibility..." |
| 451 | 674 | $composerTestContent = "<?php`n// Test essential functions for Composer`n`$required_functions = [`n `"iconv`", `"mb_strlen`", `"filter_var`", `"hash`", `"json_encode`",`n `"curl_init`", `"openssl_get_cert_locations`", `"file_get_contents`"`n];`n`nforeach (`$required_functions as `$func) {`n if (function_exists(`$func)) {`n echo `"✅ Function `$func: Available\n`";`n } else {`n echo `"❌ Function `$func: Missing\n`";`n exit(1);`n }`n}`n`n// Test essential classes`n`$required_classes = [`"Phar`", `"DOMDocument`", `"XMLReader`", `"ZipArchive`"];`nforeach (`$required_classes as `$class) {`n if (class_exists(`$class)) {`n echo `"✅ Class `$class: Available\n`";`n } else {`n echo `"❌ Class `$class: Missing\n`";`n exit(1);`n }`n}`n`necho `"✅ All Composer compatibility checks passed\n`";`n?>" |
| 452 | 675 | $composerTestContent | Out-File -FilePath "test_composer_compat.php" -Encoding UTF8 |
| 453 | 676 | & $PHP "test_composer_compat.php" |
| 454 | 677 | Remove-Item "test_composer_compat.php" |
| 455 | ||
| 678 | ||
| 456 | 679 | # Check if this is likely a real binary based on file size |
| 457 | 680 | if ($fileSize -gt 1000000) { |
| 458 | 681 | Write-Host "✅ PHP binary appears to be a real Windows binary (file size: $fileSize bytes)" |
| 459 | ||
| 682 | ||
| 460 | 683 | # Check for DLLs which should be present in a real PHP distribution |
| 461 | 684 | $dllCount = (Get-ChildItem -Path "binaries\$BINARY_NAME" -Filter "*.dll" -Recurse).Count |
| 462 | 685 | Write-Host "Found $dllCount DLL files in the PHP distribution" |
| 463 | ||
| 686 | ||
| 464 | 687 | if ($dllCount -gt 10) { |
| 465 | 688 | Write-Host "✅ PHP distribution contains expected DLL files" |
| 466 | 689 | } else { |
formatting only · 8 hidden lines
| @@ -469,7 +692,7 @@ jobs: formatting only | ||
| 469 | 692 | } else { |
| 470 | 693 | Write-Host "⚠️ PHP binary is smaller than expected, might be a placeholder" |
| 471 | 694 | } |
| 472 | ||
| 695 | ||
| 473 | 696 | Write-Host "✅ All PHP binary tests passed successfully!" |
| 474 | 697 | } else { |
| 475 | 698 | Write-Host "❌ PHP binary not found at expected location" |
| @@ -484,7 +707,7 @@ jobs: | ||
| 484 | 707 | |
| 485 | 708 | - name: Upload PHP Binary (Unix) |
| 486 | 709 | if: matrix.platform != 'win32' |
| 487 | uses: actions/upload-artifact@v4 | |
| 710 | uses: actions/upload-artifact@v4.6.2 | |
| 488 | 711 | with: |
| 489 | 712 | name: php-${{ matrix.php_version }}-${{ matrix.platform }}-${{ matrix.arch }}-${{ matrix.config }} |
| 490 | 713 | path: binaries/php-${{ matrix.php_version }}-${{ matrix.platform }}-${{ matrix.arch }}-${{ matrix.config }}.tar.gz |
| @@ -492,7 +715,7 @@ jobs: | ||
| 492 | 715 | |
| 493 | 716 | - name: Upload PHP Binary (Windows) |
| 494 | 717 | if: matrix.platform == 'win32' |
| 495 | uses: actions/upload-artifact@v4 | |
| 718 | uses: actions/upload-artifact@v4.6.2 | |
| 496 | 719 | with: |
| 497 | 720 | name: php-${{ matrix.php_version }}-${{ matrix.platform }}-${{ matrix.arch }}-${{ matrix.config }} |
| 498 | 721 | path: binaries/php-${{ matrix.php_version }}-${{ matrix.platform }}-${{ matrix.arch }}-${{ matrix.config }}.zip |
formatting only · 8 hidden lines
| @@ -603,7 +826,7 @@ jobs: formatting only | ||
| 603 | 826 | jq --argjson binary "$binary_json" '. += [$binary]' binaries_array.json > temp_array.json |
| 604 | 827 | mv temp_array.json binaries_array.json |
| 605 | 828 | done |
| 606 | ||
| 829 | ||
| 607 | 830 | # Process zip files (Windows binaries) |
| 608 | 831 | echo "Processing Windows binaries (.zip files)..." |
| 609 | 832 | for zipfile in $(find . -name "*.zip" -type f); do |
formatting only · 12 hidden lines
| @@ -635,10 +858,10 @@ jobs: formatting only | ||
| 635 | 858 | # Create a temporary directory |
| 636 | 859 | temp_dir="temp_extract_$RANDOM" |
| 637 | 860 | mkdir -p "$temp_dir" |
| 638 | ||
| 861 | ||
| 639 | 862 | # Try to extract just the metadata file |
| 640 | 863 | unzip -q -j "$zipfile" "*/metadata.json" -d "$temp_dir" 2>/dev/null || echo '{}' > "$temp_dir/metadata.json" |
| 641 | ||
| 864 | ||
| 642 | 865 | # Create JSON object for this binary |
| 643 | 866 | binary_json=$(jq -n \ |
| 644 | 867 | --arg filename "$filename" \ |
formatting only · 8 hidden lines
| @@ -663,7 +886,7 @@ jobs: formatting only | ||
| 663 | 886 | # Add this binary to the array using jq |
| 664 | 887 | jq --argjson binary "$binary_json" '. += [$binary]' binaries_array.json > temp_array.json |
| 665 | 888 | mv temp_array.json binaries_array.json |
| 666 | ||
| 889 | ||
| 667 | 890 | # Clean up temp directory |
| 668 | 891 | rm -rf "$temp_dir" |
| 669 | 892 | done |
| @@ -31,16 +31,16 @@ | ||
| 31 | 31 | "typecheck": "bun --bun tsc --noEmit" |
| 32 | 32 | }, |
| 33 | 33 | "devDependencies": { |
| 34 | "@stacksjs/bumpx": "^0.1.78", | |
| 34 | "@stacksjs/bumpx": "^0.1.84", | |
| 35 | 35 | "@stacksjs/docs": "^0.70.23", |
| 36 | 36 | "@stacksjs/eslint-config": "^4.14.0-beta.3", |
| 37 | 37 | "@stacksjs/gitlint": "^0.1.5", |
| 38 | 38 | "@stacksjs/launchpad": "workspace:*", |
| 39 | 39 | "@stacksjs/logsmith": "^0.1.18", |
| 40 | "@types/bun": "^1.2.20", | |
| 41 | "buddy-bot": "^0.9.5", | |
| 40 | "@types/bun": "^1.2.22", | |
| 41 | "buddy-bot": "^0.9.7", | |
| 42 | 42 | "bun-git-hooks": "^0.2.19", |
| 43 | "bun-plugin-dtsx": "0.9.5", | |
| 43 | "bun-plugin-dtsx": "0.21.12", | |
| 44 | 44 | "typescript": "^5.9.2" |
| 45 | 45 | }, |
| 46 | 46 | "overrides": { |