diff --git a/eng/Versions.props b/eng/Versions.props index 30e8bc0521e..6a2e8ce566c 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -14,28 +14,29 @@ beta 4.6 $(FSCoreMajorVersion).2 - $(FSCoreMajorVersion).0 - $(FSCoreVersion).0 - + $(FSCoreMajorVersion).0 + $(FSCoreVersionPrefix).0 + + 10.4 $(FSPackageMajorVersion).2 - $(FSPackageVersion) - $(FSProductVersion).0 - + $(FSPackageVersion) + $(FSPackageVersion).0 + + 16 0 $(VSMajorVersion).0 - $(VSMajorVersion).$(VSMinorVersion).0 - $(VSAssemblyVersion).0 - + $(VSMajorVersion).$(VSMinorVersion).0 + $(VSAssemblyVersionPrefix).0 - $(FSCoreVersion) + $(FSCoreVersionPrefix) $(FSCorePackageVersion) - $(FSProductVersion) - $(VSAssemblyVersion) - $(VersionPrefix) + $(FSProductVersionPrefix) + $(VSAssemblyVersionPrefix) + $(VersionPrefix).0 diff --git a/fcs/Directory.Build.props b/fcs/Directory.Build.props index 3179fe221f9..2c4782211fe 100644 --- a/fcs/Directory.Build.props +++ b/fcs/Directory.Build.props @@ -4,6 +4,7 @@ $(RestoreSources); https://api.nuget.org/v3/index.json; + https://dotnet.myget.org/F/fsharp/api/v3/index.json; diff --git a/fcs/FSharp.Compiler.Service.MSBuild.v12/FSharp.Compiler.Service.MSBuild.v12.fsproj b/fcs/FSharp.Compiler.Service.MSBuild.v12/FSharp.Compiler.Service.MSBuild.v12.fsproj index 346edc8bddd..ee02c4fb197 100644 --- a/fcs/FSharp.Compiler.Service.MSBuild.v12/FSharp.Compiler.Service.MSBuild.v12.fsproj +++ b/fcs/FSharp.Compiler.Service.MSBuild.v12/FSharp.Compiler.Service.MSBuild.v12.fsproj @@ -32,27 +32,8 @@ + - - $(FSharpSourcesRoot)\..\fcs\dependencies\MSBuild.v12.0\Microsoft.Build.Framework.dll - false - - - $(FSharpSourcesRoot)\..\fcs\dependencies\MSBuild.v12.0\Microsoft.Build.Engine.dll - false - - - $(FSharpSourcesRoot)\..\fcs\dependencies\MSBuild.v12.0\Microsoft.Build.dll - false - - - $(FSharpSourcesRoot)\..\fcs\dependencies\MSBuild.v12.0\Microsoft.Build.Utilities.v12.0.dll - false - - - $(FSharpSourcesRoot)\..\fcs\dependencies\MSBuild.v12.0\Microsoft.Build.Tasks.v12.0.dll - false - diff --git a/fcs/FSharp.Compiler.Service.ProjectCrackerTool/FSharp.Compiler.Service.ProjectCrackerTool.fsproj b/fcs/FSharp.Compiler.Service.ProjectCrackerTool/FSharp.Compiler.Service.ProjectCrackerTool.fsproj index 648aacb3c21..3beb0e1f996 100644 --- a/fcs/FSharp.Compiler.Service.ProjectCrackerTool/FSharp.Compiler.Service.ProjectCrackerTool.fsproj +++ b/fcs/FSharp.Compiler.Service.ProjectCrackerTool/FSharp.Compiler.Service.ProjectCrackerTool.fsproj @@ -24,25 +24,6 @@ - - $(FSharpSourcesRoot)\..\fcs\dependencies\MSBuild.v12.0\Microsoft.Build.Framework.dll - false - - - $(FSharpSourcesRoot)\..\fcs\dependencies\MSBuild.v12.0\Microsoft.Build.Engine.dll - false - - - $(FSharpSourcesRoot)\..\fcs\dependencies\MSBuild.v12.0\Microsoft.Build.dll - false - - - $(FSharpSourcesRoot)\..\fcs\dependencies\MSBuild.v12.0\Microsoft.Build.Utilities.v12.0.dll - false - - - $(FSharpSourcesRoot)\..\fcs\dependencies\MSBuild.v12.0\Microsoft.Build.Tasks.v12.0.dll - false - + diff --git a/fcs/dependencies/MSBuild.v12.0/.gitignore b/fcs/dependencies/MSBuild.v12.0/.gitignore new file mode 100644 index 00000000000..6a7461313bb --- /dev/null +++ b/fcs/dependencies/MSBuild.v12.0/.gitignore @@ -0,0 +1 @@ +*.dll diff --git a/fcs/dependencies/MSBuild.v12.0/MSBuild.v12.0.csproj b/fcs/dependencies/MSBuild.v12.0/MSBuild.v12.0.csproj new file mode 100644 index 00000000000..b59e15cd058 --- /dev/null +++ b/fcs/dependencies/MSBuild.v12.0/MSBuild.v12.0.csproj @@ -0,0 +1,10 @@ + + + + net45 + MSBuild.v12.0.nuspec + + + + + diff --git a/fcs/dependencies/MSBuild.v12.0/MSBuild.v12.0.nuspec b/fcs/dependencies/MSBuild.v12.0/MSBuild.v12.0.nuspec new file mode 100644 index 00000000000..e3047f0a962 --- /dev/null +++ b/fcs/dependencies/MSBuild.v12.0/MSBuild.v12.0.nuspec @@ -0,0 +1,20 @@ + + + + FSharp.Compiler.Service.MSBuild.v12.0 + 1.0 + Microsoft and F# Software Foundation + MSBuild.v12.0 dependencies for fcs. + + + + + + + + + + + + + diff --git a/fcs/dependencies/MSBuild.v12.0/Microsoft.Build.Engine.dll b/fcs/dependencies/MSBuild.v12.0/Microsoft.Build.Engine.dll deleted file mode 100644 index da712783aaf..00000000000 Binary files a/fcs/dependencies/MSBuild.v12.0/Microsoft.Build.Engine.dll and /dev/null differ diff --git a/fcs/dependencies/MSBuild.v12.0/Microsoft.Build.Framework.dll b/fcs/dependencies/MSBuild.v12.0/Microsoft.Build.Framework.dll deleted file mode 100644 index f13d4f40fc9..00000000000 Binary files a/fcs/dependencies/MSBuild.v12.0/Microsoft.Build.Framework.dll and /dev/null differ diff --git a/fcs/dependencies/MSBuild.v12.0/Microsoft.Build.Tasks.v12.0.dll b/fcs/dependencies/MSBuild.v12.0/Microsoft.Build.Tasks.v12.0.dll deleted file mode 100644 index 116eadc1180..00000000000 Binary files a/fcs/dependencies/MSBuild.v12.0/Microsoft.Build.Tasks.v12.0.dll and /dev/null differ diff --git a/fcs/dependencies/MSBuild.v12.0/Microsoft.Build.Utilities.v12.0.dll b/fcs/dependencies/MSBuild.v12.0/Microsoft.Build.Utilities.v12.0.dll deleted file mode 100644 index 9a8014abc3e..00000000000 Binary files a/fcs/dependencies/MSBuild.v12.0/Microsoft.Build.Utilities.v12.0.dll and /dev/null differ diff --git a/fcs/dependencies/MSBuild.v12.0/Microsoft.Build.dll b/fcs/dependencies/MSBuild.v12.0/Microsoft.Build.dll deleted file mode 100644 index 2ca81182c02..00000000000 Binary files a/fcs/dependencies/MSBuild.v12.0/Microsoft.Build.dll and /dev/null differ diff --git a/fcs/dependencies/MSBuild.v12.0/README.md b/fcs/dependencies/MSBuild.v12.0/README.md new file mode 100644 index 00000000000..6fe2cf4f3b1 --- /dev/null +++ b/fcs/dependencies/MSBuild.v12.0/README.md @@ -0,0 +1,9 @@ +The MSBuild.12.0 dependencies have been converted to a NuGet package. + +To create an updated version of the package: + +1. Copy the appropriate `Microsoft.Build.*.dll` files to this directory. +2. Update the `` element of `MSBuild.v12.0.nuspec`. +3. Run `msbuild MSBuild.v12.0.csproj /t:Pack` +4. Upload `\artifacts\bin\fcs\FSharp.Compiler.Service.MSBuild.v12.0.*.nupkg` to the MyGet feed at + `https://dotnet.myget.org/F/fsharp/api/v3/index.json` diff --git a/src/fsharp/CompileOps.fs b/src/fsharp/CompileOps.fs index a57ee237690..4b0b955abfe 100644 --- a/src/fsharp/CompileOps.fs +++ b/src/fsharp/CompileOps.fs @@ -4154,7 +4154,26 @@ type TcImports(tcConfigP: TcConfigProvider, initialResolutions: TcAssemblyResolu // Add the invalidation signal handlers to each provider for provider in providers do provider.PUntaint((fun tp -> - let handler = tp.Invalidate.Subscribe(fun _ -> invalidateCcu.Trigger ("The provider '" + fileNameOfRuntimeAssembly + "' reported a change")) + + // Register the type provider invalidation handler. + // + // We are explicit about what the handler closure captures to help reason about the + // lifetime of captured objects, especially in case the type provider instance gets leaked + // or keeps itself alive mistakenly, e.g. via some global state in the type provider instance. + // + // The closure captures + // 1. an Event value, ultimately this is made available in all CCus as ccu.InvalidateEvent + // 2. any handlers registered to ccu.InvalidateEvent + // 3. a message string + // + // Note that the invalidation handler does not explicitly capture the TcImports. + // The only place where handlers are registered is to ccu.InvalidateEvent is in IncrementalBuilder.fs. + + let capturedInvalidateCcu = invalidateCcu + let capturedMessage = "The provider '" + fileNameOfRuntimeAssembly + "' reported a change" + let handler = tp.Invalidate.Subscribe(fun _ -> capturedInvalidateCcu.Trigger (capturedMessage)) + + // When the TcImports is disposed we detach the invalidation callback tcImports.AttachDisposeAction(fun () -> try handler.Dispose() with _ -> ())), m) match providers with diff --git a/src/fsharp/service/IncrementalBuild.fs b/src/fsharp/service/IncrementalBuild.fs index 9548dfa1ecc..495b57f8e8f 100755 --- a/src/fsharp/service/IncrementalBuild.fs +++ b/src/fsharp/service/IncrementalBuild.fs @@ -1326,7 +1326,23 @@ type IncrementalBuilder(tcGlobals, frameworkTcImports, nonFrameworkAssemblyInput tcImports.GetCcusExcludingBase() |> Seq.iter (fun ccu -> // When a CCU reports an invalidation, merge them together and just report a // general "imports invalidated". This triggers a rebuild. - ccu.Deref.InvalidateEvent.Add(fun msg -> importsInvalidated.Trigger msg)) + // + // We are explicit about what the handler closure captures to help reason about the + // lifetime of captured objects, especially in case the type provider instance gets leaked + // or keeps itself alive mistakenly, e.g. via some global state in the type provider instance. + // + // The handler only captures + // 1. a weak reference to the importsInvalidated event. + // + // The IncrementalBuilder holds the strong reference the importsInvalidated event. + // + // In the invalidation handler we use a weak reference to allow the IncrementalBuilder to + // be collected if, for some reason, a TP instance is not disposed or not GC'd. + let capturedImportsInvalidated = WeakReference<_>(importsInvalidated) + ccu.Deref.InvalidateEvent.Add(fun msg -> + match capturedImportsInvalidated.TryGetTarget() with + | true, tg -> tg.Trigger msg + | _ -> ())) #endif diff --git a/vsintegration/Vsix/RegisterFsharpPackage.pkgdef b/vsintegration/Vsix/RegisterFsharpPackage.pkgdef index c95d35e2ef0..cc6731507ec 100644 --- a/vsintegration/Vsix/RegisterFsharpPackage.pkgdef +++ b/vsintegration/Vsix/RegisterFsharpPackage.pkgdef @@ -62,42 +62,42 @@ [$RootKey$\CLSID\{e1194663-db3c-49eb-8b45-276fcdc440ea}] "InprocServer32"="$WinDir$\SYSTEM32\MSCOREE.DLL" "Class"="Microsoft.VisualStudio.FSharp.ProjectSystem.FSharpBuildPropertyPage" -"Assembly"="FSharp.ProjectSystem.FSharp, Version=15.9.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" +"Assembly"="FSharp.ProjectSystem.FSharp, Version=16.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" "ThreadingModel"="Both" @="Microsoft.VisualStudio.FSharp.ProjectSystem.FSharpBuildPropertyPage" [$RootKey$\CLSID\{6d2d9b56-2691-4624-a1bf-d07a14594748}] "InprocServer32"="$WinDir$\SYSTEM32\MSCOREE.DLL" "Class"="Microsoft.VisualStudio.Editors.PropertyPages.FSharpApplicationPropPageComClass" -"Assembly"="FSharp.ProjectSystem.PropertyPages, Version=15.9.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" +"Assembly"="FSharp.ProjectSystem.PropertyPages, Version=16.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" "ThreadingModel"="Both" @="Microsoft.VisualStudio.Editors.PropertyPages.FSharpApplicationPropPageComClass" [$RootKey$\CLSID\{dd84aa8f-71bb-462a-8ef8-c9992cb325b7}] "InprocServer32"="$System$mscoree.dll" "Class"="Microsoft.VisualStudio.Editors.PropertyPages.FSharpBuildEventsPropPageComClass" -"Assembly"="FSharp.ProjectSystem.PropertyPages, Version=15.9.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" +"Assembly"="FSharp.ProjectSystem.PropertyPages, Version=16.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" "ThreadingModel"="Both" @="Microsoft.VisualStudio.Editors.PropertyPages.FSharpBuildEventsPropPageComClass" [$RootKey$\CLSID\{fac0a17e-2e70-4211-916a-0d34fb708bff}] "InprocServer32"="$System$mscoree.dll" "Class"="Microsoft.VisualStudio.Editors.PropertyPages.FSharpBuildPropPageComClass" -"Assembly"="FSharp.ProjectSystem.PropertyPages, Version=15.9.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" +"Assembly"="FSharp.ProjectSystem.PropertyPages, Version=16.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" "ThreadingModel"="Both" @="Microsoft.VisualStudio.Editors.PropertyPages.FSharpBuildPropPageComClass" [$RootKey$\CLSID\{9cfbeb2a-6824-43e2-bd3b-b112febc3772}] "InprocServer32"="$WinDir$\SYSTEM32\MSCOREE.DLL" "Class"="Microsoft.VisualStudio.Editors.PropertyPages.FSharpDebugPropPageComClass" -"Assembly"="FSharp.ProjectSystem.PropertyPages, Version=15.9.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" +"Assembly"="FSharp.ProjectSystem.PropertyPages, Version=16.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" "ThreadingModel"="Both" @="Microsoft.VisualStudio.Editors.PropertyPages.FSharpDebugPropPageComClass" [$RootKey$\CLSID\{df16b1a2-0e91-4499-ae60-c7144e614bf1}] "InprocServer32"="$WinDir$\SYSTEM32\MSCOREE.DLL" "Class"="Microsoft.VisualStudio.Editors.PropertyPages.FSharpReferencePathsPropPageComClass" -"Assembly"="FSharp.ProjectSystem.PropertyPages, Version=15.9.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" +"Assembly"="FSharp.ProjectSystem.PropertyPages, Version=16.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" "ThreadingModel"="Both" @="Microsoft.VisualStudio.Editors.PropertyPages.FSharpReferencePathsPropPageComClass" diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/ProjectSystem.fsproj b/vsintegration/src/FSharp.ProjectSystem.FSharp/ProjectSystem.fsproj index cc3ed63cfcd..6c2b6091402 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/ProjectSystem.fsproj +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/ProjectSystem.fsproj @@ -71,13 +71,13 @@ FSharp.Compiler.Private - $(FSProductVersion)$(_BuildNumberSuffix) + $(FSProductVersion) $PackageFolder$\FSharp.Compiler.Private.dll FSharp.Compiler.Server.Shared + $(FSProductVersion) $PackageFolder$\FSharp.Compiler.Server.Shared.dll - $(FSProductVersion)$(_BuildNumberSuffix) FSharp.UIResources diff --git a/vsintegration/src/FSharp.VS.FSI/FSharp.VS.FSI.fsproj b/vsintegration/src/FSharp.VS.FSI/FSharp.VS.FSI.fsproj index c2f52d1f065..f6deaa32daf 100644 --- a/vsintegration/src/FSharp.VS.FSI/FSharp.VS.FSI.fsproj +++ b/vsintegration/src/FSharp.VS.FSI/FSharp.VS.FSI.fsproj @@ -78,7 +78,7 @@ - FSharp.VS.FSI.Base + FSharp.VS.FSI $(VSAssemblyVersion) $PackageFolder$\FSharp.VS.FSI.dll