Skip to content

Commit

Permalink
[ArPow Tarball] Tier 4 - Add aspnetcore repo to arpow tarball (#11113)
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelSimons committed Aug 4, 2021
1 parent 19baf42 commit 0b62347
Show file tree
Hide file tree
Showing 9 changed files with 148 additions and 40 deletions.
5 changes: 5 additions & 0 deletions eng/SourceBuild.Version.Details.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<Dependencies>
<ProductDependencies>
<Dependency Name="VS.Redist.Common.AspNetCore.SharedFramework.x64.6.0" Version="6.0.0-preview.6.21355.2" CoherentParentDependency="Microsoft.NET.Sdk">
<Uri>https://github.com/dotnet/aspnetcore</Uri>
<Sha>71dd6b0c87d7619668a40876d084d93db57eab41</Sha>
<SourceBuild RepoName="aspnetcore" ManagedOnly="true" />
</Dependency>
<Dependency Name="Microsoft.DotNet.Cli.CommandLine" Version="1.0.0-preview.21310.2">
<Uri>https://github.com/dotnet/clicommandlineparser</Uri>
<Sha>3198bf5660cad3dab85f5475bf1fda9688146e3f</Sha>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
file can be removed.
-->
<PropertyGroup>
<MicrosoftExtensionsDependencyModelVersion>6.0.0-preview.6.21352.12</MicrosoftExtensionsDependencyModelVersion>
<MicrosoftNETCorePlatformsPackageVersion>3.1.0</MicrosoftNETCorePlatformsPackageVersion>
<MicrosoftNETCorePlatformsVersion>3.1.0</MicrosoftNETCorePlatformsVersion>
<SystemCollectionsImmutablePackageVersion>6.0.0-preview.6.21352.12</SystemCollectionsImmutablePackageVersion>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
From db187e95f62d9bff268e68f39b441b6da8be9111 Mon Sep 17 00:00:00 2001
From: Michael Simons <msimons@microsoft.com>
Date: Mon, 2 Aug 2021 19:02:27 +0000
Subject: [PATCH] Run GenerateFiles during source build

GenerateFiles is not running in source build yet the outputs are required.
These changes get GenerateFiles to run as part of source build.
These changes also turn on the binaryLog option while building the RepoTasks during source build.
---
eng/SourceBuild.props | 3 +--
eng/Tools.props | 2 +-
eng/tools/GenerateFiles/GenerateFiles.csproj | 1 +
4 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/eng/SourceBuild.props b/eng/SourceBuild.props
index 27cbe92036..3dbfe2ce7e 100644
--- a/eng/SourceBuild.props
+++ b/eng/SourceBuild.props
@@ -1,5 +1,4 @@
<Project>
-
<PropertyGroup>
<GitHubRepositoryName>aspnetcore</GitHubRepositoryName>
<SourceBuildManagedOnly>true</SourceBuildManagedOnly>
@@ -47,7 +46,7 @@
BeforeTargets="Execute">

<Exec
- Command="./eng/build.sh --only-build-repo-tasks"
+ Command="./eng/build.sh --only-build-repo-tasks -bl"
WorkingDirectory="$(InnerSourceBuildRepoRoot)"
EnvironmentVariables="@(InnerBuildEnv)" />
</Target>
diff --git a/eng/Tools.props b/eng/Tools.props
index a285c2406a..a38257f770 100644
--- a/eng/Tools.props
+++ b/eng/Tools.props
@@ -13,7 +13,7 @@
<!-- Update the generated files when we restore projects. Skip in desktop msbuild due to VS 16.8 requirements. -->
<Target Name="GenerateDirectoryBuildFiles"
AfterTargets="Restore"
- Condition=" '$(DotNetBuildFromSource)' != 'true' AND '$(MSBuildRuntimeType)' == 'core' ">
+ Condition=" '$(MSBuildRuntimeType)' == 'core' ">
<!-- Separate invocations and use different properties to ensure second can load the restored package info. -->
<MSBuild Projects="$(RepoRoot)eng\tools\GenerateFiles\GenerateFiles.csproj"
RemoveProperties="BaseIntermediateOutputPath"
diff --git a/eng/tools/GenerateFiles/GenerateFiles.csproj b/eng/tools/GenerateFiles/GenerateFiles.csproj
index 0ae5c9753e..dbf9965bf9 100644
--- a/eng/tools/GenerateFiles/GenerateFiles.csproj
+++ b/eng/tools/GenerateFiles/GenerateFiles.csproj
@@ -2,6 +2,7 @@
<PropertyGroup>
<!-- Use fixed version instead of $(DefaultNetCoreTargetFramework) to avoid needing workarounds set up here. -->
<TargetFramework>net5.0</TargetFramework>
+ <ExcludeFromSourceBuild>false</ExcludeFromSourceBuild>
</PropertyGroup>

<ItemGroup>
--
2.29.2

Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
From 14992fbe4d8f433025cc45be81ef0035ed77221b Mon Sep 17 00:00:00 2001
From: Michael Simons <msimons@microsoft.com>
Date: Mon, 2 Aug 2021 13:40:03 +0000
Subject: [PATCH] Use Versions.props MicrosoftExtensionsDependencyModelVersion
in RepoTasks

Source build is loading a reference assembly which fails when the RepoTasks are invoked.
This change gets source build to use the version which is source built.
---
eng/tools/RepoTasks/RepoTasks.csproj | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/eng/tools/RepoTasks/RepoTasks.csproj b/eng/tools/RepoTasks/RepoTasks.csproj
index e723beb353..67e01850f8 100644
--- a/eng/tools/RepoTasks/RepoTasks.csproj
+++ b/eng/tools/RepoTasks/RepoTasks.csproj
@@ -16,7 +16,7 @@

<ItemGroup>
<PackageReference Include="NuGet.Packaging" Version="$(NuGetPackagingVersion)" />
- <PackageReference Include="Microsoft.Extensions.DependencyModel" Version="2.1.0" />
+ <PackageReference Include="Microsoft.Extensions.DependencyModel" Version="$(MicrosoftExtensionsDependencyModelVersion)" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == '$(DefaultNetCoreTargetFramework)'">
--
2.29.2

Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
From 6fce3b3afda68cd041cb3b38c8c21fa0513ab5e3 Mon Sep 17 00:00:00 2001
From: Michael Simons <msimons@microsoft.com>
Date: Mon, 2 Aug 2021 19:56:17 +0000
Subject: [PATCH] Exclude warnings as errors from source build


NU1604: These hopefully go away once runtime-portable is added to the tarball.
Microsoft.AspNetCore.App.Runtime.csproj : error NU1604: Project dependency Microsoft.NETCore.App.Crossgen2.linux-x64 does not contain an inclusive lower bound. Include a lower bound in the dependency version to ensure consistent restore results.
Microsoft.AspNetCore.App.Runtime.csproj : error NU1604: Project dependency Microsoft.NETCore.App.Runtime.linux-x64 does not contain an inclusive lower bound. Include a lower bound in the dependency version to ensure consistent restore results.

CS8601:
CascadingAuthenticationState.razor(4,108): error CS8601: Possible null reference assignment.
---
Directory.Build.props | 4 ++++++++++++++
1 file changed, 4 insertions(+)

diff --git a/Directory.Build.props b/Directory.Build.props
index ba1c1675a0..ce6bc50c66 100644
--- a/Directory.Build.props
+++ b/Directory.Build.props
@@ -225,6 +225,10 @@
<ArchiveExtension Condition="'$(TargetOsName)' == 'win'">.zip</ArchiveExtension>
</PropertyGroup>

+ <PropertyGroup>
+ <NoWarn>$(NoWarn);NU1604;CS8601</NoWarn>
+ </PropertyGroup>
+
<Import Project="eng\Workarounds.props" />
<Import Project="artifacts\bin\GenerateFiles\Directory.Build.props" Condition=" '$(MSBuildProjectName)' != 'GenerateFiles' " />
<Import Project="eng\Dependencies.props" />
--
2.29.2

Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
<OldText><![CDATA[</Project>]]></OldText>
<NewText>
<![CDATA[ <PropertyGroup>
<NoWarn>$(NoWarn);NU5104</NoWarn>
<NoWarn>%24(NoWarn);NU5104</NoWarn>
</PropertyGroup>
</Project>]]>
</NewText>
Expand Down
48 changes: 9 additions & 39 deletions src/SourceBuild/tarball/content/repos/aspnetcore.proj
Original file line number Diff line number Diff line change
@@ -1,66 +1,43 @@
<Project>
<PropertyGroup>
<SourceDirectory>aspnetcore</SourceDirectory>
</PropertyGroup>

<Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" />

<PropertyGroup>
<OverrideTargetRid>$(TargetRid)</OverrideTargetRid>
<OverrideTargetRid Condition="'$(TargetOS)' == 'FreeBSD'">freebsd-x64</OverrideTargetRid>
<OverrideTargetRid Condition="'$(TargetOS)' == 'OSX'">osx-x64</OverrideTargetRid>

<BuildCommandArgs>$(BuildCommandArgs) --restore --build --pack</BuildCommandArgs>
<BuildCommandArgs>$(BuildCommandArgs) --configuration $(Configuration)</BuildCommandArgs>
<BuildCommandArgs>$(BuildCommandArgs) --ci</BuildCommandArgs>
<BuildCommandArgs>$(BuildCommandArgs) -bl</BuildCommandArgs>
<BuildCommandArgs>$(BuildCommandArgs) /v:$(LogVerbosity)</BuildCommandArgs>
<!-- StandardSourceBuildArgs include -publish which is not supported by the aspnetcore build script. -->
<BuildCommandArgs>$(StandardSourceBuildArgs.Replace('--publish', ''))</BuildCommandArgs>
<!-- The arch flag (defaults to x64) overrides any value of TargetArchitecture that we might set -->
<BuildCommandArgs>$(BuildCommandArgs) --arch $(Platform)</BuildCommandArgs>
<BuildCommandArgs>$(BuildCommandArgs) --no-build-repo-tasks</BuildCommandArgs>
<BuildCommandArgs>$(BuildCommandArgs) /p:BuildNodeJs=false</BuildCommandArgs>
<BuildCommandArgs>$(BuildCommandArgs) /p:SourceBuildRuntimeIdentifier=$(OverrideTargetRid)</BuildCommandArgs>
<BuildCommandArgs>$(BuildCommandArgs) /p:UseAppHost=false</BuildCommandArgs>
<BuildCommandArgs>$(BuildCommandArgs) /p:PublishCompressedFilesPathPrefix=$(SourceBuiltAspNetCoreRuntime)</BuildCommandArgs>

<!-- Update to 1.0.0 version of reference assemblies which are built in SBRP instead of the preview.2 version
included by Arcade -->
<BuildCommandArgs>$(BuildCommandArgs) /p:MicrosoftNetFrameworkReferenceAssembliesVersion=1.0.0</BuildCommandArgs>
<BuildCommand>$(ProjectDirectory)\eng\build$(ShellExtension) $(BuildCommandArgs)</BuildCommand>

<LogVerbosityOptOut>true</LogVerbosityOptOut>

<BuildCommand>$(ProjectDirectory)build$(ShellExtension) $(BuildCommandArgs)</BuildCommand>

<ShippingPackagesOutput>$(ProjectDirectory)artifacts/packages/$(Configuration)/Shipping/</ShippingPackagesOutput>
<NonShippingPackagesOutput>$(ProjectDirectory)artifacts/packages/$(Configuration)/NonShipping/</NonShippingPackagesOutput>
<RepoApiImplemented>false</RepoApiImplemented>
<DependencyVersionInputRepoApiImplemented>true</DependencyVersionInputRepoApiImplemented>

<GlobalJsonFile>$(ProjectDirectory)global.json</GlobalJsonFile>
<NuGetConfigFile>$(ProjectDirectory)NuGet.config</NuGetConfigFile>

<EnvironmentRestoreSources>$(SourceBuiltPackagesPath)</EnvironmentRestoreSources>
<EnvironmentRestoreSources>$(EnvironmentRestoreSources)%3B$(ReferencePackagesDir)%3B$(PrebuiltPackagesPath)</EnvironmentRestoreSources>
<EnvironmentRestoreSources Condition="'$(BuildWithOnlineSources)' == 'true'">$(EnvironmentRestoreSources)%3Bhttps://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public%40Local/nuget/v3/index.json</EnvironmentRestoreSources>
</PropertyGroup>

<ItemGroup>
<RepositoryReference Include="arcade" />
<RepositoryReference Include="cssparser" />
<RepositoryReference Include="runtime" />
<RepositoryReference Include="source-build" />
<!-- TODO: Enable with https://github.com/dotnet/source-build/issues/2274
<RepositoryReference Include="runtime" /> -->
<RepositoryReference Include="msbuild" />
<RepositoryReference Include="roslyn" />
<RepositoryReference Include="roslyn-analyzers" />
<!-- TODO: https://github.com/dotnet/source-build/issues/2319
<RepositoryReference Include="roslyn-analyzers" /> -->
</ItemGroup>

<ItemGroup>
<UseSourceBuiltSdkOverride Include="@(ArcadeSdkOverride)" />
</ItemGroup>

<ItemGroup>
<EnvironmentVariables Include="RestoreSources=$(EnvironmentRestoreSources)" />
<EnvironmentVariables Include="DotNetPackageVersionPropsPath=$(PackageVersionPropsPath)" />
</ItemGroup>

<UsingTask AssemblyFile="$(XPlatSourceBuildTasksAssembly)" TaskName="ReplaceRegexInFiles" />

<Target Name="FixAspNetCoreVersion"
Expand All @@ -82,12 +59,5 @@

</Target>

<Target Name="SetOutputList" AfterTargets="Package" BeforeTargets="GatherBuiltPackages">
<ItemGroup>
<PackagesOutputList Include="$(ShippingPackagesOutput)" />
<PackagesOutputList Include="$(NonShippingPackagesOutput)" />
</ItemGroup>
</Target>

<Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />
</Project>
3 changes: 3 additions & 0 deletions src/SourceBuild/tarball/content/repos/known-good.proj
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@
<RepositoryReference Include="templating" />

<!-- Tier 4 -->
<RepositoryReference Include="aspnetcore" />

<!-- Tier 5 -->
<RepositoryReference Include="fsharp" />
<RepositoryReference Include="vstest" />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@ public static string NormalizeNewLineChars(string source, string newLineChars)
throw new ArgumentException("Unsupported new line characters", nameof(newLineChars));
}

// Ensure trailing new line on linux.
if (newLineChars == LF && !source.EndsWith(newLineChars))
{
source += newLineChars;
}

return source;
}
}
Expand Down

0 comments on commit 0b62347

Please sign in to comment.