also looking at this
chore(deps): update dependency actions/download-artifact to v5.0.0
#178
1 file
+638
-860
Review threads live on the whole diff, not on one commit, so none are shown here - a thread's line means something in the branch's final form, and painting it into an intermediate step would put it on code it is not about.
| @@ -149,7 +149,18 @@ jobs: | ||
| 149 | 149 | if: matrix.platform == 'linux' |
| 150 | 150 | run: | |
| 151 | 151 | sudo apt-get update |
| 152 | sudo apt-get install -y build-essential autoconf automake libtool pkg-config bison re2c libxml2-dev libssl-dev libcurl4-openssl-dev libpng-dev libjpeg-dev libfreetype6-dev libonig-dev libzip-dev libpq-dev libreadline-dev libbz2-dev libgmp-dev libldap2-dev libxslt1-dev libicu-dev libsodium-dev zlib1g-dev | |
| 152 | sudo apt-get install -y \ | |
| 153 | build-essential autoconf automake libtool pkg-config bison re2c \ | |
| 154 | libxml2-dev libssl-dev libcurl4-openssl-dev libpng-dev libjpeg-dev \ | |
| 155 | libfreetype6-dev libonig-dev libzip-dev libpq-dev libreadline-dev \ | |
| 156 | libbz2-dev libgmp-dev libldap2-dev libxslt1-dev libicu-dev \ | |
| 157 | libsodium-dev zlib1g-dev libsqlite3-dev libenchant-2-dev \ | |
| 158 | libtidy-dev libsnmp-dev libgd-dev libwebp-dev libc-client-dev \ | |
| 159 | libkrb5-dev libedit-dev libargon2-dev libffi-dev \ | |
| 160 | libmcrypt-dev libmhash-dev libpcre3-dev libexpat1-dev \ | |
| 161 | libc-ares-dev libnghttp2-dev libpsl-dev libidn2-dev \ | |
| 162 | librtmp-dev libssh2-1-dev libgssapi-krb5-2 libkrb5-dev \ | |
| 163 | gettext libgettext-ocaml-dev | |
| 153 | 164 | |
| 154 | 165 | - name: Install build dependencies (macOS) |
| 155 | 166 | if: matrix.platform == 'darwin' |
| @@ -227,20 +238,44 @@ jobs: | ||
| 227 | 238 | if [ -f "binaries/$BINARY_NAME/bin/php" ]; then |
| 228 | 239 | echo "✅ PHP binary created successfully" |
| 229 | 240 | binaries/$BINARY_NAME/bin/php --version |
| 230 | echo "📋 Available extensions:" | |
| 231 | binaries/$BINARY_NAME/bin/php -m | head -20 | |
| 241 | echo "📋 All available extensions:" | |
| 242 | binaries/$BINARY_NAME/bin/php -m | |
| 232 | 243 | |
| 233 | # Test phar extension specifically | |
| 234 | echo "🧪 Testing phar extension..." | |
| 244 | # Define essential extensions that MUST be present | |
| 245 | REQUIRED_EXTENSIONS=( | |
| 246 | "Core" "date" "hash" "json" "pcre" "Reflection" "SPL" "standard" | |
| 247 | "mbstring" "iconv" "filter" "ctype" "tokenizer" "session" "fileinfo" | |
| 248 | "opcache" "phar" "dom" "xml" "xmlreader" "xmlwriter" "simplexml" | |
| 249 | "curl" "openssl" "zip" "zlib" "calendar" "ftp" "pcntl" "posix" | |
| 250 | "shmop" "sockets" "exif" "bcmath" "bz2" "gettext" "readline" | |
| 251 | ) | |
| 252 | ||
| 253 | # Test each required extension | |
| 254 | echo "🧪 Testing essential extensions..." | |
| 255 | MISSING_EXTENSIONS=() | |
| 256 | for ext in "${REQUIRED_EXTENSIONS[@]}"; do | |
| 257 | EXT_LOADED=$(binaries/$BINARY_NAME/bin/php -r "echo extension_loaded('$ext') ? '1' : '0';") | |
| 258 | if [ "$EXT_LOADED" = "1" ]; then | |
| 259 | echo "✅ $ext: LOADED" | |
| 260 | else | |
| 261 | echo "❌ $ext: MISSING" | |
| 262 | MISSING_EXTENSIONS+=("$ext") | |
| 263 | fi | |
| 264 | done | |
| 265 | ||
| 266 | # Check if any essential extensions are missing | |
| 267 | if [ ${#MISSING_EXTENSIONS[@]} -gt 0 ]; then | |
| 268 | echo "❌ Critical extensions missing: ${MISSING_EXTENSIONS[*]}" | |
| 269 | echo "This build is incomplete and will cause issues with Composer and Laravel." | |
| 270 | exit 1 | |
| 271 | fi | |
| 272 | ||
| 273 | # Test phar extension functionality specifically | |
| 274 | echo "🧪 Testing phar extension functionality..." | |
| 235 | 275 | PHAR_LOADED=$(binaries/$BINARY_NAME/bin/php -r 'echo extension_loaded("phar") ? "1" : "0";') |
| 236 | 276 | if [ "$PHAR_LOADED" = "1" ]; then |
| 237 | 277 | echo "✅ Phar extension is loaded" |
| 238 | # Test phar functionality | |
| 239 | echo "🧪 Testing phar functionality..." | |
| 240 | echo '<?php echo "Phar test: " . (extension_loaded("phar") ? "ENABLED" : "DISABLED") . "\n";' > test_phar.php | |
| 241 | binaries/$BINARY_NAME/bin/php test_phar.php | |
| 242 | rm test_phar.php | |
| 243 | # Test creating a simple phar | |
| 278 | # Test phar creation (essential for Composer) | |
| 244 | 279 | echo "🧪 Testing phar creation..." |
| 245 | 280 | echo '<?php |
| 246 | 281 | if (extension_loaded("phar")) { |
| @@ -261,11 +296,45 @@ jobs: | ||
| 261 | 296 | binaries/$BINARY_NAME/bin/php -d phar.readonly=0 test_phar_create.php |
| 262 | 297 | rm test_phar_create.php |
| 263 | 298 | else |
| 264 | echo "❌ Phar extension not loaded (runtime check)" | |
| 265 | echo "Available modules:" | |
| 266 | binaries/$BINARY_NAME/bin/php -m | |
| 299 | echo "❌ Phar extension not loaded - this will break Composer!" | |
| 267 | 300 | exit 1 |
| 268 | 301 | fi |
| 302 | ||
| 303 | # Test Composer compatibility | |
| 304 | echo "🧪 Testing Composer compatibility..." | |
| 305 | echo '<?php | |
| 306 | // Test essential functions for Composer | |
| 307 | $required_functions = [ | |
| 308 | "iconv", "mb_strlen", "filter_var", "hash", "json_encode", | |
| 309 | "curl_init", "openssl_get_cert_locations", "file_get_contents" | |
| 310 | ]; | |
| 311 | ||
| 312 | foreach ($required_functions as $func) { | |
| 313 | if (function_exists($func)) { | |
| 314 | echo "✅ Function $func: Available\n"; | |
| 315 | } else { | |
| 316 | echo "❌ Function $func: Missing\n"; | |
| 317 | exit(1); | |
| 318 | } | |
| 319 | } | |
| 320 | ||
| 321 | // Test essential classes | |
| 322 | $required_classes = ["Phar", "DOMDocument", "XMLReader", "ZipArchive"]; | |
| 323 | foreach ($required_classes as $class) { | |
| 324 | if (class_exists($class)) { | |
| 325 | echo "✅ Class $class: Available\n"; | |
| 326 | } else { | |
| 327 | echo "❌ Class $class: Missing\n"; | |
| 328 | exit(1); | |
| 329 | } | |
| 330 | } | |
| 331 | ||
| 332 | echo "✅ All Composer compatibility checks passed\n"; | |
| 333 | ?>' > test_composer_compat.php | |
| 334 | binaries/$BINARY_NAME/bin/php test_composer_compat.php | |
| 335 | rm test_composer_compat.php | |
| 336 | ||
| 337 | echo "✅ All PHP binary tests passed successfully!" | |
| 269 | 338 | else |
| 270 | 339 | echo "❌ PHP binary not found" |
| 271 | 340 | exit 1 |
| @@ -295,27 +364,67 @@ jobs: | ||
| 295 | 364 | # Test PHP version and extensions |
| 296 | 365 | Write-Host "🧪 Testing PHP binary..." |
| 297 | 366 | & $PHP --version |
| 298 | Write-Host "📋 Available extensions:" | |
| 299 | & $PHP -m | Select-Object -First 20 | |
| 367 | Write-Host "📋 All available extensions:" | |
| 368 | & $PHP -m | |
| 369 | ||
| 370 | # Define essential extensions that MUST be present | |
| 371 | $REQUIRED_EXTENSIONS = @( | |
| 372 | "Core", "date", "hash", "json", "pcre", "Reflection", "SPL", "standard", | |
| 373 | "mbstring", "iconv", "filter", "ctype", "tokenizer", "session", "fileinfo", | |
| 374 | "opcache", "phar", "dom", "xml", "xmlreader", "xmlwriter", "simplexml", | |
| 375 | "curl", "openssl", "zip", "zlib", "calendar", "ftp", "pcntl", "posix", | |
| 376 | "shmop", "sockets", "exif", "bcmath", "bz2", "gettext", "readline" | |
| 377 | ) | |
| 300 | 378 | |
| 301 | # Test phar extension specifically using a direct runtime check | |
| 302 | Write-Host "🧪 Testing phar extension..." | |
| 379 | # Test each required extension | |
| 380 | Write-Host "🧪 Testing essential extensions..." | |
| 381 | $MISSING_EXTENSIONS = @() | |
| 382 | foreach ($ext in $REQUIRED_EXTENSIONS) { | |
| 383 | $extLoaded = & $PHP -r "echo extension_loaded('$ext') ? '1' : '0';" | |
| 384 | if ($extLoaded -eq "1") { | |
| 385 | Write-Host "✅ $ext`: LOADED" | |
| 386 | } else { | |
| 387 | Write-Host "❌ $ext`: MISSING" | |
| 388 | $MISSING_EXTENSIONS += $ext | |
| 389 | } | |
| 390 | } | |
| 391 | ||
| 392 | # Check if any essential extensions are missing | |
| 393 | if ($MISSING_EXTENSIONS.Count -gt 0) { | |
| 394 | Write-Host "❌ Critical extensions missing: $($MISSING_EXTENSIONS -join ', ')" | |
| 395 | Write-Host "This build is incomplete and will cause issues with Composer and Laravel." | |
| 396 | exit 1 | |
| 397 | } | |
| 398 | ||
| 399 | # Test phar extension functionality specifically | |
| 400 | Write-Host "🧪 Testing phar extension functionality..." | |
| 303 | 401 | $pharLoaded = & $PHP -r 'echo extension_loaded("phar") ? "1" : "0";' |
| 304 | 402 | if ($pharLoaded -eq "1") { |
| 305 | 403 | Write-Host "✅ Phar extension is loaded" |
| 306 | # Try a minimal creation test | |
| 404 | # Test phar creation (essential for Composer) | |
| 307 | 405 | Write-Host "🧪 Testing phar creation..." |
| 308 | & $PHP -d phar.readonly=0 -r 'try { $p = new Phar("test.phar"); $p->addFromString("t.txt", "x"); echo "OK"; unlink("test.phar"); } catch (Exception $e) { echo "ERR: ".$e->getMessage(); exit(1); }' | Out-String | |
| 406 | $pharTest = & $PHP -d phar.readonly=0 -r 'try { $p = new Phar("test.phar"); $p->addFromString("t.txt", "x"); echo "OK"; unlink("test.phar"); } catch (Exception $e) { echo "ERR: ".$e->getMessage(); exit(1); }' | |
| 407 | if ($pharTest -eq "OK") { | |
| 408 | Write-Host "✅ Phar creation successful" | |
| 409 | } else { | |
| 410 | Write-Host "❌ Phar creation failed: $pharTest" | |
| 411 | exit 1 | |
| 412 | } | |
| 309 | 413 | } else { |
| 310 | Write-Host "Phar extension not found (runtime check)" | |
| 311 | Write-Host "Available modules:" | |
| 312 | & $PHP -m | |
| 313 | Write-Host "⚠️ Phar extension not available on this Windows binary; continuing without failure" | |
| 414 | Write-Host "❌ Phar extension not loaded - this will break Composer!" | |
| 415 | exit 1 | |
| 314 | 416 | } |
| 315 | 417 | |
| 316 | # Check if this is likely a real binary based on file size (real PHP binaries are several MB) | |
| 418 | # Test Composer compatibility | |
| 419 | Write-Host "🧪 Testing Composer compatibility..." | |
| 420 | $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?>" | |
| 421 | $composerTestContent | Out-File -FilePath "test_composer_compat.php" -Encoding UTF8 | |
| 422 | & $PHP "test_composer_compat.php" | |
| 423 | Remove-Item "test_composer_compat.php" | |
| 424 | ||
| 425 | # Check if this is likely a real binary based on file size | |
| 317 | 426 | if ($fileSize -gt 1000000) { |
| 318 | Write-Host "PHP binary appears to be a real Windows binary (file size: $fileSize bytes)" | |
| 427 | Write-Host "✅ PHP binary appears to be a real Windows binary (file size: $fileSize bytes)" | |
| 319 | 428 | |
| 320 | 429 | # Check for DLLs which should be present in a real PHP distribution |
| 321 | 430 | $dllCount = (Get-ChildItem -Path "binaries\$BINARY_NAME" -Filter "*.dll" -Recurse).Count |
| @@ -330,8 +439,7 @@ jobs: | ||
| 330 | 439 | Write-Host "⚠️ PHP binary is smaller than expected, might be a placeholder" |
| 331 | 440 | } |
| 332 | 441 | |
| 333 | # Note: We don't try to execute the binary as it may not be executable in the GitHub Actions environment | |
| 334 | Write-Host "ℹ️ Skipping execution test as the binary may not be executable in this environment" | |
| 442 | Write-Host "✅ All PHP binary tests passed successfully!" | |
| 335 | 443 | } else { |
| 336 | 444 | Write-Host "❌ PHP binary not found at expected location" |
| 337 | 445 | Write-Host "Directory contents:" |