From a43fbe3f72a4dba84f10bc1271e79de6f6378e5e Mon Sep 17 00:00:00 2001 From: Gauthier Segay Date: Fri, 23 Oct 2020 23:53:18 -0700 Subject: [PATCH 1/5] attempt to fix pathToExtension in FsiExtension tests. --- integrationtests/Paket.IntegrationTests/FsiExtension.fs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integrationtests/Paket.IntegrationTests/FsiExtension.fs b/integrationtests/Paket.IntegrationTests/FsiExtension.fs index f74097fec1..7b2b0b4fe3 100644 --- a/integrationtests/Paket.IntegrationTests/FsiExtension.fs +++ b/integrationtests/Paket.IntegrationTests/FsiExtension.fs @@ -13,7 +13,7 @@ module FsiExtension = "Release" #endif - let pathToExtension = Path.Combine(__SOURCE_DIRECTORY__, "..", "..", "src", "FSharp.DependencyManager.Paket", "bin", configuration, "netstandard2.1") + let pathToExtension = Path.Combine(__SOURCE_DIRECTORY__, "..", "..", "bin", configuration, "netstandard2.1") let extensionFileName = "FSharp.DependencyManager.Paket.dll" [] From 58db12db49322ea0283d2ebf77adb607952ddcd1 Mon Sep 17 00:00:00 2001 From: Gauthier Segay Date: Sat, 24 Oct 2020 11:28:26 -0700 Subject: [PATCH 2/5] FsExtension tests: find most location with most recent extension to troubleshoot the build issue --- .../Paket.IntegrationTests/FsiExtension.fs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/integrationtests/Paket.IntegrationTests/FsiExtension.fs b/integrationtests/Paket.IntegrationTests/FsiExtension.fs index 7b2b0b4fe3..a533a59104 100644 --- a/integrationtests/Paket.IntegrationTests/FsiExtension.fs +++ b/integrationtests/Paket.IntegrationTests/FsiExtension.fs @@ -13,9 +13,19 @@ module FsiExtension = "Release" #endif - let pathToExtension = Path.Combine(__SOURCE_DIRECTORY__, "..", "..", "bin", configuration, "netstandard2.1") let extensionFileName = "FSharp.DependencyManager.Paket.dll" + let pathToExtension = + let mostRecentLocation = + ( + DirectoryInfo(Path.Combine(__SOURCE_DIRECTORY__, "..", "..")).EnumerateFiles(extensionFileName, SearchOption.AllDirectories) + |> Seq.filter (fun f -> not (f.FullName.Contains(Path.DirectorySeparatorChar + "obj" + Path.DirectorySeparatorChar))) + |> Seq.sortByDescending (fun f -> f.CreationTimeUtc) + |> Seq.head + ) + printfn "%s found in %s" extensionFileName mostRecentLocation.Directory.FullName + mostRecentLocation.Directory.FullName + [] let ``fcs can type check `` () = System.AppDomain.CurrentDomain.add_AssemblyResolve(fun _ (e: System.ResolveEventArgs) -> From 8b2a3e6573073a181f67396c40df26f436636b09 Mon Sep 17 00:00:00 2001 From: Gauthier Segay Date: Sat, 24 Oct 2020 12:21:49 -0700 Subject: [PATCH 3/5] string --- integrationtests/Paket.IntegrationTests/FsiExtension.fs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integrationtests/Paket.IntegrationTests/FsiExtension.fs b/integrationtests/Paket.IntegrationTests/FsiExtension.fs index a533a59104..63bdd39675 100644 --- a/integrationtests/Paket.IntegrationTests/FsiExtension.fs +++ b/integrationtests/Paket.IntegrationTests/FsiExtension.fs @@ -19,7 +19,7 @@ module FsiExtension = let mostRecentLocation = ( DirectoryInfo(Path.Combine(__SOURCE_DIRECTORY__, "..", "..")).EnumerateFiles(extensionFileName, SearchOption.AllDirectories) - |> Seq.filter (fun f -> not (f.FullName.Contains(Path.DirectorySeparatorChar + "obj" + Path.DirectorySeparatorChar))) + |> Seq.filter (fun f -> not (f.FullName.Contains((string Path.DirectorySeparatorChar) + "obj" + (string Path.DirectorySeparatorChar)))) |> Seq.sortByDescending (fun f -> f.CreationTimeUtc) |> Seq.head ) From 9a02ae5a3066977104f385b1e181aae67a7f34e7 Mon Sep 17 00:00:00 2001 From: Gauthier Segay Date: Sat, 24 Oct 2020 18:20:57 -0700 Subject: [PATCH 4/5] printing message for assembly resolve in FCS test --- integrationtests/Paket.IntegrationTests/FsiExtension.fs | 1 + 1 file changed, 1 insertion(+) diff --git a/integrationtests/Paket.IntegrationTests/FsiExtension.fs b/integrationtests/Paket.IntegrationTests/FsiExtension.fs index 63bdd39675..04cfeb2878 100644 --- a/integrationtests/Paket.IntegrationTests/FsiExtension.fs +++ b/integrationtests/Paket.IntegrationTests/FsiExtension.fs @@ -29,6 +29,7 @@ module FsiExtension = [] let ``fcs can type check `` () = System.AppDomain.CurrentDomain.add_AssemblyResolve(fun _ (e: System.ResolveEventArgs) -> + printfn "assembly resolve: %s" e.Name // the paket dependency manager assembly depends on fsharp.core version // which may not be the same as hosting process if e.Name.StartsWith "FSharp.Core," then From 6d5b88593cc7b5f1dd7872e3a8f80179b192a86a Mon Sep 17 00:00:00 2001 From: Gauthier Segay Date: Sat, 24 Oct 2020 21:15:44 -0700 Subject: [PATCH 5/5] troubleshooting: resolve path to extension in each test --- integrationtests/Paket.IntegrationTests/FsiExtension.fs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/integrationtests/Paket.IntegrationTests/FsiExtension.fs b/integrationtests/Paket.IntegrationTests/FsiExtension.fs index 04cfeb2878..2f7d824b91 100644 --- a/integrationtests/Paket.IntegrationTests/FsiExtension.fs +++ b/integrationtests/Paket.IntegrationTests/FsiExtension.fs @@ -15,7 +15,7 @@ module FsiExtension = let extensionFileName = "FSharp.DependencyManager.Paket.dll" - let pathToExtension = + let pathToExtension () = let mostRecentLocation = ( DirectoryInfo(Path.Combine(__SOURCE_DIRECTORY__, "..", "..")).EnumerateFiles(extensionFileName, SearchOption.AllDirectories) @@ -40,7 +40,7 @@ module FsiExtension = ) let checker = FSharpChecker.Create(suggestNamesForErrors=true, keepAssemblyContents=true) - let fileName = Path.Combine(pathToExtension,extensionFileName) + let fileName = Path.Combine(pathToExtension (),extensionFileName) if not (File.Exists fileName) then failwithf "Extension: %s not found" fileName @@ -49,7 +49,7 @@ module FsiExtension = let v = FSharp.Data.JsonValue.Boolean true """ let projectOptions = - checker.GetProjectOptionsFromScript("test.fsx", SourceText.ofString sourceText, otherFlags = [| "/langversion:preview"; sprintf "/compilertool:%s" pathToExtension |] ) + checker.GetProjectOptionsFromScript("test.fsx", SourceText.ofString sourceText, otherFlags = [| "/langversion:preview"; sprintf "/compilertool:%s" (pathToExtension()) |] ) |> Async.RunSynchronously |> fst @@ -72,7 +72,7 @@ module FsiExtension = let fsxsFolder = Path.Combine(__SOURCE_DIRECTORY__, "..", "scenarios", "fsi-depmanager", "deterministic.output") let runSingleFsxTestForOutput (fsxFile: FileInfo) = - let arguments = sprintf @"fsi --langversion:preview %s %s" (sprintf "--compilertool:%s" pathToExtension) fsxFile.FullName + let arguments = sprintf @"fsi --langversion:preview %s %s" (sprintf "--compilertool:%s" (pathToExtension ())) fsxFile.FullName let standardOutput, errorOutput = let p = new System.Diagnostics.Process() p.StartInfo.UseShellExecute <- false