fix: improve Windows error diagnostics with DLL dependency check #36
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Test | |
| on: | |
| push: | |
| branches: ["master"] | |
| jobs: | |
| build: | |
| strategy: | |
| matrix: | |
| os: | |
| - runner: "ubuntu-24.04" | |
| sys: "linux" | |
| - runner: "ubuntu-24.04-arm" | |
| sys: "linux" | |
| - runner: "macos-15" | |
| sys: "darwin" | |
| - runner: "windows-2025" | |
| sys: "windows" | |
| shell: "powershell" | |
| - runner: "windows-2025" | |
| sys: "windows" | |
| shell: "pwsh" | |
| mirror: ["", "--mirror"] | |
| fail-fast: false | |
| runs-on: ${{ matrix.os.runner }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Cangjie | |
| uses: Zxilly/setup-cangjie@v2 | |
| with: | |
| channel: "nightly" | |
| version: "1.1.0-alpha.20260107020002" | |
| - name: Test unix install | |
| if: matrix.os.sys != 'windows' | |
| run: | | |
| chmod +x public/install.sh | |
| bash public/install.sh ${{ matrix.mirror }} | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Test windows install | |
| if: matrix.os.sys == 'windows' | |
| run: | | |
| ${{ matrix.os.shell }} -File public/install.ps1 ${{ matrix.mirror }} | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Test cjbind (Windows - with error capture) | |
| if: matrix.os.sys == 'windows' | |
| run: | | |
| Write-Host "Testing cjbind installation..." | |
| Write-Host "Executable path: $env:USERPROFILE\.cjpm\bin\cjbind.exe" | |
| # Check if file exists | |
| if (Test-Path "$env:USERPROFILE\.cjpm\bin\cjbind.exe") { | |
| Write-Host "File exists, size: $((Get-Item "$env:USERPROFILE\.cjpm\bin\cjbind.exe").Length) bytes" | |
| } else { | |
| Write-Host "ERROR: File not found!" | |
| exit 1 | |
| } | |
| # Try to run with error capture | |
| try { | |
| $process = Start-Process -FilePath "cjbind" -ArgumentList "--version" -NoNewWindow -PassThru -Wait -RedirectStandardOutput "stdout.txt" -RedirectStandardError "stderr.txt" | |
| Write-Host "`n=== STDOUT ===" | |
| if (Test-Path "stdout.txt") { Get-Content "stdout.txt" } | |
| Write-Host "`n=== STDERR ===" | |
| if (Test-Path "stderr.txt") { Get-Content "stderr.txt" } | |
| Write-Host "`n=== Exit Code: $($process.ExitCode) ===" | |
| if ($process.ExitCode -eq -1073741511) { | |
| Write-Host "`nERROR 0xC0000139: STATUS_ENTRYPOINT_NOT_FOUND" | |
| Write-Host "This means a required DLL is missing or incompatible.`n" | |
| Write-Host "Attempting to check dependencies..." | |
| # Try dumpbin | |
| $dumpbinPath = "${env:ProgramFiles}\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\*\bin\Hostx64\x64\dumpbin.exe" | |
| $dumpbin = Get-Item $dumpbinPath -ErrorAction SilentlyContinue | Select-Object -First 1 | |
| if ($dumpbin) { | |
| Write-Host "`n=== DLL Dependencies (dumpbin) ===" | |
| & $dumpbin.FullName /dependents "$env:USERPROFILE\.cjpm\bin\cjbind.exe" | |
| } else { | |
| Write-Host "dumpbin not found" | |
| } | |
| Write-Host "`n=== System PATH ===" | |
| $env:PATH -split ';' | ForEach-Object { Write-Host " $_" } | |
| exit 1 | |
| } elseif ($process.ExitCode -ne 0) { | |
| Write-Host "ERROR: Non-zero exit code" | |
| exit $process.ExitCode | |
| } | |
| } catch { | |
| Write-Host "EXCEPTION: $_" | |
| Write-Host "Exception Type: $($_.Exception.GetType().FullName)" | |
| Write-Host "Exception Message: $($_.Exception.Message)" | |
| exit 1 | |
| } | |
| - name: Test cjbind (Unix) | |
| if: matrix.os.sys != 'windows' | |
| run: | | |
| cjbind --version |