From 45771abb326f0e3dbe3ce25993ce558674cb4489 Mon Sep 17 00:00:00 2001 From: Kevin Ransom Date: Mon, 22 Aug 2022 18:42:09 -0700 Subject: [PATCH 1/7] Initial --- FSharpBuild.Directory.Build.props | 12 ++ azure-pipelines.yml | 58 +++++++ eng/Build.ps1 | 8 +- src/Compiler/Driver/CompilerImports.fs | 163 ++++++++++-------- src/Compiler/Driver/CompilerImports.fsi | 3 +- src/Compiler/FSComp.txt | 4 + src/Compiler/FSharp.Compiler.Service.fsproj | 6 + src/Compiler/Service/IncrementalBuild.fs | 6 +- src/Compiler/SyntaxTree/PrettyNaming.fs | 9 +- src/Compiler/SyntaxTree/PrettyNaming.fsi | 4 + src/Compiler/xlf/FSComp.txt.cs.xlf | 20 +++ src/Compiler/xlf/FSComp.txt.de.xlf | 20 +++ src/Compiler/xlf/FSComp.txt.es.xlf | 20 +++ src/Compiler/xlf/FSComp.txt.fr.xlf | 20 +++ src/Compiler/xlf/FSComp.txt.it.xlf | 20 +++ src/Compiler/xlf/FSComp.txt.ja.xlf | 20 +++ src/Compiler/xlf/FSComp.txt.ko.xlf | 20 +++ src/Compiler/xlf/FSComp.txt.pl.xlf | 20 +++ src/Compiler/xlf/FSComp.txt.pt-BR.xlf | 20 +++ src/Compiler/xlf/FSComp.txt.ru.xlf | 20 +++ src/Compiler/xlf/FSComp.txt.tr.xlf | 20 +++ src/Compiler/xlf/FSComp.txt.zh-Hans.xlf | 20 +++ src/Compiler/xlf/FSComp.txt.zh-Hant.xlf | 20 +++ src/FSharp.Build/FSharp.Build.fsproj | 6 + ...Sharp.Compiler.Interactive.Settings.fsproj | 6 + .../FSharp.Compiler.Server.Shared.fsproj | 6 + src/FSharp.Core/FSharp.Core.fsproj | 6 + .../FSharp.DependencyManager.Nuget.fsproj | 6 + src/fsc/fsc.targets | 6 + src/fsi/fsi.targets | 6 + .../FSharp.Test.Utilities.fsproj | 1 + tests/FSharp.Test.Utilities/TestFramework.fs | 16 +- tests/FSharp.Test.Utilities/Utilities.fs | 6 +- .../fsc/dumpAllCommandLineOptions/dummy.fs | 4 +- .../fsc/dumpAllCommandLineOptions/dummy.fsx | 4 +- .../fsc/help/help40.437.1033.bsl | 14 +- 36 files changed, 521 insertions(+), 99 deletions(-) diff --git a/FSharpBuild.Directory.Build.props b/FSharpBuild.Directory.Build.props index 3d0ccc3d95c..d1dddc0e38d 100644 --- a/FSharpBuild.Directory.Build.props +++ b/FSharpBuild.Directory.Build.props @@ -83,6 +83,18 @@ $(DefineConstants);TESTING_ON_LINUX + + file + file + + + + + + compress + compress + + $(ProtoOutputPath)\fsc\Microsoft.FSharp.Targets diff --git a/azure-pipelines.yml b/azure-pipelines.yml index c66ed2f4a94..8d758b5360d 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -334,6 +334,64 @@ stages: continueOnError: true condition: failed() + # Windows With Compressed Metadata + - job: WindowsCompressedMetadata + pool: + # The PR build definition sets this variable: + # WindowsMachineQueueName=Windows.vs2022.amd64.open + # and there is an alternate build definition that sets this to a queue that is always scouting the + # next preview of Visual Studio. + name: NetCore1ESPool-Public + demands: ImageOverride -equals $(WindowsMachineQueueName) + timeoutInMinutes: 120 + strategy: + maxParallel: 4 + matrix: + desktop_release: + _configuration: Release + _testKind: testDesktop + coreclr_release: + _configuration: Release + _testKind: testCoreclr + fsharpqa_release: + _configuration: Release + _testKind: testFSharpQA + vs_release: + _configuration: Release + _testKind: testVs + steps: + - checkout: self + clean: true + - script: eng\CIBuild.cmd -compressallmetadata -configuration $(_configuration) -$(_testKind) + displayName: Build / Test + - task: PublishTestResults@2 + displayName: Publish Test Results + inputs: + testResultsFormat: 'NUnit' + testResultsFiles: '*.xml' + searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/$(_configuration)' + continueOnError: true + condition: ne(variables['_testKind'], 'testFSharpQA') + - task: PublishBuildArtifacts@1 + displayName: Publish Test Logs + inputs: + PathtoPublish: '$(Build.SourcesDirectory)\artifacts\TestResults\$(_configuration)' + ArtifactName: 'Windows $(_configuration) $(_testKind) test logs' + publishLocation: Container + continueOnError: true + condition: failed() + - script: dotnet build $(Build.SourcesDirectory)/eng/DumpPackageRoot/DumpPackageRoot.csproj + displayName: Dump NuGet cache contents + condition: failed() + - task: PublishBuildArtifacts@1 + displayName: Publish NuGet cache contents + inputs: + PathtoPublish: '$(Build.SourcesDirectory)\artifacts\NugetPackageRootContents' + ArtifactName: 'NuGetPackageContents Windows $(_testKind)' + publishLocation: Container + continueOnError: true + condition: failed() + # Mock official build - job: MockOfficial pool: diff --git a/eng/Build.ps1 b/eng/Build.ps1 index 010d465d5d4..af103f7911a 100644 --- a/eng/Build.ps1 +++ b/eng/Build.ps1 @@ -62,7 +62,7 @@ param ( [switch]$noVisualStudio, [switch]$sourceBuild, [switch]$skipBuild, - + [switch]$compressAllMetadata, [parameter(ValueFromRemainingArguments = $true)][string[]]$properties) Set-StrictMode -version 2.0 @@ -116,6 +116,7 @@ function Print-Usage() { Write-Host " -noVisualStudio Only build fsc and fsi as .NET Core applications. No Visual Studio required. '-configuration', '-verbosity', '-norestore', '-rebuild' are supported." Write-Host " -sourceBuild Simulate building for source-build." Write-Host " -skipbuild Skip building product" + Write-Host " -compressAllMetadata Build product with compressed metadata" Write-Host "" Write-Host "Command line arguments starting with '/p:' are passed through to MSBuild." } @@ -170,6 +171,10 @@ function Process-Arguments() { $script:binaryLog = $False; } + if ($compressAllMetadata) { + $script:compressAllMetadata = $True; + } + foreach ($property in $properties) { if (!$property.StartsWith("/p:", "InvariantCultureIgnoreCase")) { Write-Host "Invalid argument: $property" @@ -228,6 +233,7 @@ function BuildSolution([string] $solutionName) { /p:QuietRestoreBinaryLog=$binaryLog ` /p:TestTargetFrameworks=$testTargetFrameworks ` /p:DotNetBuildFromSource=$sourceBuild ` + /p:CompressAllMetadata=$CompressAllMetadata ` /v:$verbosity ` $suppressExtensionDeployment ` @properties diff --git a/src/Compiler/Driver/CompilerImports.fs b/src/Compiler/Driver/CompilerImports.fs index 7d453dace33..148ea22f129 100644 --- a/src/Compiler/Driver/CompilerImports.fs +++ b/src/Compiler/Driver/CompilerImports.fs @@ -9,6 +9,7 @@ open System.Collections.Generic open System.Collections.Immutable open System.Diagnostics open System.IO +open System.IO.Compression open System.Reflection open Internal.Utilities @@ -54,27 +55,57 @@ let (++) x s = x @ [ s ] let IsSignatureDataResource (r: ILResource) = r.Name.StartsWithOrdinal FSharpSignatureDataResourceName + || r.Name.StartsWithOrdinal FSharpSignatureCompressDataResourceName || r.Name.StartsWithOrdinal FSharpSignatureDataResourceName2 let IsOptimizationDataResource (r: ILResource) = r.Name.StartsWithOrdinal FSharpOptimizationDataResourceName + || r.Name.StartsWithOrdinal FSharpOptimizationCompressDataResourceName || r.Name.StartsWithOrdinal FSharpOptimizationDataResourceName2 -let GetSignatureDataResourceName (r: ILResource) = - if r.Name.StartsWithOrdinal FSharpSignatureDataResourceName then - String.dropPrefix r.Name FSharpSignatureDataResourceName - elif r.Name.StartsWithOrdinal FSharpSignatureDataResourceName2 then - String.dropPrefix r.Name FSharpSignatureDataResourceName2 +let decompressResource (r: ILResource) = + use raw = r.GetBytes().AsStream() + use decompressed = new MemoryStream() + use deflator = new DeflateStream(raw, CompressionMode.Decompress) + deflator.CopyTo decompressed + deflator.Close() + ByteStorage.FromByteArray(decompressed.ToArray()).GetByteMemory() + +let GetResourceNameAndSignatureDataFunc (r: ILResource) = + let getResourceTypeAndName (r: ILResource) = + if r.Name.StartsWithOrdinal FSharpSignatureDataResourceName then + FSharpSignatureDataResourceName, String.dropPrefix r.Name FSharpSignatureDataResourceName + elif r.Name.StartsWithOrdinal FSharpSignatureCompressDataResourceName then + FSharpSignatureCompressDataResourceName, String.dropPrefix r.Name FSharpSignatureCompressDataResourceName + elif r.Name.StartsWithOrdinal FSharpSignatureDataResourceName2 then + FSharpSignatureDataResourceName2, String.dropPrefix r.Name FSharpSignatureDataResourceName2 + else + failwith "GetSignatureDataResourceName" + + let resourceType, ccuName = getResourceTypeAndName r + + if resourceType = FSharpSignatureCompressDataResourceName then + ccuName, (fun () -> decompressResource (r)) else - failwith "GetSignatureDataResourceName" + ccuName, (fun () -> r.GetBytes()) + +let GetResourceNameAndOptimizationDataFunc (r: ILResource) = + let getResourceTypeAndName (r: ILResource) = + if r.Name.StartsWithOrdinal FSharpOptimizationDataResourceName then + FSharpOptimizationDataResourceName, String.dropPrefix r.Name FSharpOptimizationDataResourceName + elif r.Name.StartsWithOrdinal FSharpOptimizationCompressDataResourceName then + FSharpOptimizationCompressDataResourceName, String.dropPrefix r.Name FSharpOptimizationCompressDataResourceName + elif r.Name.StartsWithOrdinal FSharpOptimizationDataResourceName2 then + FSharpOptimizationDataResourceName2, String.dropPrefix r.Name FSharpOptimizationDataResourceName2 + else + failwith "GetOptimizationDataResourceName" + + let resourceType, ccuName = getResourceTypeAndName r -let GetOptimizationDataResourceName (r: ILResource) = - if r.Name.StartsWithOrdinal FSharpOptimizationDataResourceName then - String.dropPrefix r.Name FSharpOptimizationDataResourceName - elif r.Name.StartsWithOrdinal FSharpOptimizationDataResourceName2 then - String.dropPrefix r.Name FSharpOptimizationDataResourceName2 + if resourceType = FSharpOptimizationCompressDataResourceName then + ccuName, (fun () -> decompressResource (r)) else - failwith "GetOptimizationDataResourceName" + ccuName, (fun () -> r.GetBytes()) let IsReflectedDefinitionsResource (r: ILResource) = r.Name.StartsWithOrdinal(QuotationPickler.SerializedReflectedDefinitionsResourceNameBase) @@ -88,18 +119,23 @@ let MakeILResource rName bytes = MetadataIndex = NoMetadataIdx } -let PickleToResource inMem file (g: TcGlobals) scope rName p x = +let PickleToResource inMem file (g: TcGlobals) compress scope rName p x = let file = PathMap.apply g.pathMap file - let bytes = pickleObjWithDanglingCcus inMem file g scope p x + let bytes = + let bytes = pickleObjWithDanglingCcus inMem file g scope p x - let byteStorage = - if inMem then - ByteStorage.FromMemoryAndCopy(bytes.AsMemory(), useBackingMemoryMappedFile = true) + if compress then + let raw = new MemoryStream(bytes.AsMemory().ToArray()) + let compressed = new MemoryStream() + use deflator = new DeflateStream(compressed, CompressionLevel.Optimal) + raw.CopyTo deflator + deflator.Close() + compressed.ToArray() else - ByteStorage.FromByteArray(bytes.AsMemory().ToArray()) + bytes.AsMemory().ToArray() - (bytes :> IDisposable).Dispose() + let byteStorage = ByteStorage.FromByteArray(bytes) { Name = rName @@ -113,15 +149,18 @@ let GetSignatureData (file, ilScopeRef, ilModule, byteReader) : PickledDataWithR unpickleObjWithDanglingCcus file ilScopeRef ilModule unpickleCcuInfo (byteReader ()) let WriteSignatureData (tcConfig: TcConfig, tcGlobals, exportRemapping, ccu: CcuThunk, fileName, inMem) : ILResource = - let mspec = ccu.Contents - let mspec = ApplyExportRemappingToEntity tcGlobals exportRemapping mspec + let mspec = ApplyExportRemappingToEntity tcGlobals exportRemapping ccu.Contents + // For historical reasons, we use a different resource name for FSharp.Core, so older F# compilers // don't complain when they see the resource. - let rName = - if ccu.AssemblyName = getFSharpCoreLibraryName then - FSharpSignatureDataResourceName2 - else - FSharpSignatureDataResourceName + let rName, compress = + match tcConfig.signatureData with + | SignatureDataOptions.Compress -> FSharpSignatureCompressDataResourceName, true + | _ -> + if ccu.AssemblyName = getFSharpCoreLibraryName then + FSharpSignatureDataResourceName2, false + else + FSharpSignatureDataResourceName, false let includeDir = if String.IsNullOrEmpty tcConfig.implicitIncludeDir then @@ -135,6 +174,7 @@ let WriteSignatureData (tcConfig: TcConfig, tcGlobals, exportRemapping, ccu: Ccu inMem fileName tcGlobals + compress ccu (rName + ccu.AssemblyName) pickleCcuInfo @@ -147,34 +187,24 @@ let WriteSignatureData (tcConfig: TcConfig, tcGlobals, exportRemapping, ccu: Ccu let GetOptimizationData (file, ilScopeRef, ilModule, byteReader) = unpickleObjWithDanglingCcus file ilScopeRef ilModule Optimizer.u_CcuOptimizationInfo (byteReader ()) -let WriteOptimizationData (tcGlobals, fileName, inMem, ccu: CcuThunk, modulInfo) = +let WriteOptimizationData (tcConfig: TcConfig, tcGlobals, fileName, inMem, ccu: CcuThunk, modulInfo) = // For historical reasons, we use a different resource name for FSharp.Core, so older F# compilers // don't complain when they see the resource. - let rName = - if ccu.AssemblyName = getFSharpCoreLibraryName then - FSharpOptimizationDataResourceName2 - else - FSharpOptimizationDataResourceName + let rName, compress = + match tcConfig.optimizationData with + | OptimizationDataOptions.Compress -> FSharpOptimizationCompressDataResourceName, true + | _ -> + if ccu.AssemblyName = getFSharpCoreLibraryName then + FSharpOptimizationDataResourceName2, false + else + FSharpOptimizationDataResourceName, false - PickleToResource inMem fileName tcGlobals ccu (rName + ccu.AssemblyName) Optimizer.p_CcuOptimizationInfo modulInfo + PickleToResource inMem fileName tcGlobals compress ccu (rName + ccu.AssemblyName) Optimizer.p_CcuOptimizationInfo modulInfo let EncodeSignatureData (tcConfig: TcConfig, tcGlobals, exportRemapping, generatedCcu, outfile, isIncrementalBuild) = if tcConfig.GenerateSignatureData then let resource = WriteSignatureData(tcConfig, tcGlobals, exportRemapping, generatedCcu, outfile, isIncrementalBuild) - // The resource gets written to a file for FSharp.Core - let useDataFiles = - (tcConfig.useOptimizationDataFile || tcGlobals.compilingFSharpCore) - && not isIncrementalBuild - - if useDataFiles then - let sigDataFileName = (FileSystemUtils.chopExtension outfile) + ".sigdata" - let bytes = resource.GetBytes() - - use fileStream = - FileSystem.OpenFileForWriteShim(sigDataFileName, FileMode.Create, FileAccess.ReadWrite, FileShare.None) - - bytes.CopyTo fileStream let resources = [ resource ] @@ -188,31 +218,16 @@ let EncodeSignatureData (tcConfig: TcConfig, tcGlobals, exportRemapping, generat let EncodeOptimizationData (tcGlobals, tcConfig: TcConfig, outfile, exportRemapping, data, isIncrementalBuild) = if tcConfig.GenerateOptimizationData then let data = map2Of2 (Optimizer.RemapOptimizationInfo tcGlobals exportRemapping) data - // As with the sigdata file, the optdata gets written to a file for FSharp.Core - let useDataFiles = - (tcConfig.useOptimizationDataFile || tcGlobals.compilingFSharpCore) - && not isIncrementalBuild - - if useDataFiles then - let ccu, modulInfo = data - - let bytes = - pickleObjWithDanglingCcus isIncrementalBuild outfile tcGlobals ccu Optimizer.p_CcuOptimizationInfo modulInfo - - let optDataFileName = (FileSystemUtils.chopExtension outfile) + ".optdata" - - use fileStream = - FileSystem.OpenFileForWriteShim(optDataFileName, FileMode.Create, FileAccess.ReadWrite, FileShare.None) - - fileStream.Write(bytes) let ccu, optData = - if tcConfig.onlyEssentialOptimizationData then + if tcConfig.optimizationData = OptimizationDataOptions.None then map2Of2 Optimizer.AbstractOptimizationInfoToEssentials data else data - [ WriteOptimizationData(tcGlobals, outfile, isIncrementalBuild, ccu, optData) ] + [ + WriteOptimizationData(tcConfig, tcGlobals, outfile, isIncrementalBuild, ccu, optData) + ] else [] @@ -846,10 +861,9 @@ type RawFSharpAssemblyDataBackedByFileOnDisk(ilModule: ILModuleDef, ilAssemblyRe let sigDataReaders = [ - for iresource in resources do - if IsSignatureDataResource iresource then - let ccuName = GetSignatureDataResourceName iresource - (ccuName, (fun () -> iresource.GetBytes())) + for r in resources do + if IsSignatureDataResource r then + GetResourceNameAndSignatureDataFunc r ] let sigDataReaders = @@ -877,7 +891,7 @@ type RawFSharpAssemblyDataBackedByFileOnDisk(ilModule: ILModuleDef, ilAssemblyRe ilModule.Resources.AsList() |> List.choose (fun r -> if IsOptimizationDataResource r then - Some(GetOptimizationDataResourceName r, (fun () -> r.GetBytes())) + Some(GetResourceNameAndOptimizationDataFunc r) else None) @@ -938,17 +952,16 @@ type RawFSharpAssemblyData(ilModule: ILModuleDef, ilAssemblyRefs) = let resources = ilModule.Resources.AsList() [ - for iresource in resources do - if IsSignatureDataResource iresource then - let ccuName = GetSignatureDataResourceName iresource - (ccuName, (fun () -> iresource.GetBytes())) + for r in resources do + if IsSignatureDataResource r then + GetResourceNameAndSignatureDataFunc r ] member _.GetRawFSharpOptimizationData(_, _, _) = ilModule.Resources.AsList() |> List.choose (fun r -> if IsOptimizationDataResource r then - Some(GetOptimizationDataResourceName r, (fun () -> r.GetBytes())) + Some(GetResourceNameAndOptimizationDataFunc r) else None) diff --git a/src/Compiler/Driver/CompilerImports.fsi b/src/Compiler/Driver/CompilerImports.fsi index 9a3e9b517ef..d6be5bbd60b 100644 --- a/src/Compiler/Driver/CompilerImports.fsi +++ b/src/Compiler/Driver/CompilerImports.fsi @@ -17,6 +17,7 @@ open FSharp.Compiler.TypedTree open FSharp.Compiler.TypedTreeOps open FSharp.Compiler.TcGlobals open FSharp.Compiler.BuildGraph +open FSharp.Compiler.IO open FSharp.Compiler.Text open FSharp.Core.CompilerServices @@ -42,7 +43,7 @@ val IsOptimizationDataResource: ILResource -> bool /// Determine if an IL resource attached to an F# assembly is an F# quotation data resource for reflected definitions val IsReflectedDefinitionsResource: ILResource -> bool -val GetSignatureDataResourceName: ILResource -> string +val GetResourceNameAndSignatureDataFunc: ILResource -> string * (unit -> ReadOnlyByteMemory) /// Encode the F# interface data into a set of IL attributes and resources val EncodeSignatureData: diff --git a/src/Compiler/FSComp.txt b/src/Compiler/FSComp.txt index c749444f32c..7106d8a5e62 100644 --- a/src/Compiler/FSComp.txt +++ b/src/Compiler/FSComp.txt @@ -928,6 +928,10 @@ optsTargetProfile,"Specify target framework profile of this assembly. Valid valu optsEmitDebugInfoInQuotations,"Emit debug information in quotations" optsPreferredUiLang,"Specify the preferred output language culture name (e.g. es-ES, ja-JP)" optsNoCopyFsharpCore,"Don't copy FSharp.Core.dll along the produced binaries" +optsSignatureData,"Include F# interface information, the default is file. Essential for distributing libraries." +1046,optsUnknownSignatureData,"Invalid value '%s' for --interfacedata, valid value are: none, file, compress."" +optsOptimizationData,"Specify included optimization information, the default is file. Important for distributed libraries." +1047,optsUnknownOptimizationData,"Invalid value '%s' for --optimizationdata, valid value are: none, file, compress." 1051,optsInvalidSubSystemVersion,"Invalid version '%s' for '--subsystemversion'. The version must be 4.00 or greater." 1052,optsInvalidTargetProfile,"Invalid value '%s' for '--targetprofile', valid values are 'mscorlib', 'netcore' or 'netstandard'." typeInfoFullName,"Full name" diff --git a/src/Compiler/FSharp.Compiler.Service.fsproj b/src/Compiler/FSharp.Compiler.Service.fsproj index 5f53b8b610d..e46205d9dac 100644 --- a/src/Compiler/FSharp.Compiler.Service.fsproj +++ b/src/Compiler/FSharp.Compiler.Service.fsproj @@ -27,6 +27,12 @@ false + + + compress + compress + + $(IntermediateOutputPath)$(TargetFramework)\ $(IntermediateOutputPath)$(TargetFramework)\ diff --git a/src/Compiler/Service/IncrementalBuild.fs b/src/Compiler/Service/IncrementalBuild.fs index 96e0c8ef1cc..45e50d441bf 100644 --- a/src/Compiler/Service/IncrementalBuild.fs +++ b/src/Compiler/Service/IncrementalBuild.fs @@ -7,6 +7,7 @@ open System.Collections.Generic open System.Collections.Immutable open System.Diagnostics open System.IO +open System.IO.Compression open System.Threading open Internal.Utilities.Library open Internal.Utilities.Collections @@ -29,6 +30,7 @@ open FSharp.Compiler.IO open FSharp.Compiler.CodeAnalysis open FSharp.Compiler.NameResolution open FSharp.Compiler.ParseAndCheckInputs +open FSharp.Compiler.Syntax.PrettyNaming open FSharp.Compiler.ScriptClosure open FSharp.Compiler.Syntax open FSharp.Compiler.TcGlobals @@ -701,8 +703,8 @@ type RawFSharpAssemblyDataBackedByLanguageService (tcConfig, tcGlobals, generate let sigData = let _sigDataAttributes, sigDataResources = EncodeSignatureData(tcConfig, tcGlobals, exportRemapping, generatedCcu, outfile, true) [ for r in sigDataResources do - let ccuName = GetSignatureDataResourceName r - yield (ccuName, (fun () -> r.GetBytes())) ] + GetResourceNameAndSignatureDataFunc r + ] let autoOpenAttrs = topAttrs.assemblyAttrs |> List.choose (List.singleton >> TryFindFSharpStringAttribute tcGlobals tcGlobals.attrib_AutoOpenAttribute) diff --git a/src/Compiler/SyntaxTree/PrettyNaming.fs b/src/Compiler/SyntaxTree/PrettyNaming.fs index b4ba20670f8..b81d742a357 100755 --- a/src/Compiler/SyntaxTree/PrettyNaming.fs +++ b/src/Compiler/SyntaxTree/PrettyNaming.fs @@ -1097,15 +1097,20 @@ let GetLongNameFromString x = SplitNamesForILPath x // Resource format for pickled data //-------------------------------------------------------------------------- +// Uncompressed OptimizationData/SignatureData name for embedded resource let FSharpOptimizationDataResourceName = "FSharpOptimizationData." - let FSharpSignatureDataResourceName = "FSharpSignatureData." +// Compressed OptimizationData/SignatureData name for embedded resource +let FSharpOptimizationCompressDataResourceName = "FSharpOptimizationCompressData." +let FSharpSignatureCompressDataResourceName = "FSharpSignatureCompressData." + // For historical reasons, we use a different resource name for FSharp.Core, so older F# compilers // don't complain when they see the resource. The prefix of these names must not be 'FSharpOptimizationData' // or 'FSharpSignatureData' -let FSharpOptimizationDataResourceName2 = "FSharpOptimizationInfo." +// Uncompressed OptimizationData/SignatureData name for FSharp.Core embedded resources +let FSharpOptimizationDataResourceName2 = "FSharpOptimizationInfo." let FSharpSignatureDataResourceName2 = "FSharpSignatureInfo." [] diff --git a/src/Compiler/SyntaxTree/PrettyNaming.fsi b/src/Compiler/SyntaxTree/PrettyNaming.fsi index 01f2918712f..bef380034a4 100644 --- a/src/Compiler/SyntaxTree/PrettyNaming.fsi +++ b/src/Compiler/SyntaxTree/PrettyNaming.fsi @@ -271,6 +271,10 @@ val internal FSharpOptimizationDataResourceName: string val internal FSharpSignatureDataResourceName: string +val internal FSharpOptimizationCompressDataResourceName: string + +val internal FSharpSignatureCompressDataResourceName: string + val internal FSharpOptimizationDataResourceName2: string val internal FSharpSignatureDataResourceName2: string diff --git a/src/Compiler/xlf/FSComp.txt.cs.xlf b/src/Compiler/xlf/FSComp.txt.cs.xlf index 8c2f6fe5f54..8d9ad147d8e 100644 --- a/src/Compiler/xlf/FSComp.txt.cs.xlf +++ b/src/Compiler/xlf/FSComp.txt.cs.xlf @@ -487,6 +487,11 @@ Zobrazte si povolené hodnoty verze jazyka a pak zadejte požadovanou verzi, například latest nebo preview. + + Specify included optimization information, the default is file. Important for distributed libraries. + Specify included optimization information, the default is file. Important for distributed libraries. + + The pdb output file name cannot match the build output filename use --pdb:filename.pdb The pdb output file name cannot match the build output filename use --pdb:filename.pdb @@ -507,11 +512,26 @@ Disable implicit generation of constructs using reflection + + Include F# interface information, the default is file. Essential for distributing libraries. + Include F# interface information, the default is file. Essential for distributing libraries. + + Supported language versions: Podporované jazykové verze: + + Invalid value '{0}' for --optimizationdata, valid value are: none, file, compress. + Invalid value '{0}' for --optimizationdata, valid value are: none, file, compress. + + + + Invalid value '{0}' for --interfacedata, valid value are: none, file, compress." + Invalid value '{0}' for --interfacedata, valid value are: none, file, compress." + + Unrecognized value '{0}' for --langversion use --langversion:? for complete list Nerozpoznaná hodnota {0} pro parametr --langversion; seznam možností zobrazíte zadáním --langversion:? diff --git a/src/Compiler/xlf/FSComp.txt.de.xlf b/src/Compiler/xlf/FSComp.txt.de.xlf index 68e2a3f1eb7..dc5964e68dd 100644 --- a/src/Compiler/xlf/FSComp.txt.de.xlf +++ b/src/Compiler/xlf/FSComp.txt.de.xlf @@ -487,6 +487,11 @@ Zeigen Sie die zulässigen Werte für die Sprachversion an. Geben Sie die Sprachversion als "latest" oder "preview" an. + + Specify included optimization information, the default is file. Important for distributed libraries. + Specify included optimization information, the default is file. Important for distributed libraries. + + The pdb output file name cannot match the build output filename use --pdb:filename.pdb The pdb output file name cannot match the build output filename use --pdb:filename.pdb @@ -507,11 +512,26 @@ Disable implicit generation of constructs using reflection + + Include F# interface information, the default is file. Essential for distributing libraries. + Include F# interface information, the default is file. Essential for distributing libraries. + + Supported language versions: Unterstützte Sprachversionen: + + Invalid value '{0}' for --optimizationdata, valid value are: none, file, compress. + Invalid value '{0}' for --optimizationdata, valid value are: none, file, compress. + + + + Invalid value '{0}' for --interfacedata, valid value are: none, file, compress." + Invalid value '{0}' for --interfacedata, valid value are: none, file, compress." + + Unrecognized value '{0}' for --langversion use --langversion:? for complete list Unbekannter Wert "{0}" für "--langversion". Verwenden Sie "--langversion:?", um die vollständige Liste anzuzeigen. diff --git a/src/Compiler/xlf/FSComp.txt.es.xlf b/src/Compiler/xlf/FSComp.txt.es.xlf index bea08c9779f..07b31404551 100644 --- a/src/Compiler/xlf/FSComp.txt.es.xlf +++ b/src/Compiler/xlf/FSComp.txt.es.xlf @@ -487,6 +487,11 @@ Mostrar los valores permitidos para la versión de idioma, especificar la versión de idioma como "latest" "preview" + + Specify included optimization information, the default is file. Important for distributed libraries. + Specify included optimization information, the default is file. Important for distributed libraries. + + The pdb output file name cannot match the build output filename use --pdb:filename.pdb The pdb output file name cannot match the build output filename use --pdb:filename.pdb @@ -507,11 +512,26 @@ Disable implicit generation of constructs using reflection + + Include F# interface information, the default is file. Essential for distributing libraries. + Include F# interface information, the default is file. Essential for distributing libraries. + + Supported language versions: Versiones de lenguaje admitidas: + + Invalid value '{0}' for --optimizationdata, valid value are: none, file, compress. + Invalid value '{0}' for --optimizationdata, valid value are: none, file, compress. + + + + Invalid value '{0}' for --interfacedata, valid value are: none, file, compress." + Invalid value '{0}' for --interfacedata, valid value are: none, file, compress." + + Unrecognized value '{0}' for --langversion use --langversion:? for complete list Valor no reconocido "{0}" para --langversion, use --langversion:? para una lista completa diff --git a/src/Compiler/xlf/FSComp.txt.fr.xlf b/src/Compiler/xlf/FSComp.txt.fr.xlf index 227a9b0bd32..f8a334479dd 100644 --- a/src/Compiler/xlf/FSComp.txt.fr.xlf +++ b/src/Compiler/xlf/FSComp.txt.fr.xlf @@ -487,6 +487,11 @@ Afficher les valeurs autorisées pour la version du langage, spécifier la version du langage comme 'dernière' ou 'préversion' + + Specify included optimization information, the default is file. Important for distributed libraries. + Specify included optimization information, the default is file. Important for distributed libraries. + + The pdb output file name cannot match the build output filename use --pdb:filename.pdb The pdb output file name cannot match the build output filename use --pdb:filename.pdb @@ -507,11 +512,26 @@ Disable implicit generation of constructs using reflection + + Include F# interface information, the default is file. Essential for distributing libraries. + Include F# interface information, the default is file. Essential for distributing libraries. + + Supported language versions: Versions linguistiques prises en charge : + + Invalid value '{0}' for --optimizationdata, valid value are: none, file, compress. + Invalid value '{0}' for --optimizationdata, valid value are: none, file, compress. + + + + Invalid value '{0}' for --interfacedata, valid value are: none, file, compress." + Invalid value '{0}' for --interfacedata, valid value are: none, file, compress." + + Unrecognized value '{0}' for --langversion use --langversion:? for complete list Valeur non reconnue '{0}' pour --langversion use --langversion:? pour la liste complète diff --git a/src/Compiler/xlf/FSComp.txt.it.xlf b/src/Compiler/xlf/FSComp.txt.it.xlf index 4ebe76e823c..1f6e7595ae4 100644 --- a/src/Compiler/xlf/FSComp.txt.it.xlf +++ b/src/Compiler/xlf/FSComp.txt.it.xlf @@ -487,6 +487,11 @@ Visualizza i valori consentiti per la versione del linguaggio. Specificare la versione del linguaggio, ad esempio 'latest' o 'preview' + + Specify included optimization information, the default is file. Important for distributed libraries. + Specify included optimization information, the default is file. Important for distributed libraries. + + The pdb output file name cannot match the build output filename use --pdb:filename.pdb The pdb output file name cannot match the build output filename use --pdb:filename.pdb @@ -507,11 +512,26 @@ Disable implicit generation of constructs using reflection + + Include F# interface information, the default is file. Essential for distributing libraries. + Include F# interface information, the default is file. Essential for distributing libraries. + + Supported language versions: Versioni del linguaggio supportate: + + Invalid value '{0}' for --optimizationdata, valid value are: none, file, compress. + Invalid value '{0}' for --optimizationdata, valid value are: none, file, compress. + + + + Invalid value '{0}' for --interfacedata, valid value are: none, file, compress." + Invalid value '{0}' for --interfacedata, valid value are: none, file, compress." + + Unrecognized value '{0}' for --langversion use --langversion:? for complete list Valore '{0}' non riconosciuto per --langversion. Per l'elenco completo usare --langversion:? diff --git a/src/Compiler/xlf/FSComp.txt.ja.xlf b/src/Compiler/xlf/FSComp.txt.ja.xlf index 3d330529d59..32b6ae3efd0 100644 --- a/src/Compiler/xlf/FSComp.txt.ja.xlf +++ b/src/Compiler/xlf/FSComp.txt.ja.xlf @@ -487,6 +487,11 @@ 言語バージョンで許可された値を表示し、'最新' や 'プレビュー' などの言語バージョンを指定する + + Specify included optimization information, the default is file. Important for distributed libraries. + Specify included optimization information, the default is file. Important for distributed libraries. + + The pdb output file name cannot match the build output filename use --pdb:filename.pdb The pdb output file name cannot match the build output filename use --pdb:filename.pdb @@ -507,11 +512,26 @@ Disable implicit generation of constructs using reflection + + Include F# interface information, the default is file. Essential for distributing libraries. + Include F# interface information, the default is file. Essential for distributing libraries. + + Supported language versions: サポートされる言語バージョン: + + Invalid value '{0}' for --optimizationdata, valid value are: none, file, compress. + Invalid value '{0}' for --optimizationdata, valid value are: none, file, compress. + + + + Invalid value '{0}' for --interfacedata, valid value are: none, file, compress." + Invalid value '{0}' for --interfacedata, valid value are: none, file, compress." + + Unrecognized value '{0}' for --langversion use --langversion:? for complete list --langversion の値 '{0}' が認識されません。完全なリストについては、--langversion:? を使用してください diff --git a/src/Compiler/xlf/FSComp.txt.ko.xlf b/src/Compiler/xlf/FSComp.txt.ko.xlf index fb1cc618ecb..ca89fd5d341 100644 --- a/src/Compiler/xlf/FSComp.txt.ko.xlf +++ b/src/Compiler/xlf/FSComp.txt.ko.xlf @@ -487,6 +487,11 @@ 언어 버전의 허용된 값을 표시하고 '최신' 또는 '미리 보기'와 같은 언어 버전을 지정합니다. + + Specify included optimization information, the default is file. Important for distributed libraries. + Specify included optimization information, the default is file. Important for distributed libraries. + + The pdb output file name cannot match the build output filename use --pdb:filename.pdb The pdb output file name cannot match the build output filename use --pdb:filename.pdb @@ -507,11 +512,26 @@ Disable implicit generation of constructs using reflection + + Include F# interface information, the default is file. Essential for distributing libraries. + Include F# interface information, the default is file. Essential for distributing libraries. + + Supported language versions: 지원되는 언어 버전: + + Invalid value '{0}' for --optimizationdata, valid value are: none, file, compress. + Invalid value '{0}' for --optimizationdata, valid value are: none, file, compress. + + + + Invalid value '{0}' for --interfacedata, valid value are: none, file, compress." + Invalid value '{0}' for --interfacedata, valid value are: none, file, compress." + + Unrecognized value '{0}' for --langversion use --langversion:? for complete list 전체 목록에 대한 --langversion use --langversion:?의 인식할 수 없는 값 '{0}'입니다. diff --git a/src/Compiler/xlf/FSComp.txt.pl.xlf b/src/Compiler/xlf/FSComp.txt.pl.xlf index d8e30e88c62..5e6c726403e 100644 --- a/src/Compiler/xlf/FSComp.txt.pl.xlf +++ b/src/Compiler/xlf/FSComp.txt.pl.xlf @@ -487,6 +487,11 @@ Wyświetl dozwolone wartości dla wersji językowej; określ wersję językową, np. „latest” lub „preview” + + Specify included optimization information, the default is file. Important for distributed libraries. + Specify included optimization information, the default is file. Important for distributed libraries. + + The pdb output file name cannot match the build output filename use --pdb:filename.pdb The pdb output file name cannot match the build output filename use --pdb:filename.pdb @@ -507,11 +512,26 @@ Disable implicit generation of constructs using reflection + + Include F# interface information, the default is file. Essential for distributing libraries. + Include F# interface information, the default is file. Essential for distributing libraries. + + Supported language versions: Obsługiwane wersje językowe: + + Invalid value '{0}' for --optimizationdata, valid value are: none, file, compress. + Invalid value '{0}' for --optimizationdata, valid value are: none, file, compress. + + + + Invalid value '{0}' for --interfacedata, valid value are: none, file, compress." + Invalid value '{0}' for --interfacedata, valid value are: none, file, compress." + + Unrecognized value '{0}' for --langversion use --langversion:? for complete list Nierozpoznana wartość „{0}” dla parametru –langversion; podaj parametr –langversion:?, aby uzyskać pełną listę diff --git a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf index aeeba1d4271..1bc30be257b 100644 --- a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf +++ b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf @@ -487,6 +487,11 @@ Exibe os valores permitidos para a versão do idioma, especifica a versão do idioma, como 'mais recente ' ou 'prévia' + + Specify included optimization information, the default is file. Important for distributed libraries. + Specify included optimization information, the default is file. Important for distributed libraries. + + The pdb output file name cannot match the build output filename use --pdb:filename.pdb The pdb output file name cannot match the build output filename use --pdb:filename.pdb @@ -507,11 +512,26 @@ Disable implicit generation of constructs using reflection + + Include F# interface information, the default is file. Essential for distributing libraries. + Include F# interface information, the default is file. Essential for distributing libraries. + + Supported language versions: Versões de linguagens com suporte: + + Invalid value '{0}' for --optimizationdata, valid value are: none, file, compress. + Invalid value '{0}' for --optimizationdata, valid value are: none, file, compress. + + + + Invalid value '{0}' for --interfacedata, valid value are: none, file, compress." + Invalid value '{0}' for --interfacedata, valid value are: none, file, compress." + + Unrecognized value '{0}' for --langversion use --langversion:? for complete list Valor não reconhecido '{0}' para --langversion use --langversion:? para a lista completa diff --git a/src/Compiler/xlf/FSComp.txt.ru.xlf b/src/Compiler/xlf/FSComp.txt.ru.xlf index 5959290379e..196b3c0cf10 100644 --- a/src/Compiler/xlf/FSComp.txt.ru.xlf +++ b/src/Compiler/xlf/FSComp.txt.ru.xlf @@ -487,6 +487,11 @@ Отображение допустимых значений для версии языка. Укажите версию языка, например, "latest" или "preview". + + Specify included optimization information, the default is file. Important for distributed libraries. + Specify included optimization information, the default is file. Important for distributed libraries. + + The pdb output file name cannot match the build output filename use --pdb:filename.pdb The pdb output file name cannot match the build output filename use --pdb:filename.pdb @@ -507,11 +512,26 @@ Disable implicit generation of constructs using reflection + + Include F# interface information, the default is file. Essential for distributing libraries. + Include F# interface information, the default is file. Essential for distributing libraries. + + Supported language versions: Поддерживаемые языковые версии: + + Invalid value '{0}' for --optimizationdata, valid value are: none, file, compress. + Invalid value '{0}' for --optimizationdata, valid value are: none, file, compress. + + + + Invalid value '{0}' for --interfacedata, valid value are: none, file, compress." + Invalid value '{0}' for --interfacedata, valid value are: none, file, compress." + + Unrecognized value '{0}' for --langversion use --langversion:? for complete list Не удалось распознать значение "{0}" для параметра --langversion. Для получения полного списка допустимых значений выполните команду use --langversion:? diff --git a/src/Compiler/xlf/FSComp.txt.tr.xlf b/src/Compiler/xlf/FSComp.txt.tr.xlf index 37583dc87c5..8a8faefcde1 100644 --- a/src/Compiler/xlf/FSComp.txt.tr.xlf +++ b/src/Compiler/xlf/FSComp.txt.tr.xlf @@ -487,6 +487,11 @@ Dil sürümü için izin verilen değerleri görüntüleyin, dil sürümünü 'en son' veya 'önizleme' örneklerindeki gibi belirtin + + Specify included optimization information, the default is file. Important for distributed libraries. + Specify included optimization information, the default is file. Important for distributed libraries. + + The pdb output file name cannot match the build output filename use --pdb:filename.pdb The pdb output file name cannot match the build output filename use --pdb:filename.pdb @@ -507,11 +512,26 @@ Disable implicit generation of constructs using reflection + + Include F# interface information, the default is file. Essential for distributing libraries. + Include F# interface information, the default is file. Essential for distributing libraries. + + Supported language versions: Desteklenen dil sürümleri: + + Invalid value '{0}' for --optimizationdata, valid value are: none, file, compress. + Invalid value '{0}' for --optimizationdata, valid value are: none, file, compress. + + + + Invalid value '{0}' for --interfacedata, valid value are: none, file, compress." + Invalid value '{0}' for --interfacedata, valid value are: none, file, compress." + + Unrecognized value '{0}' for --langversion use --langversion:? for complete list --langversion için '{0}' değeri tanınmıyor. Tam liste için --langversion:? kullanın diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf index a627b09742f..656b1508114 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf @@ -487,6 +487,11 @@ 显示语言版本的允许值,指定语言版本,如“最新”或“预览” + + Specify included optimization information, the default is file. Important for distributed libraries. + Specify included optimization information, the default is file. Important for distributed libraries. + + The pdb output file name cannot match the build output filename use --pdb:filename.pdb The pdb output file name cannot match the build output filename use --pdb:filename.pdb @@ -507,11 +512,26 @@ Disable implicit generation of constructs using reflection + + Include F# interface information, the default is file. Essential for distributing libraries. + Include F# interface information, the default is file. Essential for distributing libraries. + + Supported language versions: 支持的语言版本: + + Invalid value '{0}' for --optimizationdata, valid value are: none, file, compress. + Invalid value '{0}' for --optimizationdata, valid value are: none, file, compress. + + + + Invalid value '{0}' for --interfacedata, valid value are: none, file, compress." + Invalid value '{0}' for --interfacedata, valid value are: none, file, compress." + + Unrecognized value '{0}' for --langversion use --langversion:? for complete list --langversion 的值“{0}”无法识别,使用 --langversion:? 获取完整列表。 diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf index dd69d33f792..a26023d8585 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf @@ -487,6 +487,11 @@ 顯示語言版本允許的值,指定 'latest' 或 'preview' 等語言版本 + + Specify included optimization information, the default is file. Important for distributed libraries. + Specify included optimization information, the default is file. Important for distributed libraries. + + The pdb output file name cannot match the build output filename use --pdb:filename.pdb The pdb output file name cannot match the build output filename use --pdb:filename.pdb @@ -507,11 +512,26 @@ Disable implicit generation of constructs using reflection + + Include F# interface information, the default is file. Essential for distributing libraries. + Include F# interface information, the default is file. Essential for distributing libraries. + + Supported language versions: 支援的語言版本: + + Invalid value '{0}' for --optimizationdata, valid value are: none, file, compress. + Invalid value '{0}' for --optimizationdata, valid value are: none, file, compress. + + + + Invalid value '{0}' for --interfacedata, valid value are: none, file, compress." + Invalid value '{0}' for --interfacedata, valid value are: none, file, compress." + + Unrecognized value '{0}' for --langversion use --langversion:? for complete list 對 --langversion 為無法識別的值 '{0}',對完整清單使用 --langversion:? diff --git a/src/FSharp.Build/FSharp.Build.fsproj b/src/FSharp.Build/FSharp.Build.fsproj index 9bfe2497b45..41526fe6904 100644 --- a/src/FSharp.Build/FSharp.Build.fsproj +++ b/src/FSharp.Build/FSharp.Build.fsproj @@ -18,6 +18,12 @@ Debug;Release;Proto + + + compress + compress + + diff --git a/src/FSharp.Compiler.Interactive.Settings/FSharp.Compiler.Interactive.Settings.fsproj b/src/FSharp.Compiler.Interactive.Settings/FSharp.Compiler.Interactive.Settings.fsproj index e8561e03080..bc983a8a51d 100644 --- a/src/FSharp.Compiler.Interactive.Settings/FSharp.Compiler.Interactive.Settings.fsproj +++ b/src/FSharp.Compiler.Interactive.Settings/FSharp.Compiler.Interactive.Settings.fsproj @@ -9,6 +9,12 @@ true + + + compress + compress + + diff --git a/src/FSharp.Compiler.Server.Shared/FSharp.Compiler.Server.Shared.fsproj b/src/FSharp.Compiler.Server.Shared/FSharp.Compiler.Server.Shared.fsproj index b2c7d204445..8bc9c65373f 100644 --- a/src/FSharp.Compiler.Server.Shared/FSharp.Compiler.Server.Shared.fsproj +++ b/src/FSharp.Compiler.Server.Shared/FSharp.Compiler.Server.Shared.fsproj @@ -8,6 +8,12 @@ true + + + none + none + + diff --git a/src/FSharp.Core/FSharp.Core.fsproj b/src/FSharp.Core/FSharp.Core.fsproj index 2059fcc6096..33c7b0b861f 100644 --- a/src/FSharp.Core/FSharp.Core.fsproj +++ b/src/FSharp.Core/FSharp.Core.fsproj @@ -39,6 +39,12 @@ Debug;Release;Proto + + + file + file + + true diff --git a/src/FSharp.DependencyManager.Nuget/FSharp.DependencyManager.Nuget.fsproj b/src/FSharp.DependencyManager.Nuget/FSharp.DependencyManager.Nuget.fsproj index 8bf96070658..12a352a6434 100644 --- a/src/FSharp.DependencyManager.Nuget/FSharp.DependencyManager.Nuget.fsproj +++ b/src/FSharp.DependencyManager.Nuget/FSharp.DependencyManager.Nuget.fsproj @@ -12,6 +12,12 @@ true + + + compress + compress + + $(BaseOutputPath)\$(Configuration)\$(TargetFramework) diff --git a/src/fsc/fsc.targets b/src/fsc/fsc.targets index 9e4e4e48067..7dfc3d82a91 100644 --- a/src/fsc/fsc.targets +++ b/src/fsc/fsc.targets @@ -20,6 +20,12 @@ false + + + none + none + + diff --git a/src/fsi/fsi.targets b/src/fsi/fsi.targets index 6b6e89dc6f4..208e9ff19b4 100644 --- a/src/fsi/fsi.targets +++ b/src/fsi/fsi.targets @@ -24,6 +24,12 @@ $(DefineConstants);FSI_SHADOW_COPY_REFERENCES;FSI_SERVER + + + none + none + + diff --git a/tests/FSharp.Test.Utilities/FSharp.Test.Utilities.fsproj b/tests/FSharp.Test.Utilities/FSharp.Test.Utilities.fsproj index f9c57fa0386..4f88cb393bb 100644 --- a/tests/FSharp.Test.Utilities/FSharp.Test.Utilities.fsproj +++ b/tests/FSharp.Test.Utilities/FSharp.Test.Utilities.fsproj @@ -53,6 +53,7 @@ + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/tests/FSharp.Test.Utilities/TestFramework.fs b/tests/FSharp.Test.Utilities/TestFramework.fs index 34c5cb5beaf..ffaf1a5f925 100644 --- a/tests/FSharp.Test.Utilities/TestFramework.fs +++ b/tests/FSharp.Test.Utilities/TestFramework.fs @@ -44,6 +44,7 @@ module Commands = let executeProcess pathToExe arguments workingDir (timeout:int) = match pathToExe with | Some path -> + let commandLine = ResizeArray() let errorsList = ResizeArray() let outputList = ResizeArray() let mutable errorslock = obj @@ -56,6 +57,9 @@ module Commands = if not (isNull message) then lock errorslock (fun () -> errorsList.Add(message)) + commandLine.Add $"cd {workingDir}" + commandLine.Add $"{path} {arguments} /bl" + let psi = ProcessStartInfo() psi.FileName <- path psi.WorkingDirectory <- workingDir @@ -94,6 +98,7 @@ module Commands = workingDir lock gate (fun () -> + File.WriteAllLines(Path.Combine(workingDir', "commandline.txt"), commandLine) File.WriteAllLines(Path.Combine(workingDir', "StandardOutput.txt"), outputList) File.WriteAllLines(Path.Combine(workingDir', "StandardError.txt"), errorsList) ) @@ -225,6 +230,7 @@ type TestConfig = FSIANYCPU : string FSCANYCPU : string #endif + DOTNETFSCCOMPILERPATH : string FSI_FOR_SCRIPTS : string FSharpBuild : string FSharpCompilerInteractiveSettings : string @@ -293,14 +299,15 @@ let config configurationName envVars = let fsharpCoreArchitecture = "netstandard2.0" let fsharpBuildArchitecture = "netstandard2.0" let fsharpCompilerInteractiveSettingsArchitecture = "netstandard2.0" + let dotnetArchitecture = "net7.0" #if NET472 let fscArchitecture = "net472" let fsiArchitecture = "net472" let peverifyArchitecture = "net472" #else - let fscArchitecture = "net7.0" - let fsiArchitecture = "net7.0" - let peverifyArchitecture = "net7.0" + let fscArchitecture = dotnetArchitecture + let fsiArchitecture = dotnetArchitecture + let peverifyArchitecture = dotnetArchitecture #endif let repoRoot = SCRIPT_ROOT ++ ".." ++ ".." let artifactsPath = repoRoot ++ "artifacts" @@ -350,7 +357,7 @@ let config configurationName envVars = let FSC = requireArtifact ("fsc" ++ configurationName ++ fscArchitecture ++ "fsc.dll") #endif let FSCOREDLLPATH = requireArtifact ("FSharp.Core" ++ configurationName ++ fsharpCoreArchitecture ++ "FSharp.Core.dll") - + let DOTNETFSCCOMPILERPATH = requireArtifact ("fsc" ++ configurationName ++ dotnetArchitecture ++ "fsc.dll") let defaultPlatform = match Is64BitOperatingSystem with // | PlatformID.MacOSX, true -> "osx.10.10-x64" @@ -372,6 +379,7 @@ let config configurationName envVars = FSCANYCPU = FSCANYCPU FSIANYCPU = FSIANYCPU #endif + DOTNETFSCCOMPILERPATH = DOTNETFSCCOMPILERPATH FSI_FOR_SCRIPTS = FSI_FOR_SCRIPTS FSharpBuild = FSharpBuild FSharpCompilerInteractiveSettings = FSharpCompilerInteractiveSettings diff --git a/tests/FSharp.Test.Utilities/Utilities.fs b/tests/FSharp.Test.Utilities/Utilities.fs index f74faf49fa9..96b8e352e5a 100644 --- a/tests/FSharp.Test.Utilities/Utilities.fs +++ b/tests/FSharp.Test.Utilities/Utilities.fs @@ -120,6 +120,7 @@ module Utilities = $TARGETFRAMEWORK true true + $DOTNETFSCCOMPILERPATH @@ -170,6 +171,7 @@ let main argv = 0""" let pathToTemp = Path.Combine(pathToArtifacts, "Temp") let projectDirectory = Path.Combine(pathToTemp,Guid.NewGuid().ToString() + ".tmp") let pathToFSharpCore = typeof.Assembly.Location + let dotNetFscCompilerPath = config.DOTNETFSCCOMPILERPATH try try Directory.CreateDirectory(projectDirectory) |> ignore @@ -179,9 +181,9 @@ let main argv = 0""" let directoryBuildTargetsFileName = Path.Combine(projectDirectory, "Directory.Build.targets") let frameworkReferencesFileName = Path.Combine(projectDirectory, "FrameworkReferences.txt") #if NETCOREAPP - File.WriteAllText(projectFileName, projectFile.Replace("$TARGETFRAMEWORK", "net7.0").Replace("$FSHARPCORELOCATION", pathToFSharpCore)) + File.WriteAllText(projectFileName, projectFile.Replace("$TARGETFRAMEWORK", "net7.0").Replace("$FSHARPCORELOCATION", pathToFSharpCore).Replace("$DOTNETFSCCOMPILERPATH", dotNetFscCompilerPath)) #else - File.WriteAllText(projectFileName, projectFile.Replace("$TARGETFRAMEWORK", "net472").Replace("$FSHARPCORELOCATION", pathToFSharpCore)) + File.WriteAllText(projectFileName, projectFile.Replace("$TARGETFRAMEWORK", "net472").Replace("$FSHARPCORELOCATION", pathToFSharpCore).Replace("$DOTNETFSCCOMPILERPATH", dotNetFscCompilerPath)) #endif File.WriteAllText(programFsFileName, programFs) File.WriteAllText(directoryBuildPropsFileName, directoryBuildProps) diff --git a/tests/fsharpqa/Source/CompilerOptions/fsc/dumpAllCommandLineOptions/dummy.fs b/tests/fsharpqa/Source/CompilerOptions/fsc/dumpAllCommandLineOptions/dummy.fs index 7b2bcd451e1..7ee16f93aef 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsc/dumpAllCommandLineOptions/dummy.fs +++ b/tests/fsharpqa/Source/CompilerOptions/fsc/dumpAllCommandLineOptions/dummy.fs @@ -8,8 +8,8 @@ //section='- OUTPUT FILES - ' ! option=doc kind=OptionString //section='- OUTPUT FILES - ' ! option=keyfile kind=OptionString //section='- OUTPUT FILES - ' ! option=platform kind=OptionString -//section='- OUTPUT FILES - ' ! option=nooptimizationdata kind=OptionUnit -//section='- OUTPUT FILES - ' ! option=nointerfacedata kind=OptionUnit +//section='- OUTPUT FILES - ' ! option=optimizationdata kind=OptionString +//section='- OUTPUT FILES - ' ! option=interfacedata kind=OptionString //section='- OUTPUT FILES - ' ! option=sig kind=OptionString //section='- INPUT FILES - ' ! option=reference kind=OptionString //section='- RESOURCES - ' ! option=win32res kind=OptionString diff --git a/tests/fsharpqa/Source/CompilerOptions/fsc/dumpAllCommandLineOptions/dummy.fsx b/tests/fsharpqa/Source/CompilerOptions/fsc/dumpAllCommandLineOptions/dummy.fsx index 2f22ee0d2a0..eee657d68b9 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsc/dumpAllCommandLineOptions/dummy.fsx +++ b/tests/fsharpqa/Source/CompilerOptions/fsc/dumpAllCommandLineOptions/dummy.fsx @@ -109,8 +109,8 @@ //section='- OUTPUT FILES - ' ! option=doc kind=OptionString //section='- OUTPUT FILES - ' ! option=keyfile kind=OptionString //section='- OUTPUT FILES - ' ! option=platform kind=OptionString -//section='- OUTPUT FILES - ' ! option=nooptimizationdata kind=OptionUnit -//section='- OUTPUT FILES - ' ! option=nointerfacedata kind=OptionUnit +//section='- OUTPUT FILES - ' ! option=optimizationdata kind=OptionString +//section='- OUTPUT FILES - ' ! option=interfacedata kind=OptionString //section='- OUTPUT FILES - ' ! option=sig kind=OptionString //section='- RESOURCES - ' ! option=win32res kind=OptionString //section='- RESOURCES - ' ! option=win32manifest kind=OptionString diff --git a/tests/fsharpqa/Source/CompilerOptions/fsc/help/help40.437.1033.bsl b/tests/fsharpqa/Source/CompilerOptions/fsc/help/help40.437.1033.bsl index 885f49a5c64..9e9da6c5fc7 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsc/help/help40.437.1033.bsl +++ b/tests/fsharpqa/Source/CompilerOptions/fsc/help/help40.437.1033.bsl @@ -24,14 +24,12 @@ Copyright (c) Microsoft Corporation. All Rights Reserved. run on: x86, x64, Arm, Arm64, Itanium, anycpu32bitpreferred, or anycpu. The default is anycpu. ---nooptimizationdata Only include optimization - information essential for - implementing inlined constructs. - Inhibits cross-module inlining but - improves binary compatibility. ---nointerfacedata Don't add a resource to the - generated assembly containing - F#-specific metadata +--optimizationdata:{none|compress|file} Specify included optimization + information, the default is file. + Important for distributed libraries. +--interfacedata:{none|compress|file} Include F# interface information, + the default is file. Essential for + distributing libraries. --sig: Print the inferred interface of the assembly to a file --allsigs Print the inferred interfaces of all From cf9a87d5f81362a3012b2964d6ffe3cc43fa98a1 Mon Sep 17 00:00:00 2001 From: Kevin Ransom Date: Mon, 22 Aug 2022 21:06:25 -0700 Subject: [PATCH 2/7] tests+xlf --- src/Compiler/Driver/CompilerConfig.fs | 3 ++ src/Compiler/Driver/CompilerConfig.fsi | 4 +++ src/Compiler/Driver/CompilerImports.fs | 28 +++++++++---------- src/Compiler/Driver/CompilerOptions.fs | 8 ++++++ src/Compiler/FSComp.txt | 1 + src/Compiler/xlf/FSComp.txt.cs.xlf | 5 ++++ src/Compiler/xlf/FSComp.txt.de.xlf | 5 ++++ src/Compiler/xlf/FSComp.txt.es.xlf | 5 ++++ src/Compiler/xlf/FSComp.txt.fr.xlf | 5 ++++ src/Compiler/xlf/FSComp.txt.it.xlf | 5 ++++ src/Compiler/xlf/FSComp.txt.ja.xlf | 5 ++++ src/Compiler/xlf/FSComp.txt.ko.xlf | 5 ++++ src/Compiler/xlf/FSComp.txt.pl.xlf | 5 ++++ src/Compiler/xlf/FSComp.txt.pt-BR.xlf | 5 ++++ src/Compiler/xlf/FSComp.txt.ru.xlf | 5 ++++ src/Compiler/xlf/FSComp.txt.tr.xlf | 5 ++++ src/Compiler/xlf/FSComp.txt.zh-Hans.xlf | 5 ++++ src/Compiler/xlf/FSComp.txt.zh-Hant.xlf | 5 ++++ src/FSharp.Build/Fsc.fs | 21 ++++++++++++++ .../fsc/dumpAllCommandLineOptions/dummy.fs | 5 ++-- .../fsc/dumpAllCommandLineOptions/dummy.fsx | 5 ++-- .../fsc/help/help40.437.1033.bsl | 16 +++++++---- 22 files changed, 131 insertions(+), 25 deletions(-) diff --git a/src/Compiler/Driver/CompilerConfig.fs b/src/Compiler/Driver/CompilerConfig.fs index 38c67e917f6..7a957b722da 100644 --- a/src/Compiler/Driver/CompilerConfig.fs +++ b/src/Compiler/Driver/CompilerConfig.fs @@ -458,6 +458,7 @@ type TcConfigBuilder = mutable metadataVersion: string option mutable standalone: bool mutable extraStaticLinkRoots: string list + mutable compressMetadata: bool mutable noSignatureData: bool mutable onlyEssentialOptimizationData: bool mutable useOptimizationDataFile: bool @@ -682,6 +683,7 @@ type TcConfigBuilder = metadataVersion = None standalone = false extraStaticLinkRoots = [] + compressMetadata = false noSignatureData = false onlyEssentialOptimizationData = false useOptimizationDataFile = false @@ -1230,6 +1232,7 @@ type TcConfig private (data: TcConfigBuilder, validate: bool) = member _.metadataVersion = data.metadataVersion member _.standalone = data.standalone member _.extraStaticLinkRoots = data.extraStaticLinkRoots + member _.compressMetadata = data.compressMetadata member _.noSignatureData = data.noSignatureData member _.onlyEssentialOptimizationData = data.onlyEssentialOptimizationData member _.useOptimizationDataFile = data.useOptimizationDataFile diff --git a/src/Compiler/Driver/CompilerConfig.fsi b/src/Compiler/Driver/CompilerConfig.fsi index 0ac2d8a0e86..461298b5d60 100644 --- a/src/Compiler/Driver/CompilerConfig.fsi +++ b/src/Compiler/Driver/CompilerConfig.fsi @@ -331,6 +331,8 @@ type TcConfigBuilder = mutable extraStaticLinkRoots: string list + mutable compressMetadata: bool + mutable noSignatureData: bool mutable onlyEssentialOptimizationData: bool @@ -647,6 +649,8 @@ type TcConfig = member extraStaticLinkRoots: string list + member compressMetadata: bool + member noSignatureData: bool member onlyEssentialOptimizationData: bool diff --git a/src/Compiler/Driver/CompilerImports.fs b/src/Compiler/Driver/CompilerImports.fs index 148ea22f129..a7a9499dd20 100644 --- a/src/Compiler/Driver/CompilerImports.fs +++ b/src/Compiler/Driver/CompilerImports.fs @@ -154,13 +154,12 @@ let WriteSignatureData (tcConfig: TcConfig, tcGlobals, exportRemapping, ccu: Ccu // For historical reasons, we use a different resource name for FSharp.Core, so older F# compilers // don't complain when they see the resource. let rName, compress = - match tcConfig.signatureData with - | SignatureDataOptions.Compress -> FSharpSignatureCompressDataResourceName, true - | _ -> - if ccu.AssemblyName = getFSharpCoreLibraryName then - FSharpSignatureDataResourceName2, false - else - FSharpSignatureDataResourceName, false + if tcConfig.compressMetadata then + FSharpSignatureCompressDataResourceName, true + elif ccu.AssemblyName = getFSharpCoreLibraryName then + FSharpSignatureDataResourceName2, false + else + FSharpSignatureDataResourceName, false let includeDir = if String.IsNullOrEmpty tcConfig.implicitIncludeDir then @@ -191,13 +190,12 @@ let WriteOptimizationData (tcConfig: TcConfig, tcGlobals, fileName, inMem, ccu: // For historical reasons, we use a different resource name for FSharp.Core, so older F# compilers // don't complain when they see the resource. let rName, compress = - match tcConfig.optimizationData with - | OptimizationDataOptions.Compress -> FSharpOptimizationCompressDataResourceName, true - | _ -> - if ccu.AssemblyName = getFSharpCoreLibraryName then - FSharpOptimizationDataResourceName2, false - else - FSharpOptimizationDataResourceName, false + if tcConfig.compressMetadata then + FSharpOptimizationCompressDataResourceName, true + elif ccu.AssemblyName = getFSharpCoreLibraryName then + FSharpOptimizationDataResourceName2, false + else + FSharpOptimizationDataResourceName, false PickleToResource inMem fileName tcGlobals compress ccu (rName + ccu.AssemblyName) Optimizer.p_CcuOptimizationInfo modulInfo @@ -220,7 +218,7 @@ let EncodeOptimizationData (tcGlobals, tcConfig: TcConfig, outfile, exportRemapp let data = map2Of2 (Optimizer.RemapOptimizationInfo tcGlobals exportRemapping) data let ccu, optData = - if tcConfig.optimizationData = OptimizationDataOptions.None then + if tcConfig.onlyEssentialOptimizationData then map2Of2 Optimizer.AbstractOptimizationInfoToEssentials data else data diff --git a/src/Compiler/Driver/CompilerOptions.fs b/src/Compiler/Driver/CompilerOptions.fs index 7bbecb8916b..ea4c2f49bb2 100644 --- a/src/Compiler/Driver/CompilerOptions.fs +++ b/src/Compiler/Driver/CompilerOptions.fs @@ -922,6 +922,14 @@ let outputFileFlagsFsc (tcConfigB: TcConfigBuilder) = Some(FSComp.SR.optsPlatform ()) ) + CompilerOption( + "compressmetadata", + tagNone, + OptionUnit(fun () -> tcConfigB.compressMetadata <- false), + None, + Some(FSComp.SR.optsCompressMetadata ()) + ) + CompilerOption( "nooptimizationdata", tagNone, diff --git a/src/Compiler/FSComp.txt b/src/Compiler/FSComp.txt index 7106d8a5e62..4e6eec610f9 100644 --- a/src/Compiler/FSComp.txt +++ b/src/Compiler/FSComp.txt @@ -847,6 +847,7 @@ optsPublicSign,"Public-sign the assembly using only the public portion of the st optsWriteXml,"Write the xmldoc of the assembly to the given file" optsStrongKeyFile,"Specify a strong name key file" optsStrongKeyContainer,"Specify a strong name key container" +optsCompressMetadata,"Compress interface and optimization data files" optsPlatform,"Limit which platforms this code can run on: x86, x64, Arm, Arm64, Itanium, anycpu32bitpreferred, or anycpu. The default is anycpu." optsNoOpt,"Only include optimization information essential for implementing inlined constructs. Inhibits cross-module inlining but improves binary compatibility." optsNoInterface,"Don't add a resource to the generated assembly containing F#-specific metadata" diff --git a/src/Compiler/xlf/FSComp.txt.cs.xlf b/src/Compiler/xlf/FSComp.txt.cs.xlf index 8d9ad147d8e..ff2bd508550 100644 --- a/src/Compiler/xlf/FSComp.txt.cs.xlf +++ b/src/Compiler/xlf/FSComp.txt.cs.xlf @@ -472,6 +472,11 @@ Vymazat mezipaměť výsledků správce balíčků + + Compress interface and optimization data files + Compress interface and optimization data files + + Invalid use of emitting a reference assembly, do not use '--staticlink', or '--refonly' and '--refout' together. Neplatné použití generování referenčního sestavení, nepoužívejte --staticlink ani --refonly a --refout společně. diff --git a/src/Compiler/xlf/FSComp.txt.de.xlf b/src/Compiler/xlf/FSComp.txt.de.xlf index dc5964e68dd..3067a772651 100644 --- a/src/Compiler/xlf/FSComp.txt.de.xlf +++ b/src/Compiler/xlf/FSComp.txt.de.xlf @@ -472,6 +472,11 @@ Löschen Sie den Ergebniscache des Paketmanagers + + Compress interface and optimization data files + Compress interface and optimization data files + + Invalid use of emitting a reference assembly, do not use '--staticlink', or '--refonly' and '--refout' together. Ungültige Verwendung der Ausgabe einer Referenzassembly. Verwenden Sie nicht "--staticlink" oder "--refonly" und "--refout" zusammen. diff --git a/src/Compiler/xlf/FSComp.txt.es.xlf b/src/Compiler/xlf/FSComp.txt.es.xlf index 07b31404551..c2456360c25 100644 --- a/src/Compiler/xlf/FSComp.txt.es.xlf +++ b/src/Compiler/xlf/FSComp.txt.es.xlf @@ -472,6 +472,11 @@ Borrar la caché de resultados del administrador de paquetes + + Compress interface and optimization data files + Compress interface and optimization data files + + Invalid use of emitting a reference assembly, do not use '--staticlink', or '--refonly' and '--refout' together. Uso no válido de emitir un ensamblado de referencia, no use "--staticlink', or '--refonly' and '--refout" de forma conjunta. diff --git a/src/Compiler/xlf/FSComp.txt.fr.xlf b/src/Compiler/xlf/FSComp.txt.fr.xlf index f8a334479dd..a238ba0136f 100644 --- a/src/Compiler/xlf/FSComp.txt.fr.xlf +++ b/src/Compiler/xlf/FSComp.txt.fr.xlf @@ -472,6 +472,11 @@ Effacer le cache des résultats du Gestionnaire de package + + Compress interface and optimization data files + Compress interface and optimization data files + + Invalid use of emitting a reference assembly, do not use '--staticlink', or '--refonly' and '--refout' together. Utilisation non valide de l’émission d’un assembly de référence. N’utilisez pas '--staticlink' ni '--refonly' et '--refout' ensemble. diff --git a/src/Compiler/xlf/FSComp.txt.it.xlf b/src/Compiler/xlf/FSComp.txt.it.xlf index 1f6e7595ae4..a7cc725c625 100644 --- a/src/Compiler/xlf/FSComp.txt.it.xlf +++ b/src/Compiler/xlf/FSComp.txt.it.xlf @@ -472,6 +472,11 @@ Cancellare la cache dei risultati di Gestione pacchetti + + Compress interface and optimization data files + Compress interface and optimization data files + + Invalid use of emitting a reference assembly, do not use '--staticlink', or '--refonly' and '--refout' together. Utilizzo non valido della creazione di un assembly di riferimento. Non usare insieme '--staticlink' o '--refonly' e '--refout'. diff --git a/src/Compiler/xlf/FSComp.txt.ja.xlf b/src/Compiler/xlf/FSComp.txt.ja.xlf index 32b6ae3efd0..5b49c4bd125 100644 --- a/src/Compiler/xlf/FSComp.txt.ja.xlf +++ b/src/Compiler/xlf/FSComp.txt.ja.xlf @@ -472,6 +472,11 @@ パッケージ マネージャーの結果キャッシュをクリアする + + Compress interface and optimization data files + Compress interface and optimization data files + + Invalid use of emitting a reference assembly, do not use '--staticlink', or '--refonly' and '--refout' together. 参照アセンブリの生成の使用が無効です。'--staticlink'、または '--refonly' と '--refout' を同時に使用しないでください。 diff --git a/src/Compiler/xlf/FSComp.txt.ko.xlf b/src/Compiler/xlf/FSComp.txt.ko.xlf index ca89fd5d341..e3d5a493923 100644 --- a/src/Compiler/xlf/FSComp.txt.ko.xlf +++ b/src/Compiler/xlf/FSComp.txt.ko.xlf @@ -472,6 +472,11 @@ 패키지 관리자 결과 캐시 지우기 + + Compress interface and optimization data files + Compress interface and optimization data files + + Invalid use of emitting a reference assembly, do not use '--staticlink', or '--refonly' and '--refout' together. 참조 어셈블리 내보내기를 잘못 사용했습니다. '--staticlink' 또는 '--refonly' 및 '--refout'을 함께 사용하지 마세요. diff --git a/src/Compiler/xlf/FSComp.txt.pl.xlf b/src/Compiler/xlf/FSComp.txt.pl.xlf index 5e6c726403e..3b02a48f812 100644 --- a/src/Compiler/xlf/FSComp.txt.pl.xlf +++ b/src/Compiler/xlf/FSComp.txt.pl.xlf @@ -472,6 +472,11 @@ Wyczyść pamięć podręczną wyników menedżera pakietów + + Compress interface and optimization data files + Compress interface and optimization data files + + Invalid use of emitting a reference assembly, do not use '--staticlink', or '--refonly' and '--refout' together. Nieprawidłowe użycie emitowania zestawu odwołania, nie używaj razem elementów „--staticlink” ani „--refonly” i „--refout”. diff --git a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf index 1bc30be257b..ddc53052a3e 100644 --- a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf +++ b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf @@ -472,6 +472,11 @@ Limpar o cache de resultados do gerenciador de pacotes + + Compress interface and optimization data files + Compress interface and optimization data files + + Invalid use of emitting a reference assembly, do not use '--staticlink', or '--refonly' and '--refout' together. Uso inválido de emitir um assembly de referência, não use '--staticlink' ou '--reutilly' e '--refout' juntos. diff --git a/src/Compiler/xlf/FSComp.txt.ru.xlf b/src/Compiler/xlf/FSComp.txt.ru.xlf index 196b3c0cf10..a87376fa075 100644 --- a/src/Compiler/xlf/FSComp.txt.ru.xlf +++ b/src/Compiler/xlf/FSComp.txt.ru.xlf @@ -472,6 +472,11 @@ Очистка кэша результатов диспетчера пакетов + + Compress interface and optimization data files + Compress interface and optimization data files + + Invalid use of emitting a reference assembly, do not use '--staticlink', or '--refonly' and '--refout' together. Недопустимое использование при создании базовой сборки. Не используйте "--staticlink" или "--refonly" и "--refout" вместе. diff --git a/src/Compiler/xlf/FSComp.txt.tr.xlf b/src/Compiler/xlf/FSComp.txt.tr.xlf index 8a8faefcde1..88856174155 100644 --- a/src/Compiler/xlf/FSComp.txt.tr.xlf +++ b/src/Compiler/xlf/FSComp.txt.tr.xlf @@ -472,6 +472,11 @@ Paket yöneticisi sonuçları önbelleğini temizle + + Compress interface and optimization data files + Compress interface and optimization data files + + Invalid use of emitting a reference assembly, do not use '--staticlink', or '--refonly' and '--refout' together. Başvuru bütünleştirilmiş kodunun oluşturulması için geçersiz kullanım: '--staticlink' veya '--refonly' ile '--refout' birlikte kullanılmaz. diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf index 656b1508114..d45f95ac8bc 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf @@ -472,6 +472,11 @@ 清除包管理器结果缓存 + + Compress interface and optimization data files + Compress interface and optimization data files + + Invalid use of emitting a reference assembly, do not use '--staticlink', or '--refonly' and '--refout' together. 发出引用程序集的使用无效,请勿同时使用“--staticlink”或“--refonly”和“--refout”。 diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf index a26023d8585..981d2f170aa 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf @@ -472,6 +472,11 @@ 清除封裝管理員結果快取 + + Compress interface and optimization data files + Compress interface and optimization data files + + Invalid use of emitting a reference assembly, do not use '--staticlink', or '--refonly' and '--refout' together. 發出參考組件的使用無效,請勿同時使用 '--staticlink' 或 '--refonly' 和 '--refout'。 diff --git a/src/FSharp.Build/Fsc.fs b/src/FSharp.Build/Fsc.fs index 909354e83e7..805a3c31a81 100644 --- a/src/FSharp.Build/Fsc.fs +++ b/src/FSharp.Build/Fsc.fs @@ -27,6 +27,7 @@ type public Fsc() as this = let mutable codePage: string MaybeNull = null let mutable commandLineArgs: ITaskItem list = [] let mutable compilerTools: ITaskItem[] = [||] + let mutable compressMetadata = false let mutable debugSymbols = false let mutable debugType: string MaybeNull = null let mutable defineConstants: ITaskItem[] = [||] @@ -42,6 +43,8 @@ type public Fsc() as this = let mutable keyFile: string MaybeNull = null let mutable langVersion: string MaybeNull = null let mutable noFramework = false + let mutable noInterfaceData = false + let mutable noOptimizationData = false let mutable optimize: bool = true let mutable otherFlags: string MaybeNull = null let mutable outputAssembly: string MaybeNull = null @@ -151,6 +154,14 @@ type public Fsc() as this = if noFramework then builder.AppendSwitch("--noframework") + // NoInterfaceData + if noInterfaceData then + builder.AppendSwitch("--noInterfaceData") + + // NoOptimizationData + if noOptimizationData then + builder.AppendSwitch("--noOptimizationData") + // BaseAddress builder.AppendSwitchIfNotNull("--baseaddress:", baseAddress) @@ -438,6 +449,16 @@ type public Fsc() as this = with get () = noFramework and set (b) = noFramework <- b + // --nointerfacedata + member _.NoInterfaceDataData + with get () = noInterfaceData + and set (b) = noInterfaceData <- b + + // --nooptimizationdata + member _.NoOptimizationData + with get () = noOptimizationData + and set (b) = noOptimizationData <- b + // --optimize member _.Optimize with get () = optimize diff --git a/tests/fsharpqa/Source/CompilerOptions/fsc/dumpAllCommandLineOptions/dummy.fs b/tests/fsharpqa/Source/CompilerOptions/fsc/dumpAllCommandLineOptions/dummy.fs index 7ee16f93aef..104eb8e2166 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsc/dumpAllCommandLineOptions/dummy.fs +++ b/tests/fsharpqa/Source/CompilerOptions/fsc/dumpAllCommandLineOptions/dummy.fs @@ -8,8 +8,9 @@ //section='- OUTPUT FILES - ' ! option=doc kind=OptionString //section='- OUTPUT FILES - ' ! option=keyfile kind=OptionString //section='- OUTPUT FILES - ' ! option=platform kind=OptionString -//section='- OUTPUT FILES - ' ! option=optimizationdata kind=OptionString -//section='- OUTPUT FILES - ' ! option=interfacedata kind=OptionString +//section='- OUTPUT FILES - ' ! option=compressmetadata kind=OptionUnit +//section='- OUTPUT FILES - ' ! option=nooptimizationdata kind=OptionUnit +//section='- OUTPUT FILES - ' ! option=nointerfacedata kind=OptionUnit //section='- OUTPUT FILES - ' ! option=sig kind=OptionString //section='- INPUT FILES - ' ! option=reference kind=OptionString //section='- RESOURCES - ' ! option=win32res kind=OptionString diff --git a/tests/fsharpqa/Source/CompilerOptions/fsc/dumpAllCommandLineOptions/dummy.fsx b/tests/fsharpqa/Source/CompilerOptions/fsc/dumpAllCommandLineOptions/dummy.fsx index eee657d68b9..45ec1d3da2a 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsc/dumpAllCommandLineOptions/dummy.fsx +++ b/tests/fsharpqa/Source/CompilerOptions/fsc/dumpAllCommandLineOptions/dummy.fsx @@ -109,8 +109,9 @@ //section='- OUTPUT FILES - ' ! option=doc kind=OptionString //section='- OUTPUT FILES - ' ! option=keyfile kind=OptionString //section='- OUTPUT FILES - ' ! option=platform kind=OptionString -//section='- OUTPUT FILES - ' ! option=optimizationdata kind=OptionString -//section='- OUTPUT FILES - ' ! option=interfacedata kind=OptionString +//section='- OUTPUT FILES - ' ! option=compressmetadata kind=OptionUnit +//section='- OUTPUT FILES - ' ! option=nooptimizationdata kind=OptionUnit +//section='- OUTPUT FILES - ' ! option=nointerfacedata kind=OptionUnit //section='- OUTPUT FILES - ' ! option=sig kind=OptionString //section='- RESOURCES - ' ! option=win32res kind=OptionString //section='- RESOURCES - ' ! option=win32manifest kind=OptionString diff --git a/tests/fsharpqa/Source/CompilerOptions/fsc/help/help40.437.1033.bsl b/tests/fsharpqa/Source/CompilerOptions/fsc/help/help40.437.1033.bsl index 9e9da6c5fc7..4889e4a2c34 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsc/help/help40.437.1033.bsl +++ b/tests/fsharpqa/Source/CompilerOptions/fsc/help/help40.437.1033.bsl @@ -24,12 +24,16 @@ Copyright (c) Microsoft Corporation. All Rights Reserved. run on: x86, x64, Arm, Arm64, Itanium, anycpu32bitpreferred, or anycpu. The default is anycpu. ---optimizationdata:{none|compress|file} Specify included optimization - information, the default is file. - Important for distributed libraries. ---interfacedata:{none|compress|file} Include F# interface information, - the default is file. Essential for - distributing libraries. +--compressmetadata Compress interface and optimization + data files +--nooptimizationdata Only include optimization + information essential for + implementing inlined constructs. + Inhibits cross-module inlining but + improves binary compatibility. +--nointerfacedata Don't add a resource to the + generated assembly containing + F#-specific metadata --sig: Print the inferred interface of the assembly to a file --allsigs Print the inferred interfaces of all From 0b0078ea2072f6990fa15c1dc42435f914c47b11 Mon Sep 17 00:00:00 2001 From: KevinRansom Date: Tue, 23 Aug 2022 03:01:32 -0700 Subject: [PATCH 3/7] switches --- FSharpBuild.Directory.Build.props | 10 ++++------ src/Compiler/Driver/CompilerOptions.fs | 2 +- src/Compiler/FSharp.Compiler.Service.fsproj | 3 +-- src/FSharp.Build/FSharp.Build.fsproj | 3 +-- src/FSharp.Build/Fsc.fs | 15 ++++++++++++--- src/FSharp.Build/Microsoft.FSharp.Targets | 3 +++ .../FSharp.Compiler.Interactive.Settings.fsproj | 3 +-- .../FSharp.Compiler.Server.Shared.fsproj | 3 +-- src/FSharp.Core/FSharp.Core.fsproj | 3 +-- .../FSharp.DependencyManager.Nuget.fsproj | 3 +-- src/fsc/fsc.targets | 4 ++-- src/fsi/fsi.targets | 3 +-- 12 files changed, 29 insertions(+), 26 deletions(-) diff --git a/FSharpBuild.Directory.Build.props b/FSharpBuild.Directory.Build.props index d1dddc0e38d..dbfb1860320 100644 --- a/FSharpBuild.Directory.Build.props +++ b/FSharpBuild.Directory.Build.props @@ -83,16 +83,14 @@ $(DefineConstants);TESTING_ON_LINUX - - file - file - + + false + - compress - compress + true diff --git a/src/Compiler/Driver/CompilerOptions.fs b/src/Compiler/Driver/CompilerOptions.fs index ea4c2f49bb2..c4583b9a58c 100644 --- a/src/Compiler/Driver/CompilerOptions.fs +++ b/src/Compiler/Driver/CompilerOptions.fs @@ -925,7 +925,7 @@ let outputFileFlagsFsc (tcConfigB: TcConfigBuilder) = CompilerOption( "compressmetadata", tagNone, - OptionUnit(fun () -> tcConfigB.compressMetadata <- false), + OptionSwitch(fun switch -> tcConfigB.compressMetadata <- switch=OptionSwitch.On), None, Some(FSComp.SR.optsCompressMetadata ()) ) diff --git a/src/Compiler/FSharp.Compiler.Service.fsproj b/src/Compiler/FSharp.Compiler.Service.fsproj index e46205d9dac..b239d13f8a2 100644 --- a/src/Compiler/FSharp.Compiler.Service.fsproj +++ b/src/Compiler/FSharp.Compiler.Service.fsproj @@ -29,8 +29,7 @@ - compress - compress + true diff --git a/src/FSharp.Build/FSharp.Build.fsproj b/src/FSharp.Build/FSharp.Build.fsproj index 41526fe6904..1d2670fbc84 100644 --- a/src/FSharp.Build/FSharp.Build.fsproj +++ b/src/FSharp.Build/FSharp.Build.fsproj @@ -20,8 +20,7 @@ - compress - compress + true diff --git a/src/FSharp.Build/Fsc.fs b/src/FSharp.Build/Fsc.fs index 805a3c31a81..af7e16d13cc 100644 --- a/src/FSharp.Build/Fsc.fs +++ b/src/FSharp.Build/Fsc.fs @@ -156,15 +156,19 @@ type public Fsc() as this = // NoInterfaceData if noInterfaceData then - builder.AppendSwitch("--noInterfaceData") + builder.AppendSwitch("--nointerfacedata") // NoOptimizationData if noOptimizationData then - builder.AppendSwitch("--noOptimizationData") + builder.AppendSwitch("--nooptimizationdata") // BaseAddress builder.AppendSwitchIfNotNull("--baseaddress:", baseAddress) + // CompressMetadata + if compressMetadata then + builder.AppendSwitch("--compressmetadata") + // DefineConstants for item in defineConstants do builder.AppendSwitchIfNotNull("--define:", item.ItemSpec) @@ -369,6 +373,11 @@ type public Fsc() as this = with get () = compilerTools and set (a) = compilerTools <- a + // CompressMetadata + member _.CompressMetadata + with get () = compressMetadata + and set (v) = compressMetadata <- v + // -g: Produce debug file. Disables optimizations if a -O flag is not given. member _.DebugSymbols with get () = debugSymbols @@ -450,7 +459,7 @@ type public Fsc() as this = and set (b) = noFramework <- b // --nointerfacedata - member _.NoInterfaceDataData + member _.NoInterfaceData with get () = noInterfaceData and set (b) = noInterfaceData <- b diff --git a/src/FSharp.Build/Microsoft.FSharp.Targets b/src/FSharp.Build/Microsoft.FSharp.Targets index 26d9a170882..31bde3076ff 100644 --- a/src/FSharp.Build/Microsoft.FSharp.Targets +++ b/src/FSharp.Build/Microsoft.FSharp.Targets @@ -327,6 +327,7 @@ this file. ChecksumAlgorithm="$(PdbChecksumAlgorithm)" CodePage="$(CodePage)" CompilerTools="@(FscCompilerTools)" + CompressMetadata="$(CompressMetadata)" DebugSymbols="$(DebugSymbols)" DebugType="$(DebugType)" DefineConstants="$(DefineConstants)" @@ -343,6 +344,8 @@ this file. LangVersion="$(LangVersion)" LCID="$(LCID)" NoFramework="true" + NoInterfaceData="$(NoInterfaceData)" + NoOptimizationData="$(NoOptimizationData)" Optimize="$(Optimize)" ReflectionFree="$(ReflectionFree)" OtherFlags="$(FscOtherFlags)" diff --git a/src/FSharp.Compiler.Interactive.Settings/FSharp.Compiler.Interactive.Settings.fsproj b/src/FSharp.Compiler.Interactive.Settings/FSharp.Compiler.Interactive.Settings.fsproj index bc983a8a51d..12952536046 100644 --- a/src/FSharp.Compiler.Interactive.Settings/FSharp.Compiler.Interactive.Settings.fsproj +++ b/src/FSharp.Compiler.Interactive.Settings/FSharp.Compiler.Interactive.Settings.fsproj @@ -11,8 +11,7 @@ - compress - compress + true diff --git a/src/FSharp.Compiler.Server.Shared/FSharp.Compiler.Server.Shared.fsproj b/src/FSharp.Compiler.Server.Shared/FSharp.Compiler.Server.Shared.fsproj index 8bc9c65373f..d63c3ce02f9 100644 --- a/src/FSharp.Compiler.Server.Shared/FSharp.Compiler.Server.Shared.fsproj +++ b/src/FSharp.Compiler.Server.Shared/FSharp.Compiler.Server.Shared.fsproj @@ -10,8 +10,7 @@ - none - none + true diff --git a/src/FSharp.Core/FSharp.Core.fsproj b/src/FSharp.Core/FSharp.Core.fsproj index 33c7b0b861f..2c78bf6cfee 100644 --- a/src/FSharp.Core/FSharp.Core.fsproj +++ b/src/FSharp.Core/FSharp.Core.fsproj @@ -41,8 +41,7 @@ - file - file + true diff --git a/src/FSharp.DependencyManager.Nuget/FSharp.DependencyManager.Nuget.fsproj b/src/FSharp.DependencyManager.Nuget/FSharp.DependencyManager.Nuget.fsproj index 12a352a6434..2425866f41b 100644 --- a/src/FSharp.DependencyManager.Nuget/FSharp.DependencyManager.Nuget.fsproj +++ b/src/FSharp.DependencyManager.Nuget/FSharp.DependencyManager.Nuget.fsproj @@ -14,8 +14,7 @@ - compress - compress + true diff --git a/src/fsc/fsc.targets b/src/fsc/fsc.targets index 7dfc3d82a91..ee9688f53fa 100644 --- a/src/fsc/fsc.targets +++ b/src/fsc/fsc.targets @@ -22,8 +22,8 @@ - none - none + true + true diff --git a/src/fsi/fsi.targets b/src/fsi/fsi.targets index 208e9ff19b4..b66ca4b2241 100644 --- a/src/fsi/fsi.targets +++ b/src/fsi/fsi.targets @@ -26,8 +26,7 @@ - none - none + true From 7d60b096a3725e2bfd634a8e1dd71316485831de Mon Sep 17 00:00:00 2001 From: KevinRansom Date: Tue, 23 Aug 2022 03:15:09 -0700 Subject: [PATCH 4/7] reformat --- src/Compiler/Checking/CheckExpressions.fsi | 1 - src/Compiler/Driver/CompilerImports.fs | 8 ++------ src/Compiler/Driver/CompilerOptions.fs | 2 +- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/src/Compiler/Checking/CheckExpressions.fsi b/src/Compiler/Checking/CheckExpressions.fsi index 3b70a5caa1e..0bbaca89177 100644 --- a/src/Compiler/Checking/CheckExpressions.fsi +++ b/src/Compiler/Checking/CheckExpressions.fsi @@ -126,7 +126,6 @@ val TcFieldInit: range -> ILFieldInit -> Const val LightweightTcValForUsingInBuildMethodCall: g: TcGlobals -> vref: ValRef -> vrefFlags: ValUseFlag -> vrefTypeInst: TTypes -> m: range -> Expr * TType - /// Indicates whether a syntactic type is allowed to include new type variables /// not declared anywhere, e.g. `let f (x: 'T option) = x.Value` type ImplicitlyBoundTyparsAllowed = diff --git a/src/Compiler/Driver/CompilerImports.fs b/src/Compiler/Driver/CompilerImports.fs index a7a9499dd20..0006d271579 100644 --- a/src/Compiler/Driver/CompilerImports.fs +++ b/src/Compiler/Driver/CompilerImports.fs @@ -72,7 +72,7 @@ let decompressResource (r: ILResource) = ByteStorage.FromByteArray(decompressed.ToArray()).GetByteMemory() let GetResourceNameAndSignatureDataFunc (r: ILResource) = - let getResourceTypeAndName (r: ILResource) = + let resourceType, ccuName = if r.Name.StartsWithOrdinal FSharpSignatureDataResourceName then FSharpSignatureDataResourceName, String.dropPrefix r.Name FSharpSignatureDataResourceName elif r.Name.StartsWithOrdinal FSharpSignatureCompressDataResourceName then @@ -82,15 +82,13 @@ let GetResourceNameAndSignatureDataFunc (r: ILResource) = else failwith "GetSignatureDataResourceName" - let resourceType, ccuName = getResourceTypeAndName r - if resourceType = FSharpSignatureCompressDataResourceName then ccuName, (fun () -> decompressResource (r)) else ccuName, (fun () -> r.GetBytes()) let GetResourceNameAndOptimizationDataFunc (r: ILResource) = - let getResourceTypeAndName (r: ILResource) = + let resourceType, ccuName = if r.Name.StartsWithOrdinal FSharpOptimizationDataResourceName then FSharpOptimizationDataResourceName, String.dropPrefix r.Name FSharpOptimizationDataResourceName elif r.Name.StartsWithOrdinal FSharpOptimizationCompressDataResourceName then @@ -100,8 +98,6 @@ let GetResourceNameAndOptimizationDataFunc (r: ILResource) = else failwith "GetOptimizationDataResourceName" - let resourceType, ccuName = getResourceTypeAndName r - if resourceType = FSharpOptimizationCompressDataResourceName then ccuName, (fun () -> decompressResource (r)) else diff --git a/src/Compiler/Driver/CompilerOptions.fs b/src/Compiler/Driver/CompilerOptions.fs index c4583b9a58c..0eb19af39b6 100644 --- a/src/Compiler/Driver/CompilerOptions.fs +++ b/src/Compiler/Driver/CompilerOptions.fs @@ -925,7 +925,7 @@ let outputFileFlagsFsc (tcConfigB: TcConfigBuilder) = CompilerOption( "compressmetadata", tagNone, - OptionSwitch(fun switch -> tcConfigB.compressMetadata <- switch=OptionSwitch.On), + OptionSwitch(fun switch -> tcConfigB.compressMetadata <- switch = OptionSwitch.On), None, Some(FSComp.SR.optsCompressMetadata ()) ) From 22bf8c0aeb697c72048234e127172931e2864a7f Mon Sep 17 00:00:00 2001 From: KevinRansom Date: Tue, 23 Aug 2022 03:59:53 -0700 Subject: [PATCH 5/7] compressed + format --- src/Compiler/Driver/CompilerImports.fs | 20 ++++++++++---------- src/Compiler/SyntaxTree/PrettyNaming.fs | 6 ++++-- src/Compiler/SyntaxTree/PrettyNaming.fsi | 4 ++-- 3 files changed, 16 insertions(+), 14 deletions(-) diff --git a/src/Compiler/Driver/CompilerImports.fs b/src/Compiler/Driver/CompilerImports.fs index 0006d271579..61028362da3 100644 --- a/src/Compiler/Driver/CompilerImports.fs +++ b/src/Compiler/Driver/CompilerImports.fs @@ -55,12 +55,12 @@ let (++) x s = x @ [ s ] let IsSignatureDataResource (r: ILResource) = r.Name.StartsWithOrdinal FSharpSignatureDataResourceName - || r.Name.StartsWithOrdinal FSharpSignatureCompressDataResourceName + || r.Name.StartsWithOrdinal FSharpSignatureCompressedDataResourceName || r.Name.StartsWithOrdinal FSharpSignatureDataResourceName2 let IsOptimizationDataResource (r: ILResource) = r.Name.StartsWithOrdinal FSharpOptimizationDataResourceName - || r.Name.StartsWithOrdinal FSharpOptimizationCompressDataResourceName + || r.Name.StartsWithOrdinal FSharpOptimizationCompressedDataResourceName || r.Name.StartsWithOrdinal FSharpOptimizationDataResourceName2 let decompressResource (r: ILResource) = @@ -75,14 +75,14 @@ let GetResourceNameAndSignatureDataFunc (r: ILResource) = let resourceType, ccuName = if r.Name.StartsWithOrdinal FSharpSignatureDataResourceName then FSharpSignatureDataResourceName, String.dropPrefix r.Name FSharpSignatureDataResourceName - elif r.Name.StartsWithOrdinal FSharpSignatureCompressDataResourceName then - FSharpSignatureCompressDataResourceName, String.dropPrefix r.Name FSharpSignatureCompressDataResourceName + elif r.Name.StartsWithOrdinal FSharpSignatureCompressedDataResourceName then + FSharpSignatureCompressedDataResourceName, String.dropPrefix r.Name FSharpSignatureCompressedDataResourceName elif r.Name.StartsWithOrdinal FSharpSignatureDataResourceName2 then FSharpSignatureDataResourceName2, String.dropPrefix r.Name FSharpSignatureDataResourceName2 else failwith "GetSignatureDataResourceName" - if resourceType = FSharpSignatureCompressDataResourceName then + if resourceType = FSharpSignatureCompressedDataResourceName then ccuName, (fun () -> decompressResource (r)) else ccuName, (fun () -> r.GetBytes()) @@ -91,14 +91,14 @@ let GetResourceNameAndOptimizationDataFunc (r: ILResource) = let resourceType, ccuName = if r.Name.StartsWithOrdinal FSharpOptimizationDataResourceName then FSharpOptimizationDataResourceName, String.dropPrefix r.Name FSharpOptimizationDataResourceName - elif r.Name.StartsWithOrdinal FSharpOptimizationCompressDataResourceName then - FSharpOptimizationCompressDataResourceName, String.dropPrefix r.Name FSharpOptimizationCompressDataResourceName + elif r.Name.StartsWithOrdinal FSharpOptimizationCompressedDataResourceName then + FSharpOptimizationCompressedDataResourceName, String.dropPrefix r.Name FSharpOptimizationCompressedDataResourceName elif r.Name.StartsWithOrdinal FSharpOptimizationDataResourceName2 then FSharpOptimizationDataResourceName2, String.dropPrefix r.Name FSharpOptimizationDataResourceName2 else failwith "GetOptimizationDataResourceName" - if resourceType = FSharpOptimizationCompressDataResourceName then + if resourceType = FSharpOptimizationCompressedDataResourceName then ccuName, (fun () -> decompressResource (r)) else ccuName, (fun () -> r.GetBytes()) @@ -151,7 +151,7 @@ let WriteSignatureData (tcConfig: TcConfig, tcGlobals, exportRemapping, ccu: Ccu // don't complain when they see the resource. let rName, compress = if tcConfig.compressMetadata then - FSharpSignatureCompressDataResourceName, true + FSharpSignatureCompressedDataResourceName, true elif ccu.AssemblyName = getFSharpCoreLibraryName then FSharpSignatureDataResourceName2, false else @@ -187,7 +187,7 @@ let WriteOptimizationData (tcConfig: TcConfig, tcGlobals, fileName, inMem, ccu: // don't complain when they see the resource. let rName, compress = if tcConfig.compressMetadata then - FSharpOptimizationCompressDataResourceName, true + FSharpOptimizationCompressedDataResourceName, true elif ccu.AssemblyName = getFSharpCoreLibraryName then FSharpOptimizationDataResourceName2, false else diff --git a/src/Compiler/SyntaxTree/PrettyNaming.fs b/src/Compiler/SyntaxTree/PrettyNaming.fs index b81d742a357..4ab6f181358 100755 --- a/src/Compiler/SyntaxTree/PrettyNaming.fs +++ b/src/Compiler/SyntaxTree/PrettyNaming.fs @@ -1102,8 +1102,10 @@ let FSharpOptimizationDataResourceName = "FSharpOptimizationData." let FSharpSignatureDataResourceName = "FSharpSignatureData." // Compressed OptimizationData/SignatureData name for embedded resource -let FSharpOptimizationCompressDataResourceName = "FSharpOptimizationCompressData." -let FSharpSignatureCompressDataResourceName = "FSharpSignatureCompressData." +let FSharpOptimizationCompressedDataResourceName = + "FSharpOptimizationCompressedData." + +let FSharpSignatureCompressedDataResourceName = "FSharpSignatureCompressedData." // For historical reasons, we use a different resource name for FSharp.Core, so older F# compilers // don't complain when they see the resource. The prefix of these names must not be 'FSharpOptimizationData' diff --git a/src/Compiler/SyntaxTree/PrettyNaming.fsi b/src/Compiler/SyntaxTree/PrettyNaming.fsi index bef380034a4..61bf5a19ddb 100644 --- a/src/Compiler/SyntaxTree/PrettyNaming.fsi +++ b/src/Compiler/SyntaxTree/PrettyNaming.fsi @@ -271,9 +271,9 @@ val internal FSharpOptimizationDataResourceName: string val internal FSharpSignatureDataResourceName: string -val internal FSharpOptimizationCompressDataResourceName: string +val internal FSharpOptimizationCompressedDataResourceName: string -val internal FSharpSignatureCompressDataResourceName: string +val internal FSharpSignatureCompressedDataResourceName: string val internal FSharpOptimizationDataResourceName2: string From b4d275bd71536f750b8d55c28993b3f532387726 Mon Sep 17 00:00:00 2001 From: Kevin Ransom Date: Tue, 23 Aug 2022 14:35:49 -0700 Subject: [PATCH 6/7] comments --- src/Compiler/Driver/CompilerImports.fs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Compiler/Driver/CompilerImports.fs b/src/Compiler/Driver/CompilerImports.fs index 61028362da3..b7738705788 100644 --- a/src/Compiler/Driver/CompilerImports.fs +++ b/src/Compiler/Driver/CompilerImports.fs @@ -119,7 +119,7 @@ let PickleToResource inMem file (g: TcGlobals) compress scope rName p x = let file = PathMap.apply g.pathMap file let bytes = - let bytes = pickleObjWithDanglingCcus inMem file g scope p x + use bytes = pickleObjWithDanglingCcus inMem file g scope p x if compress then let raw = new MemoryStream(bytes.AsMemory().ToArray()) From 8ec69d81118e620274708c267990bae636322b09 Mon Sep 17 00:00:00 2001 From: Kevin Ransom Date: Tue, 23 Aug 2022 14:51:38 -0700 Subject: [PATCH 7/7] fsharpqa --- .../Source/CompilerOptions/fsc/help/help40.437.1033.bsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/fsharpqa/Source/CompilerOptions/fsc/help/help40.437.1033.bsl b/tests/fsharpqa/Source/CompilerOptions/fsc/help/help40.437.1033.bsl index 4889e4a2c34..779ea3c45a3 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsc/help/help40.437.1033.bsl +++ b/tests/fsharpqa/Source/CompilerOptions/fsc/help/help40.437.1033.bsl @@ -24,7 +24,7 @@ Copyright (c) Microsoft Corporation. All Rights Reserved. run on: x86, x64, Arm, Arm64, Itanium, anycpu32bitpreferred, or anycpu. The default is anycpu. ---compressmetadata Compress interface and optimization +--compressmetadata[+|-] Compress interface and optimization data files --nooptimizationdata Only include optimization information essential for