Windows-powershell / PowerShell-master /.github /instructions /troubleshooting-builds.instructions.md
metadata
applyTo:
- build.psm1
- tools/ci.psm1
- .github/**/*.yml
- .github/**/*.yaml
Troubleshooting Build Issues
Git Describe Error
Error:
error MSB3073: The command "git describe --abbrev=60 --long" exited with code 128.
Cause: Insufficient git history (shallow clone)
Solution: Add fetch-depth: 1000 to checkout step
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1000
Version Information Incorrect
Symptom: Build produces wrong version numbers
Cause: Git tags not synchronized
Solution: Run Sync-PSTags -AddRemoteIfMissing:
- name: Bootstrap
shell: pwsh
run: |
Import-Module ./tools/ci.psm1
Invoke-CIInstall -SkipUser
Sync-PSTags -AddRemoteIfMissing
PowerShell Binary Not Built
Error:
Exception: CoreCLR pwsh.exe was not built
Causes:
- Build failed (check logs)
- Wrong configuration used
- Build output location incorrect
Solutions:
- Check build logs for errors
- Verify correct configuration for use case
- Use default parameters:
Start-PSBuild
Module Restore Issues
Symptom: Slow build or module restore failures
Causes:
- Network issues
- Module cache problems
- Package source unavailable
Solutions:
- Retry the build
- Check network connectivity
- Use
-NoPSModuleRestoreif modules not needed - Clear package cache if persistent
.NET SDK Not Found
Symptom: Build can't find .NET SDK
Solution: Ensure .NET setup step runs first:
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
global-json-file: ./global.json
Bootstrap Failures
Symptom: Invoke-CIInstall fails
Causes:
- Missing dependencies
- Network issues
- Platform-specific requirements not met
Solution: Check prerequisites for your platform in build system docs