-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move linker to runtime #77149
Move linker to runtime #77149
Changes from 250 commits
5fcf5b2
0bea8ef
633b42e
8f9ee45
f5f5782
53dd873
c9a7186
92d9b50
523e771
27fcd6b
b3b639d
2248c60
711b59e
388039e
6efba4b
a45e92d
63d67fa
61cf245
ed78135
2c6959e
e5c1e22
e6d61e7
60f4498
3329287
4425957
f2af716
c6659b7
1bac0d4
22ee6b1
9cf9a33
f6a81b6
58bf9cd
a193b58
00d3eb2
50ed201
09905d7
4db2f5c
ab65c64
d5ff8a6
029de02
1948eaa
13a5a08
d000f06
79200be
e0fc7e0
f6c78d1
d3eccf4
3b017fe
0696838
b709695
03791e8
b958eb9
73c3e1f
b09c959
18e8097
b7d371e
84cb288
f51da34
24df782
c81a38e
9d7c1e1
f6a6aa5
7a68aa0
7491783
b16fe51
1df17ac
4ad23a2
db06f03
49aa059
83279b1
5f3ddb2
0624a52
fa1c5b9
3a43f07
24521fd
64adcdc
d18bd5f
c07faaf
1718dda
398a848
d4e7d66
87e64eb
bee4931
ab2bd0e
0f2faf2
0422829
a48c81a
f6950a8
ad2e12c
8e8144d
1eb466a
8dba253
3249cdb
833ad0d
d242d6e
9af3455
e14b322
ad7f96e
97981c4
aa820d2
d512298
1f15bb6
f0737f2
e0dae3e
d38e869
2e987e8
dcfe8ec
bd94741
3fdf0eb
c492274
3db5605
a7762df
659bcb5
1b18095
736d0f1
347293b
26fe218
a8bd538
83e96a6
7a5d3a7
d3e6515
10e0bda
63f6df4
59bc964
99140e9
657a094
e7624e0
70fccc4
d45c523
6231ab3
0450d9b
742f5a3
233fc93
894d09d
609cca8
ea9ab9b
ce01945
c869b10
4fdaf21
a40adc2
2a8227d
bab6a8b
00e42a0
784fede
4bf1bcf
982d2b8
1c77e69
6f6e4a6
fa43f73
2fa20c3
9a8f2c0
5340b8c
37a73e6
1434c75
eedc180
d9c3249
5e073ae
3707a37
fe18f19
99e5df3
c1400cf
c6f3a67
0f361d9
68a6b6a
9f6a97c
fcd58bd
c3ae17c
0e33465
01652f4
4361681
96a5d72
e522d58
e33aab6
f35559b
b8e2e1c
d4481ef
d4f0b87
2e5b893
7d404e9
44c4742
a571ef1
011aab4
a027f21
eccba9a
fee2bb1
8120f77
f74729a
b117fa0
b60d366
9e7bdbf
ffdcf15
21c440a
4e75a56
ee43bd2
60e99cc
8e5af0a
015cfd4
a67ebf3
8c295a7
8e40f0b
1776452
8c6f47f
f3d31d4
b2437ee
cabc760
6b5e37e
6ac7820
69cc1e2
bf57dbb
61ac4ff
e966196
faa322a
11af0c1
244e25c
6eecc0c
6fed335
bd2bb82
668d000
d707852
3138b2c
c678f44
304e1ca
c27a0a3
eb6d176
229f829
cdfa89e
87f3ac1
fa2e881
2cb62ff
b7d664c
d433f19
6698128
12f4ea1
01a13e9
2ddff0a
d615e00
2d44ea4
aaba9e1
89d94ed
a10d6c4
3db6dda
0ec286d
8c6a936
d016c82
0412b85
312ac9a
eb4482e
7ed5f12
b654deb
10e4841
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
### Code Style Analyzers | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we delete this and use repo-wide global configurations ( There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This already takes into account the CodeAnalysis.{src,test}.globalconfig. This is an override of what's in that file. For example, IDE0005 is not enabled globally because a lot of the files in the runtime have |
||
|
||
[*.cs] | ||
# IDE0005: Remove unnecessary usings/imports | ||
dotnet_diagnostic.IDE0005.severity = error | ||
|
||
# IDE0073: Require file header | ||
dotnet_diagnostic.IDE0073.severity = warning | ||
|
||
# IL3000: Avoid accessing Assembly file path when publishing as a single file | ||
dotnet_diagnostic.IL3000.severity = suggestion | ||
|
||
# CS0176: Cannot be accessed with an instance ref | ||
dotnet_diagnostic.CS0176.severity = silent |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<Project> | ||
<PropertyGroup> | ||
<IsReferenceAssembly Condition="'$(IsReferenceAssembly)' == '' and '$([System.IO.Path]::GetFileName($(MSBuildProjectDirectory)))' == 'ref'">true</IsReferenceAssembly> | ||
<DisableImplicitNamespaceImports_DotNet>true</DisableImplicitNamespaceImports_DotNet> | ||
<!-- The TFM for the product (linker, task,.. not analyzer, which is netstandard) --> | ||
<NetCoreAppToolCurrent>net7.0</NetCoreAppToolCurrent> | ||
<!-- The TFM for all the tests - intentionally different since tests may depend on new framework APIs in order to validate | ||
linker interaction with them, linker itself doesn't need the new framework typically. --> | ||
<NetCoreAppTestsCurrent>net7.0</NetCoreAppTestsCurrent> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(IsReferenceAssembly)' == 'true' "> | ||
<!-- Since .NET 5 reference assemblies are always produced --> | ||
<ProduceReferenceAssembly>false</ProduceReferenceAssembly> | ||
<ProduceOnlyReferenceAssembly>true</ProduceOnlyReferenceAssembly> | ||
<!-- Used by Arcade to compute OutputPath, IntermediateOutputPath, etc. early in the import chain. --> | ||
<OutDirName>$(MSBuildProjectName)/ref</OutDirName> | ||
<!-- Don't try to publish PDBs for ref assemblies that have none. --> | ||
<PublishWindowsPdb>false</PublishWindowsPdb> | ||
<RunApiCompat>false</RunApiCompat> | ||
</PropertyGroup> | ||
|
||
<Import Project="Sdk.props" Sdk="Microsoft.DotNet.Arcade.Sdk" /> | ||
<Import Project="eng/Analyzers.props" /> | ||
<PropertyGroup> | ||
<IsPackable>false</IsPackable> | ||
<PackageLicenseExpression>MIT</PackageLicenseExpression> | ||
<RepositoryUrl>/~https://github.com/dotnet/linker</RepositoryUrl> | ||
<!-- Set this to true to build against the package instead of the submodule. --> | ||
<UseCecilPackage Condition="'$(UseCecilPackage)' == ''">true</UseCecilPackage> | ||
<!-- No symbols are produced for ref assemblies, but some parts of the SDK still expect pdbs, so we explicitly tell it there are none. --> | ||
<!-- Must be set after importing Arcade to override its defaults. --> | ||
<DebugType Condition=" '$(IsReferenceAssembly)' == 'true' ">none</DebugType> | ||
</PropertyGroup> | ||
|
||
<PropertyGroup> | ||
<LangVersion>preview</LangVersion> | ||
<AnalysisLevel>latest</AnalysisLevel> | ||
</PropertyGroup> | ||
</Project> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
<Project> | ||
<Import Project="Sdk.targets" Sdk="Microsoft.DotNet.Arcade.Sdk" /> | ||
|
||
<Import Project="$(_ToolsProjectTargets)" Condition="Exists('$(_ToolsProjectTargets)')" /> | ||
|
||
<Target Name="VSTestIfTestProject"> | ||
<CallTarget Targets="VSTest" Condition="'$(IsTestProject)' == 'true'" /> | ||
</Target> | ||
|
||
|
||
<!-- Shared logic for reference assemblies. This enables apicompat and | ||
packaging logic for projects that have corresponding reference assemblies. --> | ||
<PropertyGroup> | ||
<ContractProject Condition="'$(ContractProject)' == ''">$(MSBuildProjectDirectory)\ref\$(MSBuildProjectName).csproj</ContractProject> | ||
<HasMatchingContract Condition="Exists('$(ContractProject)')">true</HasMatchingContract> | ||
<RunApiCompat Condition="'$(HasMatchingContract)' != 'true'">false</RunApiCompat> | ||
<TargetsForTfmSpecificContentInPackage Condition="'$(HasMatchingContract)' == 'true'">$(TargetsForTfmSpecificContentInPackage);_AddReferenceAssemblyToPackage</TargetsForTfmSpecificContentInPackage> | ||
</PropertyGroup> | ||
<!-- Work around ApiCompat breaking change /~https://github.com/dotnet/arcade/issues/5361 --> | ||
<ItemGroup Condition="'$(RunApiCompat)' == 'true'"> | ||
<_DependencyDirectories Include="$(IntermediateOutputPath)" /> | ||
</ItemGroup> | ||
<!-- Add a ProjectReference to the reference assembly project for ApiCompat. --> | ||
<!-- This also ensures that it is built when the current project gets packaged. --> | ||
<ItemGroup Condition="'$(HasMatchingContract)' == 'true'"> | ||
<ProjectReference Include="$(ContractProject)"> | ||
<ReferenceOutputAssembly>false</ReferenceOutputAssembly> | ||
<OutputItemType>ResolvedMatchingContract</OutputItemType> | ||
</ProjectReference> | ||
</ItemGroup> | ||
|
||
<!-- The default pack logic will include the implementation assembly in lib. | ||
This also adds the reference assembly under ref. --> | ||
<Target Name="_AddReferenceAssemblyToPackage"> | ||
<!-- Get the build output of the reference project, which has been built due to the ProjectReference. --> | ||
<MSBuild Projects="$(ContractProject)" Targets="BuiltProjectOutputGroup" Properties="TargetFramework=$(TargetFramework)"> | ||
<Output TaskParameter="TargetOutputs" ItemName="_ReferenceAssemblies" /> | ||
</MSBuild> | ||
<!-- Check just to be safe. --> | ||
<Error Condition="!Exists('%(_ReferenceAssemblies.Identity)')" Text="Reference assembly %(Identity) does not exist. Ensure it has been built before packaging." /> | ||
<!-- Add it to the package. --> | ||
<ItemGroup> | ||
<TfmSpecificPackageFile Include="@(_ReferenceAssemblies)" PackagePath="ref\$(TargetFramework)" /> | ||
</ItemGroup> | ||
</Target> | ||
|
||
|
||
<!-- Shared logic to publish multiple projects in the same | ||
package. Pack doesn't support including project references | ||
(/~https://github.com/NuGet/Home/issues/3891), so we work around | ||
this by explicitly including the publish output in the | ||
package. --> | ||
<PropertyGroup> | ||
<IncludePublishOutput Condition="'$(IncludePublishOutput)' == ''">false</IncludePublishOutput> | ||
</PropertyGroup> | ||
<PropertyGroup Condition="'$(IncludePublishOutput)' == 'true'"> | ||
<!-- Don't include the build output. Instead, we want to include the TargetFramework-specific publish output. --> | ||
<IncludeBuildOutput>false</IncludeBuildOutput> | ||
<!-- Suppress NuGet warning for package which sets IncludeBuildOutput=false, see /~https://github.com/NuGet/Home/issues/8583 --> | ||
<NoWarn>$(NoWarn);NU5128</NoWarn> | ||
<!-- Option to include Json files in the package. Default is to just include dlls. --> | ||
<IncludeJsonFilesInPackage Condition="'$(IncludeJsonFilesInPackage)' == ''">false</IncludeJsonFilesInPackage> | ||
<!-- Use a NuGet extension point to publish and set up the package files. --> | ||
<!-- We can't use TargetsForTfmSpecificBuildOutput, because it doesn't run when IncludeBuildOutput is false. --> | ||
<TargetsForTfmSpecificContentInPackage>$(TargetsForTfmSpecificContentInPackage);_AddPublishOutputToPackage</TargetsForTfmSpecificContentInPackage> | ||
</PropertyGroup> | ||
|
||
<Target Name="_AddPublishOutputToPackage"> | ||
<PropertyGroup> | ||
<PublishDir>$(BaseOutputPath)$(TargetFramework)</PublishDir> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<ProjectsToPublish Include="$(MSBuildProjectFile)"> | ||
<AdditionalProperties>TargetFramework=$(TargetFramework);PublishDir=$(PublishDir)</AdditionalProperties> | ||
</ProjectsToPublish> | ||
</ItemGroup> | ||
<!-- Clean the publish directory in case there are any left-over artifacts (publish does not work incrementally). --> | ||
<ItemGroup> | ||
<_FilesToDelete Remove="@(_FilesToDelete)" /> | ||
<_FilesToDelete Include="$(PublishDir)/*.dll" /> | ||
<_FilesToDelete Include="$(PublishDir)/*.json" /> | ||
</ItemGroup> | ||
<Delete Files="@(_FilesToDelete)" /> | ||
<MSBuild Projects="@(ProjectsToPublish)" Targets="Publish" /> | ||
<ItemGroup> | ||
<_PublishOutputInPackage Include="$(PublishDir)/*.dll" /> | ||
<_PublishOutputInPackage Include="$(PublishDir)/*.json" Condition="'$(IncludeJsonFilesInPackage)' == 'true'" /> | ||
</ItemGroup> | ||
<!-- Sanity check. --> | ||
<Error Condition="@(_PublishOutputInPackage->Count()) == 0" Text="No publish output included in package." /> | ||
<ItemGroup> | ||
<TfmSpecificPackageFile Include="@(_PublishOutputInPackage)" PackagePath="$(BuildOutputTargetFolder)\$(TargetFramework)" /> | ||
</ItemGroup> | ||
</Target> | ||
|
||
</Project> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
Microsoft Patent Promise for Mono | ||
|
||
Microsoft Corporation and its affiliates (“Microsoft”) promise not to | ||
assert any Applicable Patents against you for making, using, selling, | ||
offering for sale, importing, or distributing Mono. | ||
|
||
If you file, maintain, or voluntarily participate in any claim in a | ||
lawsuit alleging direct or contributory patent infringement by Mono, | ||
or inducement of patent infringement by Mono, then your rights under | ||
this promise will automatically terminate. | ||
|
||
This promise is not an assurance that (i) any Applicable Patents are | ||
valid or enforceable or (ii) Mono does not infringe patents or other | ||
intellectual property rights of any third party. No rights except | ||
those expressly stated in this promise are granted, waived or received | ||
by Microsoft, whether by implication, exhaustion, estoppel or | ||
otherwise. This is a personal promise directly from Microsoft to you, | ||
and you agree as a condition of benefitting from it that no Microsoft | ||
rights are received from suppliers, distributors, or otherwise in | ||
connection with this promise. | ||
|
||
Definitions: | ||
|
||
“Mono” means those portions of the software development technology, as | ||
originally distributed by Xamarin, Inc. or the .NET Foundation under | ||
the name “Mono,” that implement .NET Framework Functionality, provided | ||
that such portions at a minimum implement all of the required parts of | ||
the mandatory provisions of Standard ECMA-335 – Common Language | ||
Infrastructure (CLI). | ||
|
||
“.NET Framework Functionality” means any functionality in Microsoft’s | ||
.NET Framework as described in Microsoft’s API documentation on | ||
Microsoft’s MSDN website, including the functionality in | ||
Windowsbase.dll, but excluding all other functionality in the Windows | ||
Presentation Foundation component of .NET Framework. | ||
|
||
“Applicable Patents” are those patent claims, currently owned by | ||
Microsoft and acquired in the future, that are necessarily infringed | ||
by Mono. For clarity, Applicable Patents do not include any patent | ||
claims that are infringed (x) by any underlying or enabling technology | ||
that may be used, combined, or distributed in connection with Mono | ||
(such as hardware, operating systems, or applications that run on | ||
Mono), (y) only as a consequence of modification of Mono, or (z) only | ||
by the combination of Mono with third party code. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These should be built even in source build.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, never mind, I guess we don't need tests for source build.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is meant by "source build" please?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In a nutshell source-build is a requirement from some Linux distributions which require source code to build. So basically when they get dotnet they actually get all the source code (one of those pieces is the runtime, but they are more pieces) and build it. The source-build repository is in charge of taking all of these pieces and glue them together, it also has an explanation of what source build is -> /~https://github.com/dotnet/source-build#source-build-goals
We want all the source code to be included, but the tests are not going to be executed once it's an app like dotnet so we exclude them using the DotNetBuildFromSource variable.