diff options
author | Jeremy Koritzinsky <jekoritz@microsoft.com> | 2019-04-29 09:27:10 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-29 09:27:10 -0700 |
commit | 9cf8b4b5c7d43c4352823ad57493dc91640a4fe2 (patch) | |
tree | 661de1ce059bd3515008ce7f4cad7a9c99427b85 | |
parent | 64b5ddd69e979c84e54c1fe278c94feaee3fbabf (diff) | |
download | coreclr-9cf8b4b5c7d43c4352823ad57493dc91640a4fe2.tar.gz coreclr-9cf8b4b5c7d43c4352823ad57493dc91640a4fe2.tar.bz2 coreclr-9cf8b4b5c7d43c4352823ad57493dc91640a4fe2.zip |
Restore IBCMerge using an authenticated service connection (#24284)
* Add separate build steps to do the IBCMerge restore.
* Attempt 1 to get config picked up.
* Attempt 2 getting ibcmerge restore working.
* Fix invalid MSBuild syntax.
* Fix getting IBC package version.
-rw-r--r-- | build.cmd | 8 | ||||
-rw-r--r-- | eng/build-job.yml | 20 | ||||
-rw-r--r-- | eng/internal/NuGet.config | 14 | ||||
-rw-r--r-- | src/.nuget/optdata/ibcmerge.csproj | 7 |
4 files changed, 42 insertions, 7 deletions
@@ -670,11 +670,7 @@ if %__BuildCoreLib% EQU 1 ( for /f "tokens=*" %%s in ('call "%__ProjectDir%\dotnet.cmd" msbuild "!IbcMergeProjectFilePath!" /t:DumpIbcMergePackageVersion /nologo') do @( set __IbcMergeVersion=%%s ) - - echo Restoring IBCMerge version !__IbcMergeVersion!... - echo Running: %__ProjectDir%\dotnet.cmd restore src/.nuget/optdata/ibcmerge.csproj --no-cache --packages "%__PackagesDir%" --source "https://devdiv.pkgs.visualstudio.com/_packaging/dotnet-core-internal-tooling/nuget/v3/index.json" - call %__ProjectDir%\dotnet.cmd restore src/.nuget/optdata/ibcmerge.csproj --no-cache --packages "%__PackagesDir%" --source "https://devdiv.pkgs.visualstudio.com/_packaging/dotnet-core-internal-tooling/nuget/v3/index.json" - + set IbcMergePath=%__PackagesDir%\microsoft.dotnet.ibcmerge\!__IbcMergeVersion!\tools\netcoreapp2.0\ibcmerge.dll if exist !IbcMergePath! ( echo %__MsgPrefix%Optimizing using IBC training data @@ -754,7 +750,7 @@ if %__BuildCoreLib% EQU 1 ( goto CrossgenFailure ) ) else ( - echo Could not find IBCMerge at !IbcMergePath! + echo Could not find IBCMerge at !IbcMergePath!. Have you restored src/.nuget/optdata/ibcmerge.csproj? goto CrossgenFailure ) ) diff --git a/eng/build-job.yml b/eng/build-job.yml index d62d267649..ec91ba03cf 100644 --- a/eng/build-job.yml +++ b/eng/build-job.yml @@ -101,6 +101,26 @@ jobs: - script: eng\common\init-tools-native.cmd -InstallDirectory $(Build.SourcesDirectory)\native-tools -Force displayName: Install native dependencies + # 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: 'src/.nuget/optdata/ibcmerge.csproj' + nugetConfigPath: 'eng/internal/NuGet.config' + restoreDirectory: '$(Build.SourcesDirectory)\packages' + verbosityRestore: 'normal' + externalFeedCredentials: 'dotnet-core-internal-tooling' + # Build - ${{ if ne(parameters.osGroup, 'Windows_NT') }}: - script: ./build.sh $(buildConfig) $(archType) $(crossArg) -skiptests -skipnuget $(clangArg) $(stripSymbolsArg) $(officialBuildIdArg) diff --git a/eng/internal/NuGet.config b/eng/internal/NuGet.config new file mode 100644 index 0000000000..b7a79f13bc --- /dev/null +++ b/eng/internal/NuGet.config @@ -0,0 +1,14 @@ +<configuration> + <!-- Don't use any higher level config files. + Our builds need to be isolated from user/machine state --> + <fallbackPackageFolders> + <clear /> + </fallbackPackageFolders> + <packageSources> + <clear/> + <add key="dotnet-core-internal-tooling" value="https://devdiv.pkgs.visualstudio.com/_packaging/dotnet-core-internal-tooling/nuget/v3/index.json" /> + </packageSources> + <disabledPackageSources> + <clear /> + </disabledPackageSources> +</configuration> diff --git a/src/.nuget/optdata/ibcmerge.csproj b/src/.nuget/optdata/ibcmerge.csproj index e69ac17b4a..3ec0272a7a 100644 --- a/src/.nuget/optdata/ibcmerge.csproj +++ b/src/.nuget/optdata/ibcmerge.csproj @@ -9,11 +9,16 @@ </PropertyGroup> <ItemGroup> - <PackageReference Include="microsoft.dotnet.ibcmerge" Version="$(IbcMergePackageVersion)" Condition="'$(IbcMergePackageVersion)'!=''" /> + <PackageReference Include="microsoft.dotnet.ibcmerge" Version="[$(IbcMergePackageVersion)]" Condition="'$(IbcMergePackageVersion)'!=''" /> </ItemGroup> <Target Name="DumpIbcMergePackageVersion"> <Message Importance="high" Text="$(IbcMergePackageVersion)" /> </Target> + <PropertyGroup> + <RestoreSources> + https://devdiv.pkgs.visualstudio.com/_packaging/dotnet-core-internal-tooling/nuget/v3/index.json; + </RestoreSources> + </PropertyGroup> </Project> |