Fix restore of internal tools and enable IBC merge (#1846)
authorSantiago Fernandez Madero <safern@microsoft.com>
Sat, 25 Jan 2020 03:02:49 +0000 (19:02 -0800)
committerGitHub <noreply@github.com>
Sat, 25 Jan 2020 03:02:49 +0000 (19:02 -0800)
eng/Versions.props
eng/pipelines/common/restore-internal-tools.yml [new file with mode: 0644]
eng/pipelines/common/variables.yml
eng/pipelines/coreclr/templates/build-job.yml
eng/pipelines/libraries/build-job.yml

index 5e2ce31..6d4aff9 100644 (file)
@@ -17,8 +17,7 @@
     <DotNetFinalVersionKind Condition="'$(StabilizePackageVersion)' == 'true'">release</DotNetFinalVersionKind>
     <!-- Opt-in/out repo features -->
     <UsingToolMicrosoftNetCompilers>true</UsingToolMicrosoftNetCompilers>
-    <!-- TODO: (Consolidation) Fix internal tool restore and re-enable. https://github.com/dotnet/runtime/issues/1024 -->
-    <!-- <UsingToolIbcOptimization>true</UsingToolIbcOptimization> -->
+    <UsingToolIbcOptimization>true</UsingToolIbcOptimization>
     <UsingToolXliff>false</UsingToolXliff>
     <!-- Paths used during restore -->
     <EnableNgenOptimization Condition="'$(EnableNgenOptimization)' == '' and '$(ConfigurationGroup)' == 'Release'">true</EnableNgenOptimization>
diff --git a/eng/pipelines/common/restore-internal-tools.yml b/eng/pipelines/common/restore-internal-tools.yml
new file mode 100644 (file)
index 0000000..0f1cc00
--- /dev/null
@@ -0,0 +1,26 @@
+parameters:
+  installDotnet: false
+
+steps:
+  - ${{ if eq(parameters.installDotnet, true) }}:
+    - task: UseDotNet@2
+      displayName: Install dotnet ${{ parameters.dotnetVersion }}
+      inputs:
+        packageType: sdk
+        useGlobalJson: true
+        installationPath: $(Agent.ToolsDirectory)/dotnet
+
+  - task: NuGetAuthenticate@0
+    inputs:
+      nuGetServiceConnections: 'dotnet-core-internal-tooling'
+
+  - task: DotNetCoreCLI@2
+    displayName: Restore internal tools
+    condition: and(succeeded(), ne(variables['_skipRestoreInternalTools'], 'true'))
+    inputs:
+      command: restore
+      feedsToUse: config
+      projects: 'eng/common/internal/Tools.csproj'
+      nugetConfigPath: 'eng/internal/NuGet.config'
+      restoreDirectory: '$(Build.SourcesDirectory)\.packages'
+      verbosityRestore: 'normal'
\ No newline at end of file
index 827cb81..188eeeb 100644 (file)
@@ -7,4 +7,4 @@ variables:
   ${{ if ne(variables['Build.Reason'], 'PullRequest') }}:
     value: Release
   ${{ if eq(variables['Build.Reason'], 'PullRequest') }}:
-    value: Debug
\ No newline at end of file
+    value: Debug
index ff36d2a..54b8335 100644 (file)
@@ -89,11 +89,11 @@ jobs:
     - ${{ if and(eq(variables['System.TeamProject'], 'internal'), ne(variables['Build.Reason'], 'PullRequest')) }}:
       - name: officialBuildIdArg
         value: '-officialbuildid=$(Build.BuildNumber)'
-      # TODO: (Consolidation) Fix internal tool restore and re-enable. https://github.com/dotnet/runtime/issues/1024
-      # IBCMerge is currently Windows-only and x86/x64-only
-      - ${{ if and(eq(parameters.osGroup, 'Windows_NT'), or(eq(parameters.archType, 'x64'), eq(parameters.archType, 'x86'))) }}:
-        - name: ibcOptimizeArg
-          value: '-ibcoptimize'
+
+      # IBCMerge is currently Windows-only and x86/x64-only
+      - ${{ if and(eq(parameters.osGroup, 'Windows_NT'), or(eq(parameters.archType, 'x64'), eq(parameters.archType, 'x86'))) }}:
+        - name: ibcOptimizeArg
+          value: '-ibcoptimize'
     - name: enforcePgoArg
       value: ''
     # The EnforcePGO script is only supported on Windows and is not supported on arm or arm64.
@@ -117,26 +117,14 @@ jobs:
       - script: $(Build.SourcesDirectory)\eng\common\init-tools-native.cmd -InstallDirectory $(Build.SourcesDirectory)\native-tools -Force
         displayName: Install native dependencies
 
-    # TODO: (Consolidation) Fix internal tool restore and re-enable. https://github.com/dotnet/runtime/issues/1024
     # # 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(and(eq(variables['System.TeamProject'], 'internal'), ne(variables['Build.Reason'], 'PullRequest')), eq(parameters.osGroup, 'Windows_NT')) }}:
-    #     - task: DotNetCoreInstaller@0
-    #       inputs:
-    #         packageType: 'sdk'
-    #         version: '2.1.503'
-    #     - task: DotNetCoreCLI@2
-    #       displayName: Restore internal tools
-    #       inputs:
-    #         command: restore
-    #         feedsToUse: config
-    #         projects: '$(Build.SourcesDirectory)/eng/common/internal/Tools.csproj'
-    #         nugetConfigPath: 'eng/internal/NuGet.config'
-    #         restoreDirectory: '$(Build.SourcesDirectory)\.packages'
-    #         verbosityRestore: 'normal'
-    #         externalFeedCredentials: 'dotnet-core-internal-tooling'
+    - ${{ if and(and(eq(variables['System.TeamProject'], 'internal'), ne(variables['Build.Reason'], 'PullRequest')), eq(parameters.osGroup, 'Windows_NT')) }}:
+      - template: /eng/pipelines/common/restore-internal-tools.yml
+        parameters:
+          installDotnet: true
 
     # Build
     - ${{ if ne(parameters.osGroup, 'Windows_NT') }}:
index d27bce3..fe75539 100644 (file)
@@ -67,20 +67,6 @@ jobs:
         - ${{ parameters.variables }}
 
       steps:
-        # TODO: (Consolidation) Fix internal tool restore and re-enable. https://github.com/dotnet/runtime/issues/1024
-        # - ${{ if eq(parameters.isOfficialBuild, true) }}:
-        #   - task: DotNetCoreCLI@2
-        #     displayName: Restore internal tools
-        #     condition: and(succeeded(), ne(variables['_skipRestoreInternalTools'], 'true'))
-        #     inputs:
-        #       command: restore
-        #       feedsToUse: config
-        #       projects: 'eng/common/internal/Tools.csproj'
-        #       nugetConfigPath: 'eng/internal/NuGet.config'
-        #       restoreDirectory: '$(Build.SourcesDirectory)\.packages'
-        #       verbosityRestore: 'normal'
-        #       externalFeedCredentials: 'dotnet-core-internal-tooling'
-
         - ${{ if eq(parameters.osGroup, 'OSX') }}:
           - script: |
               brew install pkgconfig icu4c openssl
@@ -102,6 +88,11 @@ jobs:
         - script: $(_buildScript) -restore $(_buildArguments) $(_skipTestRestoreArg)
           displayName: Restore
 
+        - ${{ if eq(parameters.isOfficialBuild, true) }}:
+          - template: /eng/pipelines/common/restore-internal-tools.yml
+            parameters:
+              installDotnet: false
+
         - script: $(_buildScript)
                 $(_buildAction)
                 $(_buildArguments)