From 58de9b0abe0415c03f250145dc16d902ceb3c9de Mon Sep 17 00:00:00 2001 From: Vlad Zarytovskii Date: Wed, 24 Jul 2024 15:03:18 +0200 Subject: [PATCH 01/11] Turn a bunch of options by default --- src/Compiler/Driver/CompilerConfig.fs | 22 +++------ src/Compiler/Driver/CompilerConfig.fsi | 4 ++ src/Compiler/Driver/CompilerOptions.fs | 48 +++++++++++++++++++ src/Compiler/FSComp.txt | 4 ++ src/Compiler/Optimize/Optimizer.fs | 2 +- src/FSharp.Build/Fsc.fs | 28 +++++++++++ .../fsc/misc/compiler_help_output.bsl | 5 +- 7 files changed, 96 insertions(+), 17 deletions(-) diff --git a/src/Compiler/Driver/CompilerConfig.fs b/src/Compiler/Driver/CompilerConfig.fs index 4a1d0d18c74..7b3537f78ba 100644 --- a/src/Compiler/Driver/CompilerConfig.fs +++ b/src/Compiler/Driver/CompilerConfig.fs @@ -529,6 +529,7 @@ type TcConfigBuilder = mutable deterministic: bool mutable concurrentBuild: bool mutable parallelIlxGen: bool + mutable graphTypeChecking: bool mutable emitMetadataAssembly: MetadataAssemblyGeneration mutable preferredUiLang: string option mutable lcid: int option @@ -762,18 +763,12 @@ type TcConfigBuilder = doTLR = false doFinalSimplify = false optsOn = false - optSettings = - { OptimizationSettings.Defaults with - processingMode = - if FSharpExperimentalFeaturesEnabledAutomatically then - OptimizationProcessingMode.Parallel - else - OptimizationProcessingMode.Sequential - } + optSettings = OptimizationSettings.Defaults emitTailcalls = true deterministic = false concurrentBuild = true - parallelIlxGen = FSharpExperimentalFeaturesEnabledAutomatically + parallelIlxGen = false + graphTypeChecking = true emitMetadataAssembly = MetadataAssemblyGeneration.None preferredUiLang = None lcid = None @@ -815,15 +810,11 @@ type TcConfigBuilder = sdkDirOverride = sdkDirOverride xmlDocInfoLoader = None exiter = QuitProcessExiter - parallelReferenceResolution = ParallelReferenceResolution.Off + parallelReferenceResolution = ParallelReferenceResolution.On captureIdentifiersWhenParsing = false typeCheckingConfig = { - TypeCheckingConfig.Mode = - if FSharpExperimentalFeaturesEnabledAutomatically then - TypeCheckingMode.Graph - else - TypeCheckingMode.Sequential + TypeCheckingConfig.Mode = TypeCheckingMode.Graph DumpGraph = false } dumpSignatureData = false @@ -1336,6 +1327,7 @@ type TcConfig private (data: TcConfigBuilder, validate: bool) = member _.deterministic = data.deterministic member _.concurrentBuild = data.concurrentBuild member _.parallelIlxGen = data.parallelIlxGen + member _.graphTypeChecking = data.graphTypeChecking member _.emitMetadataAssembly = data.emitMetadataAssembly member _.pathMap = data.pathMap member _.langVersion = data.langVersion diff --git a/src/Compiler/Driver/CompilerConfig.fsi b/src/Compiler/Driver/CompilerConfig.fsi index f21ae429029..ca241b992e4 100644 --- a/src/Compiler/Driver/CompilerConfig.fsi +++ b/src/Compiler/Driver/CompilerConfig.fsi @@ -438,6 +438,8 @@ type TcConfigBuilder = mutable parallelIlxGen: bool + mutable graphTypeChecking: bool + mutable emitMetadataAssembly: MetadataAssemblyGeneration mutable preferredUiLang: string option @@ -772,6 +774,8 @@ type TcConfig = member parallelIlxGen: bool + member graphTypeChecking: bool + member emitMetadataAssembly: MetadataAssemblyGeneration member pathMap: PathMap diff --git a/src/Compiler/Driver/CompilerOptions.fs b/src/Compiler/Driver/CompilerOptions.fs index a43d686fb01..ac87616b614 100644 --- a/src/Compiler/Driver/CompilerOptions.fs +++ b/src/Compiler/Driver/CompilerOptions.fs @@ -571,6 +571,22 @@ let SetDeterministicSwitch (tcConfigB: TcConfigBuilder) switch = let SetRealsig (tcConfigB: TcConfigBuilder) switch = tcConfigB.realsig <- (switch = OptionSwitch.On) +let SetGraphTypeCheckingSwitch (tcConfigB: TcConfigBuilder) switch = + tcConfigB.graphTypeChecking <- (switch = OptionSwitch.On) + +let SetParallelOptimizationSwitch (tcConfigB: TcConfigBuilder) switch = + match switch with + | OptionSwitch.On -> tcConfigB.optSettings <- { tcConfigB.optSettings with processingMode = OptimizationProcessingMode.Parallel } + | OptionSwitch.Off -> tcConfigB.optSettings <- { tcConfigB.optSettings with processingMode = OptimizationProcessingMode.Sequential } + +let SetParallelIlxGenSwitch (tcConfigB: TcConfigBuilder) switch = + tcConfigB.parallelIlxGen <- (switch = OptionSwitch.On) + +let SetPparallelReferenceResolutionSwitch (tcConfigB: TcConfigBuilder) switch = + match switch with + | OptionSwitch.On -> tcConfigB.parallelReferenceResolution <- ParallelReferenceResolution.On + | OptionSwitch.Off -> tcConfigB.parallelReferenceResolution <- ParallelReferenceResolution.Off + let SetReferenceAssemblyOnlySwitch (tcConfigB: TcConfigBuilder) switch = match tcConfigB.emitMetadataAssembly with | MetadataAssemblyGeneration.None when (not tcConfigB.standalone) && tcConfigB.extraStaticLinkRoots.IsEmpty -> @@ -1056,6 +1072,38 @@ let codeGenerationFlags isFsi (tcConfigB: TcConfigBuilder) = None, Some(FSComp.SR.optsReflectionFree ()) ) + + CompilerOption( + "graphtypechecking", + tagNone, + OptionSwitch(SetGraphTypeCheckingSwitch tcConfigB), + None, + Some(FSComp.SR.optsGraphTypeChecking ()) + ) + + CompilerOption( + "paralleloptimization", + tagNone, + OptionSwitch(SetParallelOptimizationSwitch tcConfigB), + None, + Some(FSComp.SR.optsParallelOptimization ()) + ) + + CompilerOption( + "parallelilxgen", + tagNone, + OptionSwitch(SetParallelIlxGenSwitch tcConfigB), + None, + Some(FSComp.SR.optsParallelIlxGen ()) + ) + + CompilerOption( + "parallelreferenceresolution", + tagNone, + OptionSwitch(SetPparallelReferenceResolutionSwitch tcConfigB), + None, + Some(FSComp.SR.optsParallelReferenceResolution ()) + ) ] if isFsi then debug @ codegen else debug @ embed @ codegen diff --git a/src/Compiler/FSComp.txt b/src/Compiler/FSComp.txt index d98cfb61b97..be5b06ea011 100644 --- a/src/Compiler/FSComp.txt +++ b/src/Compiler/FSComp.txt @@ -933,6 +933,10 @@ 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." +optsGraphTypeChecking,"Use graph typechecking." +optsParallelOptimization,"Enable parallel optimization." +optsParallelIlxGen,"Enable parallel IL generation." +optsParallelReferenceResolution,"Enable parallel reference resolution." 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." diff --git a/src/Compiler/Optimize/Optimizer.fs b/src/Compiler/Optimize/Optimizer.fs index bc4c0829871..793002e9396 100644 --- a/src/Compiler/Optimize/Optimizer.fs +++ b/src/Compiler/Optimize/Optimizer.fs @@ -347,7 +347,7 @@ type OptimizationSettings = reportFunctionSizes = false reportHasEffect = false reportTotalSizes = false - processingMode = OptimizationProcessingMode.Sequential + processingMode = OptimizationProcessingMode.Parallel } /// Determines if JIT optimizations are enabled diff --git a/src/FSharp.Build/Fsc.fs b/src/FSharp.Build/Fsc.fs index 9de88c9dbca..e436c599491 100644 --- a/src/FSharp.Build/Fsc.fs +++ b/src/FSharp.Build/Fsc.fs @@ -95,6 +95,10 @@ type public Fsc() as this = let mutable vslcid: string MaybeNull = null let mutable utf8output: bool = false let mutable useReflectionFreeCodeGen: bool = false + let mutable graphTypeChecking: bool = true + let mutable parallelOptimization: bool = true + let mutable parallelIlxGen: bool = false + let mutable parallelReferenceResolution: bool = true /// Trim whitespace ... spaces, tabs, newlines,returns, Double quotes and single quotes let wsCharsToTrim = [| ' '; '\t'; '\"'; '\'' |] @@ -195,6 +199,30 @@ type public Fsc() as this = else builder.AppendSwitch("--optimize-") + // graphbasedchecking + if graphTypeChecking then + builder.AppendSwitch("--graphtypechecking+") + else + builder.AppendSwitch("--graphtypechecking-") + + // paralleloptimization + if parallelOptimization then + builder.AppendSwitch("--paralleloptimization+") + else + builder.AppendSwitch("--paralleloptimization-") + + // parallelilxgen + if parallelIlxGen then + builder.AppendSwitch("--parallelilxgen+") + else + builder.AppendSwitch("--parallelilxgen-") + + // parallelreferenceresolution + if parallelReferenceResolution then + builder.AppendSwitch("--parallelreferenceresolution+") + else + builder.AppendSwitch("--parallelreferenceresolution-") + // realsig if realsig then builder.AppendSwitch("--realsig+") diff --git a/tests/FSharp.Compiler.ComponentTests/CompilerOptions/fsc/misc/compiler_help_output.bsl b/tests/FSharp.Compiler.ComponentTests/CompilerOptions/fsc/misc/compiler_help_output.bsl index a1cb129cc66..6c66ff35659 100644 --- a/tests/FSharp.Compiler.ComponentTests/CompilerOptions/fsc/misc/compiler_help_output.bsl +++ b/tests/FSharp.Compiler.ComponentTests/CompilerOptions/fsc/misc/compiler_help_output.bsl @@ -63,7 +63,10 @@ Copyright (c) Microsoft Corporation. All Rights Reserved. --pathmap: Maps physical paths to source path names output by the compiler --crossoptimize[+|-] Enable or disable cross-module optimizations --reflectionfree Disable implicit generation of constructs using reflection - +--graphtypechecking[+|-] Use graph typechecking. +--paralleloptimization[+|-] Enable parallel optimization. +--parallelilxgen[+|-] Enable parallel IL generation. +--parallelreferenceresolution[+|-] Enable parallel reference resolution. - ERRORS AND WARNINGS - --warnaserror[+|-] Report all warnings as errors From b864ea2d7c03302c891f7f72a2e36d6980930cee Mon Sep 17 00:00:00 2001 From: Vlad Zarytovskii Date: Wed, 24 Jul 2024 15:24:24 +0200 Subject: [PATCH 02/11] Update xlf --- 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 ++++++++++++++++++++ 13 files changed, 260 insertions(+) diff --git a/src/Compiler/xlf/FSComp.txt.cs.xlf b/src/Compiler/xlf/FSComp.txt.cs.xlf index 2d6569495fb..71ef3e7be6d 100644 --- a/src/Compiler/xlf/FSComp.txt.cs.xlf +++ b/src/Compiler/xlf/FSComp.txt.cs.xlf @@ -877,6 +877,11 @@ Zobrazí povolené hodnoty pro jazykovou verzi. + + Use graph typechecking. + Use graph typechecking. + + Invalid use of emitting a reference assembly, do not use '--standalone or --staticlink' with '--refonly or --refout'. Neplatné použití generování referenčního sestavení, nepoužívejte --standalone ani --staticlink s --refonly nebo --refout. @@ -892,6 +897,21 @@ Zadejte zahrnuté informace o optimalizaci, výchozí hodnota je soubor. Důležité pro distribuované knihovny. + + Enable parallel IL generation. + Enable parallel IL generation. + + + + Enable parallel optimization. + Enable parallel optimization. + + + + Enable parallel reference resolution. + Enable parallel reference resolution. + + The pdb output file name cannot match the build output filename use --pdb:filename.pdb Název výstupního souboru pdb se nemůže shodovat s výstupním názvem souboru sestavení pomocí --pdb:filename.pdb. diff --git a/src/Compiler/xlf/FSComp.txt.de.xlf b/src/Compiler/xlf/FSComp.txt.de.xlf index 05412ee34ff..6a84a49b86e 100644 --- a/src/Compiler/xlf/FSComp.txt.de.xlf +++ b/src/Compiler/xlf/FSComp.txt.de.xlf @@ -877,6 +877,11 @@ Anzeigen der zulässigen Werte für die Sprachversion. + + Use graph typechecking. + Use graph typechecking. + + Invalid use of emitting a reference assembly, do not use '--standalone or --staticlink' with '--refonly or --refout'. Ungültige Verwendung der Ausgabe einer Referenzassembly. Verwenden Sie nicht „--standalone“ oder „--staticlink“ mit „--refonly“ oder „--refout“. @@ -892,6 +897,21 @@ Geben Sie die enthaltenen Optimierungsinformationen an, der Standardwert ist „file“. Wichtig für verteilte Bibliotheken. + + Enable parallel IL generation. + Enable parallel IL generation. + + + + Enable parallel optimization. + Enable parallel optimization. + + + + Enable parallel reference resolution. + Enable parallel reference resolution. + + The pdb output file name cannot match the build output filename use --pdb:filename.pdb Der Name der PDB-Ausgabedatei kann nicht mit dem Ausgabedateinamen für den Build übereinstimmen, verwenden Sie --pdb:filename.pdb diff --git a/src/Compiler/xlf/FSComp.txt.es.xlf b/src/Compiler/xlf/FSComp.txt.es.xlf index fc01995a3e7..ada1e88f058 100644 --- a/src/Compiler/xlf/FSComp.txt.es.xlf +++ b/src/Compiler/xlf/FSComp.txt.es.xlf @@ -877,6 +877,11 @@ Muestra los valores permitidos para la versión del lenguaje. + + Use graph typechecking. + Use graph typechecking. + + Invalid use of emitting a reference assembly, do not use '--standalone or --staticlink' with '--refonly or --refout'. Uso no válido de emisión de un ensamblado de referencia, no use '--standalone or --staticlink' con '--refonly or --refout'. @@ -892,6 +897,21 @@ Especifique la información de optimización incluida, el valor predeterminado es el archivo. Importante para las bibliotecas distribuidas. + + Enable parallel IL generation. + Enable parallel IL generation. + + + + Enable parallel optimization. + Enable parallel optimization. + + + + Enable parallel reference resolution. + Enable parallel reference resolution. + + The pdb output file name cannot match the build output filename use --pdb:filename.pdb El nombre del archivo de salida pdb no puede coincidir con el nombre de archivo de salida de compilación. Use --pdb:filename.pdb diff --git a/src/Compiler/xlf/FSComp.txt.fr.xlf b/src/Compiler/xlf/FSComp.txt.fr.xlf index 0210d676034..00e3679ad72 100644 --- a/src/Compiler/xlf/FSComp.txt.fr.xlf +++ b/src/Compiler/xlf/FSComp.txt.fr.xlf @@ -877,6 +877,11 @@ Affichez les valeurs autorisées pour la version du langage. + + Use graph typechecking. + Use graph typechecking. + + Invalid use of emitting a reference assembly, do not use '--standalone or --staticlink' with '--refonly or --refout'. Utilisation non valide de l’émission d’un assembly de référence, n’utilisez pas '--standalone ou --staticlink' avec '--refonly ou --refout'. @@ -892,6 +897,21 @@ Spécifiez les informations d’optimisation incluses, la valeur par défaut est le fichier. Important pour les bibliothèques distribuées. + + Enable parallel IL generation. + Enable parallel IL generation. + + + + Enable parallel optimization. + Enable parallel optimization. + + + + Enable parallel reference resolution. + Enable parallel reference resolution. + + The pdb output file name cannot match the build output filename use --pdb:filename.pdb Le nom du fichier de sortie pdb ne peut pas correspondre au nom de fichier de sortie de build utilisé --pdb:filename.pdb. diff --git a/src/Compiler/xlf/FSComp.txt.it.xlf b/src/Compiler/xlf/FSComp.txt.it.xlf index 09fc8de5a9a..a82b628f442 100644 --- a/src/Compiler/xlf/FSComp.txt.it.xlf +++ b/src/Compiler/xlf/FSComp.txt.it.xlf @@ -877,6 +877,11 @@ Visualizzare i valori consentiti per la versione della lingua. + + Use graph typechecking. + Use graph typechecking. + + Invalid use of emitting a reference assembly, do not use '--standalone or --staticlink' with '--refonly or --refout'. Utilizzo non valido della creazione di un assembly di riferimento. Non usare insieme '--standalone o --staticlink' con '--refonly o --refout'.. @@ -892,6 +897,21 @@ Specificare le informazioni di ottimizzazione incluse. Il valore predefinito è file. Important per le librerie distribuite. + + Enable parallel IL generation. + Enable parallel IL generation. + + + + Enable parallel optimization. + Enable parallel optimization. + + + + Enable parallel reference resolution. + Enable parallel reference resolution. + + The pdb output file name cannot match the build output filename use --pdb:filename.pdb Il nome del file di output pdb non può corrispondere all’uso del nome file di output della compilazione --pdb:filename.pdb diff --git a/src/Compiler/xlf/FSComp.txt.ja.xlf b/src/Compiler/xlf/FSComp.txt.ja.xlf index e9a86b84566..10a4d16a281 100644 --- a/src/Compiler/xlf/FSComp.txt.ja.xlf +++ b/src/Compiler/xlf/FSComp.txt.ja.xlf @@ -877,6 +877,11 @@ 言語バージョンで許可されている値を表示します。 + + Use graph typechecking. + Use graph typechecking. + + Invalid use of emitting a reference assembly, do not use '--standalone or --staticlink' with '--refonly or --refout'. 参照アセンブリの出力の使用が無効です。'--standalone または --staticlink' を '--relabelly または --refout' と共に使用しないでください。 @@ -892,6 +897,21 @@ 含まれる最適化情報を指定します。既定値は file です。分散ライブラリの場合は重要です。 + + Enable parallel IL generation. + Enable parallel IL generation. + + + + Enable parallel optimization. + Enable parallel optimization. + + + + Enable parallel reference resolution. + Enable parallel reference resolution. + + The pdb output file name cannot match the build output filename use --pdb:filename.pdb PDB 出力ファイル名がビルド出力ファイル名と一致しません - --pdb:filename.pdb を使用してください diff --git a/src/Compiler/xlf/FSComp.txt.ko.xlf b/src/Compiler/xlf/FSComp.txt.ko.xlf index 8133d0bd01e..e49631a584c 100644 --- a/src/Compiler/xlf/FSComp.txt.ko.xlf +++ b/src/Compiler/xlf/FSComp.txt.ko.xlf @@ -877,6 +877,11 @@ 언어 버전에 허용되는 값을 표시합니다. + + Use graph typechecking. + Use graph typechecking. + + Invalid use of emitting a reference assembly, do not use '--standalone or --staticlink' with '--refonly or --refout'. 참조 어셈블리 내보내기를 잘못 사용했습니다. '--refonly 또는 --refout'과 함께 '--standalone 또는 --staticlink'를 사용하지 마세요. @@ -892,6 +897,21 @@ 포함된 최적화 정보를 지정합니다. 기본값은 파일입니다. 분산 라이브러리에 중요합니다. + + Enable parallel IL generation. + Enable parallel IL generation. + + + + Enable parallel optimization. + Enable parallel optimization. + + + + Enable parallel reference resolution. + Enable parallel reference resolution. + + The pdb output file name cannot match the build output filename use --pdb:filename.pdb pdb 출력 파일 이름은 빌드 출력 파일 이름 사용 --pdb:filename.pdb와 일치할 수 없습니다. diff --git a/src/Compiler/xlf/FSComp.txt.pl.xlf b/src/Compiler/xlf/FSComp.txt.pl.xlf index 626ead02352..4ff702f8cf4 100644 --- a/src/Compiler/xlf/FSComp.txt.pl.xlf +++ b/src/Compiler/xlf/FSComp.txt.pl.xlf @@ -877,6 +877,11 @@ Wyświetl dozwolone wartości dla wersji językowej. + + Use graph typechecking. + Use graph typechecking. + + Invalid use of emitting a reference assembly, do not use '--standalone or --staticlink' with '--refonly or --refout'. Nieprawidłowe użycie emitowania zestawu odwołania. Nie używaj elementu „--standalone ani --staticlink” z elementem „--refonly lub --refout”. @@ -892,6 +897,21 @@ Określ dołączone informacje o optymalizacji. Wartość domyślna to plik. Ważne dla bibliotek rozproszonych. + + Enable parallel IL generation. + Enable parallel IL generation. + + + + Enable parallel optimization. + Enable parallel optimization. + + + + Enable parallel reference resolution. + Enable parallel reference resolution. + + The pdb output file name cannot match the build output filename use --pdb:filename.pdb Nazwa pliku wyjściowego pdb nie może być zgodna z nazwą pliku wyjściowego kompilacji, użyj parametru --pdb:filename.pdb diff --git a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf index 06620eb856c..eb7b8e11bcb 100644 --- a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf +++ b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf @@ -877,6 +877,11 @@ Exiba os valores permitidos para a versão do idioma. + + Use graph typechecking. + Use graph typechecking. + + Invalid use of emitting a reference assembly, do not use '--standalone or --staticlink' with '--refonly or --refout'. Uso inválido da emissão de um assembly de referência, não use '--standalone ou --staticlink' com '--refonly ou --refout'. @@ -892,6 +897,21 @@ Especifique as informações de otimização incluídas, o padrão é o file. Importante para bibliotecas distribuídas. + + Enable parallel IL generation. + Enable parallel IL generation. + + + + Enable parallel optimization. + Enable parallel optimization. + + + + Enable parallel reference resolution. + Enable parallel reference resolution. + + The pdb output file name cannot match the build output filename use --pdb:filename.pdb O nome do arquivo de saída pdb não pode corresponder ao nome do arquivo de saída do build. Use --pdb:filename.pdb diff --git a/src/Compiler/xlf/FSComp.txt.ru.xlf b/src/Compiler/xlf/FSComp.txt.ru.xlf index 722b02ce15f..f67aa46c718 100644 --- a/src/Compiler/xlf/FSComp.txt.ru.xlf +++ b/src/Compiler/xlf/FSComp.txt.ru.xlf @@ -877,6 +877,11 @@ Отображение допустимых значений для версии языка. + + Use graph typechecking. + Use graph typechecking. + + Invalid use of emitting a reference assembly, do not use '--standalone or --staticlink' with '--refonly or --refout'. Недопустимое использование при создании базовой сборки. Не используйте "--standalone or --staticlink" с "--refonly or --refout". @@ -892,6 +897,21 @@ Укажите включенные сведения об оптимизации, по умолчанию это файл. Необходимо для распределенных библиотек. + + Enable parallel IL generation. + Enable parallel IL generation. + + + + Enable parallel optimization. + Enable parallel optimization. + + + + Enable parallel reference resolution. + Enable parallel reference resolution. + + The pdb output file name cannot match the build output filename use --pdb:filename.pdb Имя выходного файла pdb не может совпадать с именем выходного файла сборки. Используйте --pdb:filename.pdb diff --git a/src/Compiler/xlf/FSComp.txt.tr.xlf b/src/Compiler/xlf/FSComp.txt.tr.xlf index 12f8cfeeb77..4f4472a5d72 100644 --- a/src/Compiler/xlf/FSComp.txt.tr.xlf +++ b/src/Compiler/xlf/FSComp.txt.tr.xlf @@ -877,6 +877,11 @@ Dil sürümü için izin verilen değerleri görüntüleyin. + + Use graph typechecking. + Use graph typechecking. + + Invalid use of emitting a reference assembly, do not use '--standalone or --staticlink' with '--refonly or --refout'. Başvuru bütünleştirilmiş kodu oluşturmanın geçersiz kullanımı; '--standalone’ veya ‘--staticlink' seçeneğini '--refonly’ veya ‘--refout' ile birlikte kullanmayın. @@ -892,6 +897,21 @@ Dahil edilen iyileştirme bilgilerini belirtin; varsayılan değer dosyadır. Dağıtılmış kitaplıklar için önemlidir. + + Enable parallel IL generation. + Enable parallel IL generation. + + + + Enable parallel optimization. + Enable parallel optimization. + + + + Enable parallel reference resolution. + Enable parallel reference resolution. + + The pdb output file name cannot match the build output filename use --pdb:filename.pdb pdb çıkış dosyası adı, derleme çıkış dosya adı kullanımı --pdb:filename.pdb ile eşleşmiyor diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf index caca4c82014..a538992de27 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf @@ -877,6 +877,11 @@ 显示语言版本的允许值。 + + Use graph typechecking. + Use graph typechecking. + + Invalid use of emitting a reference assembly, do not use '--standalone or --staticlink' with '--refonly or --refout'. 发出引用程序集的使用无效,请勿将 '--standalone 或 --staticlink' 与 '--refonly 或 --refout' 一起使用。 @@ -892,6 +897,21 @@ 指定包含的优化信息,默认值为文件。对于分发库非常重要。 + + Enable parallel IL generation. + Enable parallel IL generation. + + + + Enable parallel optimization. + Enable parallel optimization. + + + + Enable parallel reference resolution. + Enable parallel reference resolution. + + The pdb output file name cannot match the build output filename use --pdb:filename.pdb pdb 输出文件名不能与生成输出文件名 use --pdb: filename.pdb 匹配 diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf index fe208053fc5..4cbadd8e9fd 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf @@ -877,6 +877,11 @@ 顯示語言版本的允許值。 + + Use graph typechecking. + Use graph typechecking. + + Invalid use of emitting a reference assembly, do not use '--standalone or --staticlink' with '--refonly or --refout'. 發出參考組件的使用無效,請勿同時使用 '--standalone 或 '--refonly' 和 '--refout'。 @@ -892,6 +897,21 @@ 指定包含的最佳化資訊,預設值為檔案。對於分散式文件庫很重要。 + + Enable parallel IL generation. + Enable parallel IL generation. + + + + Enable parallel optimization. + Enable parallel optimization. + + + + Enable parallel reference resolution. + Enable parallel reference resolution. + + The pdb output file name cannot match the build output filename use --pdb:filename.pdb pdb 輸出檔案名與使用 --pdb:filename.pdb 的建置輸出檔案名不相符 From 76b0fa57abedb803f5c658f39951f795fac54783 Mon Sep 17 00:00:00 2001 From: Vlad Zarytovskii Date: Wed, 24 Jul 2024 16:21:18 +0200 Subject: [PATCH 03/11] Disable parallel resolution --- src/Compiler/Driver/CompilerConfig.fs | 2 +- src/FSharp.Build/Fsc.fs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Compiler/Driver/CompilerConfig.fs b/src/Compiler/Driver/CompilerConfig.fs index 7b3537f78ba..58112f960b0 100644 --- a/src/Compiler/Driver/CompilerConfig.fs +++ b/src/Compiler/Driver/CompilerConfig.fs @@ -810,7 +810,7 @@ type TcConfigBuilder = sdkDirOverride = sdkDirOverride xmlDocInfoLoader = None exiter = QuitProcessExiter - parallelReferenceResolution = ParallelReferenceResolution.On + parallelReferenceResolution = ParallelReferenceResolution.Off captureIdentifiersWhenParsing = false typeCheckingConfig = { diff --git a/src/FSharp.Build/Fsc.fs b/src/FSharp.Build/Fsc.fs index e436c599491..719dde0378e 100644 --- a/src/FSharp.Build/Fsc.fs +++ b/src/FSharp.Build/Fsc.fs @@ -98,7 +98,7 @@ type public Fsc() as this = let mutable graphTypeChecking: bool = true let mutable parallelOptimization: bool = true let mutable parallelIlxGen: bool = false - let mutable parallelReferenceResolution: bool = true + let mutable parallelReferenceResolution: bool = false /// Trim whitespace ... spaces, tabs, newlines,returns, Double quotes and single quotes let wsCharsToTrim = [| ' '; '\t'; '\"'; '\'' |] From 24e5b8ba60ea64a59e611b69969c18959dd1e137 Mon Sep 17 00:00:00 2001 From: Vlad Zarytovskii Date: Mon, 12 Aug 2024 20:18:25 +0200 Subject: [PATCH 04/11] Fomatting + turn options for compiler on by default --- Directory.Build.props | 5 +++++ src/Compiler/Driver/CompilerOptions.fs | 12 ++++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index 043c4b01feb..bc1909a56de 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -41,6 +41,11 @@ false + + + $(OtherFlags) --test:ParallelOptimization --test:GraphBasedChecking + + diff --git a/src/Compiler/Driver/CompilerOptions.fs b/src/Compiler/Driver/CompilerOptions.fs index ac87616b614..6391643d571 100644 --- a/src/Compiler/Driver/CompilerOptions.fs +++ b/src/Compiler/Driver/CompilerOptions.fs @@ -576,8 +576,16 @@ let SetGraphTypeCheckingSwitch (tcConfigB: TcConfigBuilder) switch = let SetParallelOptimizationSwitch (tcConfigB: TcConfigBuilder) switch = match switch with - | OptionSwitch.On -> tcConfigB.optSettings <- { tcConfigB.optSettings with processingMode = OptimizationProcessingMode.Parallel } - | OptionSwitch.Off -> tcConfigB.optSettings <- { tcConfigB.optSettings with processingMode = OptimizationProcessingMode.Sequential } + | OptionSwitch.On -> + tcConfigB.optSettings <- + { tcConfigB.optSettings with + processingMode = OptimizationProcessingMode.Parallel + } + | OptionSwitch.Off -> + tcConfigB.optSettings <- + { tcConfigB.optSettings with + processingMode = OptimizationProcessingMode.Sequential + } let SetParallelIlxGenSwitch (tcConfigB: TcConfigBuilder) switch = tcConfigB.parallelIlxGen <- (switch = OptionSwitch.On) From 3dda157d6f3ce11972bef3ab5e977f7bcf87a181 Mon Sep 17 00:00:00 2001 From: Vlad Zarytovskii Date: Mon, 12 Aug 2024 21:00:55 +0200 Subject: [PATCH 05/11] Cleanup + release notes --- .../.FSharp.Compiler.Service/9.0.100.md | 2 ++ src/Compiler/Driver/CompilerConfig.fs | 3 --- src/Compiler/Driver/CompilerConfig.fsi | 4 ---- src/Compiler/Driver/CompilerOptions.fs | 13 ++++++++++++- 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/docs/release-notes/.FSharp.Compiler.Service/9.0.100.md b/docs/release-notes/.FSharp.Compiler.Service/9.0.100.md index 4888bd1aad6..182afc28f4e 100644 --- a/docs/release-notes/.FSharp.Compiler.Service/9.0.100.md +++ b/docs/release-notes/.FSharp.Compiler.Service/9.0.100.md @@ -11,5 +11,7 @@ * Change compiler default setting realsig+ when building assemblies ([Issue #17384](https://github.com/dotnet/fsharp/issues/17384), [PR #17378](https://github.com/dotnet/fsharp/pull/17385)) * Change compiler default setting for compressedMetadata ([Issue #17379](https://github.com/dotnet/fsharp/issues/17379), [PR #17383](https://github.com/dotnet/fsharp/pull/17383)) * Enforce `AttributeTargets` on unions. ([PR #17389](https://github.com/dotnet/fsharp/pull/17389)) +* Enable graph type checking and parallel optimizations by default, can be turned off via the following compiler flags `--graphtypechecking-` and `--paralleloptimization-` respectfully. ([PR #17442](https://github.com/dotnet/fsharp/pull/17442)) +* Added flags for enabling parallel ILx generation and parallel reference resolution, to enable, turn on the following compiler flags: `--parallelilxgen+` and `--parallelreferenceresolution+` ([PR #17442](https://github.com/dotnet/fsharp/pull/17442)) ### Breaking Changes diff --git a/src/Compiler/Driver/CompilerConfig.fs b/src/Compiler/Driver/CompilerConfig.fs index 58112f960b0..932f122ce50 100644 --- a/src/Compiler/Driver/CompilerConfig.fs +++ b/src/Compiler/Driver/CompilerConfig.fs @@ -529,7 +529,6 @@ type TcConfigBuilder = mutable deterministic: bool mutable concurrentBuild: bool mutable parallelIlxGen: bool - mutable graphTypeChecking: bool mutable emitMetadataAssembly: MetadataAssemblyGeneration mutable preferredUiLang: string option mutable lcid: int option @@ -768,7 +767,6 @@ type TcConfigBuilder = deterministic = false concurrentBuild = true parallelIlxGen = false - graphTypeChecking = true emitMetadataAssembly = MetadataAssemblyGeneration.None preferredUiLang = None lcid = None @@ -1327,7 +1325,6 @@ type TcConfig private (data: TcConfigBuilder, validate: bool) = member _.deterministic = data.deterministic member _.concurrentBuild = data.concurrentBuild member _.parallelIlxGen = data.parallelIlxGen - member _.graphTypeChecking = data.graphTypeChecking member _.emitMetadataAssembly = data.emitMetadataAssembly member _.pathMap = data.pathMap member _.langVersion = data.langVersion diff --git a/src/Compiler/Driver/CompilerConfig.fsi b/src/Compiler/Driver/CompilerConfig.fsi index ca241b992e4..f21ae429029 100644 --- a/src/Compiler/Driver/CompilerConfig.fsi +++ b/src/Compiler/Driver/CompilerConfig.fsi @@ -438,8 +438,6 @@ type TcConfigBuilder = mutable parallelIlxGen: bool - mutable graphTypeChecking: bool - mutable emitMetadataAssembly: MetadataAssemblyGeneration mutable preferredUiLang: string option @@ -774,8 +772,6 @@ type TcConfig = member parallelIlxGen: bool - member graphTypeChecking: bool - member emitMetadataAssembly: MetadataAssemblyGeneration member pathMap: PathMap diff --git a/src/Compiler/Driver/CompilerOptions.fs b/src/Compiler/Driver/CompilerOptions.fs index 6391643d571..a48d52992f6 100644 --- a/src/Compiler/Driver/CompilerOptions.fs +++ b/src/Compiler/Driver/CompilerOptions.fs @@ -572,7 +572,18 @@ let SetRealsig (tcConfigB: TcConfigBuilder) switch = tcConfigB.realsig <- (switch = OptionSwitch.On) let SetGraphTypeCheckingSwitch (tcConfigB: TcConfigBuilder) switch = - tcConfigB.graphTypeChecking <- (switch = OptionSwitch.On) + match switch with + | OptionSwitch.On -> + tcConfigB.typeCheckingConfig <- + { tcConfigB.typeCheckingConfig with + TypeCheckingConfig.Mode = TypeCheckingMode.Graph + } + + | OptionSwitch.Off -> + tcConfigB.typeCheckingConfig <- + { tcConfigB.typeCheckingConfig with + TypeCheckingConfig.Mode = TypeCheckingMode.Sequential + } let SetParallelOptimizationSwitch (tcConfigB: TcConfigBuilder) switch = match switch with From c709f891679350e0531fe4946dcb3478f8c5d67d Mon Sep 17 00:00:00 2001 From: Vlad Zarytovskii Date: Mon, 12 Aug 2024 21:35:36 +0200 Subject: [PATCH 06/11] Baselines --- .../CompilerOptions/fsc/misc/compiler_help_output.bsl | 3 ++- vsintegration/tests/UnitTests/Tests.Build.fs | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/FSharp.Compiler.ComponentTests/CompilerOptions/fsc/misc/compiler_help_output.bsl b/tests/FSharp.Compiler.ComponentTests/CompilerOptions/fsc/misc/compiler_help_output.bsl index 6c66ff35659..5d5ceb4ebc4 100644 --- a/tests/FSharp.Compiler.ComponentTests/CompilerOptions/fsc/misc/compiler_help_output.bsl +++ b/tests/FSharp.Compiler.ComponentTests/CompilerOptions/fsc/misc/compiler_help_output.bsl @@ -1,4 +1,4 @@ -Microsoft (R) F# Compiler version 12.5.0.0 for F# 7.0 + Copyright (c) Microsoft Corporation. All Rights Reserved. @@ -68,6 +68,7 @@ Copyright (c) Microsoft Corporation. All Rights Reserved. --parallelilxgen[+|-] Enable parallel IL generation. --parallelreferenceresolution[+|-] Enable parallel reference resolution. + - ERRORS AND WARNINGS - --warnaserror[+|-] Report all warnings as errors --warnaserror[+|-]: Report specific warnings as errors diff --git a/vsintegration/tests/UnitTests/Tests.Build.fs b/vsintegration/tests/UnitTests/Tests.Build.fs index bd1b88bcf6e..54915da9a4c 100644 --- a/vsintegration/tests/UnitTests/Tests.Build.fs +++ b/vsintegration/tests/UnitTests/Tests.Build.fs @@ -755,6 +755,10 @@ type Build() = "--compressmetadata" + Environment.NewLine + "--optimize+" + Environment.NewLine + "--realsig+" + Environment.NewLine + + "--graphtypechecking+" + Environment.NewLine + + "--paralleloptimization+" + Environment.NewLine + + "--parallelilxgen-" + Environment.NewLine + + "--parallelreferenceresolution-" + Environment.NewLine + "--nowarn:52,109,110,73,85" + Environment.NewLine + "--fullpaths" + Environment.NewLine + "--flaterrors" + Environment.NewLine + @@ -762,4 +766,3 @@ type Build() = "--nocopyfsharpcore" AssertEqual expected cmd - From dd99ddf0ce91d1d35f10f15f8d90bc3042fe24ae Mon Sep 17 00:00:00 2001 From: Vlad Zarytovskii Date: Mon, 12 Aug 2024 21:47:59 +0200 Subject: [PATCH 07/11] Update 9.0.100.md --- docs/release-notes/.FSharp.Compiler.Service/9.0.100.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/release-notes/.FSharp.Compiler.Service/9.0.100.md b/docs/release-notes/.FSharp.Compiler.Service/9.0.100.md index caaa832bda7..218f26c6f1a 100644 --- a/docs/release-notes/.FSharp.Compiler.Service/9.0.100.md +++ b/docs/release-notes/.FSharp.Compiler.Service/9.0.100.md @@ -25,6 +25,8 @@ * Treat `{ new Foo() }` as `SynExpr.ObjExpr` ([PR #17388](https://github.com/dotnet/fsharp/pull/17388)) * Optimize metadata reading for type members and custom attributes. ([PR #17364](https://github.com/dotnet/fsharp/pull/17364)) * Enforce `AttributeTargets` on unions. ([PR #17389](https://github.com/dotnet/fsharp/pull/17389)) +* Ensure that isinteractive multi-emit backing fields are not public. ([Issue #17439](https://github.com/dotnet/fsharp/issues/17438)), ([PR #17439](https://github.com/dotnet/fsharp/pull/17439)) +* Enable FSharp 9.0 Language Version ([Issue #17497](https://github.com/dotnet/fsharp/issues/17438)), [PR](https://github.com/dotnet/fsharp/pull/17500))) * Enable graph type checking and parallel optimizations by default, can be turned off via the following compiler flags `--graphtypechecking-` and `--paralleloptimization-` respectfully. ([PR #17442](https://github.com/dotnet/fsharp/pull/17442)) * Added flags for enabling parallel ILx generation and parallel reference resolution, to enable, turn on the following compiler flags: `--parallelilxgen+` and `--parallelreferenceresolution+` ([PR #17442](https://github.com/dotnet/fsharp/pull/17442)) From 4d642302cc666edf9d7469bbd9bcb95b3731e764 Mon Sep 17 00:00:00 2001 From: Vlad Zarytovskii Date: Mon, 12 Aug 2024 22:47:04 +0200 Subject: [PATCH 08/11] Some additional baselines cleanup, perhaps, pretty please? --- .../CompilerOptions/fsc/misc/compiler_help_output.bsl | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/FSharp.Compiler.ComponentTests/CompilerOptions/fsc/misc/compiler_help_output.bsl b/tests/FSharp.Compiler.ComponentTests/CompilerOptions/fsc/misc/compiler_help_output.bsl index 5d5ceb4ebc4..0bc45d8760f 100644 --- a/tests/FSharp.Compiler.ComponentTests/CompilerOptions/fsc/misc/compiler_help_output.bsl +++ b/tests/FSharp.Compiler.ComponentTests/CompilerOptions/fsc/misc/compiler_help_output.bsl @@ -1,4 +1,3 @@ - Copyright (c) Microsoft Corporation. All Rights Reserved. From 1e028ec0dbb0cce7846b7a4d6d4882dfd3735ea7 Mon Sep 17 00:00:00 2001 From: Vlad Zarytovskii Date: Tue, 13 Aug 2024 11:15:00 +0200 Subject: [PATCH 09/11] Baselines, please --- .../fsc/misc/compiler_help_output.bsl | 1 + vsintegration/tests/UnitTests/Tests.Build.fs | 141 +++++++++++++++++- 2 files changed, 141 insertions(+), 1 deletion(-) diff --git a/tests/FSharp.Compiler.ComponentTests/CompilerOptions/fsc/misc/compiler_help_output.bsl b/tests/FSharp.Compiler.ComponentTests/CompilerOptions/fsc/misc/compiler_help_output.bsl index 0bc45d8760f..5d5ceb4ebc4 100644 --- a/tests/FSharp.Compiler.ComponentTests/CompilerOptions/fsc/misc/compiler_help_output.bsl +++ b/tests/FSharp.Compiler.ComponentTests/CompilerOptions/fsc/misc/compiler_help_output.bsl @@ -1,3 +1,4 @@ + Copyright (c) Microsoft Corporation. All Rights Reserved. diff --git a/vsintegration/tests/UnitTests/Tests.Build.fs b/vsintegration/tests/UnitTests/Tests.Build.fs index 54915da9a4c..62c59e42feb 100644 --- a/vsintegration/tests/UnitTests/Tests.Build.fs +++ b/vsintegration/tests/UnitTests/Tests.Build.fs @@ -80,6 +80,10 @@ type Build() = AssertEqual ("--codepage:65001" + Environment.NewLine + "--compressmetadata" + Environment.NewLine + "--optimize+" + Environment.NewLine + + "--graphtypechecking+" + Environment.NewLine + + "--paralleloptimization+" + Environment.NewLine + + "--parallelilxgen-" + Environment.NewLine + + "--parallelreferenceresolution-" + Environment.NewLine + "--realsig+" + Environment.NewLine + "--fullpaths" + Environment.NewLine + "--flaterrors" + Environment.NewLine + @@ -97,6 +101,10 @@ type Build() = AssertEqual ("-g" + Environment.NewLine + "--compressmetadata" + Environment.NewLine + "--optimize+" + Environment.NewLine + + "--graphtypechecking+" + Environment.NewLine + + "--paralleloptimization+" + Environment.NewLine + + "--parallelilxgen-" + Environment.NewLine + + "--parallelreferenceresolution-" + Environment.NewLine + "--realsig+" + Environment.NewLine + "--fullpaths" + Environment.NewLine + "--flaterrors" + Environment.NewLine + @@ -114,6 +122,10 @@ type Build() = AssertEqual ("--debug:pdbonly" + Environment.NewLine + "--compressmetadata" + Environment.NewLine + "--optimize+" + Environment.NewLine + + "--graphtypechecking+" + Environment.NewLine + + "--paralleloptimization+" + Environment.NewLine + + "--parallelilxgen-" + Environment.NewLine + + "--parallelreferenceresolution-" + Environment.NewLine + "--realsig+" + Environment.NewLine + "--fullpaths" + Environment.NewLine + "--flaterrors" + Environment.NewLine + @@ -133,6 +145,10 @@ type Build() = "--define:FOO=3" + Environment.NewLine + "--define:BAR=4" + Environment.NewLine + "--optimize+" + Environment.NewLine + + "--graphtypechecking+" + Environment.NewLine + + "--paralleloptimization+" + Environment.NewLine + + "--parallelilxgen-" + Environment.NewLine + + "--parallelreferenceresolution-" + Environment.NewLine + "--realsig+" + Environment.NewLine + "--fullpaths" + Environment.NewLine + "--flaterrors" + Environment.NewLine + @@ -149,6 +165,10 @@ type Build() = printfn "cmd=\"%s\"" cmd AssertEqual ("--compressmetadata" + Environment.NewLine + "--optimize+" + Environment.NewLine + + "--graphtypechecking+" + Environment.NewLine + + "--paralleloptimization+" + Environment.NewLine + + "--parallelilxgen-" + Environment.NewLine + + "--parallelreferenceresolution-" + Environment.NewLine + "--realsig+" + Environment.NewLine + "--nowarn:52,109" + Environment.NewLine + "--fullpaths" + Environment.NewLine + @@ -166,6 +186,10 @@ type Build() = printfn "cmd=\"%s\"" cmd AssertEqual ("--compressmetadata" + Environment.NewLine + "--optimize+" + Environment.NewLine + + "--graphtypechecking+" + Environment.NewLine + + "--paralleloptimization+" + Environment.NewLine + + "--parallelilxgen-" + Environment.NewLine + + "--parallelreferenceresolution-" + Environment.NewLine + "--realsig+" + Environment.NewLine + "--fullpaths" + Environment.NewLine + "--flaterrors" + Environment.NewLine + @@ -182,6 +206,10 @@ type Build() = printfn "cmd=\"%s\"" cmd AssertEqual ("--compressmetadata" + Environment.NewLine + "--optimize+" + Environment.NewLine + + "--graphtypechecking+" + Environment.NewLine + + "--paralleloptimization+" + Environment.NewLine + + "--parallelilxgen-" + Environment.NewLine + + "--parallelreferenceresolution-" + Environment.NewLine + "--realsig+" + Environment.NewLine + "--warnaserror-:52,109" + Environment.NewLine + "--fullpaths" + Environment.NewLine + @@ -199,6 +227,10 @@ type Build() = printfn "cmd=\"%s\"" cmd AssertEqual ("--compressmetadata" + Environment.NewLine + "--optimize+" + Environment.NewLine + + "--graphtypechecking+" + Environment.NewLine + + "--paralleloptimization+" + Environment.NewLine + + "--parallelilxgen-" + Environment.NewLine + + "--parallelreferenceresolution-" + Environment.NewLine + "--realsig+" + Environment.NewLine + "--versionfile:src/version" + Environment.NewLine + "--fullpaths" + Environment.NewLine + @@ -217,6 +249,10 @@ type Build() = AssertEqual ("--compressmetadata" + Environment.NewLine + "--doc:foo.xml" + Environment.NewLine + "--optimize+" + Environment.NewLine + + "--graphtypechecking+" + Environment.NewLine + + "--paralleloptimization+" + Environment.NewLine + + "--parallelilxgen-" + Environment.NewLine + + "--parallelreferenceresolution-" + Environment.NewLine + "--realsig+" + Environment.NewLine + "--fullpaths" + Environment.NewLine + "--flaterrors" + Environment.NewLine + @@ -234,6 +270,10 @@ type Build() = AssertEqual ("--compressmetadata" + Environment.NewLine + "--sig:foo.fsi" + Environment.NewLine + "--optimize+" + Environment.NewLine + + "--graphtypechecking+" + Environment.NewLine + + "--paralleloptimization+" + Environment.NewLine + + "--parallelilxgen-" + Environment.NewLine + + "--parallelreferenceresolution-" + Environment.NewLine + "--realsig+" + Environment.NewLine + "--fullpaths" + Environment.NewLine + "--flaterrors" + Environment.NewLine + @@ -251,6 +291,10 @@ type Build() = AssertEqual ("--compressmetadata" + Environment.NewLine + "--keyfile:key.txt" + Environment.NewLine + "--optimize+" + Environment.NewLine + + "--graphtypechecking+" + Environment.NewLine + + "--paralleloptimization+" + Environment.NewLine + + "--parallelilxgen-" + Environment.NewLine + + "--parallelreferenceresolution-" + Environment.NewLine + "--realsig+" + Environment.NewLine + "--fullpaths" + Environment.NewLine + "--flaterrors" + Environment.NewLine + @@ -268,6 +312,10 @@ type Build() = AssertEqual ("--noframework" + Environment.NewLine + "--compressmetadata" + Environment.NewLine + "--optimize+" + Environment.NewLine + + "--graphtypechecking+" + Environment.NewLine + + "--paralleloptimization+" + Environment.NewLine + + "--parallelilxgen-" + Environment.NewLine + + "--parallelreferenceresolution-" + Environment.NewLine + "--realsig+" + Environment.NewLine + "--fullpaths" + Environment.NewLine + "--flaterrors" + Environment.NewLine + @@ -284,6 +332,10 @@ type Build() = printfn "cmd=\"%s\"" cmd AssertEqual ("--compressmetadata" + Environment.NewLine + "--optimize-" + Environment.NewLine + + "--graphtypechecking+" + Environment.NewLine + + "--paralleloptimization+" + Environment.NewLine + + "--parallelilxgen-" + Environment.NewLine + + "--parallelreferenceresolution-" + Environment.NewLine + "--realsig+" + Environment.NewLine + "--fullpaths" + Environment.NewLine + "--flaterrors" + Environment.NewLine + @@ -301,6 +353,10 @@ type Build() = // REVIEW we don't put the default, is that desired? AssertEqual ("--compressmetadata" + Environment.NewLine + "--optimize+" + Environment.NewLine + + "--graphtypechecking+" + Environment.NewLine + + "--paralleloptimization+" + Environment.NewLine + + "--parallelilxgen-" + Environment.NewLine + + "--parallelreferenceresolution-" + Environment.NewLine + "--realsig+" + Environment.NewLine + "--fullpaths" + Environment.NewLine + "--flaterrors" + Environment.NewLine + @@ -317,6 +373,10 @@ type Build() = printfn "cmd=\"%s\"" cmd AssertEqual ("--compressmetadata" + Environment.NewLine + "--optimize+" + Environment.NewLine + + "--graphtypechecking+" + Environment.NewLine + + "--paralleloptimization+" + Environment.NewLine + + "--parallelilxgen-" + Environment.NewLine + + "--parallelreferenceresolution-" + Environment.NewLine + "--realsig+" + Environment.NewLine + "--fullpaths" + Environment.NewLine + "--flaterrors" + Environment.NewLine + @@ -336,6 +396,10 @@ type Build() = AssertEqual ("-o:oUt.dll" + Environment.NewLine + "--compressmetadata" + Environment.NewLine + "--optimize+" + Environment.NewLine + + "--graphtypechecking+" + Environment.NewLine + + "--paralleloptimization+" + Environment.NewLine + + "--parallelilxgen-" + Environment.NewLine + + "--parallelreferenceresolution-" + Environment.NewLine + "--realsig+" + Environment.NewLine + "--fullpaths" + Environment.NewLine + "--flaterrors" + Environment.NewLine + @@ -352,6 +416,10 @@ type Build() = printfn "cmd=\"%s\"" cmd AssertEqual ("--compressmetadata" + Environment.NewLine + "--optimize+" + Environment.NewLine + + "--graphtypechecking+" + Environment.NewLine + + "--paralleloptimization+" + Environment.NewLine + + "--parallelilxgen-" + Environment.NewLine + + "--parallelreferenceresolution-" + Environment.NewLine + "--realsig+" + Environment.NewLine + "--pdb:out.pdb" + Environment.NewLine + "--fullpaths" + Environment.NewLine + @@ -369,6 +437,10 @@ type Build() = printfn "cmd=\"%s\"" cmd AssertEqual ("--compressmetadata" + Environment.NewLine + "--optimize+" + Environment.NewLine + + "--graphtypechecking+" + Environment.NewLine + + "--paralleloptimization+" + Environment.NewLine + + "--parallelilxgen-" + Environment.NewLine + + "--parallelreferenceresolution-" + Environment.NewLine + "--realsig+" + Environment.NewLine + "--platform:x64" + Environment.NewLine + "--fullpaths" + Environment.NewLine + @@ -386,6 +458,10 @@ type Build() = printfn "cmd=\"%s\"" cmd AssertEqual ("--compressmetadata" + Environment.NewLine + "--optimize+" + Environment.NewLine + + "--graphtypechecking+" + Environment.NewLine + + "--paralleloptimization+" + Environment.NewLine + + "--parallelilxgen-" + Environment.NewLine + + "--parallelreferenceresolution-" + Environment.NewLine + "--realsig+" + Environment.NewLine + "--platform:x86" + Environment.NewLine + "--fullpaths" + Environment.NewLine + @@ -404,6 +480,10 @@ type Build() = printfn "cmd=\"%s\"" cmd AssertEqual ("--compressmetadata" + Environment.NewLine + "--optimize+" + Environment.NewLine + + "--graphtypechecking+" + Environment.NewLine + + "--paralleloptimization+" + Environment.NewLine + + "--parallelilxgen-" + Environment.NewLine + + "--parallelreferenceresolution-" + Environment.NewLine + "--realsig+" + Environment.NewLine + "-r:" + dll + Environment.NewLine + "--fullpaths" + Environment.NewLine + @@ -422,6 +502,10 @@ type Build() = printfn "cmd=\"%s\"" cmd AssertEqual ("--compressmetadata" + Environment.NewLine + "--optimize+" + Environment.NewLine + + "--graphtypechecking+" + Environment.NewLine + + "--paralleloptimization+" + Environment.NewLine + + "--parallelilxgen-" + Environment.NewLine + + "--parallelreferenceresolution-" + Environment.NewLine + "--realsig+" + Environment.NewLine + "--lib:c:\\sd\\staging\\tools\\nunit\\,c:\\Foo" + Environment.NewLine + "--fullpaths" + Environment.NewLine + @@ -440,6 +524,10 @@ type Build() = printfn "cmd=\"%s\"" cmd AssertEqual ("--compressmetadata" + Environment.NewLine + "--optimize+" + Environment.NewLine + + "--graphtypechecking+" + Environment.NewLine + + "--paralleloptimization+" + Environment.NewLine + + "--parallelilxgen-" + Environment.NewLine + + "--parallelreferenceresolution-" + Environment.NewLine + "--realsig+" + Environment.NewLine + "--lib:c:\\program files,c:\\sd\\staging\\tools\\nunit,c:\\Foo" + Environment.NewLine + "--fullpaths" + Environment.NewLine + @@ -457,6 +545,10 @@ type Build() = printfn "cmd=\"%s\"" cmd AssertEqual ("--compressmetadata" + Environment.NewLine + "--optimize+" + Environment.NewLine + + "--graphtypechecking+" + Environment.NewLine + + "--paralleloptimization+" + Environment.NewLine + + "--parallelilxgen-" + Environment.NewLine + + "--parallelreferenceresolution-" + Environment.NewLine + "--realsig+" + Environment.NewLine + "--resource:Foo.resources" + Environment.NewLine + "--fullpaths" + Environment.NewLine + @@ -476,6 +568,10 @@ type Build() = printfn "cmd=\"%s\"" cmd AssertEqual ("--compressmetadata" + Environment.NewLine + "--optimize+" + Environment.NewLine + + "--graphtypechecking+" + Environment.NewLine + + "--paralleloptimization+" + Environment.NewLine + + "--parallelilxgen-" + Environment.NewLine + + "--parallelreferenceresolution-" + Environment.NewLine + "--realsig+" + Environment.NewLine + "--fullpaths" + Environment.NewLine + "--flaterrors" + Environment.NewLine + @@ -495,6 +591,10 @@ type Build() = printfn "cmd=\"%s\"" cmd AssertEqual ("--compressmetadata" + Environment.NewLine + "--optimize+" + Environment.NewLine + + "--graphtypechecking+" + Environment.NewLine + + "--paralleloptimization+" + Environment.NewLine + + "--parallelilxgen-" + Environment.NewLine + + "--parallelreferenceresolution-" + Environment.NewLine + "--realsig+" + Environment.NewLine + "--target:library" + Environment.NewLine + "--fullpaths" + Environment.NewLine + @@ -512,6 +612,10 @@ type Build() = printfn "cmd=\"%s\"" cmd AssertEqual ("--compressmetadata" + Environment.NewLine + "--optimize+" + Environment.NewLine + + "--graphtypechecking+" + Environment.NewLine + + "--paralleloptimization+" + Environment.NewLine + + "--parallelilxgen-" + Environment.NewLine + + "--parallelreferenceresolution-" + Environment.NewLine + "--realsig+" + Environment.NewLine + "--target:winexe" + Environment.NewLine + "--fullpaths" + Environment.NewLine + @@ -529,6 +633,10 @@ type Build() = printfn "cmd=\"%s\"" cmd AssertEqual ("--compressmetadata" + Environment.NewLine + "--optimize+" + Environment.NewLine + + "--graphtypechecking+" + Environment.NewLine + + "--paralleloptimization+" + Environment.NewLine + + "--parallelilxgen-" + Environment.NewLine + + "--parallelreferenceresolution-" + Environment.NewLine + "--realsig+" + Environment.NewLine + "--target:module" + Environment.NewLine + "--fullpaths" + Environment.NewLine + @@ -545,6 +653,13 @@ type Build() = printfn "cmd=\"%s\"" cmd AssertEqual ("--compressmetadata" + Environment.NewLine + "--optimize+" + Environment.NewLine + + "--graphtypechecking+" + Environment.NewLine + + "--paralleloptimization+" + Environment.NewLine + + "--parallelilxgen-" + Environment.NewLine + + "--parallelreferenceresolution-" + Environment.NewLine + + "--paralleloptimization+" + Environment.NewLine + + "--parallelilxgen-" + Environment.NewLine + + "--parallelreferenceresolution-" + Environment.NewLine + "--realsig+" + Environment.NewLine + "--utf8output" + Environment.NewLine + "--fullpaths" + Environment.NewLine + @@ -561,6 +676,10 @@ type Build() = printfn "cmd=\"%s\"" cmd AssertEqual ("--compressmetadata" + Environment.NewLine + "--optimize+" + Environment.NewLine + + "--graphtypechecking+" + Environment.NewLine + + "--paralleloptimization+" + Environment.NewLine + + "--parallelilxgen-" + Environment.NewLine + + "--parallelreferenceresolution-" + Environment.NewLine + "--realsig+" + Environment.NewLine + "--win32res:foo.res" + Environment.NewLine + "--fullpaths" + Environment.NewLine + @@ -577,6 +696,10 @@ type Build() = printfn "cmd=\"%s\"" cmd AssertEqual ("--compressmetadata" + Environment.NewLine + "--optimize+" + Environment.NewLine + + "--graphtypechecking+" + Environment.NewLine + + "--paralleloptimization+" + Environment.NewLine + + "--parallelilxgen-" + Environment.NewLine + + "--parallelreferenceresolution-" + Environment.NewLine + "--realsig+" + Environment.NewLine + "--win32manifest:foo.manifest" + Environment.NewLine + "--fullpaths" + Environment.NewLine + @@ -593,6 +716,10 @@ type Build() = printfn "cmd=\"%s\"" cmd AssertEqual ("--compressmetadata" + Environment.NewLine + "--optimize+" + Environment.NewLine + + "--graphtypechecking+" + Environment.NewLine + + "--paralleloptimization+" + Environment.NewLine + + "--parallelilxgen-" + Environment.NewLine + + "--parallelreferenceresolution-" + Environment.NewLine + "--realsig+" + Environment.NewLine + "--fullpaths" + Environment.NewLine + "--flaterrors" + Environment.NewLine + @@ -608,6 +735,10 @@ type Build() = printfn "cmd=\"%s\"" cmd AssertEqual ("--compressmetadata" + Environment.NewLine + "--optimize+" + Environment.NewLine + + "--graphtypechecking+" + Environment.NewLine + + "--paralleloptimization+" + Environment.NewLine + + "--parallelilxgen-" + Environment.NewLine + + "--parallelreferenceresolution-" + Environment.NewLine + "--realsig+" + Environment.NewLine + "--fullpaths" + Environment.NewLine + "--flaterrors" + Environment.NewLine + @@ -664,6 +795,10 @@ type Build() = "--sig:foo.fsi" + Environment.NewLine + "--keyfile:key.txt" + Environment.NewLine + "--optimize+" + Environment.NewLine + + "--graphtypechecking+" + Environment.NewLine + + "--paralleloptimization+" + Environment.NewLine + + "--parallelilxgen-" + Environment.NewLine + + "--parallelreferenceresolution-" + Environment.NewLine + "--realsig+" + Environment.NewLine + "--pdb:out.pdb" + Environment.NewLine + "--platform:anycpu" + Environment.NewLine + @@ -709,6 +844,10 @@ type Build() = "--sig:foo.fsi" "--keyfile:key.txt" "--optimize+" + "--graphtypechecking+" + "--paralleloptimization+" + "--parallelilxgen-" + "--parallelreferenceresolution-" "--realsig+" "--pdb:out.pdb" "--platform:anycpu" @@ -754,11 +893,11 @@ type Build() = let expected = "--compressmetadata" + Environment.NewLine + "--optimize+" + Environment.NewLine + - "--realsig+" + Environment.NewLine + "--graphtypechecking+" + Environment.NewLine + "--paralleloptimization+" + Environment.NewLine + "--parallelilxgen-" + Environment.NewLine + "--parallelreferenceresolution-" + Environment.NewLine + + "--realsig+" + Environment.NewLine + "--nowarn:52,109,110,73,85" + Environment.NewLine + "--fullpaths" + Environment.NewLine + "--flaterrors" + Environment.NewLine + From 8bf9b33ac94e6d482e84983af01fc91f379cea9f Mon Sep 17 00:00:00 2001 From: Vlad Zarytovskii Date: Tue, 13 Aug 2024 12:55:18 +0200 Subject: [PATCH 10/11] Maybe fix baselines? --- tests/FSharp.Test.Utilities/Compiler.fs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/FSharp.Test.Utilities/Compiler.fs b/tests/FSharp.Test.Utilities/Compiler.fs index 60378c63bfd..9f2366b45a8 100644 --- a/tests/FSharp.Test.Utilities/Compiler.fs +++ b/tests/FSharp.Test.Utilities/Compiler.fs @@ -1281,7 +1281,7 @@ Actual: | None -> cResult | Some actual -> let expected = stripVersion (normalizeNewlines expected) - if expected <> actual then + if expected <> (normalizeNewlines actual) then failwith $"""Output does not match expected: ------------{Environment.NewLine}{expected}{Environment.NewLine}Actual: ------------{Environment.NewLine}{actual}{Environment.NewLine}""" else cResult From 494a95c20ed3b9cd0ee32cab1bf532ffca47d78c Mon Sep 17 00:00:00 2001 From: Vlad Zarytovskii Date: Wed, 14 Aug 2024 20:28:29 +0200 Subject: [PATCH 11/11] Fixed more baselines --- .../ConsoleOnlyOptionsTests.fs | 1 + .../FSharp.Compiler.Service.Tests/expected-help-output.bsl | 7 ++++++- vsintegration/tests/UnitTests/Tests.Build.fs | 3 --- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/tests/FSharp.Compiler.Service.Tests/ConsoleOnlyOptionsTests.fs b/tests/FSharp.Compiler.Service.Tests/ConsoleOnlyOptionsTests.fs index 0e5cf76221e..b4873aadb5d 100644 --- a/tests/FSharp.Compiler.Service.Tests/ConsoleOnlyOptionsTests.fs +++ b/tests/FSharp.Compiler.Service.Tests/ConsoleOnlyOptionsTests.fs @@ -22,6 +22,7 @@ let ``fsc help text is displayed correctly`` () = let blocks = GetCoreFscCompilerOptions builder let help = GetHelpFsc builder blocks let actualHelp = help.Replace("\r\n", Environment.NewLine) + let expectedHelp = expectedHelp.Replace("\r\n", Environment.NewLine) Assert.Equal(expectedHelp, actualHelp) diff --git a/tests/FSharp.Compiler.Service.Tests/expected-help-output.bsl b/tests/FSharp.Compiler.Service.Tests/expected-help-output.bsl index f6d8f432cd2..6d1639366de 100644 --- a/tests/FSharp.Compiler.Service.Tests/expected-help-output.bsl +++ b/tests/FSharp.Compiler.Service.Tests/expected-help-output.bsl @@ -1,4 +1,4 @@ - + - OUTPUT FILES - --out: Name of the output file (Short form: @@ -100,6 +100,11 @@ optimizations --reflectionfree Disable implicit generation of constructs using reflection +--graphtypechecking[+|-] Use graph typechecking. +--paralleloptimization[+|-] Enable parallel optimization. +--parallelilxgen[+|-] Enable parallel IL generation. +--parallelreferenceresolution[+|-] Enable parallel reference + resolution. - ERRORS AND WARNINGS - diff --git a/vsintegration/tests/UnitTests/Tests.Build.fs b/vsintegration/tests/UnitTests/Tests.Build.fs index 62c59e42feb..0459c286dab 100644 --- a/vsintegration/tests/UnitTests/Tests.Build.fs +++ b/vsintegration/tests/UnitTests/Tests.Build.fs @@ -657,9 +657,6 @@ type Build() = "--paralleloptimization+" + Environment.NewLine + "--parallelilxgen-" + Environment.NewLine + "--parallelreferenceresolution-" + Environment.NewLine + - "--paralleloptimization+" + Environment.NewLine + - "--parallelilxgen-" + Environment.NewLine + - "--parallelreferenceresolution-" + Environment.NewLine + "--realsig+" + Environment.NewLine + "--utf8output" + Environment.NewLine + "--fullpaths" + Environment.NewLine +