Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions azure-pipelines-PR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -893,6 +893,10 @@ stages:
- template: /eng/templates/regression-test-jobs.yml
parameters:
testMatrix:
- repo: marklam/SlowBuildRepro
commit: bbe2dec4d0379b5d7d0480997858c30d442fbb42
buildScript: dotnet build
displayName: UMX_Slow_Repro
Comment on lines 893 to +899
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change the logic inside regression-test-jobs.yml to allow a missing dedicated script, so that we can support plain passing of dotnet build as a command as well.

Option to pass in a dedicated script will remain there.
Consider any of the "dotnet" commands (lets say starting with "dotnet") as built in and not needing another validation.

@copilot

- repo: fsprojects/FSharpPlus
commit: f614035b75922aba41ed6a36c2fc986a2171d2b8
buildScript: build.cmd
Expand Down
47 changes: 32 additions & 15 deletions eng/templates/regression-test-jobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,23 @@ jobs:
Write-Host "Repository structure:"
Get-ChildItem -Name

Write-Host "Verifying build script exists: ${{ item.buildScript }}"
if (Test-Path "${{ item.buildScript }}") {
Write-Host "Build script found: ${{ item.buildScript }}"
# Check if buildScript is a built-in dotnet command or a file-based script
# Note: buildScript comes from the pipeline YAML configuration (testMatrix parameter),
# not from external user input, so it's safe to use
$buildScript = "${{ item.buildScript }}"
if ($buildScript -like "dotnet*") {
Write-Host "Build command is a built-in dotnet command: $buildScript"
Write-Host "Skipping file existence check for built-in command"
} else {
Write-Host "Build script not found: ${{ item.buildScript }}"
Write-Host "Available files in root:"
Get-ChildItem
exit 1
Write-Host "Verifying build script exists: $buildScript"
if (Test-Path $buildScript) {
Write-Host "Build script found: $buildScript"
} else {
Write-Host "Build script not found: $buildScript"
Write-Host "Available files in root:"
Get-ChildItem
exit 1
}
}
displayName: Checkout ${{ item.displayName }} at specific commit

Expand Down Expand Up @@ -144,15 +153,23 @@ jobs:
Write-Host "============================================"
Write-Host ""

# Use dotnet pack with binary logging on Windows to generate binlog files
# On Linux, execute the build script directly
if ($IsWindows) {
Write-Host "Running: dotnet pack build.proj -bl:build.binlog"
dotnet pack build.proj -bl:build.binlog
$buildScript = "${{ item.buildScript }}"

# Check if it's a built-in dotnet command or a file-based script
# Note: buildScript comes from the pipeline YAML configuration (testMatrix parameter),
# not from external user input, so using Invoke-Expression is safe here
if ($buildScript -like "dotnet*") {
Write-Host "Executing built-in command: $buildScript"
Invoke-Expression $buildScript
} elseif ($IsWindows) {
# Execute the provided script on Windows
Write-Host "Executing file-based script: $buildScript"
& ".\$buildScript"
} else {
Write-Host "Executing: ${{ item.buildScript }}"
chmod +x "${{ item.buildScript }}"
bash -c "./${{ item.buildScript }}"
# Execute the provided script on Linux
Write-Host "Executing file-based script: $buildScript"
chmod +x "$buildScript"
bash -c "./$buildScript"
}
$exitCode = $LASTEXITCODE

Expand Down
Loading