Skip to content
Open
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
7 changes: 5 additions & 2 deletions eng/common/core-templates/job/source-index-stage1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ jobs:
- job: SourceIndexStage1
dependsOn: ${{ parameters.dependsOn }}
condition: ${{ parameters.condition }}
continueOnError: true

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I think source index stage should not block official builds by default. But happy to change this if others disagree.

variables:
- name: BinlogPath
value: ${{ parameters.binlogPath }}
Expand All @@ -38,9 +39,11 @@ jobs:

- ${{ each preStep in parameters.preSteps }}:
- ${{ preStep }}
- script: ${{ parameters.sourceIndexBuildCommand }}
displayName: Build Repository
- ${{ if ne(parameters.sourceIndexBuildCommand, '') }}:
- script: ${{ parameters.sourceIndexBuildCommand }}
displayName: Build Repository

- template: /eng/common/core-templates/steps/source-index-stage1-publish.yml
parameters:
binLogPath: ${{ parameters.binLogPath }}
runAsPublic: ${{ parameters.runAsPublic }}
19 changes: 12 additions & 7 deletions eng/common/core-templates/steps/source-index-stage1-publish.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
parameters:
sourceIndexUploadPackageVersion: 2.0.0-20260521.2
sourceIndexProcessBinlogPackageVersion: 1.0.1-20260521.2
runAsPublic: false
sourceIndexUploadPackageVersion: '2.0.0-20260521.2'
sourceIndexComplogPackageVersion: '*'
sourceIndexPackageSource: https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json
sourceIndexPublicPackageSource: https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public/nuget/v3/index.json
binlogPath: artifacts/log/Debug/Build.binlog

steps:
Expand All @@ -14,14 +16,17 @@ steps:
workingDirectory: $(Agent.TempDirectory)

- script: |
$(Agent.TempDirectory)/dotnet/dotnet tool install BinLogToSln --version ${{parameters.sourceIndexProcessBinlogPackageVersion}} --source ${{parameters.sourceIndexPackageSource}} --tool-path $(Agent.TempDirectory)/.source-index/tools
$(Agent.TempDirectory)/dotnet/dotnet tool install UploadIndexStage1 --version ${{parameters.sourceIndexUploadPackageVersion}} --source ${{parameters.sourceIndexPackageSource}} --tool-path $(Agent.TempDirectory)/.source-index/tools
displayName: "Source Index: Download netsourceindex Tools"
$(Agent.TempDirectory)/dotnet/dotnet tool install complog --version "${{parameters.sourceIndexComplogPackageVersion}}" --source ${{parameters.sourceIndexPublicPackageSource}} --tool-path $(Agent.TempDirectory)/.source-index/tools
$(Agent.TempDirectory)/dotnet/dotnet tool install UploadIndexStage1 --version "${{parameters.sourceIndexUploadPackageVersion}}" --source ${{parameters.sourceIndexPackageSource}} --tool-path $(Agent.TempDirectory)/.source-index/tools
displayName: "Source Index: Download Tools"
# Set working directory to temp directory so 'dotnet' doesn't try to use global.json and use the repo's sdk.
workingDirectory: $(Agent.TempDirectory)

- script: $(Agent.TempDirectory)/.source-index/tools/BinLogToSln -i ${{parameters.BinlogPath}} -r $(System.DefaultWorkingDirectory) -n $(Build.Repository.Name) -o .source-index/stage1output
displayName: "Source Index: Process Binlog into indexable sln"
- script: |
mkdir ".source-index/stage1output"
git rev-parse HEAD > .source-index/stage1output/hash
$(Agent.TempDirectory)/.source-index/tools/complog create ${{parameters.BinlogPath}} -o .source-index/stage1output/build.complog

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

How does this work when a repository produces multiple binlogs? That is what say VMR would do.

@jjonescz jjonescz Aug 12, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This infra doesn't currently support that (and never did). VMR doesn't use this, it has its own logic, specifically it has a loop:

https://github.com/dotnet/dotnet/blob/a2c79539ae1265f88edea9a4663ac174cd657d67/eng/pipelines/templates/steps/source-index-stage1.yml#L72

displayName: "Source Index: Process Binlog into Complog"

- ${{ if and(ne(parameters.runAsPublic, 'true'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
- task: AzureCLI@2
Expand Down
Loading