From 1bbb60a4ee1bfc1dd1a070d043f5fb012bf74bc4 Mon Sep 17 00:00:00 2001 From: "Brett V. Forsgren" Date: Wed, 6 Feb 2019 20:21:06 -0800 Subject: [PATCH 1/6] fix package signing (#6207) (#6208) --- build/config/AssemblySignToolData.json | 3 +-- fsharp.proj | 21 ++++++++++++--------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/build/config/AssemblySignToolData.json b/build/config/AssemblySignToolData.json index 55d61478581..199cc0fc79d 100644 --- a/build/config/AssemblySignToolData.json +++ b/build/config/AssemblySignToolData.json @@ -49,8 +49,7 @@ "certificate": "NuGet", "strongName": null, "values": [ - "artifacts\\*.nupkg", - "artifacts\\*\\*.nupkg" + "packages\\*\\*.nupkg" ] } ], diff --git a/fsharp.proj b/fsharp.proj index ddfa3747a9b..e5343a4a57b 100644 --- a/fsharp.proj +++ b/fsharp.proj @@ -28,7 +28,6 @@ true true true - true true true @@ -91,10 +90,10 @@ - + - + @@ -111,7 +110,7 @@ - + @@ -155,21 +154,25 @@ - + - + + - + + + + - + - + From 84f7488fd14eea39c54baa19987359adece564c2 Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Fri, 8 Feb 2019 10:54:41 -0800 Subject: [PATCH 2/6] We don't ever set the value FCS_RETAIN_BACKGROUND_PARSE_RESULTS (#6212) --- src/fsharp/service/IncrementalBuild.fs | 18 ------------------ tests/service/ProjectAnalysisTests.fs | 12 ------------ .../Tests.LanguageService.Completion.fs | 6 +----- 3 files changed, 1 insertion(+), 35 deletions(-) diff --git a/src/fsharp/service/IncrementalBuild.fs b/src/fsharp/service/IncrementalBuild.fs index f5d0141b32e..e2504be0cb8 100755 --- a/src/fsharp/service/IncrementalBuild.fs +++ b/src/fsharp/service/IncrementalBuild.fs @@ -1534,12 +1534,7 @@ type IncrementalBuilder(tcGlobals, frameworkTcImports, nonFrameworkAssemblyInput let stampedFileNamesNode = Vector.Stamp "SourceFileTimeStamps" StampFileNameTask fileNamesNode let stampedReferencedAssembliesNode = Vector.Stamp "StampReferencedAssembly" StampReferencedAssemblyTask referencedAssembliesNode let initialTcAccNode = Vector.Demultiplex "CombineImportedAssemblies" CombineImportedAssembliesTask stampedReferencedAssembliesNode -#if FCS_RETAIN_BACKGROUND_PARSE_RESULTS - let parseTreesNode = Vector.Map "ParseTrees" ParseTask stampedFileNamesNode - let tcStatesNode = Vector.ScanLeft "TypeCheckingStates" TypeCheckTask initialTcAccNode stampedFileNamesNode -#else let tcStatesNode = Vector.ScanLeft "TypeCheckingStates" (fun ctok tcAcc n -> TypeCheckTask ctok tcAcc (ParseTask ctok n)) initialTcAccNode stampedFileNamesNode -#endif let finalizedTypeCheckNode = Vector.Demultiplex "FinalizeTypeCheck" FinalizeTypeCheckTask tcStatesNode // Outputs @@ -1547,9 +1542,6 @@ type IncrementalBuilder(tcGlobals, frameworkTcImports, nonFrameworkAssemblyInput do buildDescription.DeclareVectorOutput stampedFileNamesNode do buildDescription.DeclareVectorOutput stampedReferencedAssembliesNode -#if FCS_RETAIN_BACKGROUND_PARSE_RESULTS - do buildDescription.DeclareVectorOutput parseTreesNode -#endif do buildDescription.DeclareVectorOutput tcStatesNode do buildDescription.DeclareScalarOutput initialTcAccNode do buildDescription.DeclareScalarOutput finalizedTypeCheckNode @@ -1712,15 +1704,6 @@ type IncrementalBuilder(tcGlobals, frameworkTcImports, nonFrameworkAssemblyInput member builder.GetParseResultsForFile (ctok: CompilationThreadToken, filename) = cancellable { let slotOfFile = builder.GetSlotOfFileName filename -#if FCS_RETAIN_BACKGROUND_PARSE_RESULTS - match GetVectorResultBySlot(parseTreesNode, slotOfFile, partialBuild) with - | Some (results, _) -> return results - | None -> - let! build = IncrementalBuild.EvalUpTo ctok SavePartialBuild (parseTreesNode, slotOfFile) partialBuild - match GetVectorResultBySlot(parseTreesNode, slotOfFile, build) with - | Some (results, _) -> return results - | None -> return! failwith "Build was not evaluated, expected the results to be ready after 'Eval' (GetParseResultsForFile)." -#else let! results = cancellable { match GetVectorResultBySlot(stampedFileNamesNode, slotOfFile, partialBuild) with @@ -1734,7 +1717,6 @@ type IncrementalBuilder(tcGlobals, frameworkTcImports, nonFrameworkAssemblyInput } // re-parse on demand instead of retaining return ParseTask ctok results -#endif } member __.SourceFiles = sourceFiles |> List.map (fun (_, f, _) -> f) diff --git a/tests/service/ProjectAnalysisTests.fs b/tests/service/ProjectAnalysisTests.fs index 5ea55a40505..e67aa3373b7 100644 --- a/tests/service/ProjectAnalysisTests.fs +++ b/tests/service/ProjectAnalysisTests.fs @@ -5179,11 +5179,7 @@ let ``Test request for parse and check doesn't check whole project`` () = backgroundCheckCount.Value |> shouldEqual 0 let checkResults1 = checker.CheckFileInProject(parseResults1, ProjectBig.fileNames.[5], 0, ProjectBig.fileSources2.[5], ProjectBig.options) |> Async.RunSynchronously let pD, tD = FSharpChecker.GlobalForegroundParseCountStatistic, FSharpChecker.GlobalForegroundTypeCheckCountStatistic -#if FCS_RETAIN_BACKGROUND_PARSE_RESULTS - backgroundParseCount.Value |> shouldEqual 10 -#else backgroundParseCount.Value |> shouldEqual 5 -#endif backgroundCheckCount.Value |> shouldEqual 5 (pD - pC) |> shouldEqual 0 (tD - tC) |> shouldEqual 1 @@ -5192,11 +5188,7 @@ let ``Test request for parse and check doesn't check whole project`` () = let pE, tE = FSharpChecker.GlobalForegroundParseCountStatistic, FSharpChecker.GlobalForegroundTypeCheckCountStatistic (pE - pD) |> shouldEqual 0 (tE - tD) |> shouldEqual 1 -#if FCS_RETAIN_BACKGROUND_PARSE_RESULTS - backgroundParseCount.Value |> shouldEqual 10 // but note, the project does not get reparsed -#else (backgroundParseCount.Value <= 8) |> shouldEqual true // but note, the project does not get reparsed -#endif (backgroundCheckCount.Value <= 8) |> shouldEqual true // only two extra typechecks of files // A subsequent ParseAndCheck of identical source code doesn't do any more anything @@ -5204,11 +5196,7 @@ let ``Test request for parse and check doesn't check whole project`` () = let pF, tF = FSharpChecker.GlobalForegroundParseCountStatistic, FSharpChecker.GlobalForegroundTypeCheckCountStatistic (pF - pE) |> shouldEqual 0 // note, no new parse of the file (tF - tE) |> shouldEqual 0 // note, no new typecheck of the file -#if FCS_RETAIN_BACKGROUND_PARSE_RESULTS - backgroundParseCount.Value |> shouldEqual 10 // but note, the project does not get reparsed -#else (backgroundParseCount.Value <= 8) |> shouldEqual true // but note, the project does not get reparsed -#endif (backgroundCheckCount.Value <= 8) |> shouldEqual true // only two extra typechecks of files () diff --git a/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.Completion.fs b/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.Completion.fs index c72825d1ee4..180f7178afa 100644 --- a/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.Completion.fs +++ b/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.Completion.fs @@ -4260,12 +4260,8 @@ let x = query { for bbbb in abbbbc(*D0*) do ReplaceFileInMemory file2 [""] SaveFileToDisk file2 TakeCoffeeBreak(this.VS) - -#if FCS_RETAIN_BACKGROUND_PARSE_RESULTS - gpatcc.AssertExactly(notAA[file2], notAA[file2;file3]) -#else + gpatcc.AssertExactly(notAA[file2; file3], notAA[file2;file3]) -#endif /// FEATURE: References added to the project bring corresponding new .NET and F# items into scope. [] From 31a98b9c8064a57bc7f0b7d0edc1381efea98a14 Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Fri, 8 Feb 2019 10:55:10 -0800 Subject: [PATCH 3/6] Ensure core tests pick up fsharp.core nuget packages from artifacts build (#6206) * Ensure core tests pick up fsharp.core nuget packages from artifacts build * Feedback --- tests/fsharp/single-test.fs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tests/fsharp/single-test.fs b/tests/fsharp/single-test.fs index 14a79c360d2..557ee021ed9 100644 --- a/tests/fsharp/single-test.fs +++ b/tests/fsharp/single-test.fs @@ -89,7 +89,7 @@ let generateOverrides = " template -let generateProjectArtifacts (pc:ProjectConfiguration) targetFramework = +let generateProjectArtifacts (pc:ProjectConfiguration) targetFramework configuration = let computeSourceItems addDirectory addCondition (compileItem:CompileItem) sources = let computeInclude src = let fileName = if addDirectory then Path.Combine(pc.SourceDirectory, src) else src @@ -130,6 +130,8 @@ let generateProjectArtifacts (pc:ProjectConfiguration) targetFramework = FX_RESHAPED_REFLECTION NETCOREAPP false + $(RestoreFromArtifactsPath) + $(RestoreAdditionalProjectSources);$(RestoreFromArtifactsPath) @@ -170,6 +172,8 @@ let generateProjectArtifacts (pc:ProjectConfiguration) targetFramework = |> replaceTokens "$(OPTIMIZE)" optimize |> replaceTokens "$(DEBUG)" debug |> replaceTokens "$(TARGETFRAMEWORK)" targetFramework + |> replaceTokens "$(RestoreFromArtifactsPath)" (Path.GetFullPath(__SOURCE_DIRECTORY__) + "/../../artifacts/packages/" + configuration) + generateProjBody let singleTestBuildAndRunCore cfg copyFiles p = @@ -212,7 +216,7 @@ let singleTestBuildAndRunCore cfg copyFiles p = let executeFsc testCompilerVersion targetFramework = let propsBody = generateProps testCompilerVersion emitFile propsFileName propsBody - let projectBody = generateProjectArtifacts pc targetFramework + let projectBody = generateProjectArtifacts pc targetFramework cfg.BUILD_CONFIG emitFile projectFileName projectBody use testOkFile = new FileGuard(Path.Combine(directory, "test.ok")) exec { cfg with Directory = directory } cfg.DotNetExe (sprintf "run -f %s" targetFramework) @@ -222,7 +226,7 @@ let singleTestBuildAndRunCore cfg copyFiles p = let executeFsi testCompilerVersion targetFramework = let propsBody = generateProps testCompilerVersion emitFile propsFileName propsBody - let projectBody = generateProjectArtifacts pc targetFramework + let projectBody = generateProjectArtifacts pc targetFramework cfg.BUILD_CONFIG emitFile projectFileName projectBody use testOkFile = new FileGuard(Path.Combine(directory, "test.ok")) exec { cfg with Directory = directory } cfg.DotNetExe "build /t:RunFSharpScript" From b88055c350dd4bde7466e2d3e9656dd925d2a088 Mon Sep 17 00:00:00 2001 From: Chet Husk Date: Wed, 13 Feb 2019 13:18:01 -0600 Subject: [PATCH 4/6] Update mono props: support OSX and more .NET Framework versions (#6181) * Update mono props: support OSX and more .NET Framework versions A potential solve for #6180 that uses msbuild built-ins to determine the target OS and pivots off of that to set the FrameworkPathOverride. I included a `MonoRoot` property to allow for easy integration into the build process that fsharp/fsharp uses, which allows for a 'floating' mono root. * add osx build jobs matching the linux jobs, and add a matrix entry to build the compiler for .net framework using mono * don't try to build anything for .net framework on non-windows this required additional build work that may conflict with upcoming work, so we'll just settle for building the existing components on macos at all in CI --- .vsts-pr.yaml | 26 ++++++++++++++++++++++++-- FSharpBuild.Directory.Build.props | 14 ++++++++++++-- 2 files changed, 36 insertions(+), 4 deletions(-) diff --git a/.vsts-pr.yaml b/.vsts-pr.yaml index 44c277a3943..c9f88e2296c 100644 --- a/.vsts-pr.yaml +++ b/.vsts-pr.yaml @@ -4,12 +4,11 @@ jobs: vmImage: ubuntu-16.04 timeoutInMinutes: 90 strategy: - maxParallel: 2 + maxParallel: 3 matrix: dotnet_sdk: _command: make _args: Configuration=release - # disabled until it can be properly fixed release_fcs: _command: ./fcs/build.sh _args: Build @@ -23,6 +22,29 @@ jobs: continueOnError: true condition: failed() +- job: MacOS + pool: + vmImage: macOS-10.13 + timeoutInMinutes: 90 + strategy: + maxParallel: 3 + matrix: + dotnet_sdk: + _command: make + _args: Configuration=release + release_fcs: + _command: ./fcs/build.sh + _args: Build + steps: + - script: $(_command) $(_args) + - task: PublishBuildArtifacts@1 + inputs: + PathtoPublish: '$(Build.SourcesDirectory)/artifacts/TestResults' + ArtifactName: 'MacOS $(_command) $(_args)' + publishLocation: Container + continueOnError: true + condition: failed() + - job: Windows pool: vmImage: vs2017-win2016 diff --git a/FSharpBuild.Directory.Build.props b/FSharpBuild.Directory.Build.props index 732f311b791..f64b9fc88bc 100644 --- a/FSharpBuild.Directory.Build.props +++ b/FSharpBuild.Directory.Build.props @@ -44,9 +44,19 @@ + /usr + /Library/Frameworks/Mono.framework/Versions/Current + $(MonoRoot)/lib/mono true - /usr/lib/mono/4.5-api - /usr/lib/mono/4.6-api + $(MonoLibFolder)/4.5-api + $(MonoLibFolder)/4.5.1-api + $(MonoLibFolder)/4.5.2-api + $(MonoLibFolder)/4.6-api + $(MonoLibFolder)/4.6.1-api + $(MonoLibFolder)/4.6.2-api + $(MonoLibFolder)/4.7-api + $(MonoLibFolder)/4.7.1-api + $(MonoLibFolder)/4.7.2-api From 54c22cdea6e069db28d8dd16723e402e364aab44 Mon Sep 17 00:00:00 2001 From: "Brett V. Forsgren" Date: Sat, 16 Feb 2019 18:56:45 -0800 Subject: [PATCH 5/6] fix double-build of vsix packages (#6233) * fix double-build of vsix packages (#6232) * Update Microsoft.FSharp.vsmanproj --- build/config/AssemblySignToolData.json | 2 +- fsharp.proj | 5 +++-- setup/Swix/Microsoft.FSharp.vsmanproj | 8 ++++---- setup/fsharp-setup-build.csproj | 12 ------------ 4 files changed, 8 insertions(+), 19 deletions(-) diff --git a/build/config/AssemblySignToolData.json b/build/config/AssemblySignToolData.json index 199cc0fc79d..79eaf9f3355 100644 --- a/build/config/AssemblySignToolData.json +++ b/build/config/AssemblySignToolData.json @@ -39,7 +39,7 @@ "certificate": "VsixSHA2", "strongName": null, "values": [ - "bin\\VisualFSharpFull\\*\\*VisualFSharpFull.vsix", + "bin\\VisualFSharpFull\\*\\*\\VisualFSharpFull.vsix", "bin\\VisualFSharpTemplates\\*\\*\\VisualFSharpTemplate.vsix", "VSSetup\\*\\Insertion\\Microsoft.FSharp.Dependencies.vsix", "VSSetup\\*\\Insertion\\Microsoft.FSharp.VSIX.Full.Resources.*.vsix" diff --git a/fsharp.proj b/fsharp.proj index e5343a4a57b..75887c46db6 100644 --- a/fsharp.proj +++ b/fsharp.proj @@ -90,7 +90,8 @@ - + + @@ -110,7 +111,7 @@ - + diff --git a/setup/Swix/Microsoft.FSharp.vsmanproj b/setup/Swix/Microsoft.FSharp.vsmanproj index 6e6f7d4e7e9..a09ca5442f5 100644 --- a/setup/Swix/Microsoft.FSharp.vsmanproj +++ b/setup/Swix/Microsoft.FSharp.vsmanproj @@ -12,10 +12,10 @@ - - - - + + + + diff --git a/setup/fsharp-setup-build.csproj b/setup/fsharp-setup-build.csproj index 7968f56c51b..074879dc20e 100644 --- a/setup/fsharp-setup-build.csproj +++ b/setup/fsharp-setup-build.csproj @@ -20,15 +20,6 @@ - - - ..\vsintegration\Vsix\VisualFSharpFull\VisualFSharpFull.csproj - - - ..\vsintegration\Vsix\VisualFSharpTemplates\VisualFSharpTemplates.csproj - - - @@ -59,9 +50,6 @@ AssemblySearchPaths={HintPathFromItem};{TargetFrameworkDirectory};{RawFileName} - From 7376e22a6c827de1c16a8ebf9a35ae4d5c266519 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Tue, 19 Feb 2019 11:04:36 +0000 Subject: [PATCH 6/6] debug fixes (#6170) * debug fixes * apply code review fixes --- src/fsharp/CompileOps.fs | 25 ++++++---- src/fsharp/FSComp.txt | 1 - .../SimulatedMSBuildReferenceResolver.fs | 46 ++++++++++--------- src/fsharp/xlf/FSComp.txt.cs.xlf | 5 -- src/fsharp/xlf/FSComp.txt.de.xlf | 5 -- src/fsharp/xlf/FSComp.txt.en.xlf | 5 -- src/fsharp/xlf/FSComp.txt.es.xlf | 5 -- src/fsharp/xlf/FSComp.txt.fr.xlf | 5 -- src/fsharp/xlf/FSComp.txt.it.xlf | 5 -- src/fsharp/xlf/FSComp.txt.ja.xlf | 5 -- src/fsharp/xlf/FSComp.txt.ko.xlf | 5 -- src/fsharp/xlf/FSComp.txt.pl.xlf | 5 -- src/fsharp/xlf/FSComp.txt.pt-BR.xlf | 5 -- src/fsharp/xlf/FSComp.txt.ru.xlf | 5 -- src/fsharp/xlf/FSComp.txt.tr.xlf | 5 -- src/fsharp/xlf/FSComp.txt.zh-Hans.xlf | 5 -- src/fsharp/xlf/FSComp.txt.zh-Hant.xlf | 5 -- 17 files changed, 39 insertions(+), 103 deletions(-) diff --git a/src/fsharp/CompileOps.fs b/src/fsharp/CompileOps.fs index 830a08bf2f4..c3f7ab6e0a2 100644 --- a/src/fsharp/CompileOps.fs +++ b/src/fsharp/CompileOps.fs @@ -2790,22 +2790,26 @@ type TcConfig private (data : TcConfigBuilder, validate:bool) = error(Error(FSComp.SR.buildExplicitCoreLibRequiresNoFramework("--noframework"), rangeStartup)) let ilGlobals = mkILGlobals ILScopeRef.Local + + // clrRoot: the location of the primary assembly (mscorlib.dll or netstandard.dll or System.Runtime.dll) + // + // targetFrameworkVersionValue: Normally just HighestInstalledNetFrameworkVersion() + // + // Note, when mscorlib.dll has been given explicitly the actual value of + // targetFrameworkVersion shouldn't matter since resolution has already happened. + // In those cases where it does matter (e.g. --noframework is not being used or we are processing further + // resolutions for a script) then it is correct to just use HighestInstalledNetFrameworkVersion(). let clrRootValue, targetFrameworkVersionValue = match primaryAssemblyExplicitFilenameOpt with - | Some(primaryAssemblyFilename) -> + | Some primaryAssemblyFilename -> let filename = ComputeMakePathAbsolute data.implicitIncludeDir primaryAssemblyFilename try - use ilReader = OpenILBinary(filename, data.reduceMemoryUsage, ilGlobals, None, data.shadowCopyReferences, data.tryGetMetadataSnapshot) - let ilModule = ilReader.ILModuleDef - match ilModule.ManifestOfAssembly.Version with - | Some(v1, v2, _, _) -> - let clrRoot = Some(Path.GetDirectoryName(FileSystem.GetFullPathShim(filename))) - clrRoot, (sprintf "v%d.%d" v1 v2) - | _ -> - failwith (FSComp.SR.buildCouldNotReadVersionInfoFromMscorlib()) + let clrRoot = Some(Path.GetDirectoryName(FileSystem.GetFullPathShim(filename))) + clrRoot, data.legacyReferenceResolver.HighestInstalledNetFrameworkVersion() with e -> + // We no longer expect the above to fail but leaving this just in case error(Error(FSComp.SR.buildErrorOpeningBinaryFile(filename, e.Message), rangeStartup)) - | _ -> + | None -> #if !ENABLE_MONO_SUPPORT // TODO: we have to get msbuild out of this if data.useSimpleResolution then @@ -2821,6 +2825,7 @@ type TcConfig private (data : TcConfigBuilder, validate:bool) = let fsharpBinariesDirValue = // NOTE: It's not clear why this behaviour has been changed for the NETSTANDARD compilations of the F# compiler #if NETSTANDARD1_6 || NETSTANDARD2_0 + ignore ilGlobals data.defaultFSharpBinariesDir #else match fslibExplicitFilenameOpt with diff --git a/src/fsharp/FSComp.txt b/src/fsharp/FSComp.txt index cb5747f3c5d..1e36681680f 100644 --- a/src/fsharp/FSComp.txt +++ b/src/fsharp/FSComp.txt @@ -44,7 +44,6 @@ buildProductNameCommunity,"F# Compiler for F# %s" 213,buildInvalidAssemblyName,"'%s' is not a valid assembly name" 214,buildInvalidPrivacy,"Unrecognized privacy setting '%s' for managed resource, valid options are 'public' and 'private'" 215,buildMultipleReferencesNotAllowed,"Multiple references to '%s.dll' are not permitted" -buildCouldNotReadVersionInfoFromMscorlib,"Could not read version from mscorlib.dll" 218,buildCannotReadAssembly,"Unable to read assembly '%s'" 220,buildAssemblyResolutionFailed,"Assembly resolution failure at or near this location" 221,buildImplicitModuleIsNotLegalIdentifier,"The declarations in this file will be placed in an implicit module '%s' based on the file name '%s'. However this is not a valid F# identifier, so the contents will not be accessible from other files. Consider renaming the file or adding a 'module' or 'namespace' declaration at the top of the file." diff --git a/src/fsharp/SimulatedMSBuildReferenceResolver.fs b/src/fsharp/SimulatedMSBuildReferenceResolver.fs index 6fd5fc53120..fd6acf30bbb 100644 --- a/src/fsharp/SimulatedMSBuildReferenceResolver.fs +++ b/src/fsharp/SimulatedMSBuildReferenceResolver.fs @@ -147,13 +147,14 @@ let internal SimulatedMSBuildResolver = match n.Version, n.GetPublicKeyToken() with | null, _ | _,null -> let options = - [ for gacdir in Directory.EnumerateDirectories(gac) do - let assdir = Path.Combine(gacdir,n.Name) - if Directory.Exists(assdir) then - for tdir in Directory.EnumerateDirectories(assdir) do - let trialPath = Path.Combine(tdir,qual) - if FileSystem.SafeExists(trialPath) then - yield trialPath ] + [ if Directory.Exists(gac) then + for gacdir in Directory.EnumerateDirectories(gac) do + let assemblyDir = Path.Combine(gacdir,n.Name) + if Directory.Exists(assemblyDir) then + for tdir in Directory.EnumerateDirectories(assemblyDir) do + let trialPath = Path.Combine(tdir,qual) + if FileSystem.SafeExists(trialPath) then + yield trialPath ] //printfn "sorting GAC paths: %A" options options |> List.sort // puts latest version last @@ -161,21 +162,22 @@ let internal SimulatedMSBuildResolver = |> function None -> () | Some p -> success p | v,tok -> - for gacdir in Directory.EnumerateDirectories(gac) do - //printfn "searching GAC directory: %s" gacdir - let assdir = Path.Combine(gacdir,n.Name) - if Directory.Exists(assdir) then - //printfn "searching GAC directory: %s" assdir - - let tokText = String.concat "" [| for b in tok -> sprintf "%02x" b |] - let verdir = Path.Combine(assdir,"v4.0_"+v.ToString()+"__"+tokText) - //printfn "searching GAC directory: %s" verdir - - if Directory.Exists(verdir) then - let trialPath = Path.Combine(verdir,qual) - //printfn "searching GAC: %s" trialPath - if FileSystem.SafeExists(trialPath) then - success trialPath + if Directory.Exists(gac) then + for gacdir in Directory.EnumerateDirectories(gac) do + //printfn "searching GAC directory: %s" gacdir + let assemblyDir = Path.Combine(gacdir,n.Name) + if Directory.Exists(assemblyDir) then + //printfn "searching GAC directory: %s" assemblyDir + + let tokText = String.concat "" [| for b in tok -> sprintf "%02x" b |] + let verdir = Path.Combine(assemblyDir,"v4.0_"+v.ToString()+"__"+tokText) + //printfn "searching GAC directory: %s" verdir + + if Directory.Exists(verdir) then + let trialPath = Path.Combine(verdir,qual) + //printfn "searching GAC: %s" trialPath + if FileSystem.SafeExists(trialPath) then + success trialPath with e -> logWarningOrError false "SR001" (e.ToString()) #endif diff --git a/src/fsharp/xlf/FSComp.txt.cs.xlf b/src/fsharp/xlf/FSComp.txt.cs.xlf index 4e1e34ea11c..82f9c225686 100644 --- a/src/fsharp/xlf/FSComp.txt.cs.xlf +++ b/src/fsharp/xlf/FSComp.txt.cs.xlf @@ -217,11 +217,6 @@ Víc odkazů na knihovnu {0}.dll se nepovoluje. - - Could not read version from mscorlib.dll - Nedala se přečíst verze souboru mscorlib.dll. - - Unable to read assembly '{0}' Sestavení {0} se nedá přečíst. diff --git a/src/fsharp/xlf/FSComp.txt.de.xlf b/src/fsharp/xlf/FSComp.txt.de.xlf index a0bf99f05bb..211ee752a39 100644 --- a/src/fsharp/xlf/FSComp.txt.de.xlf +++ b/src/fsharp/xlf/FSComp.txt.de.xlf @@ -217,11 +217,6 @@ Mehrere Verweise auf "{0}.dll" sind nicht zulässig - - Could not read version from mscorlib.dll - Version konnte nicht aus "mscorlib.dll" gelesen werden. - - Unable to read assembly '{0}' Assembly "{0}" kann nicht gelesen werden. diff --git a/src/fsharp/xlf/FSComp.txt.en.xlf b/src/fsharp/xlf/FSComp.txt.en.xlf index 9af1fa19c42..8b1c95f11a9 100644 --- a/src/fsharp/xlf/FSComp.txt.en.xlf +++ b/src/fsharp/xlf/FSComp.txt.en.xlf @@ -217,11 +217,6 @@ Multiple references to '{0}.dll' are not permitted - - Could not read version from mscorlib.dll - Could not read version from mscorlib.dll - - Unable to read assembly '{0}' Unable to read assembly '{0}' diff --git a/src/fsharp/xlf/FSComp.txt.es.xlf b/src/fsharp/xlf/FSComp.txt.es.xlf index a4110506d8a..60ecd276a50 100644 --- a/src/fsharp/xlf/FSComp.txt.es.xlf +++ b/src/fsharp/xlf/FSComp.txt.es.xlf @@ -217,11 +217,6 @@ No se permiten varias referencias a '{0}.dll'. - - Could not read version from mscorlib.dll - No se pudo leer la versión de mscorlib.dll. - - Unable to read assembly '{0}' No se puede leer el ensamblado '{0}'. diff --git a/src/fsharp/xlf/FSComp.txt.fr.xlf b/src/fsharp/xlf/FSComp.txt.fr.xlf index bddd70ea557..9021c1a640d 100644 --- a/src/fsharp/xlf/FSComp.txt.fr.xlf +++ b/src/fsharp/xlf/FSComp.txt.fr.xlf @@ -217,11 +217,6 @@ Les références multiples à '{0}.dll' ne sont pas autorisées - - Could not read version from mscorlib.dll - Impossible de lire la version à partir de mscorlib.dll - - Unable to read assembly '{0}' Impossible de lire l'assembly '{0}' diff --git a/src/fsharp/xlf/FSComp.txt.it.xlf b/src/fsharp/xlf/FSComp.txt.it.xlf index 0ea5fab97c6..038551937a8 100644 --- a/src/fsharp/xlf/FSComp.txt.it.xlf +++ b/src/fsharp/xlf/FSComp.txt.it.xlf @@ -217,11 +217,6 @@ Non sono consentiti più riferimenti a '{0}.dll' - - Could not read version from mscorlib.dll - Non è stato possibile leggere la versione da mscorlib.dll - - Unable to read assembly '{0}' Non è possibile leggere l'assembly '{0}' diff --git a/src/fsharp/xlf/FSComp.txt.ja.xlf b/src/fsharp/xlf/FSComp.txt.ja.xlf index cee24364394..6bf71240043 100644 --- a/src/fsharp/xlf/FSComp.txt.ja.xlf +++ b/src/fsharp/xlf/FSComp.txt.ja.xlf @@ -217,11 +217,6 @@ '{0}.dll' に対する複数の参照は許可されていません - - Could not read version from mscorlib.dll - mscorlib.dll からバージョンを読み取ることができませんでした - - Unable to read assembly '{0}' アセンブリ '{0}' を読み取れません diff --git a/src/fsharp/xlf/FSComp.txt.ko.xlf b/src/fsharp/xlf/FSComp.txt.ko.xlf index 5fa1678b110..1fc90c3d59c 100644 --- a/src/fsharp/xlf/FSComp.txt.ko.xlf +++ b/src/fsharp/xlf/FSComp.txt.ko.xlf @@ -217,11 +217,6 @@ '{0}.dll'에 대한 다중 참조는 허용되지 않습니다. - - Could not read version from mscorlib.dll - mscorlib.dll에서 버전을 읽을 수 없습니다. - - Unable to read assembly '{0}' '{0}' 어셈블리를 읽을 수 없습니다. diff --git a/src/fsharp/xlf/FSComp.txt.pl.xlf b/src/fsharp/xlf/FSComp.txt.pl.xlf index 6f93b850c47..dfd69a4d2d5 100644 --- a/src/fsharp/xlf/FSComp.txt.pl.xlf +++ b/src/fsharp/xlf/FSComp.txt.pl.xlf @@ -217,11 +217,6 @@ Używanie wielu odwołań do pliku „{0}.dll” jest niedozwolone - - Could not read version from mscorlib.dll - Nie można odczytać wersji z pliku mscorlib.dll - - Unable to read assembly '{0}' Nie można odczytać zestawu „{0}” diff --git a/src/fsharp/xlf/FSComp.txt.pt-BR.xlf b/src/fsharp/xlf/FSComp.txt.pt-BR.xlf index 73ad77b0ee8..ee23fb78116 100644 --- a/src/fsharp/xlf/FSComp.txt.pt-BR.xlf +++ b/src/fsharp/xlf/FSComp.txt.pt-BR.xlf @@ -217,11 +217,6 @@ As referências múltiplas '{0}.dll' não são permitidas - - Could not read version from mscorlib.dll - Não foi possível ler a versão em mscorlib.dll - - Unable to read assembly '{0}' Não é possível ler o assembly '{0}' diff --git a/src/fsharp/xlf/FSComp.txt.ru.xlf b/src/fsharp/xlf/FSComp.txt.ru.xlf index f539d85c4bc..b8ca16eba38 100644 --- a/src/fsharp/xlf/FSComp.txt.ru.xlf +++ b/src/fsharp/xlf/FSComp.txt.ru.xlf @@ -217,11 +217,6 @@ Множественные ссылки на файлы "{0}.dll" не допускаются - - Could not read version from mscorlib.dll - Не удалось прочитать версию из библиотеки mscorlib.dll - - Unable to read assembly '{0}' Не удается прочитать сборку "{0}" diff --git a/src/fsharp/xlf/FSComp.txt.tr.xlf b/src/fsharp/xlf/FSComp.txt.tr.xlf index 9f3993f415b..c84533dd8ad 100644 --- a/src/fsharp/xlf/FSComp.txt.tr.xlf +++ b/src/fsharp/xlf/FSComp.txt.tr.xlf @@ -217,11 +217,6 @@ Birden çok '{0}.dll' başvurusuna izin verilmiyor - - Could not read version from mscorlib.dll - Sürüm, mscorlib.dll'den okunamadı - - Unable to read assembly '{0}' '{0}' bütünleştirilmiş kodu okunamıyor diff --git a/src/fsharp/xlf/FSComp.txt.zh-Hans.xlf b/src/fsharp/xlf/FSComp.txt.zh-Hans.xlf index 157f72579be..bbd503effa4 100644 --- a/src/fsharp/xlf/FSComp.txt.zh-Hans.xlf +++ b/src/fsharp/xlf/FSComp.txt.zh-Hans.xlf @@ -217,11 +217,6 @@ 不允许多次引用“{0}.dll” - - Could not read version from mscorlib.dll - 未能从 mscorlib.dll 读取版本 - - Unable to read assembly '{0}' 无法读取程序集“{0}” diff --git a/src/fsharp/xlf/FSComp.txt.zh-Hant.xlf b/src/fsharp/xlf/FSComp.txt.zh-Hant.xlf index 2dcc65e9fb3..b653077c3d3 100644 --- a/src/fsharp/xlf/FSComp.txt.zh-Hant.xlf +++ b/src/fsharp/xlf/FSComp.txt.zh-Hant.xlf @@ -217,11 +217,6 @@ 不允許多次參考 '{0}.dll' - - Could not read version from mscorlib.dll - 無法從 mscorlib.dll 讀取版本 - - Unable to read assembly '{0}' 無法讀取組件 '{0}'