Skip to content
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

Yeet fx_reshaped_msbuild #9780

Merged
merged 2 commits into from
Jul 25, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion FSharp.Profiles.props
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
<DefineConstants>$(DefineConstants);FX_NO_WINFORMS</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_INDENTED_TEXT_WRITER</DefineConstants>
<DefineConstants>$(DefineConstants);FX_RESHAPED_REFEMIT</DefineConstants>
<DefineConstants>$(DefineConstants);FX_RESHAPED_MSBUILD</DefineConstants>
<OtherFlags>$(OtherFlags) --simpleresolution</OtherFlags>
</PropertyGroup>

Expand Down
2 changes: 1 addition & 1 deletion eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
<MicrosoftCodeAnalysisTestResourcesProprietaryVersion>2.0.17</MicrosoftCodeAnalysisTestResourcesProprietaryVersion>
<MicrosoftVisualStudioLanguageServicesVersion>$(RoslynVersion)</MicrosoftVisualStudioLanguageServicesVersion>
<!-- Microsoft Build packages -->
<MicrosoftBuildOverallPackagesVersion>16.4</MicrosoftBuildOverallPackagesVersion>
<MicrosoftBuildOverallPackagesVersion>16.6</MicrosoftBuildOverallPackagesVersion>
<MicrosoftBuildVersion>$(MicrosoftBuildOverallPackagesVersion)</MicrosoftBuildVersion>
<MicrosoftBuildFrameworkVersion>$(MicrosoftBuildOverallPackagesVersion)</MicrosoftBuildFrameworkVersion>
<MicrosoftBuildTasksCoreVersion>$(MicrosoftBuildOverallPackagesVersion)</MicrosoftBuildTasksCoreVersion>
Expand Down
3 changes: 0 additions & 3 deletions fcs/FSharp.Compiler.Service/FSharp.Compiler.Service.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -283,9 +283,6 @@
<Compile Include="$(FSharpSourcesRoot)/absil/ilreflect.fs">
<Link>AbsIL/ilreflect.fs</Link>
</Compile>
<Compile Include="$(FSharpSourcesRoot)\utils\reshapedmsbuild.fs">
<Link>ReferenceResolution/reshapedmsbuild.fs</Link>
</Compile>
<Compile Include="$(FSharpSourcesRoot)/fsharp/ReferenceResolver.fs">
<Link>ReferenceResolution/ReferenceResolver.fs</Link>
</Compile>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ folder "InstallDir:Common7\IDE\CommonExtensions\Microsoft\FSharp"
file source="$(BinariesFolder)\FSharp.Core\$(Configuration)\net45\FSharp.Core.sigdata"
file source="$(BinariesFolder)\FSharp.Build\$(Configuration)\$(TargetFramework)\FSharp.Build.dll" vs.file.ngen=yes vs.file.ngenArchitecture=All vs.file.ngenPriority=2
file source="$(BinariesFolder)\Microsoft.DotNet.DependencyManager\$(Configuration)\net472\Microsoft.DotNet.DependencyManager.dll" vs.file.ngen=yes vs.file.ngenArchitecture=All vs.file.ngenPriority=2
file source="$(BinariesFolder)\FSharp.Build\$(Configuration)\$(TargetFramework)\Microsoft.Build.dll"
file source="$(BinariesFolder)\FSharp.Build\$(Configuration)\$(TargetFramework)\Microsoft.Build.Framework.dll"
file source="$(BinariesFolder)\FSharp.Build\$(Configuration)\$(TargetFramework)\Microsoft.Build.Tasks.Core.dll"
file source="$(BinariesFolder)\FSharp.Build\$(Configuration)\$(TargetFramework)\Microsoft.Build.Utilities.Core.dll"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
</PropertyGroup>
<ItemGroup>
<BuiltProjectOutputGroupKeyOutput Include="$(BuildOutputGroupLocation)\Microsoft.Build.Framework.dll" />
<BuiltProjectOutputGroupKeyOutput Include="$(BuildOutputGroupLocation)\Microsoft.Build.dll" />
<BuiltProjectOutputGroupKeyOutput Include="$(BuildOutputGroupLocation)\Microsoft.Build.Utilities.Core.dll" />
<BuiltProjectOutputGroupKeyOutput Include="$(BuildOutputGroupLocation)\Microsoft.Build.Tasks.Core.dll" />
<BuiltProjectOutputGroupKeyOutput Include="$(BuildOutputGroupLocation)\System.Buffers.dll" />
Expand Down Expand Up @@ -273,9 +272,6 @@
<Compile Include="..\ReferenceResolver.fs">
<Link>ReferenceResolution\ReferenceResolver.fs</Link>
</Compile>
<Compile Include="..\..\utils\reshapedmsbuild.fs">
<Link>ReferenceResolution/reshapedmsbuild.fs</Link>
</Compile>
<!-- A legacy resolver used to help with scripting diagnostics in the Visual Studio tools -->
<Compile Include="..\LegacyMSBuildReferenceResolver.fsi">
<Link>ReferenceResolution/LegacyMSBuildReferenceResolver.fsi</Link>
Expand Down Expand Up @@ -734,10 +730,6 @@

<ItemGroup Condition="'$(TargetFramework)' == 'net472'">
<Reference Include="ISymWrapper, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<PackageReference Include="Microsoft.Build" Version="$(MicrosoftBuildVersion)" />
<PackageReference Include="Microsoft.Build.Framework" Version="$(MicrosoftBuildVersion)" />
<PackageReference Include="Microsoft.Build.Tasks.Core" Version="$(MicrosoftBuildVersion)" />
<PackageReference Include="Microsoft.Build.Utilities.Core" Version="$(MicrosoftBuildVersion)" />
<PackageReference Include="System.IO.Compression" Version="$(SystemIoCompressionVersion)" />
</ItemGroup>

Expand Down Expand Up @@ -766,6 +758,9 @@
<PackageReference Include="System.Threading.ThreadPool" Version="$(SystemThreadingThreadPoolVersion)" />
<PackageReference Include="System.Buffers" Version="$(SystemBuffersVersion)" />
<PackageReference Include="System.Memory" Version="$(SystemMemoryVersion)" />
<PackageReference Include="Microsoft.Build.Framework" Version="$(MicrosoftBuildVersion)" />
<PackageReference Include="Microsoft.Build.Tasks.Core" Version="$(MicrosoftBuildVersion)" />
<PackageReference Include="Microsoft.Build.Utilities.Core" Version="$(MicrosoftBuildVersion)" />
</ItemGroup>

</Project>
22 changes: 0 additions & 22 deletions src/fsharp/LegacyMSBuildReferenceResolver.fs
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,6 @@ module LegacyMSBuildReferenceResolver
open System
open System.IO
open System.Reflection

#if FX_RESHAPED_MSBUILD
open FSharp.Compiler.MsBuildAdapters
open FSharp.Compiler.ToolLocationHelper
#endif

open FSharp.Compiler.AbstractIL.Internal.Library
open FSharp.Compiler.ReferenceResolver
open Microsoft.Build.Tasks
Expand Down Expand Up @@ -137,7 +131,6 @@ module LegacyMSBuildReferenceResolver
else Net45 // version is 4.5 assumed since this code is running.
with _ -> Net45

#if !FX_RESHAPED_MSBUILD
// 1. First look to see if we can find the highest installed set of dotnet reference assemblies, if yes then select that framework
// 2. Otherwise ask msbuild for the highestinstalled framework
let checkFrameworkForReferenceAssemblies (dotNetVersion:string) =
Expand All @@ -153,9 +146,6 @@ module LegacyMSBuildReferenceResolver
match SupportedDesktopFrameworkVersions |> Seq.tryFind(fun v -> checkFrameworkForReferenceAssemblies v) with
| Some v -> v
| None -> getHighestInstalledDotNETFramework()
#else
getHighestInstalledDotNETFramework()
#endif

/// Derive the target framework directories.
let DeriveTargetFrameworkDirectories (targetFrameworkVersion:string, logMessage) =
Expand Down Expand Up @@ -270,17 +260,10 @@ module LegacyMSBuildReferenceResolver
let engine =
{ new IBuildEngine with
member __.BuildProjectFile(projectFileName, targetNames, globalProperties, targetOutputs) = true
#if FX_RESHAPED_MSBUILD
member __.LogCustomEvent(e) = protect (fun () -> logMessage ((e.GetPropertyValue("Message")) :?> string))
member __.LogErrorEvent(e) = protect (fun () -> logDiagnostic true ((e.GetPropertyValue("Code")) :?> string) ((e.GetPropertyValue("Message")) :?> string))
member __.LogMessageEvent(e) = protect (fun () -> logMessage ((e.GetPropertyValue("Message")) :?> string))
member __.LogWarningEvent(e) = protect (fun () -> logDiagnostic false ((e.GetPropertyValue("Code")) :?> string) ((e.GetPropertyValue("Message")) :?> string))
#else
member __.LogCustomEvent(e) = protect (fun () -> logMessage e.Message)
member __.LogErrorEvent(e) = protect (fun () -> logDiagnostic true e.Code e.Message)
member __.LogMessageEvent(e) = protect (fun () -> logMessage e.Message)
member __.LogWarningEvent(e) = protect (fun () -> logDiagnostic false e.Code e.Message)
#endif
member __.ColumnNumberOfTaskNode with get() = 1
member __.LineNumberOfTaskNode with get() = 1
member __.ContinueOnError with get() = true
Expand Down Expand Up @@ -329,15 +312,10 @@ module LegacyMSBuildReferenceResolver
|]

let assemblies =
#if FX_RESHAPED_MSBUILD
ignore references
[||]
#else
[| for (referenceName,baggage) in references ->
let item = new Microsoft.Build.Utilities.TaskItem(referenceName) :> ITaskItem
item.SetMetadata("Baggage", baggage)
item |]
#endif
let rar =
ResolveAssemblyReference(BuildEngine=engine, TargetFrameworkDirectories=targetFrameworkDirectories,
FindRelatedFiles=false, FindDependencies=false, FindSatellites=false,
Expand Down
6 changes: 0 additions & 6 deletions src/fsharp/SimulatedMSBuildReferenceResolver.fs
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,13 @@ let private SimulatedMSBuildResolver =
| None -> "v4.5"

member __.DotNetFrameworkReferenceAssembliesRootDirectory =
#if !FX_RESHAPED_MSBUILD
if System.Environment.OSVersion.Platform = System.PlatformID.Win32NT then
let PF =
match Environment.GetEnvironmentVariable("ProgramFiles(x86)") with
| null -> Environment.GetEnvironmentVariable("ProgramFiles") // if PFx86 is null, then we are 32-bit and just get PF
| s -> s
PF + @"\Reference Assemblies\Microsoft\Framework\.NETFramework"
else
#endif
""

member __.Resolve(resolutionEnvironment, references, targetFrameworkVersion, targetFrameworkDirectories, targetProcessorArchitecture,
Expand Down Expand Up @@ -105,7 +103,6 @@ let private SimulatedMSBuildResolver =
success r
with e -> logWarningOrError false "SR001" (e.ToString())

#if !FX_RESHAPED_MSBUILD
// For this one we need to get the version search exactly right, without doing a load
try
if not found && r.StartsWithOrdinal("FSharp.Core, Version=") && Environment.OSVersion.Platform = PlatformID.Win32NT then
Expand All @@ -120,7 +117,6 @@ let private SimulatedMSBuildResolver =
if FileSystem.SafeExists trialPath then
success trialPath
with e -> logWarningOrError false "SR001" (e.ToString())
#endif

let isFileName =
r.EndsWith("dll", StringComparison.OrdinalIgnoreCase) ||
Expand All @@ -136,7 +132,6 @@ let private SimulatedMSBuildResolver =
success trialPath
with e -> logWarningOrError false "SR001" (e.ToString())

#if !FX_RESHAPED_MSBUILD
try
// Search the GAC on Windows
if not found && not isFileName && Environment.OSVersion.Platform = PlatformID.Win32NT then
Expand Down Expand Up @@ -178,7 +173,6 @@ let private SimulatedMSBuildResolver =
if FileSystem.SafeExists trialPath then
success trialPath
with e -> logWarningOrError false "SR001" (e.ToString())
#endif

results.ToArray() }

Expand Down
Loading