Skip to content

Commit 73268c7

Browse files
authored
Revert "Enable restore for ref and src projects in libraries (#33242)" (#33437)
This reverts commit 981cc64.
1 parent 308ab65 commit 73268c7

39 files changed

+332
-284
lines changed

Directory.Build.props

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,6 @@
8888

8989
<!-- Resource naming bug: https://github.com/microsoft/msbuild/issues/4740 -->
9090
<EmbeddedResourceUseDependentUponConvention>false</EmbeddedResourceUseDependentUponConvention>
91-
92-
<!-- Enable NuGet static graph evaluation to optimize incremental restore: https://github.com/dotnet/sdk/pull/10794 -->
93-
<!-- <RestoreUseStaticGraphEvaluation>true</RestoreUseStaticGraphEvaluation> -->
9491
</PropertyGroup>
9592

9693
<PropertyGroup>

docs/coding-guidelines/project-guidelines.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ once before you can iterate and work on a given library project.
1010
- Netstandard Library - Copy to `bin\ref\netstandard2.0`
1111
- NetFx targeting pack - Copy to `bin\ref\net472`
1212
- Build targeting pack
13-
- Build src\libraries\ref.proj which builds all references assembly projects. For reference assembly project information see [ref](#ref)
13+
- Build src\ref.builds which builds all references assembly projects. For reference assembly project information see [ref](#ref)
1414
- Build product
15-
- Build src\libraries\src.proj which builds all the source library projects. For source library project information see [src](#src).
15+
- Build src\src.builds which builds all the source library projects. For source library project information see [src](#src).
1616
- Sign product
1717
- Build src\sign.proj
1818

eng/Analyzers.props

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
<Project>
22
<PropertyGroup>
33
<CodeAnalysisRuleset>$(MSBuildThisFileDirectory)CodeAnalysis.ruleset</CodeAnalysisRuleset>
4-
<!-- Disable analyzers in sourcebuild -->
5-
<EnableAnalyzers Condition="'$(DotNetBuildFromSource)' == 'true'">false</EnableAnalyzers>
64
</PropertyGroup>
75
<ItemGroup Condition="'$(EnableAnalyzers)' == 'true'">
86
<PackageReference Include="Microsoft.DotNet.CodeAnalysis" Version="$(MicrosoftDotNetCodeAnalysisVersion)" PrivateAssets="all" IsImplicitlyDefined="true" />

eng/Build.props

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
https://github.com/dotnet/arcade/issues/388
1616
-->
1717

18-
<!-- Import to have access to properties/items used both during the Arcade phase and in the repo. -->
1918
<Import Project="$(MSBuildThisFileDirectory)Configurations.props" />
2019
<Import Project="$(MSBuildThisFileDirectory)Subsets.props" />
2120

@@ -77,12 +76,8 @@
7776
</ItemGroup>
7877

7978
<MSBuild Projects="@(RepoTaskProjects)"
80-
Properties="Configuration=Debug;Platform=AnyCPU;__BuildPhase=Restore"
81-
Targets="Restore" />
82-
83-
<MSBuild Projects="@(RepoTaskProjects)"
84-
Properties="Configuration=Debug;Platform=AnyCPU;__BuildPhase=Build"
85-
Targets="Build" />
79+
Properties="Configuration=Debug;Platform=AnyCPU"
80+
Targets="Restore;Build"/>
8681

8782
<WriteLinesToFile File="$(RepoTasksOutputFile)"
8883
Lines="$(RepoTasksOutputFile)"

eng/Configurations.props

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,4 @@
11
<Project>
2-
<!--
3-
This file contains properties and items which are used in both the Arcade
4-
steps and in the repository.
5-
-->
6-
7-
<PropertyGroup>
8-
<LibrariesProjectRoot>$([MSBuild]::NormalizeDirectory('$(RepoRoot)', 'src', 'libraries'))</LibrariesProjectRoot>
9-
<CoreClrProjectRoot>$([MSBuild]::NormalizeDirectory('$(RepoRoot)', 'src', 'coreclr'))</CoreClrProjectRoot>
10-
<MonoProjectRoot>$([MSBuild]::NormalizeDirectory('$(RepoRoot)', 'src', 'mono'))</MonoProjectRoot>
11-
<InstallerProjectRoot>$([MSBuild]::NormalizeDirectory('$(RepoRoot)', 'src', 'installer'))</InstallerProjectRoot>
12-
<RepoToolsLocalDir>$([MSBuild]::NormalizeDirectory('$(RepoRoot)', 'tools-local'))</RepoToolsLocalDir>
13-
<RepoTasksDir>$([MSBuild]::NormalizeDirectory('$(RepoToolsLocalDir)', 'tasks'))</RepoTasksDir>
14-
<IbcOptimizationDataDir>$([MSBuild]::NormalizeDirectory('$(ArtifactsDir)', 'ibc'))</IbcOptimizationDataDir>
15-
<XmlDocDir>$([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', 'docs'))</XmlDocDir>
16-
</PropertyGroup>
17-
18-
<PropertyGroup>
19-
<EnableNgenOptimization Condition="'$(EnableNgenOptimization)' == '' and '$(Configuration)' == 'Release'">true</EnableNgenOptimization>
20-
</PropertyGroup>
21-
222
<!-- Honor the generic RuntimeConfiguration property. -->
233
<PropertyGroup>
244
<RuntimeConfiguration Condition="'$(RuntimeConfiguration)' == ''">$(Configuration)</RuntimeConfiguration>

eng/Subsets.props

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,15 @@
4747
artifacts to the test layout, then running the test subset.
4848
-->
4949

50+
<PropertyGroup>
51+
<LibrariesProjectRoot>$([MSBuild]::NormalizeDirectory('$(RepoRoot)', 'src', 'libraries'))</LibrariesProjectRoot>
52+
<CoreClrProjectRoot>$([MSBuild]::NormalizeDirectory('$(RepoRoot)', 'src', 'coreclr'))</CoreClrProjectRoot>
53+
<MonoProjectRoot>$([MSBuild]::NormalizeDirectory('$(RepoRoot)', 'src', 'mono'))</MonoProjectRoot>
54+
<InstallerProjectRoot>$([MSBuild]::NormalizeDirectory('$(RepoRoot)', 'src', 'installer'))</InstallerProjectRoot>
55+
<RepoToolsLocalDir>$([MSBuild]::NormalizeDirectory('$(RepoRoot)', 'tools-local'))</RepoToolsLocalDir>
56+
<RepoTasksDir>$([MSBuild]::NormalizeDirectory('$(RepoToolsLocalDir)', 'tasks'))</RepoTasksDir>
57+
</PropertyGroup>
58+
5059
<PropertyGroup>
5160
<DefaultSubsetCategories>libraries-installer-coreclr-mono</DefaultSubsetCategories>
5261
<DefaultInstallerSubsets>corehost-managed-depproj-pkgproj-bundle-installers-test</DefaultInstallerSubsets>

eng/Tools.props

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,39 @@
11
<Project>
2-
<!-- Import to have access to properties/items used both during the Arcade phase and in the repo. -->
3-
<Import Project="$(MSBuildThisFileDirectory)Configurations.props" />
2+
<PropertyGroup>
3+
<MSBuildTreatWarningsAsErrors>false</MSBuildTreatWarningsAsErrors>
4+
<EnableAnalyzers>true</EnableAnalyzers>
5+
</PropertyGroup>
46

7+
<!-- We need to import this props file which contains PackageReferences to analyzers so that
8+
analyzer build assets are imported via the Tools generated props and targets -->
9+
<Import Project="$(RepositoryEngineeringDir)Analyzers.props" Condition="Exists('$(RepositoryEngineeringDir)Analyzers.props') and '$(DotNetBuildFromSource)' != 'true'" />
10+
11+
<!-- source-built packages -->
512
<ItemGroup>
13+
<!-- arcade -->
14+
<PackageReference Include="Microsoft.DotNet.GenFacades" Version="$(MicrosoftDotNetGenFacadesVersion)" />
615
<PackageReference Include="Microsoft.DotNet.Build.Tasks.Packaging" Version="$(MicrosoftDotNetBuildTasksPackagingVersion)" />
16+
17+
<!-- coreclr -->
18+
<!-- Download the package in the initial arcade restore step to work around race conditions when restoring an msbuild SDK. -->
19+
<PackageDownload Include="Microsoft.NET.Sdk.IL" Version="[$(MicrosoftNETSdkILVersion)]" />
20+
21+
<!-- roslyn -->
22+
<PackageReference Include="Microsoft.Net.Compilers.Toolset" Version="$(MicrosoftNetCompilersToolsetVersion)" PrivateAssets="all" IsImplicitlyDefined="true" />
23+
24+
<!-- mono -->
25+
<PackageReference Include="illink.tasks" Version="$(ILLinkTasksVersion)" PrivateAssets="all" IsImplicitlyDefined="true" ExcludeAssets="build" GeneratePathProperty="true" />
26+
</ItemGroup>
27+
28+
<!-- excluded from offline portion of source build -->
29+
<ItemGroup Condition="'$(DotNetBuildOffline)' != 'true'">
30+
<!-- arcade -->
31+
<PackageReference Include="Microsoft.DotNet.GenAPI" Version="$(MicrosoftDotNetGenApiVersion)" />
732
</ItemGroup>
833

934
<!-- excluded from source build -->
1035
<ItemGroup Condition="'$(DotNetBuildFromSource)' != 'true'">
36+
<PackageReference Include="Microsoft.DotNet.ApiCompat" Version="$(MicrosoftDotNetApiCompatVersion)" />
1137
<PackageReference Include="Microsoft.DotNet.Build.Tasks.Feed" Version="$(MicrosoftDotNetBuildTasksFeedVersion)" />
1238
<PackageReference Include="Microsoft.DotNet.VersionTools.Tasks" Version="$(MicrosoftDotNetVersionToolsTasksVersion)" />
1339

eng/Version.Details.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,13 @@
3838
<Uri>https://github.com/dotnet/arcade</Uri>
3939
<Sha>421b20fb860907c45673de791177e3fd61402197</Sha>
4040
</Dependency>
41-
<Dependency Name="Microsoft.DotNet.CodeAnalysis" Version="5.0.0-beta.20156.4">
41+
<Dependency Name="Microsoft.DotNet.CodeAnalysis" Version="5.0.0-beta.20153.1">
4242
<Uri>https://github.com/dotnet/arcade</Uri>
4343
<Sha>421b20fb860907c45673de791177e3fd61402197</Sha>
4444
</Dependency>
45-
<Dependency Name="Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk" Version="5.0.0-beta.20155.2">
45+
<Dependency Name="Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk" Version="5.0.0-beta.20153.1">
4646
<Uri>https://github.com/dotnet/arcade</Uri>
47-
<Sha>bc4fa8e7149769db4efd466f160417a32b11f0bf</Sha>
47+
<Sha>421b20fb860907c45673de791177e3fd61402197</Sha>
4848
</Dependency>
4949
<Dependency Name="Microsoft.DotNet.RemoteExecutor" Version="5.0.0-beta.20153.1">
5050
<Uri>https://github.com/dotnet/arcade</Uri>

eng/Versions.props

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@
1919
<UsingToolMicrosoftNetCompilers>true</UsingToolMicrosoftNetCompilers>
2020
<UsingToolIbcOptimization>true</UsingToolIbcOptimization>
2121
<UsingToolXliff>false</UsingToolXliff>
22+
<!-- Paths used during restore -->
23+
<EnableNgenOptimization Condition="'$(EnableNgenOptimization)' == '' and '$(Configuration)' == 'Release'">true</EnableNgenOptimization>
24+
<IbcOptimizationDataDir>$([MSBuild]::NormalizeDirectory('$(ArtifactsDir)', 'ibc'))</IbcOptimizationDataDir>
25+
<XmlDocDir>$([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', 'docs'))</XmlDocDir>
2226
<!-- Blob storage container that has the "Latest" channel to publish to. -->
2327
<ContainerName>dotnet</ContainerName>
2428
<ChecksumContainerName>$(ContainerName)</ChecksumContainerName>
@@ -56,7 +60,7 @@
5660
<!-- Arcade dependencies -->
5761
<MicrosoftDotNetApiCompatVersion>5.0.0-beta.20153.1</MicrosoftDotNetApiCompatVersion>
5862
<MicrosoftDotNetBuildTasksFeedVersion>5.0.0-beta.20153.1</MicrosoftDotNetBuildTasksFeedVersion>
59-
<MicrosoftDotNetCodeAnalysisVersion>5.0.0-beta.20156.4</MicrosoftDotNetCodeAnalysisVersion>
63+
<MicrosoftDotNetCodeAnalysisVersion>5.0.0-beta.20153.1</MicrosoftDotNetCodeAnalysisVersion>
6064
<MicrosoftDotNetGenAPIVersion>5.0.0-beta.20153.1</MicrosoftDotNetGenAPIVersion>
6165
<MicrosoftDotNetGenFacadesVersion>5.0.0-beta.20153.1</MicrosoftDotNetGenFacadesVersion>
6266
<MicrosoftDotNetXUnitExtensionsVersion>5.0.0-beta.20153.1</MicrosoftDotNetXUnitExtensionsVersion>

eng/codeAnalysis.targets

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
<Project>
2+
<Import Condition="Exists($(AnalyzerPropsFile)) and '$(EnableAnalyzers)' == 'true'" Project="$(AnalyzerPropsFile)" />
3+
4+
<!-- This target is executed when building a project and EnableAnalyzers property is set to true.
5+
It will populate the Analyzer item that is passed to the compiler with the analyzers restored
6+
as package references in Tools.props. Those analyzers will be saved in a props file -> artifacts\toolset\Common\Tools.Analyzers.props.
7+
So in order to add a new analyzer just need to add a package reference in Tools.props to the package containing it.
8+
*
9+
This target also provides filtering for specific type of projects through to Items.
10+
- <AnalyzersToInclude> will include only the specified analyzers and will ignore the others that where restored.
11+
- <AnalyzersToExclude> will exclude the specified analyzers from the restored analyzers, but will preserve the others.
12+
**The values in these Items are the name of the analyzers' dll.
13+
**These to Items are mutually exclusive, so only 1 should be set at a time.
14+
Example of usage:
15+
<AnalyzersToInclude Condition="$(IsTestProject)" Include="Xunit.Analyzers" /> will only include Xunit analyzers.
16+
<AnalyzersToExclude Condition="$(IsSourceProject)" Include="Xunit.Analyzers" /> will include all analyzers but Xunit analyzer. -->
17+
18+
<Target Name="CalculateAnalyzersForBuildTime">
19+
<ItemGroup>
20+
<Analyzer Include="@(ResolvedAnalyzer)" />
21+
</ItemGroup>
22+
23+
<Warning Text="AnalyzersToExclude and AnalyzersToInclude shouldn't be set together, they are mutually exclusive." Condition="'@(AnalyzersToExclude)' != '' and '@(AnalyzersToInclude)' != ''" />
24+
25+
<ItemGroup Condition="'@(AnalyzersToExclude)' != '' or '@(AnalyzersToInclude)' != ''">
26+
<_AnalyzersToFileName Include="@(Analyzer -> '%(FileName)')">
27+
<OriginalIdentity>%(Identity)</OriginalIdentity>
28+
</_AnalyzersToFileName>
29+
</ItemGroup>
30+
31+
<ItemGroup Condition="'@(AnalyzersToExclude)' != ''">
32+
<_AnalyzersToRemove Include="@(_AnalyzersToFileName)" Condition="'@(AnalyzersToExclude)' == '@(_AnalyzersToFileName)' and '%(Identity)' != ''" />
33+
<Analyzer Remove="@(_AnalyzersToRemove -> '%(OriginalIdentity)')" />
34+
</ItemGroup>
35+
36+
<ItemGroup Condition="'@(AnalyzersToInclude)' != ''">
37+
<_AnalyzersToRemove Include="@(_AnalyzersToFileName)" Exclude="@(AnalyzersToInclude)" />
38+
<_missingAnalyzersToInclude Include="@(AnalyzersToInclude)" Exclude="@(_AnalyzersToFileName)" />
39+
<Analyzer Remove="@(_AnalyzersToRemove -> '%(OriginalIdentity)')" />
40+
</ItemGroup>
41+
42+
<Error Text="Couldn't find analyzer to include with values: @(_missingAnalyzersToInclude)" Condition="'@(_missingAnalyzersToInclude)' != '' and '@(_missingAnalyzersToInclude)' != 'None'" />
43+
</Target>
44+
45+
<PropertyGroup Condition="'$(EnableAnalyzers)' == 'true'">
46+
<ResolveReferencesDependsOn>
47+
$(ResolveReferencesDependsOn);
48+
CalculateAnalyzersForBuildTime;
49+
</ResolveReferencesDependsOn>
50+
</PropertyGroup>
51+
</Project>

eng/docker/build-docker-sdk.ps1

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ if ($buildWindowsContainers)
1818
# Due to size concerns, we don't currently do docker builds on windows.
1919
# Build on the host machine, then simply copy artifacts to the target docker image.
2020
# This should result in significantly lower build times, for now.
21-
& "$REPO_ROOT_DIR/build.cmd" -ci -subsetcategory coreclr-libraries -runtimeconfiguration release -c $configuration
21+
& "$REPO_ROOT_DIR/coreclr.cmd" -c Release
22+
& "$REPO_ROOT_DIR/libraries.cmd" -ci -c $configuration -runtimeConfiguration release
2223

2324
# Dockerize the build artifacts
2425
docker build --tag $imageName `

eng/docker/libraries-sdk.linux.Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ WORKDIR /repo
88
COPY . .
99

1010
ARG CONFIGURATION=Release
11-
RUN ./build.sh -ci -subsetcategory coreclr-libraries -runtimeconfiguration release -c $CONFIGURATION
11+
RUN ./src/coreclr/build.sh -release -skiptests -clang9 && \
12+
./libraries.sh -c $CONFIGURATION -runtimeconfiguration release
1213

1314
FROM $SDK_BASE_IMAGE as target
1415

eng/pipelines/libraries/enterprise/linux.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ variables:
2626
- name: enterpriseTestsSetup
2727
value: $(sourcesRoot)/Common/tests/System/Net/EnterpriseTests/setup
2828
- name: containerRunTestsCommand
29-
value: /repo/.dotnet/dotnet build /t:test
29+
value: /repo/.dotnet/dotnet build /t:test --no-restore
3030
- name: containerLibrariesRoot
3131
value: /repo/src/libraries
3232

@@ -50,7 +50,7 @@ steps:
5050
displayName: Test linuxclient connection to web server
5151

5252
- bash: |
53-
docker exec linuxclient bash -c '/repo/build.sh -subsetcategory coreclr-libraries -runtimeconfiguration release -ci'
53+
docker exec linuxclient bash -c '/repo/src/coreclr/build.sh -release -skipnuget -clang9 && /repo/libraries.sh /p:CoreCLRConfiguration=Release'
5454
displayName: Build product sources
5555

5656
- bash: |

eng/restore/repoRestore.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@
2828
<ComputeNETCoreBuildOutputFiles>false</ComputeNETCoreBuildOutputFiles>
2929
<GenerateRuntimeConfigurationFiles>false</GenerateRuntimeConfigurationFiles>
3030
</PropertyGroup>
31-
</Project>
31+
</Project>

eng/restore/repoRestore.targets

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
<RestoreProjectStyle Condition="'$(MSBuildProjectExtension)' != '.depproj'">Unknown</RestoreProjectStyle>
55
</PropertyGroup>
66

7+
<Import Project="$(RepositoryEngineeringDir)codeAnalysis.targets" />
8+
79
<PropertyGroup>
810
<!-- Nuget will normally disable all generated imports as part of a restore to avoid
911
non-determinism where first restore changes a subsequent restore,

global.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"python": "2.7.15"
1313
},
1414
"msbuild-sdks": {
15-
"Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk": "5.0.0-beta.20156.4",
15+
"Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk": "5.0.0-beta.20153.1",
1616
"Microsoft.DotNet.Arcade.Sdk": "5.0.0-beta.20153.1",
1717
"Microsoft.DotNet.Build.Tasks.SharedFramework.Sdk": "5.0.0-beta.20153.1",
1818
"Microsoft.DotNet.Helix.Sdk": "5.0.0-beta.20153.1",

0 commit comments

Comments
 (0)