|
| 1 | +parameters: |
| 2 | + archType: '' |
| 3 | + isOfficialBuild: false |
| 4 | + osGroup: '' |
| 5 | + osSubgroup: '' |
| 6 | + hostArchType: '' |
| 7 | + |
| 8 | +steps: |
| 9 | + # Always build the crossdac, that way we know in CI/PR if things break to build. |
| 10 | + - ${{ if and(eq(parameters.osGroup, 'windows'), notin(parameters.archType, 'x86')) }}: |
| 11 | + - script: $(Build.SourcesDirectory)/src/coreclr/build-runtime$(scriptExt) $(buildConfig) ${{ parameters.archType }} -hostarch ${{ parameters.hostArchType }} -ci -os linux -cmakeargs "-DCLR_CROSS_COMPONENTS_BUILD=1" -ninja $(officialBuildIdArg) -component crosscomponents |
| 12 | + displayName: Build Cross OS Linux DAC for Windows |
| 13 | + |
| 14 | + - script: $(Build.SourcesDirectory)/src/coreclr/build-runtime$(scriptExt) $(buildConfig) ${{ parameters.archType }} -hostarch ${{ parameters.hostArchType }} -ci -os alpine -cmakeargs "-DCLR_CROSS_COMPONENTS_BUILD=1" -ninja $(officialBuildIdArg) -component crosscomponents |
| 15 | + displayName: Build Cross OS Linux-musl DAC for Windows |
| 16 | + |
| 17 | + - powershell: | |
| 18 | + function CopyAndVerifyCrossOsAssets { |
| 19 | + [CmdletBinding()] |
| 20 | + param ( |
| 21 | + [Parameter(Mandatory)][string]$crossDacDir, |
| 22 | + [Parameter(Mandatory)][string]$targetDir |
| 23 | + ) |
| 24 | +
|
| 25 | + $crossDacDir = Join-Path $crossDacDir -ChildPath '${{ parameters.hostArchType }}' |
| 26 | +
|
| 27 | + $availableFiles = ls -File $crossDacDir |
| 28 | +
|
| 29 | + Write-Host "Probed for files in ""$crossDacDir"", found:" |
| 30 | + $availableFiles | fl |
| 31 | +
|
| 32 | + if (-not ("mscordaccore.dll" -in $availableFiles.Name ` |
| 33 | + -and "mscordaccore.pdb" -in $availableFiles.Name ` |
| 34 | + -and "mscordbi.dll" -in $availableFiles.Name ` |
| 35 | + -and "mscordbi.pdb" -in $availableFiles.Name` |
| 36 | + )) |
| 37 | + { |
| 38 | + Write-Error "Couldn't find one of the expected crossdac files." |
| 39 | + } |
| 40 | +
|
| 41 | + New-Item $targetDir -ItemType 'Directory' -Force -ea 0 |
| 42 | + $availableFiles | %{ cp $_.FullName $targetDir -v } |
| 43 | + } |
| 44 | +
|
| 45 | + $buildMuslDacRootFolderPath = "$(Build.SourcesDirectory)/artifacts/bin/coreclr/alpine.${{ parameters.archType }}.$(buildConfigUpper)" |
| 46 | + $buildMuslStagingPath = "$(crossDacArtifactPath)/Linux_musl.${{ parameters.archType }}.$(buildConfigUpper)/${{ parameters.hostArchType }}" |
| 47 | + |
| 48 | + $buildLinuxDacRootFolderPath = "$(Build.SourcesDirectory)/artifacts/bin/coreclr/Linux.${{ parameters.archType }}.$(buildConfigUpper)" |
| 49 | + $buildLinuxDacStagingPath = "$(crossDacArtifactPath)/Linux.${{ parameters.archType }}.$(buildConfigUpper)/${{ parameters.hostArchType }}" |
| 50 | + |
| 51 | + |
| 52 | + CopyAndVerifyCrossOsAssets -CrossDacDir $buildMuslDacRootFolderPath -TargetDir $buildMuslStagingPath |
| 53 | + CopyAndVerifyCrossOsAssets -CrossDacDir $buildLinuxDacRootFolderPath -TargetDir $buildLinuxDacStagingPath |
| 54 | +
|
| 55 | + Write-Host "Final directory contents:" |
| 56 | + ls -R $(crossDacArtifactPath) |
| 57 | +
|
| 58 | + displayName: Gather CrossDac Artifacts |
| 59 | +
|
| 60 | + - template: /eng/pipelines/coreclr/templates/sign-diagnostic-files.yml |
| 61 | + parameters: |
| 62 | + basePath: $(crossDacArtifactPath) |
| 63 | + isOfficialBuild: ${{ parameters.isOfficialBuild }} |
| 64 | + timeoutInMinutes: 30 |
| 65 | + |
| 66 | + - ${{ if eq(parameters.osGroup, 'linux') }}: |
| 67 | + - task: CopyFiles@2 |
| 68 | + displayName: Gather runtime for CrossDac |
| 69 | + inputs: |
| 70 | + SourceFolder: $(coreClrProductRootFolderPath) |
| 71 | + Contents: libcoreclr.so |
| 72 | + TargetFolder: '$(crossDacArtifactPath)/${{ parameters.osGroup }}${{ parameters.osSubgroup }}.$(archType).$(buildConfigUpper)/${{ parameters.hostArchType }}' |
| 73 | + |
| 74 | + # Make the assets available in a single container for the packaging job. |
| 75 | + - task: PublishBuildArtifacts@1 |
| 76 | + displayName: Publish runtime for CrossDac |
| 77 | + inputs: |
| 78 | + pathtoPublish: $(crossDacArtifactPath) |
| 79 | + PublishLocation: Container |
| 80 | + artifactName: $(buildCrossDacArtifactName) |
0 commit comments