Skip to content
Merged
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
2 changes: 1 addition & 1 deletion src/arcade/eng/Version.Details.props
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ This file should be imported by eng/Versions.props
<!-- dotnet-templating dependencies -->
<MicrosoftTemplateEngineAuthoringTasksPackageVersion>10.0.100-preview.4.25220.1</MicrosoftTemplateEngineAuthoringTasksPackageVersion>
<!-- dotnet-xharness dependencies -->
<MicrosoftDotNetXHarnessCLIPackageVersion>11.0.0-prerelease.26353.1</MicrosoftDotNetXHarnessCLIPackageVersion>
<MicrosoftDotNetXHarnessCLIPackageVersion>11.0.0-prerelease.26360.1</MicrosoftDotNetXHarnessCLIPackageVersion>
<!-- JamesNK-Newtonsoft.Json dependencies -->
<NewtonsoftJsonPackageVersion>13.0.3</NewtonsoftJsonPackageVersion>
<!-- microsoft-ApplicationInsights-dotnet dependencies -->
Expand Down
6 changes: 3 additions & 3 deletions src/arcade/eng/Version.Details.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Dependencies>
<Source Uri="https://github.com/dotnet/dotnet" Mapping="arcade" Sha="63346086305d259f3e01422b43cc5dd7151c4d37" BarId="321619" />
<Source Uri="https://github.com/dotnet/dotnet" Mapping="arcade" Sha="b63fd14d0c0dc26a52814d3f8debb67ba806f1f0" BarId="322528" />
<ProductDependencies>
</ProductDependencies>
<ToolsetDependencies>
Expand Down Expand Up @@ -36,9 +36,9 @@
<Uri>https://github.com/dotnet/arcade-services</Uri>
<Sha>e6a28a549cc932140719fd63ba0387254db0ac51</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.XHarness.CLI" Version="11.0.0-prerelease.26353.1">
<Dependency Name="Microsoft.DotNet.XHarness.CLI" Version="11.0.0-prerelease.26360.1">
<Uri>https://github.com/dotnet/xharness</Uri>
<Sha>4da0015e9dd1ed7d3992db7d1eb6878a5ee11ab2</Sha>
<Sha>ab06ed6b9b6366d219751bdd80b04f8f37768bb3</Sha>
</Dependency>
<Dependency Name="Microsoft.Net.Compilers.Toolset" Version="4.8.0">
<Uri>https://github.com/dotnet/roslyn</Uri>
Expand Down
2 changes: 1 addition & 1 deletion src/arcade/eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
</PropertyGroup>
<PropertyGroup Condition="'$(DotNetBuildSourceOnly)' != 'true'">
<MicrosoftBclHashCodeVersion>1.1.1</MicrosoftBclHashCodeVersion>
<SystemMemoryVersion>4.6.3</SystemMemoryVersion>
<SystemMemoryVersion>4.5.5</SystemMemoryVersion>
<MicrosoftIORedistVersion>6.0.1</MicrosoftIORedistVersion>
</PropertyGroup>
<PropertyGroup>
Expand Down
22 changes: 20 additions & 2 deletions src/arcade/eng/common/core-templates/job/onelocbuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ parameters:
CeapexPat: $(dn-bot-ceapex-package-r) # PAT for the loc AzDO instance https://dev.azure.com/ceapex
GithubPat: $(BotAccount-dotnet-bot-repo-PAT)

# Service connection for WIF-based Entra authentication to ceapex feeds (replaces CeapexPat).
# When set, dnceng/internal builds acquire a federated Entra token instead of using a PAT.
# All other projects (e.g. DevDiv, public), where this dnceng-scoped service connection does not
# exist, and any pipeline that sets this to '' fall back to PAT-based auth via the CeapexPat parameter.
CeapexServiceConnection: 'dnceng-onelocbuild-ceapex'

SourcesDirectory: $(System.DefaultWorkingDirectory)
CreatePr: true
AutoCompletePr: false
Expand Down Expand Up @@ -73,7 +79,16 @@ jobs:
displayName: Generate LocProject.json
condition: ${{ parameters.condition }}

- task: OneLocBuild@2
# Acquire an Entra token for ceapex feed access via WIF (dnceng/internal only).
# All other projects use PAT-based auth, since the ceapex service connection is scoped to dnceng/internal.
- ${{ if and(ne(parameters.CeapexServiceConnection, ''), eq(variables['System.TeamProject'], 'internal')) }}:
- template: /eng/common/templates/steps/get-federated-access-token.yml
parameters:
federatedServiceConnection: ${{ parameters.CeapexServiceConnection }}
outputVariableName: 'CeapexEntraToken'
condition: ${{ parameters.condition }}

- task: OneLocBuild@3
displayName: OneLocBuild
env:
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
Expand All @@ -88,7 +103,10 @@ jobs:
isUseLfLineEndingsSelected: ${{ parameters.UseLfLineEndings }}
isShouldReusePrSelected: ${{ parameters.ReusePr }}
packageSourceAuth: patAuth
patVariable: ${{ parameters.CeapexPat }}
${{ if and(ne(parameters.CeapexServiceConnection, ''), eq(variables['System.TeamProject'], 'internal')) }}:
patVariable: $(CeapexEntraToken)
${{ if or(eq(parameters.CeapexServiceConnection, ''), ne(variables['System.TeamProject'], 'internal')) }}:
patVariable: ${{ parameters.CeapexPat }}
${{ if eq(parameters.RepoType, 'gitHub') }}:
repoType: ${{ parameters.RepoType }}
gitHubPatVariable: "${{ parameters.GithubPat }}"
Expand Down
2 changes: 1 addition & 1 deletion src/arcade/eng/common/tools.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -732,7 +732,7 @@ function InitializeToolset() {

'<Project Sdk="Microsoft.DotNet.Arcade.Sdk"/>' | Set-Content $proj

MSBuild-Core $proj $bl /t:__WriteToolsetLocation /clp:ErrorsOnly`;NoSummary /p:__ToolsetLocationOutputFile=$toolsetLocationFile
MSBuild-Core $proj $bl /t:__WriteToolsetLocation /clp:ErrorsOnly`;NoSummary /p:__ToolsetLocationOutputFile=$toolsetLocationFile /p:RestoreIgnoreFailedSources=true

$path = Get-Content $toolsetLocationFile -Encoding UTF8 -TotalCount 1
if (!(Test-Path $path)) {
Expand Down
2 changes: 1 addition & 1 deletion src/arcade/eng/common/tools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ function InitializeToolset {
fi

echo '<Project Sdk="Microsoft.DotNet.Arcade.Sdk"/>' > "$proj"
MSBuild-Core "$proj" $bl /t:__WriteToolsetLocation /clp:ErrorsOnly\;NoSummary /p:__ToolsetLocationOutputFile="$toolset_location_file"
MSBuild-Core "$proj" $bl /t:__WriteToolsetLocation /clp:ErrorsOnly\;NoSummary /p:__ToolsetLocationOutputFile="$toolset_location_file" /p:RestoreIgnoreFailedSources=true

local toolset_build_proj=`cat "$toolset_location_file"`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,14 @@
{TargetFrameworkDirectory};
{RawFileName};
</AssemblySearchPaths>

<!--
Tolerate package sources that are unavailable (e.g. transport feeds that have been
decommissioned after a release). Restore falls back to the remaining sources instead
of failing outright. Can be overridden by setting RestoreIgnoreFailedSources explicitly.
See https://github.com/dotnet/runtime/issues/129694.
-->
<RestoreIgnoreFailedSources Condition="'$(RestoreIgnoreFailedSources)' == ''">true</RestoreIgnoreFailedSources>
</PropertyGroup>

<PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" VersionOverride="10.0.7" />
<PackageReference Include="Microsoft.Extensions.FileProviders.Abstractions" VersionOverride="10.0.7" />
<PackageReference Include="System.Collections.Immutable" VersionOverride="10.0.7" />
<PackageReference Include="System.Memory" VersionOverride="4.6.3" />
<PackageReference Include="System.Text.Encodings.Web" VersionOverride="10.0.7" />
<PackageReference Include="System.Text.Json" VersionOverride="10.0.7" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" VersionOverride="10.0.7" />
<PackageReference Include="Microsoft.Extensions.FileProviders.Abstractions" VersionOverride="10.0.7" />
<PackageReference Include="System.Collections.Immutable" VersionOverride="10.0.7" />
<PackageReference Include="System.Memory" VersionOverride="4.6.3" />
<PackageReference Include="System.Text.Encodings.Web" VersionOverride="10.0.7" />
<PackageReference Include="System.Text.Json" VersionOverride="10.0.7" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public override SigningStatus VerifySignedPEFile(Stream stream)

public override SigningStatus VerifyStrongNameSign(string fileFullPath) => SigningStatus.Signed;

public override bool RunMSBuild(IBuildEngine buildEngine, string projectFilePath, string binLogPath, string logPath, string errorLogPath)
public override bool RunMSBuild(IBuildEngine buildEngine, string projectFilePath, string binLogPath, string logPath, string errorLogPath, bool suppressErrors = false)
=> buildEngine.BuildProjectFile(projectFilePath, null, null, null);

internal static void SignFile(string path)
Expand Down
15 changes: 11 additions & 4 deletions src/arcade/src/Microsoft.DotNet.SignTool/src/RealSignTool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ internal RealSignTool(SignToolArgs args, TaskLoggingHelper log) : base(args, log
_dotnetTimeout = args.DotNetTimeout;
}

public override bool RunMSBuild(IBuildEngine buildEngine, string projectFilePath, string binLogPath, string logPath, string errorLogPath)
public override bool RunMSBuild(IBuildEngine buildEngine, string projectFilePath, string binLogPath, string logPath, string errorLogPath, bool suppressErrors = false)
{
if (_dotnetPath == null)
{
Expand Down Expand Up @@ -80,16 +80,23 @@ public override bool RunMSBuild(IBuildEngine buildEngine, string projectFilePath
bool success = true;
if (!process.WaitForExit(_dotnetTimeout))
{
_log.LogError($"MSBuild process did not exit within '{_dotnetTimeout}' ms.");
if (suppressErrors)
_log.LogMessage(MessageImportance.High, $"MSBuild process did not exit within '{_dotnetTimeout}' ms.");
else
_log.LogError($"MSBuild process did not exit within '{_dotnetTimeout}' ms.");
process.Kill();
process.WaitForExit();
success = false;
}

if (process.ExitCode != 0)
{
_log.LogError($"Failed to execute MSBuild on the project file '{projectFilePath}'" +
$" with exit code '{process.ExitCode}'.");
if (suppressErrors)
_log.LogMessage(MessageImportance.High, $"Failed to execute MSBuild on the project file '{projectFilePath}'" +
$" with exit code '{process.ExitCode}'.");
else
_log.LogError($"Failed to execute MSBuild on the project file '{projectFilePath}'" +
$" with exit code '{process.ExitCode}'.");
success = false;
}

Expand Down
7 changes: 4 additions & 3 deletions src/arcade/src/Microsoft.DotNet.SignTool/src/SignTool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ internal SignTool(SignToolArgs args, TaskLoggingHelper log)

public abstract SigningStatus VerifyStrongNameSign(string fileFullPath);

public abstract bool RunMSBuild(IBuildEngine buildEngine, string projectFilePath, string binLogPath, string logPath, string errorLogPath);
public abstract bool RunMSBuild(IBuildEngine buildEngine, string projectFilePath, string binLogPath, string logPath, string errorLogPath, bool suppressErrors = false);

public bool Sign(IBuildEngine buildEngine, int round, IEnumerable<FileSignInfo> files)
{
Expand Down Expand Up @@ -191,7 +191,7 @@ private bool AuthenticodeSignAndNotarize(IBuildEngine buildEngine, int round, IE
{
var notarizeProjectPath = Path.Combine(dir, $"Round{round}-Notarize.proj");
File.WriteAllText(notarizeProjectPath, GenerateBuildFileContent(filesToNotarize, null, true));

// Notarization can be flaky, so retry up to 5 times with no wait between retries
const int maxRetries = 5;
int attempt = 0;
Expand All @@ -208,7 +208,8 @@ private bool AuthenticodeSignAndNotarize(IBuildEngine buildEngine, int round, IE
notarizationSucceeded = RunMSBuild(buildEngine, notarizeProjectPath,
Path.Combine(_args.LogDir, $"{notarizeLogName}.binlog"),
Path.Combine(_args.LogDir, $"{notarizeLogName}.log"),
Path.Combine(_args.LogDir, $"{notarizeLogName}.error.log"));
Path.Combine(_args.LogDir, $"{notarizeLogName}.error.log"),
suppressErrors: attempt < maxRetries);

if (!notarizationSucceeded && attempt < maxRetries)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public override SigningStatus VerifySignedPEFile(Stream assemblyStream)
public override SigningStatus VerifyStrongNameSign(string fileFullPath)
=> SigningStatus.Signed;

public override bool RunMSBuild(IBuildEngine buildEngine, string projectFilePath, string binLogPath, string logPath, string errorLogPath)
public override bool RunMSBuild(IBuildEngine buildEngine, string projectFilePath, string binLogPath, string logPath, string errorLogPath, bool suppressErrors = false)
{
if (TestSign)
{
Expand Down
4 changes: 2 additions & 2 deletions src/source-manifest.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"repositories": [
{
"barId": 322031,
"barId": 323186,
"path": "arcade",
"remoteUri": "https://github.com/dotnet/arcade",
"commitSha": "4e21b419f8adadeb519bee472464824b1cff603e"
"commitSha": "30577dfb42d3f0e8e14cce39fb9840aa0e121eee"
},
{
"barId": 288647,
Expand Down