Skip to content

Commit

Permalink
Cleanup: Remove Mono support (#9745)
Browse files Browse the repository at this point in the history
### Context

The time has come to clean up the repo and remove Mono specific code.

### Changes Made

Deleted everything Mono. No changes to any of the supported platforms.

### Testing

Existing unit tests.
  • Loading branch information
ladipro authored Feb 19, 2024
1 parent 23f7752 commit 3f6dd37
Show file tree
Hide file tree
Showing 76 changed files with 159 additions and 1,185 deletions.
13 changes: 1 addition & 12 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

<PropertyGroup>
<Product>Microsoft® Build Tools®</Product>
<Configurations>Debug;Release;Debug-MONO;Release-MONO;MachineIndependent</Configurations>
<Configurations>Debug;Release;MachineIndependent</Configurations>
</PropertyGroup>

<PropertyGroup>
Expand Down Expand Up @@ -60,17 +60,6 @@
<NoWarn>$(NoWarn);NU1507;NU1603;NU5105;1701;1702;SYSLIB0011;SYSLIB0037;SYSLIB0044;RS0016;RS0017;</NoWarn>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)' == 'Debug-MONO'">
<DebugSymbols Condition="'$(DebugSymbols)' == ''">true</DebugSymbols>
<Optimize Condition="'$(Optimize)' == ''">false</Optimize>
<DefineConstants>$(DefineConstants);DEBUG</DefineConstants>
<MonoBuild>true</MonoBuild>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)' == 'Release-MONO'">
<DebugSymbols Condition="'$(DebugSymbols)' == ''">true</DebugSymbols>
<Optimize Condition="'$(Optimize)' == ''">true</Optimize>
<MonoBuild>true</MonoBuild>
</PropertyGroup>
<!-- Configuration MSBuild for portable (xcopy-install) toolsets: works on WinNT and linux/mac via Mono, isolates from machine environment:
uses only tools installed with it, ignores Registry and GAC and Visual Studio installations to provide the same build experience on all machines -->
<PropertyGroup Condition="'$(Configuration)' == 'MachineIndependent'">
Expand Down
504 changes: 0 additions & 504 deletions MSBuild.sln

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ Before you contribute, please read through the contributing and developer guides
* **Developer Guide on:**
- [.NET Core](documentation/wiki/Building-Testing-and-Debugging-on-.Net-Core-MSBuild.md)
- [Full Framework](documentation/wiki/Building-Testing-and-Debugging-on-Full-Framework-MSBuild.md)
- [Mono](documentation/wiki/Building-Testing-and-Debugging-on-Mono-MSBuild.md)

* See our [help wanted issues](https://github.com/dotnet/msbuild/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22) for a list of issues we think are great to onboard new developers.
- **Note:** Please leave a comment asking to be assigned the issue if you want to work on it.
Expand Down
2 changes: 1 addition & 1 deletion eng/AfterSigning.targets
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
<Copy
SourceFiles="$(ArtifactsBinDir)MSBuildTaskHost\x64\Release\net35\MSBuildTaskHost.pdb"
DestinationFolder="$(ArtifactsSymStoreDirectory)\MSBuildTaskHost\net35\amd64"
Condition="'$(MSBuildRuntimeType)' != 'Core' and '$(MonoBuild)' != 'true'"/>
Condition="'$(MSBuildRuntimeType)' != 'Core'"/>
</Target>
</Project>
19 changes: 3 additions & 16 deletions eng/BootStrapMSBuild.targets
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<!--
Copies the binaries of MSBuild to a bootstrap folder so we can rebuild msbuild with itself.
On netcore and mono it performs a directory copy.
On netcore it performs a directory copy.
On full framework it performs a more involved deployment.
-->

Expand All @@ -11,7 +11,6 @@
<BootstrapDestination Condition="'$(Platform)' == 'x64' or '$(Platform)' == 'arm64'">$(BootstrapDestination)$(Platform)\</BootstrapDestination>
<BootstrapDestination>$(BootstrapDestination)$(TargetFramework.ToLowerInvariant())\MSBuild\</BootstrapDestination>

<!-- TODO: Mono build should use BootstrapNetCore logic -->
<BootstrapDependsOn Condition="$(TargetFramework.StartsWith('net4'))">BootstrapFull</BootstrapDependsOn>
<BootstrapDependsOn Condition="!$(TargetFramework.StartsWith('net4'))">BootstrapNetCore</BootstrapDependsOn>

Expand Down Expand Up @@ -72,10 +71,8 @@
<InstalledVersionedExtensions Include="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\**\Tracker*.exe" />
<InstalledVersionedExtensions Include="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\**\FileTracker*.dll" />
<SdkResolverFiles Include="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Bin\SdkResolvers\Microsoft.DotNet.MSBuildSdkResolver\**\*.*" />
<NuGetSdkResolverManifest Include= "$(RepoRoot)src\MSBuild\SdkResolvers\VS\Microsoft.Build.NuGetSdkResolver.xml" Condition="'$(MonoBuild)' != 'true'" />
<NuGetSdkResolverManifest Include= "$(RepoRoot)src\MSBuild\SdkResolvers\Standalone\Microsoft.Build.NuGetSdkResolver.xml" Condition="'$(MonoBuild)' == 'true'" />
<NuGetSdkResolverManifest Include="$(RepoRoot)src\MSBuild\SdkResolvers\VS\Microsoft.Build.NuGetSdkResolver.xml" />
<InstalledSdks Include="$(DOTNET_INSTALL_DIR)\sdk\$(DotNetCliVersion)\Sdks\**\*.*" />
<InstalledSdks Include="$(MSBuildBinPath)\Sdks\**\*" Condition="'$(MonoBuild)' == 'true'" />

<InstalledStaticAnalysisTools Include="$(VsInstallRoot)\Team Tools\Static Analysis Tools\**\*.*" />

Expand Down Expand Up @@ -140,11 +137,6 @@

<Copy SourceFiles="@(InstalledSdks)"
DestinationFiles="@(InstalledSdks -> '$(BootstrapDestination)Sdks\%(RecursiveDir)%(Filename)%(Extension)')"
Condition="'$(MonoBuild)' != 'true'"
SkipUnchangedFiles="true" />
<Copy SourceFiles="@(InstalledSdks)"
DestinationFiles="@(InstalledSdks -> '$(BootstrapDestination)$(TargetMSBuildToolsVersion)\Bin\Sdks\%(RecursiveDir)%(Filename)%(Extension)')"
Condition="'$(MonoBuild)' == 'true'"
SkipUnchangedFiles="true" />

<Copy SourceFiles="@(InstalledStaticAnalysisTools)"
Expand All @@ -155,14 +147,9 @@
DestinationFiles="@(InstalledNuGetFiles->'$(BootstrapDestination)Microsoft\NuGet\%(Filename)%(Extension)')"
SkipUnchangedFiles="true" />

<Copy Condition="'$(MonoBuild)' != 'true'"
SourceFiles="@(_NuGetRuntimeDependencies)"
<Copy SourceFiles="@(_NuGetRuntimeDependencies)"
DestinationFolder="$(BootstrapDestination)..\Common7\IDE\CommonExtensions\Microsoft\NuGet\"
SkipUnchangedFiles="true" />
<Copy Condition="'$(MonoBuild)' == 'true'"
SourceFiles="@(_NuGetRuntimeDependencies)"
DestinationFolder="$(BootstrapDestination)$(TargetMSBuildToolsVersion)\Bin"
SkipUnchangedFiles="true" />

<Copy SourceFiles="@(NuGetSdkResolverManifest)"
DestinationFolder="$(BootstrapDestination)$(TargetMSBuildToolsVersion)\Bin\SdkResolvers\Microsoft.Build.NuGetSdkResolver"
Expand Down
3 changes: 1 addition & 2 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,9 @@
<!-- Workaround for https://github.com/dotnet/roslyn/issues/35793 -->
<SemanticVersioningV1>true</SemanticVersioningV1>
<MicroBuildPluginsSwixBuildVersion>1.1.87</MicroBuildPluginsSwixBuildVersion>
<MonoBuild Condition="'$(Configuration)' == 'Debug-MONO' or '$(Configuration)' == 'Release-MONO'">true</MonoBuild>
</PropertyGroup>
<!-- Repo Toolset Features -->
<PropertyGroup Condition="'$(MonoBuild)' != 'true'">
<PropertyGroup>
<UsingToolIbcOptimization>true</UsingToolIbcOptimization>
<!-- Force a specific compiler version because record changes cause genapi output to flip-flop -->
<UsingToolMicrosoftNetCompilers>true</UsingToolMicrosoftNetCompilers>
Expand Down
7 changes: 0 additions & 7 deletions eng/cibuild_bootstrapped_msbuild.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,6 @@ try {
$buildToolPath = Join-Path $bootstrapRoot "net472\MSBuild\Current\Bin\MSBuild.exe"
$buildToolCommand = "";
$buildToolFramework = "net472"

if ($configuration -eq "Debug-MONO" -or $configuration -eq "Release-MONO")
{
# Copy MSBuild.dll to MSBuild.exe so we can run it without a host
$sourceDll = Join-Path $bootstrapRoot "net472\MSBuild\Current\Bin\MSBuild.dll"
Copy-Item -Path $sourceDll -Destination $msbuildToUse
}
}
else
{
Expand Down
21 changes: 0 additions & 21 deletions eng/cibuild_bootstrapped_msbuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,6 @@ PerfLogDir="$ArtifactsDir/log/$configuration/PerformanceLogs"
. "$ScriptRoot/common/tools.sh"
InitializeDotNetCli true

if [ $host_type = "mono" ] ; then
export _InitializeBuildTool="msbuild"
export _InitializeBuildToolCommand=""
export _InitializeBuildToolFramework="net472"

configuration="$configuration-MONO"
extra_properties=" /p:DeterministicSourcePaths=false"
fi

if [[ $build_stage1 == true ]];
then
/bin/bash "$ScriptRoot/common/build.sh" --restore --build --ci --configuration $configuration /p:CreateBootstrap=true $properties $extra_properties || exit $?
Expand All @@ -65,18 +56,6 @@ then
_InitializeBuildTool="$_InitializeDotNetCli/dotnet"
_InitializeBuildToolCommand="$bootstrapRoot/net8.0/MSBuild/MSBuild.dll"
_InitializeBuildToolFramework="net8.0"
elif [ $host_type = "mono" ]
then
export _InitializeBuildTool="mono"
export _InitializeBuildToolCommand="$bootstrapRoot/net472/MSBuild/Current/Bin/MSBuild.dll"
export _InitializeBuildToolFramework="net472"

# FIXME: remove this once we move to a newer version of Arcade with a fix for $MonoTool
# https://github.com/dotnet/arcade/commit/f6f14c169ba19cd851120e0d572cd1c5619205b3
export MonoTool=`which mono`

extn_path="$bootstrapRoot/net472/MSBuild/Current/Bin/Extensions"
extra_properties=" /p:MSBuildExtensionsPath=$extn_path /p:MSBuildExtensionsPath32=$extn_path /p:MSBuildExtensionsPath64=$extn_path /p:DeterministicSourcePaths=false"
else
echo "Unsupported hostType ($host_type)"
exit 1
Expand Down
62 changes: 0 additions & 62 deletions src/Build.UnitTests/BackEnd/BuildManager_Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -325,8 +325,6 @@ public void VerifyEnvironmentSavedBetweenCalls()
/// </summary>
#if RUNTIME_TYPE_NETCORE
[Theory(Skip = "https://github.com/dotnet/msbuild/issues/1975")]
#elif MONO
[Theory(Skip = "https://github.com/dotnet/msbuild/issues/1240")]
#else
[Theory(Skip = "https://github.com/dotnet/msbuild/issues/2057")]
#endif
Expand Down Expand Up @@ -403,11 +401,7 @@ public void ShutdownNodesAfterParallelBuild(int numberOfParallelProjectsToBuild,
/// <summary>
/// A simple successful build, out of process only.
/// </summary>
#if MONO
[Fact(Skip = "https://github.com/dotnet/msbuild/issues/1240")]
#else
[Fact]
#endif
public void SimpleBuildOutOfProcess()
{
RunOutOfProcBuild(_ => _env.SetEnvironmentVariable("MSBUILDNOINPROCNODE", "1"));
Expand All @@ -416,11 +410,7 @@ public void SimpleBuildOutOfProcess()
/// <summary>
/// A simple successful build, out of process only. Triggered by setting build parameters' DisableInProcNode to true.
/// </summary>
#if MONO
[Fact(Skip = "https://github.com/dotnet/msbuild/issues/1240")]
#else
[Fact]
#endif
public void DisableInProcNode()
{
RunOutOfProcBuild(buildParameters => buildParameters.DisableInProcNode = true);
Expand Down Expand Up @@ -466,11 +456,7 @@ private void RunOutOfProcBuild(Action<BuildParameters> buildParametersModifier)
Assert.NotEqual(Process.GetCurrentProcess().Id, processId); // "Build is expected to be out-of-proc. In fact it was in-proc."
}

#if MONO
[Fact(Skip = "https://github.com/dotnet/msbuild/issues/1240")]
#else
[Fact]
#endif
public void RequestedResultsAreSatisfied()
{
const string contents = @"
Expand Down Expand Up @@ -689,8 +675,6 @@ public void MsBuildForwardAllPropertiesFromChildLaunchChildNode()
/// </summary>
#if RUNTIME_TYPE_NETCORE
[Fact(Skip = "https://github.com/dotnet/msbuild/issues/1976")]
#elif MONO
[Fact(Skip = "https://github.com/dotnet/msbuild/issues/1240")]
#else
[Fact]
#endif
Expand Down Expand Up @@ -742,8 +726,6 @@ public void OutOfProcNodeForwardCertainproperties()
/// </summary>
#if RUNTIME_TYPE_NETCORE
[Fact(Skip = "https://github.com/dotnet/msbuild/issues/1976")]
#elif MONO
[Fact(Skip = "https://github.com/dotnet/msbuild/issues/1240")]
#else
[Fact]
#endif
Expand Down Expand Up @@ -811,11 +793,7 @@ public void OutOfProcNodeForwardCertainpropertiesAlsoGetResultsFromCache()
/// Make sure when if the environment variable MsBuildForwardPropertiesFromChild is set to empty and
/// we launch a child node that we get no properties
/// </summary>
#if MONO
[Fact(Skip = "https://github.com/dotnet/msbuild/issues/1240")]
#else
[Fact]
#endif
public void ForwardNoPropertiesLaunchChildNode()
{
string contents = CleanupFileContents(@"
Expand Down Expand Up @@ -855,8 +833,6 @@ public void ForwardNoPropertiesLaunchChildNode()
/// </summary>
#if RUNTIME_TYPE_NETCORE
[Fact(Skip = "https://github.com/dotnet/msbuild/issues/933")]
#elif MONO
[Fact(Skip = "https://github.com/dotnet/msbuild/issues/1240")]
#else
[Fact]
#endif
Expand Down Expand Up @@ -916,11 +892,7 @@ public override bool Execute()
/// When a child node is launched by default we should not send any properties.
/// we launch a child node that we get no properties
/// </summary>
#if MONO
[Fact(Skip = "https://github.com/dotnet/msbuild/issues/1240")]
#else
[Fact]
#endif
public void ForwardNoPropertiesLaunchChildNodeDefault()
{
string contents = CleanupFileContents(@"
Expand Down Expand Up @@ -2139,11 +2111,7 @@ public void Regress251333()
/// <summary>
/// Verify that disabling the in-proc node doesn't cause projects which don't require it to fail.
/// </summary>
#if MONO
[Fact(Skip = "https://github.com/dotnet/msbuild/issues/1240")]
#else
[Fact]
#endif
public void Regress239661()
{
string contents = CleanupFileContents(@"
Expand Down Expand Up @@ -2201,11 +2169,7 @@ public void ExplicitInprocAffinityGetsOverruledByDisableInprocNode()
/// <summary>
/// Ensures that properties and items are transferred to the out-of-proc node when an instance is used to start the build.
/// </summary>
#if MONO
[Fact(Skip = "https://github.com/dotnet/msbuild/issues/1240")]
#else
[Fact]
#endif
public void ProjectInstanceTransfersToOOPNode()
{
string contents = CleanupFileContents(@"
Expand Down Expand Up @@ -2266,11 +2230,7 @@ public void ProjectInstanceTransfersToOOPNode()
/// <summary>
/// Ensures that a limited set of properties are transferred from a project instance to an OOP node.
/// </summary>
#if MONO
[Fact(Skip = "https://github.com/dotnet/msbuild/issues/1240")]
#else
[Fact]
#endif
public void ProjectInstanceLimitedTransferToOOPNode()
{
string contents = CleanupFileContents(@"
Expand Down Expand Up @@ -2566,8 +2526,6 @@ public void NonOverlappingEnusingTrypointTargetsShouldNotInfluenceEachOthersResu
/// </summary>
#if RUNTIME_TYPE_NETCORE
[Fact(Skip = "https://github.com/dotnet/msbuild/issues/933")]
#elif MONO
[Fact(Skip = "https://github.com/dotnet/msbuild/issues/1240")]
#else
[Fact]
#endif
Expand Down Expand Up @@ -2665,11 +2623,7 @@ public void Regress473114()
/// second request will bail out where the first request did, as though it had
/// executed the target, rather than skipping and continuing.
/// </summary>
#if MONO
[Fact(Skip = "https://github.com/dotnet/msbuild/issues/1240")]
#else
[Fact]
#endif
public void VerifyMultipleRequestForSameProjectWithErrors_Simple()
{
var projA = _env.CreateFile(".proj").Path;
Expand Down Expand Up @@ -2748,11 +2702,7 @@ public void VerifyMultipleRequestForSameProjectWithErrors_Simple()
/// expected in the first request, but be skipped by the second (since if it's "skipping
/// unsuccessful", it can assume that all other OnError targets have also already been run)
/// </summary>
#if MONO
[Fact(Skip = "https://github.com/dotnet/msbuild/issues/1240")]
#else
[Fact]
#endif
public void VerifyMultipleRequestForSameProjectWithErrors_OnErrorChain()
{
var projA = _env.CreateFile(".proj").Path;
Expand Down Expand Up @@ -2867,11 +2817,7 @@ public void VerifyMultipleRequestForSameProjectWithErrors_OnErrorChain()
/// they're marked as ContinueOnError=ErrorAndContinue, then we won't bail, but
/// will continue executing (on the first request) or skipping (on the second)
/// </summary>
#if MONO
[Fact(Skip = "https://github.com/dotnet/msbuild/issues/1240")]
#else
[Fact]
#endif
public void VerifyMultipleRequestForSameProjectWithErrors_ErrorAndContinue()
{
var projA = _env.CreateFile(".proj").Path;
Expand Down Expand Up @@ -2957,11 +2903,7 @@ public void VerifyMultipleRequestForSameProjectWithErrors_ErrorAndContinue()
/// This test verifies that if the errors are in AfterTargets, we still
/// exit as though the target that those targets run after has already run.
/// </summary>
#if MONO
[Fact(Skip = "https://github.com/dotnet/msbuild/issues/1240")]
#else
[Fact]
#endif
public void VerifyMultipleRequestForSameProjectWithErrors_AfterTargets()
{
var projA = _env.CreateFile(".proj").Path;
Expand Down Expand Up @@ -3244,11 +3186,7 @@ public void TestSimultaneousSubmissionsWithLegacyThreadingData_P2P()
/// submissions aren't restricted to running strictly serially by the single in-proc
/// node.
/// </summary>
#if MONO
[Fact(Skip = "https://github.com/dotnet/msbuild/issues/1245")]
#else
[Fact]
#endif
public void TestSimultaneousSubmissionsWithLegacyThreadingData_P2P_MP()
{
string projectContent1 = @"<Project ToolsVersion=`msbuilddefaulttoolsversion` xmlns=`msbuildnamespace`>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public void AddEntry()
/// <summary>
/// Tests that a strong reference is held to a single item
/// </summary>
[WindowsFullFrameworkOnlyFact(additionalMessage: "This test fails on .NET Core and Mono: https://github.com/dotnet/msbuild/issues/282")]
[WindowsFullFrameworkOnlyFact(additionalMessage: "This test fails on .NET Core: https://github.com/dotnet/msbuild/issues/282")]
public void AddEntryStrongReference()
{
string projectPath = NativeMethodsShared.IsUnixLike ? "/foo" : "c:\\foo";
Expand Down
Loading

0 comments on commit 3f6dd37

Please sign in to comment.