Skip to content

Commit

Permalink
Use SDK-style projects (dotnet/linker#471)
Browse files Browse the repository at this point in the history
* Use SDK-style projects for linker and tests

* Clean up linker project file

Separate out the illink build properties from the monolinker
properties. Also disable building illink for net46 on unix/core
msbuild, which doesn't work due to missing reference assemblies. This
check is more specific than what we used to have, so that illink can
potentially be built with the mono runtime.

Building this project with "nuget restore" and "msbuild" will only
work with the default configuration because nuget restore does not set
the configuration and would see a different target framework from msbuild.

* Fix assembly title and description for illink

* Fix debug and optimization info for illink configurations

* Remove references to old illink solutions

* Update cecil submodule to latest mono/cecil

* Fix typo

* Update cecil configurations in illink.sln

* Fix cecil strongname build failure with arcade

Work around dotnet/arcade#2321

* Remove unused configs from monolinker.sln

Also add a missing release config for cecil

* Set PublicKey and PublicKeyToken in cecil overrides


Commit migrated from dotnet/linker@6280036
  • Loading branch information
sbomer authored and marek-safar committed May 3, 2019
1 parent 1c29ded commit b2828dc
Show file tree
Hide file tree
Showing 16 changed files with 175 additions and 526 deletions.
28 changes: 21 additions & 7 deletions src/tools/illink/external/Mono.Cecil.overrides
Original file line number Diff line number Diff line change
@@ -1,13 +1,27 @@
<Project>

<!-- Cecil's Directory.Build.Props imports this file if it
exists. We use it to import our own Directory.Build.props. -->
<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)../'))" />

<PropertyGroup>
<!-- Cecil sets PublicSign on windows, but we always want to
PublicSign. -->
<PublicSign>true</PublicSign>
</PropertyGroup>

<PropertyGroup Condition=" '$(ArcadeBuild)' == 'true' ">
<!-- Work around
https://github.com/dotnet/arcade/issues/2321. This disables
arcade's selection of AssemblyOriginatorKeyFile based on the
StrongNameKeyId, since we want to use cecil's key file. -->
<StrongNameKeyId>CecilStrongNameKey</StrongNameKeyId>
<!-- PublicKey and PublicKeyToken are only consumed by arcade's
InternalsVisibleTo generator. We don't use this, but we set
these properties anyway to avoid hitting an arcade check. -->
<PublicKey>00240000048000009400000006020000002400005253413100040000010001002b5c9f7f04346c324a3176f8d3ee823bbf2d60efdbc35f86fd9e65ea3e6cd11bcdcba3a353e55133c8ac5c4caaba581b2c6dfff2cc2d0edc43959ddb86b973300a479a82419ef489c3225f1fe429a708507bd515835160e10bc743d20ca33ab9570cfd68d479fcf0bc797a763bec5d1000f0159ef619e709d915975e87beebaf</PublicKey>
<PublicKeyToken>50cebf1cceb9d05e</PublicKeyToken>
<NoWarn>$(NoWarn);0618</NoWarn>
<!-- Signing properties from cecil are overridden by Arcade
because cecil imports the .NET SDK (and hence Arcade) in a
nonstandard way, so set them again here. -->
<SignAssembly>true</SignAssembly>
<PublicSign>true</PublicSign>
<AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)cecil/cecil.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>

</Project>
</Project>
2 changes: 1 addition & 1 deletion src/tools/illink/external/cecil
Submodule cecil updated from 8629bf to 11c6cd
72 changes: 36 additions & 36 deletions src/tools/illink/illink.sln
Original file line number Diff line number Diff line change
Expand Up @@ -49,42 +49,42 @@ Global
{DD28E2B1-057B-4B4D-A04D-B2EBD9E76E46}.Release|x64.Build.0 = illink_Release|x64
{DD28E2B1-057B-4B4D-A04D-B2EBD9E76E46}.Release|x86.ActiveCfg = illink_Release|x86
{DD28E2B1-057B-4B4D-A04D-B2EBD9E76E46}.Release|x86.Build.0 = illink_Release|x86
{D68133BD-1E63-496E-9EDE-4FBDBF77B486}.Debug|Any CPU.ActiveCfg = netstandard_Debug|Any CPU
{D68133BD-1E63-496E-9EDE-4FBDBF77B486}.Debug|Any CPU.Build.0 = netstandard_Debug|Any CPU
{D68133BD-1E63-496E-9EDE-4FBDBF77B486}.Debug|x64.ActiveCfg = netstandard_Debug|x64
{D68133BD-1E63-496E-9EDE-4FBDBF77B486}.Debug|x64.Build.0 = netstandard_Debug|x64
{D68133BD-1E63-496E-9EDE-4FBDBF77B486}.Debug|x86.ActiveCfg = netstandard_Debug|x86
{D68133BD-1E63-496E-9EDE-4FBDBF77B486}.Debug|x86.Build.0 = netstandard_Debug|x86
{D68133BD-1E63-496E-9EDE-4FBDBF77B486}.Release|Any CPU.ActiveCfg = netstandard_Release|Any CPU
{D68133BD-1E63-496E-9EDE-4FBDBF77B486}.Release|Any CPU.Build.0 = netstandard_Release|Any CPU
{D68133BD-1E63-496E-9EDE-4FBDBF77B486}.Release|x64.ActiveCfg = netstandard_Release|x64
{D68133BD-1E63-496E-9EDE-4FBDBF77B486}.Release|x64.Build.0 = netstandard_Release|x64
{D68133BD-1E63-496E-9EDE-4FBDBF77B486}.Release|x86.ActiveCfg = netstandard_Release|x86
{D68133BD-1E63-496E-9EDE-4FBDBF77B486}.Release|x86.Build.0 = netstandard_Release|x86
{63E6915C-7EA4-4D76-AB28-0D7191EEA626}.Debug|Any CPU.ActiveCfg = netstandard_Debug|Any CPU
{63E6915C-7EA4-4D76-AB28-0D7191EEA626}.Debug|Any CPU.Build.0 = netstandard_Debug|Any CPU
{63E6915C-7EA4-4D76-AB28-0D7191EEA626}.Debug|x64.ActiveCfg = netstandard_Debug|x64
{63E6915C-7EA4-4D76-AB28-0D7191EEA626}.Debug|x64.Build.0 = netstandard_Debug|x64
{63E6915C-7EA4-4D76-AB28-0D7191EEA626}.Debug|x86.ActiveCfg = netstandard_Debug|x86
{63E6915C-7EA4-4D76-AB28-0D7191EEA626}.Debug|x86.Build.0 = netstandard_Debug|x86
{63E6915C-7EA4-4D76-AB28-0D7191EEA626}.Release|Any CPU.ActiveCfg = netstandard_Release|Any CPU
{63E6915C-7EA4-4D76-AB28-0D7191EEA626}.Release|Any CPU.Build.0 = netstandard_Release|Any CPU
{63E6915C-7EA4-4D76-AB28-0D7191EEA626}.Release|x64.ActiveCfg = netstandard_Release|x64
{63E6915C-7EA4-4D76-AB28-0D7191EEA626}.Release|x64.Build.0 = netstandard_Release|x64
{63E6915C-7EA4-4D76-AB28-0D7191EEA626}.Release|x86.ActiveCfg = netstandard_Release|x86
{63E6915C-7EA4-4D76-AB28-0D7191EEA626}.Release|x86.Build.0 = netstandard_Release|x86
{8559DD7F-A16F-46D0-A05A-9139FAEBA8FD}.Debug|Any CPU.ActiveCfg = netstandard_Debug|Any CPU
{8559DD7F-A16F-46D0-A05A-9139FAEBA8FD}.Debug|Any CPU.Build.0 = netstandard_Debug|Any CPU
{8559DD7F-A16F-46D0-A05A-9139FAEBA8FD}.Debug|x64.ActiveCfg = netstandard_Debug|x64
{8559DD7F-A16F-46D0-A05A-9139FAEBA8FD}.Debug|x64.Build.0 = netstandard_Debug|x64
{8559DD7F-A16F-46D0-A05A-9139FAEBA8FD}.Debug|x86.ActiveCfg = netstandard_Debug|x86
{8559DD7F-A16F-46D0-A05A-9139FAEBA8FD}.Debug|x86.Build.0 = netstandard_Debug|x86
{8559DD7F-A16F-46D0-A05A-9139FAEBA8FD}.Release|Any CPU.ActiveCfg = netstandard_Release|Any CPU
{8559DD7F-A16F-46D0-A05A-9139FAEBA8FD}.Release|Any CPU.Build.0 = netstandard_Release|Any CPU
{8559DD7F-A16F-46D0-A05A-9139FAEBA8FD}.Release|x64.ActiveCfg = netstandard_Release|x64
{8559DD7F-A16F-46D0-A05A-9139FAEBA8FD}.Release|x64.Build.0 = netstandard_Release|x64
{8559DD7F-A16F-46D0-A05A-9139FAEBA8FD}.Release|x86.ActiveCfg = netstandard_Release|x86
{8559DD7F-A16F-46D0-A05A-9139FAEBA8FD}.Release|x86.Build.0 = netstandard_Release|x86
{D68133BD-1E63-496E-9EDE-4FBDBF77B486}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D68133BD-1E63-496E-9EDE-4FBDBF77B486}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D68133BD-1E63-496E-9EDE-4FBDBF77B486}.Debug|x64.ActiveCfg = Debug|x64
{D68133BD-1E63-496E-9EDE-4FBDBF77B486}.Debug|x64.Build.0 = Debug|x64
{D68133BD-1E63-496E-9EDE-4FBDBF77B486}.Debug|x86.ActiveCfg = Debug|x86
{D68133BD-1E63-496E-9EDE-4FBDBF77B486}.Debug|x86.Build.0 = Debug|x86
{D68133BD-1E63-496E-9EDE-4FBDBF77B486}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D68133BD-1E63-496E-9EDE-4FBDBF77B486}.Release|Any CPU.Build.0 = Release|Any CPU
{D68133BD-1E63-496E-9EDE-4FBDBF77B486}.Release|x64.ActiveCfg = Release|x64
{D68133BD-1E63-496E-9EDE-4FBDBF77B486}.Release|x64.Build.0 = Release|x64
{D68133BD-1E63-496E-9EDE-4FBDBF77B486}.Release|x86.ActiveCfg = Release|x86
{D68133BD-1E63-496E-9EDE-4FBDBF77B486}.Release|x86.Build.0 = Release|x86
{63E6915C-7EA4-4D76-AB28-0D7191EEA626}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{63E6915C-7EA4-4D76-AB28-0D7191EEA626}.Debug|Any CPU.Build.0 = Debug|Any CPU
{63E6915C-7EA4-4D76-AB28-0D7191EEA626}.Debug|x64.ActiveCfg = Debug|x64
{63E6915C-7EA4-4D76-AB28-0D7191EEA626}.Debug|x64.Build.0 = Debug|x64
{63E6915C-7EA4-4D76-AB28-0D7191EEA626}.Debug|x86.ActiveCfg = Debug|x86
{63E6915C-7EA4-4D76-AB28-0D7191EEA626}.Debug|x86.Build.0 = Debug|x86
{63E6915C-7EA4-4D76-AB28-0D7191EEA626}.Release|Any CPU.ActiveCfg = Release|Any CPU
{63E6915C-7EA4-4D76-AB28-0D7191EEA626}.Release|Any CPU.Build.0 = Release|Any CPU
{63E6915C-7EA4-4D76-AB28-0D7191EEA626}.Release|x64.ActiveCfg = Release|x64
{63E6915C-7EA4-4D76-AB28-0D7191EEA626}.Release|x64.Build.0 = Release|x64
{63E6915C-7EA4-4D76-AB28-0D7191EEA626}.Release|x86.ActiveCfg = Release|x86
{63E6915C-7EA4-4D76-AB28-0D7191EEA626}.Release|x86.Build.0 = Release|x86
{8559DD7F-A16F-46D0-A05A-9139FAEBA8FD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8559DD7F-A16F-46D0-A05A-9139FAEBA8FD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8559DD7F-A16F-46D0-A05A-9139FAEBA8FD}.Debug|x64.ActiveCfg = Debug|x64
{8559DD7F-A16F-46D0-A05A-9139FAEBA8FD}.Debug|x64.Build.0 = Debug|x64
{8559DD7F-A16F-46D0-A05A-9139FAEBA8FD}.Debug|x86.ActiveCfg = Debug|x86
{8559DD7F-A16F-46D0-A05A-9139FAEBA8FD}.Debug|x86.Build.0 = Debug|x86
{8559DD7F-A16F-46D0-A05A-9139FAEBA8FD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8559DD7F-A16F-46D0-A05A-9139FAEBA8FD}.Release|Any CPU.Build.0 = Release|Any CPU
{8559DD7F-A16F-46D0-A05A-9139FAEBA8FD}.Release|x64.ActiveCfg = Release|x64
{8559DD7F-A16F-46D0-A05A-9139FAEBA8FD}.Release|x64.Build.0 = Release|x64
{8559DD7F-A16F-46D0-A05A-9139FAEBA8FD}.Release|x86.ActiveCfg = Release|x86
{8559DD7F-A16F-46D0-A05A-9139FAEBA8FD}.Release|x86.Build.0 = Release|x86
{275C1D10-168A-4AC4-8F3E-AD969F580B9C}.Debug|Any CPU.ActiveCfg = illink_Debug|Any CPU
{275C1D10-168A-4AC4-8F3E-AD969F580B9C}.Debug|Any CPU.Build.0 = illink_Debug|Any CPU
{275C1D10-168A-4AC4-8F3E-AD969F580B9C}.Debug|x64.ActiveCfg = illink_Debug|x64
Expand Down
10 changes: 4 additions & 6 deletions src/tools/illink/monobuild/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,9 @@ clean:

prepare:
nuget restore ../monolinker.sln
# A hack for project.assets.json issues
rm -f ../external/cecil/obj/project.assets.json
rm -f ../external/cecil/symbols/pdb/obj/project.assets.json
rm -f ../external/cecil/symbols/mdb/obj/project.assets.json
rm -f ../src/linker/obj/project.assets.json
# The nunit runner used below seems to expect the old package layout.
# This could potentially be removed with an update to nunit.
nuget restore -PackagesDirectory ../packages ../test/Mono.Linker.Tests/packages.config

check: prepare
mono ../packages/NUnit.ConsoleRunner.3.6.1/tools/nunit3-console.exe --result="TestResults.xml;format=nunit2" ../test/Mono.Linker.Tests/bin/$(CONFIGURATION)/Mono.Linker.Tests.dll
mono ../packages/NUnit.ConsoleRunner.3.6.1/tools/nunit3-console.exe --result="TestResults.xml;format=nunit2" ../test/Mono.Linker.Tests/bin/$(CONFIGURATION)/net471/Mono.Linker.Tests.dll
Loading

0 comments on commit b2828dc

Please sign in to comment.