Skip to content
Draft

Sha256 #1497

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 NuGet.config
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<clear />
<!--Begin: Package sources managed by Dependency Flow automation. Do not edit the sources below.-->
<!-- Begin: Package sources from dotnet-dotnet -->
<add key="darc-pub-dotnet-dotnet-3a0c62b" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-dotnet-3a0c62bf/nuget/v3/index.json" />
<add key="darc-pub-dotnet-dotnet-e17b0d0" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-dotnet-e17b0d08/nuget/v3/index.json" />
<!-- End: Package sources from dotnet-dotnet -->
<!--End: Package sources managed by Dependency Flow automation. Do not edit the sources above.-->
<add key="dotnet-public" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public/nuget/v3/index.json" />
Expand Down
14 changes: 6 additions & 8 deletions eng/Version.Details.props
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,17 @@ This file should be imported by eng/Versions.props
<Project>
<PropertyGroup>
<!-- dotnet/dotnet dependencies -->
<MicrosoftDotNetArcadeSdkPackageVersion>10.0.0-beta.25513.109</MicrosoftDotNetArcadeSdkPackageVersion>
<SystemCommandLinePackageVersion>2.0.0</SystemCommandLinePackageVersion>
<!-- dotnet/msbuild dependencies -->
<MicrosoftBuildPackageVersion>17.11.31</MicrosoftBuildPackageVersion>
<MicrosoftBuildTasksCorePackageVersion>17.11.31</MicrosoftBuildTasksCorePackageVersion>
<MicrosoftBuildPackageVersion>18.0.3</MicrosoftBuildPackageVersion>
<MicrosoftBuildTasksCorePackageVersion>18.0.3</MicrosoftBuildTasksCorePackageVersion>
<MicrosoftDotNetArcadeSdkPackageVersion>10.0.0-beta.25555.106</MicrosoftDotNetArcadeSdkPackageVersion>
<SystemCommandLinePackageVersion>2.0.1</SystemCommandLinePackageVersion>
</PropertyGroup>
<!--Property group for alternate package version names-->
<PropertyGroup>
<!-- dotnet/dotnet dependencies -->
<MicrosoftDotNetArcadeSdkVersion>$(MicrosoftDotNetArcadeSdkPackageVersion)</MicrosoftDotNetArcadeSdkVersion>
<SystemCommandLineVersion>$(SystemCommandLinePackageVersion)</SystemCommandLineVersion>
<!-- dotnet/msbuild dependencies -->
<MicrosoftBuildVersion>$(MicrosoftBuildPackageVersion)</MicrosoftBuildVersion>
<MicrosoftBuildTasksCoreVersion>$(MicrosoftBuildTasksCorePackageVersion)</MicrosoftBuildTasksCoreVersion>
<MicrosoftDotNetArcadeSdkVersion>$(MicrosoftDotNetArcadeSdkPackageVersion)</MicrosoftDotNetArcadeSdkVersion>
<SystemCommandLineVersion>$(SystemCommandLinePackageVersion)</SystemCommandLineVersion>
</PropertyGroup>
</Project>
22 changes: 11 additions & 11 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<Dependencies>
<Source Uri="https://github.com/dotnet/dotnet" Mapping="sourcelink" Sha="3a0c62bf027fbcb8683a13e78a5b21ae19028ca3" BarId="286911" />
<Source Uri="https://github.com/dotnet/dotnet" Mapping="sourcelink" Sha="e17b0d08def649f30aed9c09cf4a2c5741a3c76c" BarId="289695" />
<ProductDependencies>
<Dependency Name="System.CommandLine" Version="2.0.0">
<Dependency Name="System.CommandLine" Version="2.0.1">
<Uri>https://github.com/dotnet/dotnet</Uri>
<Sha>3a0c62bf027fbcb8683a13e78a5b21ae19028ca3</Sha>
<Sha>e17b0d08def649f30aed9c09cf4a2c5741a3c76c</Sha>
</Dependency>
</ProductDependencies>
<ToolsetDependencies>
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="10.0.0-beta.25513.109">
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="10.0.0-beta.25555.106">
<Uri>https://github.com/dotnet/dotnet</Uri>
<Sha>3a0c62bf027fbcb8683a13e78a5b21ae19028ca3</Sha>
<Sha>e17b0d08def649f30aed9c09cf4a2c5741a3c76c</Sha>
</Dependency>
<!-- Dependencies required for source build to lift to the previously-source-built version. -->
<Dependency Name="Microsoft.Build" Version="17.11.31">
<Uri>https://github.com/dotnet/msbuild</Uri>
<Sha>933b72e36e86c22ba73e8b8148488f8298bb73c7</Sha>
<Dependency Name="Microsoft.Build" Version="18.0.3">
<Uri>https://github.com/dotnet/dotnet</Uri>
<Sha>e17b0d08def649f30aed9c09cf4a2c5741a3c76c</Sha>
</Dependency>
<Dependency Name="Microsoft.Build.Tasks.Core" Version="17.11.31">
<Uri>https://github.com/dotnet/msbuild</Uri>
<Sha>933b72e36e86c22ba73e8b8148488f8298bb73c7</Sha>
<Dependency Name="Microsoft.Build.Tasks.Core" Version="18.0.3">
<Uri>https://github.com/dotnet/dotnet</Uri>
<Sha>e17b0d08def649f30aed9c09cf4a2c5741a3c76c</Sha>
</Dependency>
</ToolsetDependencies>
</Dependencies>
2 changes: 1 addition & 1 deletion eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@
<!-- nuget -->
<NuGetVersioningVersion>6.12.1</NuGetVersioningVersion>
<!-- runtime -->
<SystemTextJsonVersion>8.0.5</SystemTextJsonVersion>
<SystemTextJsonVersion>9.0.0</SystemTextJsonVersion>
</PropertyGroup>
</Project>
17 changes: 15 additions & 2 deletions eng/common/SetupNugetSources.ps1
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# This script adds internal feeds required to build commits that depend on internal package sources. For instance,
# dotnet6-internal would be added automatically if dotnet6 was found in the nuget.config file. In addition also enables
# disabled internal Maestro (darc-int*) feeds.
# dotnet6-internal would be added automatically if dotnet6 was found in the nuget.config file. Similarly,
# dotnet-eng-internal and dotnet-tools-internal are added if dotnet-eng and dotnet-tools are present.
# In addition, this script also enables disabled internal Maestro (darc-int*) feeds.
#
# Optionally, this script also adds a credential entry for each of the internal feeds if supplied.
#
Expand Down Expand Up @@ -173,4 +174,16 @@ foreach ($dotnetVersion in $dotnetVersions) {
}
}

# Check for dotnet-eng and add dotnet-eng-internal if present
$dotnetEngSource = $sources.SelectSingleNode("add[@key='dotnet-eng']")
if ($dotnetEngSource -ne $null) {
AddOrEnablePackageSource -Sources $sources -DisabledPackageSources $disabledSources -SourceName "dotnet-eng-internal" -SourceEndPoint "https://pkgs.dev.azure.com/dnceng/internal/_packaging/dotnet-eng-internal/nuget/$feedSuffix" -Creds $creds -Username $userName -pwd $Password
}

# Check for dotnet-tools and add dotnet-tools-internal if present
$dotnetToolsSource = $sources.SelectSingleNode("add[@key='dotnet-tools']")
if ($dotnetToolsSource -ne $null) {
AddOrEnablePackageSource -Sources $sources -DisabledPackageSources $disabledSources -SourceName "dotnet-tools-internal" -SourceEndPoint "https://pkgs.dev.azure.com/dnceng/internal/_packaging/dotnet-tools-internal/nuget/$feedSuffix" -Creds $creds -Username $userName -pwd $Password
}

$doc.Save($filename)
23 changes: 17 additions & 6 deletions eng/common/SetupNugetSources.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#!/usr/bin/env bash

# This script adds internal feeds required to build commits that depend on internal package sources. For instance,
# dotnet6-internal would be added automatically if dotnet6 was found in the nuget.config file. In addition also enables
# disabled internal Maestro (darc-int*) feeds.
# dotnet6-internal would be added automatically if dotnet6 was found in the nuget.config file. Similarly,
# dotnet-eng-internal and dotnet-tools-internal are added if dotnet-eng and dotnet-tools are present.
# In addition, this script also enables disabled internal Maestro (darc-int*) feeds.
#
# Optionally, this script also adds a credential entry for each of the internal feeds if supplied.
#
Expand Down Expand Up @@ -66,10 +67,8 @@ EnableInternalPackageSource() {
grep -i "<add key=\"$PackageSourceName\" value=\"true\"" "$ConfigFile" > /dev/null
if [ "$?" == "0" ]; then
echo "Enabling internal source '$PackageSourceName'."
# Remove the disabled entry
local OldDisableValue="<add key=\"$PackageSourceName\" value=\"true\" />"
local NewDisableValue="<!-- Reenabled for build : $PackageSourceName -->"
sed -i.bak "s|$OldDisableValue|$NewDisableValue|" "$ConfigFile"
# Remove the disabled entry (including any surrounding comments or whitespace on the same line)
sed -i.bak "/<add key=\"$PackageSourceName\" value=\"true\" \/>/d" "$ConfigFile"

# Add the source name to PackageSources for credential handling
PackageSources+=("$PackageSourceName")
Expand Down Expand Up @@ -175,6 +174,18 @@ for DotNetVersion in ${DotNetVersions[@]} ; do
fi
done

# Check for dotnet-eng and add dotnet-eng-internal if present
grep -i "<add key=\"dotnet-eng\"" $ConfigFile > /dev/null
if [ "$?" == "0" ]; then
AddOrEnablePackageSource "dotnet-eng-internal" "https://pkgs.dev.azure.com/dnceng/internal/_packaging/dotnet-eng-internal/nuget/$FeedSuffix"
fi

# Check for dotnet-tools and add dotnet-tools-internal if present
grep -i "<add key=\"dotnet-tools\"" $ConfigFile > /dev/null
if [ "$?" == "0" ]; then
AddOrEnablePackageSource "dotnet-tools-internal" "https://pkgs.dev.azure.com/dnceng/internal/_packaging/dotnet-tools-internal/nuget/$FeedSuffix"
fi

# I want things split line by line
PrevIFS=$IFS
IFS=$'\n'
Expand Down
15 changes: 7 additions & 8 deletions eng/common/core-templates/steps/install-microbuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,22 @@ parameters:
# Unfortunately, _SignType can't be used to exclude the use of the service connection in non-real sign scenarios. The
# variable is not available in template expression. _SignType has a very large proliferation across .NET, so replacing it is tough.
microbuildUseESRP: true
# Location of the MicroBuild output folder
# NOTE: There's something that relies on this being in the "default" source directory for tasks such as Signing to work properly.
microBuildOutputFolder: '$(Build.SourcesDirectory)'

continueOnError: false

steps:
- ${{ if eq(parameters.enableMicrobuild, 'true') }}:
- ${{ if eq(parameters.enableMicrobuildForMacAndLinux, 'true') }}:
# Needed to download the MicroBuild plugin nupkgs on Mac and Linux when nuget.exe is unavailable
# Installing .NET 8 is required to use the MicroBuild signing plugin on non-Windows platforms
- task: UseDotNet@2
displayName: Install .NET 8.0 SDK for MicroBuild Plugin
inputs:
packageType: sdk
version: 8.0.x
installationPath: ${{ parameters.microBuildOutputFolder }}/.dotnet
workingDirectory: ${{ parameters.microBuildOutputFolder }}
# Installing the SDK in a '.dotnet-microbuild' directory is required for signing.
# See target FindDotNetPathForMicroBuild in arcade/src/Microsoft.DotNet.Arcade.Sdk/tools/Sign.proj
# Do not remove '.dotnet-microbuild' from the path without changing the corresponding logic.
installationPath: $(Agent.TempDirectory)/.dotnet-microbuild
condition: and(succeeded(), ne(variables['Agent.Os'], 'Windows_NT'))

- script: |
Expand Down Expand Up @@ -65,7 +64,7 @@ steps:
ConnectedPMEServiceName: 248d384a-b39b-46e3-8ad5-c2c210d5e7ca
env:
TeamName: $(_TeamName)
MicroBuildOutputFolderOverride: ${{ parameters.microBuildOutputFolder }}
MicroBuildOutputFolderOverride: $(Agent.TempDirectory)/MicroBuild
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
continueOnError: ${{ parameters.continueOnError }}
condition: and(succeeded(), eq(variables['Agent.Os'], 'Windows_NT'), in(variables['_SignType'], 'real', 'test'))
Expand All @@ -85,7 +84,7 @@ steps:
ConnectedPMEServiceName: c24de2a5-cc7a-493d-95e4-8e5ff5cad2bc
env:
TeamName: $(_TeamName)
MicroBuildOutputFolderOverride: ${{ parameters.microBuildOutputFolder }}
MicroBuildOutputFolderOverride: $(Agent.TempDirectory)/MicroBuild
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
continueOnError: ${{ parameters.continueOnError }}
condition: and(succeeded(), ne(variables['Agent.Os'], 'Windows_NT'), eq(variables['_SignType'], 'real'))
6 changes: 3 additions & 3 deletions global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "10.0.100-rc.1.25451.107",
"version": "10.0.100-rc.2.25502.107",
"allowPrerelease": true,
"rollForward": "latestFeature",
"paths": [
Expand All @@ -10,10 +10,10 @@
"errorMessage": "The required .NET SDK wasn't found. Please run ./eng/common/dotnet.cmd/sh to install it."
},
"tools": {
"dotnet": "10.0.100-rc.1.25451.107"
"dotnet": "10.0.100-rc.2.25502.107"
},
"msbuild-sdks": {
"Microsoft.DotNet.Arcade.Sdk": "10.0.0-beta.25513.109",
"Microsoft.DotNet.Arcade.Sdk": "10.0.0-beta.25555.106",
"Microsoft.Build.NoTargets": "3.7.0"
}
}
25 changes: 21 additions & 4 deletions src/Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,34 @@
<PackageVersion Include="System.CommandLine.NamingConventionBinder" Version="$(SystemCommandLineNamingConventionBinderVersion)" />
<PackageVersion Include="System.CommandLine.Rendering" Version="$(SystemCommandLineRenderingVersion)" />

<!-- MSBuild dependencies -->
<PackageVersion Include="Microsoft.Build" Version="$(MicrosoftBuildVersion)" />
<PackageVersion Include="Microsoft.Build.Tasks.Core" Version="$(MicrosoftBuildTasksCoreVersion)" />

<!-- NuGet dependencies -->
<PackageVersion Include="NuGet.Versioning" Version="$(NuGetVersioningVersion)" />

<!-- Runtime dependencies -->
<PackageVersion Include="System.Text.Json" Version="$(SystemTextJsonVersion)" />
</ItemGroup>

<!--
MSBuild - need to use older packages when targeting net8.0 since the newer versions only support net472 and net9.0+.
When tareting the latest .NET the version must also be lower or equal to one specified in
https://github.com/dotnet/sdk/blob/main/src/Layout/redist/minimumMSBuildVersion#L1
-->

<ItemGroup Condition="'$(DotNetBuildSourceOnly)' == 'true'">
<PackageVersion Include="Microsoft.Build" Version="17.11.31" />
<PackageVersion Include="Microsoft.Build.Tasks.Core" Version="17.11.31" />
</ItemGroup>

<ItemGroup Condition="'$(DotNetBuildSourceOnly)' != 'true' and '$(TargetFramework)' != 'net472'">
<PackageVersion Include="Microsoft.Build" Version="17.11.31" />
<PackageVersion Include="Microsoft.Build.Tasks.Core" Version="17.11.31" />
</ItemGroup>

<ItemGroup Condition="'$(DotNetBuildSourceOnly)' != 'true' and '$(TargetFramework)' == 'net472'">
<PackageVersion Include="Microsoft.Build" Version="17.15.0-preview-25353-11" />
<PackageVersion Include="Microsoft.Build.Tasks.Core" Version="17.15.0-preview-25353-11" />
</ItemGroup>

<!-- External dependencies -->
<ItemGroup>
<!-- libgit2 used for integration tests -->
Expand Down
20 changes: 20 additions & 0 deletions src/Microsoft.Build.Tasks.Git.UnitTests/GitConfigTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,26 @@ private static GitConfig LoadFromString(string gitDirectory, string configPath,
=> new GitConfig.Reader(gitDirectory, gitDirectory, GitEnvironment.Empty, _ => new StringReader(configContent)).
LoadFrom(configPath);

[Theory]
[InlineData("sha1", ObjectFormat.Sha1)]
[InlineData("sha256", ObjectFormat.Sha256)]
internal void TryParseObjectFormat_Valid(string str, ObjectFormat expected)
{
Assert.Equal(expected, GitConfig.ParseObjectFormat(str));
}

[Theory]
[InlineData("")]
[InlineData("Sha1")]
[InlineData("sha-1")]
[InlineData("sha-256")]
[InlineData("sha384")]
[InlineData("sha512")]
internal void TryParseObjectFormat_Invalid(string str)
{
Assert.Throws<InvalidDataException>(() => GitConfig.ParseObjectFormat(str));
}

[Fact]
public void Sections()
{
Expand Down
Loading