build-jit-job.yml 5.7 KB
Newer Older
1 2 3 4
parameters:
  archType: ''
  buildConfig: ''
  container: ''
5
  crossBuild: false
6 7 8 9 10 11
  osGroup: ''
  osSubgroup: ''
  pool: ''
  stagedBuild: false
  timeoutInMinutes: ''
  variables: {}
12
  dependOnEvaluatePaths: false
K
Kunal Pathak 已提交
13
  uploadAs: 'azureBlob'
14 15 16 17 18 19 20 21 22 23 24 25 26

### Product build
jobs:
- template: xplat-pipeline-job.yml
  parameters:
    buildConfig: ${{ parameters.buildConfig }}
    archType: ${{ parameters.archType }}
    osGroup: ${{ parameters.osGroup }}
    osSubgroup: ${{ parameters.osSubgroup }}
    helixType: 'build/product/'
    enableMicrobuild: true
    stagedBuild: ${{ parameters.stagedBuild }}
    pool: ${{ parameters.pool }}
27
    dependOnEvaluatePaths: ${{ parameters.dependOnEvaluatePaths }}
28 29 30 31 32 33 34 35 36 37 38

    # Compute job name from template parameters
    name: ${{ format('coreclr_jit_build_{0}{1}_{2}_{3}', parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig) }}
    displayName: ${{ format('CoreCLR JIT Build {0}{1} {2} {3}', parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig) }}

    # Run all steps in the container.
    # Note that the containers are defined in platform-matrix.yml
    container: ${{ parameters.container }}

    timeoutInMinutes: ${{ parameters.timeoutInMinutes }}

39
    crossBuild: ${{ parameters.crossBuild }}
40 41 42 43 44 45 46 47 48 49 50

    gatherAssetManifests: true

    variables:
    - name: osGroup
      value: ${{ parameters.osGroup }}
    - name: osSubgroup
      value: ${{ parameters.osSubgroup }}

    - name: publishLogsArtifactPrefix
      value: 'BuildLogs_CoreCLR_JIT'
K
Kunal Pathak 已提交
51 52
    - name: uploadAs
      value: ${{ parameters.uploadAs }}
53 54 55

    - name: compilerArg
      value: ''
56
    - ${{ if ne(parameters.osGroup, 'windows') }}:
57 58
      - name: compilerArg
        value: '-clang9'
59 60
      # We need to use the stable version available on Alpine Linux
      - ${{ if and(eq(parameters.osGroup, 'Linux'), eq(parameters.osSubgroup, '_musl')) }}:
61 62
        - name: compilerArg
          value: ''
A
Adeel Mujahid 已提交
63
      # AppleClang has different version scheme, so we let compiler introspection pick up the available clang from PATH
64 65 66 67
      - ${{ if eq(parameters.osGroup, 'OSX') }}:
        - name: compilerArg
          value: ''

68
    - ${{ if eq(parameters.osGroup, 'windows') }}:
69 70 71 72
      - name: PythonScript
        value: 'py -3'
      - name: PipScript
        value: 'py -3 -m pip'
73
    - ${{ if ne(parameters.osGroup, 'windows') }}:
74 75 76 77 78 79 80 81 82 83 84 85 86 87
      - name: PythonScript
        value: 'python3'
      - name: PipScript
        value: 'pip3'

    - ${{ parameters.variables }}

    steps:

    # Install native dependencies
    # Linux builds use docker images with dependencies preinstalled,
    # and FreeBSD builds use a build agent with dependencies
    # preinstalled, so we only need this step for OSX and Windows.
    - ${{ if eq(parameters.osGroup, 'OSX') }}:
88
      - script: $(Build.SourcesDirectory)/eng/install-native-dependencies.sh $(osGroup)
K
Kunal Pathak 已提交
89
        displayName: Install native dependencies (OSX)
90 91 92 93 94 95 96 97

    # Install internal tools on official builds
    # Since our internal tools are behind an authenticated feed,
    # we need to use the DotNetCli AzDO task to restore from the feed using a service connection.
    # We can't do this from within the build, so we need to do this as a separate step.
    - ${{ if and(eq(variables['System.TeamProject'], 'internal'), ne(variables['Build.Reason'], 'PullRequest')) }}:
      - template: /eng/pipelines/common/restore-internal-tools.yml

98 99 100 101
    # Build/Generate native prerequisites
    - script: $(Build.SourcesDirectory)$(dir)build$(scriptExt) -subset clr.nativeprereqs $(crossArg) -arch $(archType) -c $(buildConfig) -ci /bl:$(Build.SourcesDirectory)artifacts/log/$(buildConfig)/CoreCLRNativePrereqs.binlog
      displayName: Build and generate native prerequisites

102
    # Build CoreCLR JIT
103
    - ${{ if ne(parameters.osGroup, 'windows') }}:
104
      - script: $(Build.SourcesDirectory)/src/coreclr/build-runtime$(scriptExt) $(buildConfig) $(archType) $(crossArg) -ci $(compilerArg) -component alljits -component spmi
105
        displayName: Build CoreCLR JIT
106
    - ${{ if eq(parameters.osGroup, 'windows') }}:
107
      - script: $(Build.SourcesDirectory)/src/coreclr/build-runtime$(scriptExt) $(buildConfig) $(archType) -ci -component alljits -component spmi
108 109
        displayName: Build CoreCLR JIT

K
Kunal Pathak 已提交
110 111 112 113 114
    - ${{ if eq(parameters.uploadAs, 'azureBlob') }}:
      # Ensure the Python azure-storage-blob package is installed before doing the upload.
      - script: $(PipScript) install --user --upgrade pip && $(PipScript) install --user azure.storage.blob==12.5.0 --force-reinstall
        displayName: Upgrade Pip to latest and install azure-storage-blob Python package

115
      - script: $(PythonScript) $(Build.SourcesDirectory)/src/coreclr/scripts/jitrollingbuild.py upload -build_type $(buildConfig) -arch $(archType) -host_os $(osGroup) -git_hash $(Build.SourceVersion) --use_latest_jit_change
K
Kunal Pathak 已提交
116 117 118 119 120 121 122 123 124 125 126 127 128 129 130
        displayName: Upload JIT to Azure Storage
        env:
          CLRJIT_AZ_KEY: $(clrjit_key1) # secret key stored as variable in pipeline

    - ${{ if eq(parameters.uploadAs, 'pipelineArtifacts') }}:
      # Publish product output directory for consumption by tests.
      - template: /eng/pipelines/common/upload-artifact-step.yml
        parameters:
          rootFolder: $(buildProductRootFolderPath)
          includeRootFolder: false
          archiveType: $(archiveType)
          tarCompression: $(tarCompression)
          archiveExtension: $(archiveExtension)
          artifactName: $(buildProductArtifactName)
          displayName: 'product build'
131 132 133 134 135 136 137 138 139

    # Publish Logs
    - task: PublishPipelineArtifact@1
      displayName: Publish Logs
      inputs:
        targetPath: $(Build.SourcesDirectory)/artifacts/log
        artifactName: '$(publishLogsArtifactPrefix)_$(osGroup)$(osSubgroup)_$(archType)_$(buildConfig)'
      continueOnError: true
      condition: always()