From 143e375981a55761d8a83cfd398f6ac38c8fc493 Mon Sep 17 00:00:00 2001 From: Fernando Omori <54488262+nih0n@users.noreply.github.com> Date: Mon, 16 Dec 2024 13:44:21 -0300 Subject: [PATCH 01/19] Show default value of compiler options (#18054) * Show default value of compiler options * Locale files * Revert "Show default value of compiler options" This reverts commit 842c2c139788c1423469a688dbbd9f8c0c29523b. * Revert "Locale files" This reverts commit 47de522f687c1a224141c001ae73afdcb4ca987f. * Draft * Auto-generated default values * Update compiler_help_output.bsl * Format file * Update expected-help-output.bsl * Update help baseline files * Update release notes --------- Co-authored-by: nih0n --- .../.FSharp.Compiler.Service/9.0.200.md | 1 + src/Compiler/Driver/CompilerOptions.fs | 78 ++++++++++++++----- src/Compiler/Driver/CompilerOptions.fsi | 2 + src/Compiler/FSComp.txt | 36 ++++----- src/Compiler/Interactive/FSIstrings.txt | 10 +-- src/Compiler/Interactive/fsi.fs | 10 +-- .../Interactive/xlf/FSIstrings.txt.cs.xlf | 20 ++--- .../Interactive/xlf/FSIstrings.txt.de.xlf | 20 ++--- .../Interactive/xlf/FSIstrings.txt.es.xlf | 20 ++--- .../Interactive/xlf/FSIstrings.txt.fr.xlf | 20 ++--- .../Interactive/xlf/FSIstrings.txt.it.xlf | 20 ++--- .../Interactive/xlf/FSIstrings.txt.ja.xlf | 20 ++--- .../Interactive/xlf/FSIstrings.txt.ko.xlf | 20 ++--- .../Interactive/xlf/FSIstrings.txt.pl.xlf | 20 ++--- .../Interactive/xlf/FSIstrings.txt.pt-BR.xlf | 20 ++--- .../Interactive/xlf/FSIstrings.txt.ru.xlf | 20 ++--- .../Interactive/xlf/FSIstrings.txt.tr.xlf | 20 ++--- .../xlf/FSIstrings.txt.zh-Hans.xlf | 20 ++--- .../xlf/FSIstrings.txt.zh-Hant.xlf | 20 ++--- src/Compiler/xlf/FSComp.txt.cs.xlf | 72 ++++++++--------- src/Compiler/xlf/FSComp.txt.de.xlf | 72 ++++++++--------- src/Compiler/xlf/FSComp.txt.es.xlf | 72 ++++++++--------- src/Compiler/xlf/FSComp.txt.fr.xlf | 72 ++++++++--------- src/Compiler/xlf/FSComp.txt.it.xlf | 72 ++++++++--------- src/Compiler/xlf/FSComp.txt.ja.xlf | 72 ++++++++--------- src/Compiler/xlf/FSComp.txt.ko.xlf | 72 ++++++++--------- src/Compiler/xlf/FSComp.txt.pl.xlf | 72 ++++++++--------- src/Compiler/xlf/FSComp.txt.pt-BR.xlf | 72 ++++++++--------- src/Compiler/xlf/FSComp.txt.ru.xlf | 72 ++++++++--------- src/Compiler/xlf/FSComp.txt.tr.xlf | 72 ++++++++--------- src/Compiler/xlf/FSComp.txt.zh-Hans.xlf | 72 ++++++++--------- src/Compiler/xlf/FSComp.txt.zh-Hant.xlf | 72 ++++++++--------- .../fsc/misc/compiler_help_output.bsl | 34 ++++---- .../expected-help-output.bsl | 40 ++++++---- .../fsi/help/help40-nologo.437.1033.bsl | 30 ++++--- .../fsi/help/help40.437.1033.bsl | 32 ++++---- 36 files changed, 767 insertions(+), 702 deletions(-) diff --git a/docs/release-notes/.FSharp.Compiler.Service/9.0.200.md b/docs/release-notes/.FSharp.Compiler.Service/9.0.200.md index f681c31368d..4029c80e146 100644 --- a/docs/release-notes/.FSharp.Compiler.Service/9.0.200.md +++ b/docs/release-notes/.FSharp.Compiler.Service/9.0.200.md @@ -28,6 +28,7 @@ * Added project property ParallelCompilation which turns on graph based type checking, parallel ILXGen and parallel optimization. By default on for users of langversion=preview ([PR #17948](https://github.com/dotnet/fsharp/pull/17948)) * Adding warning when consuming generic method returning T|null for types not supporting nullness (structs,anons,tuples) ([PR #18057](https://github.com/dotnet/fsharp/pull/18057)) * Sink: report SynPat.ArrayOrList type ([PR #18127](https://github.com/dotnet/fsharp/pull/18127)) +* Show the default value of compiler options ([PR #18054](https://github.com/dotnet/fsharp/pull/18054)) ### Changed diff --git a/src/Compiler/Driver/CompilerOptions.fs b/src/Compiler/Driver/CompilerOptions.fs index fa7319fd1c2..7c4c81efd40 100644 --- a/src/Compiler/Driver/CompilerOptions.fs +++ b/src/Compiler/Driver/CompilerOptions.fs @@ -712,6 +712,8 @@ let setSignatureFile tcConfigB s = let setAllSignatureFiles tcConfigB () = tcConfigB.printAllSignatureFiles <- true +let formatOptionSwitch (value: bool) = if value then "on" else "off" + // option tags let tagString = "" let tagExe = "exe" @@ -806,7 +808,7 @@ let errorsAndWarningsFlags (tcConfigB: TcConfigBuilder) = GlobalWarnAsError = switch <> OptionSwitch.Off }), None, - Some(FSComp.SR.optsWarnaserrorPM ()) + Some(FSComp.SR.optsWarnaserrorPM (formatOptionSwitch tcConfigB.diagnosticsOptions.GlobalWarnAsError)) ) CompilerOption( @@ -870,7 +872,7 @@ let errorsAndWarningsFlags (tcConfigB: TcConfigBuilder) = tagNone, OptionSwitch(fun switch -> tcConfigB.checkNullness <- switch = OptionSwitch.On), None, - Some(FSComp.SR.optsCheckNulls ()) + Some(FSComp.SR.optsCheckNulls (formatOptionSwitch tcConfigB.checkNullness)) ) CompilerOption( @@ -878,7 +880,7 @@ let errorsAndWarningsFlags (tcConfigB: TcConfigBuilder) = tagNone, OptionSwitch(fun switch -> enableConsoleColoring <- switch = OptionSwitch.On), None, - Some(FSComp.SR.optsConsoleColors ()) + Some(FSComp.SR.optsConsoleColors (formatOptionSwitch enableConsoleColoring)) ) ] @@ -904,7 +906,7 @@ let outputFileFlagsFsc (tcConfigB: TcConfigBuilder) = tagNone, OptionSwitch(fun s -> tcConfigB.delaysign <- (s = OptionSwitch.On)), None, - Some(FSComp.SR.optsDelaySign ()) + Some(FSComp.SR.optsDelaySign (formatOptionSwitch tcConfigB.delaysign)) ) CompilerOption( @@ -912,7 +914,7 @@ let outputFileFlagsFsc (tcConfigB: TcConfigBuilder) = tagNone, OptionSwitch(fun s -> tcConfigB.publicsign <- (s = OptionSwitch.On)), None, - Some(FSComp.SR.optsPublicSign ()) + Some(FSComp.SR.optsPublicSign (formatOptionSwitch tcConfigB.publicsign)) ) CompilerOption("doc", tagFile, OptionString(fun s -> tcConfigB.xmlDocOutputFile <- Some s), None, Some(FSComp.SR.optsWriteXml ())) @@ -944,7 +946,7 @@ let outputFileFlagsFsc (tcConfigB: TcConfigBuilder) = tagNone, OptionSwitch(fun switch -> tcConfigB.compressMetadata <- switch = OptionSwitch.On), None, - Some(FSComp.SR.optsCompressMetadata ()) + Some(FSComp.SR.optsCompressMetadata (formatOptionSwitch tcConfigB.compressMetadata)) ) CompilerOption( @@ -975,7 +977,13 @@ let outputFileFlagsFsc (tcConfigB: TcConfigBuilder) = Some(FSComp.SR.optsNoCopyFsharpCore ()) ) - CompilerOption("refonly", tagNone, OptionSwitch(SetReferenceAssemblyOnlySwitch tcConfigB), None, Some(FSComp.SR.optsRefOnly ())) + CompilerOption( + "refonly", + tagNone, + OptionSwitch(SetReferenceAssemblyOnlySwitch tcConfigB), + None, + Some(FSComp.SR.optsRefOnly (formatOptionSwitch (tcConfigB.emitMetadataAssembly <> MetadataAssemblyGeneration.None))) + ) CompilerOption("refout", tagFile, OptionString(SetReferenceAssemblyOutSwitch tcConfigB), None, Some(FSComp.SR.optsRefOut ())) ] @@ -1023,7 +1031,13 @@ let resourcesFlagsFsc (tcConfigB: TcConfigBuilder) = let codeGenerationFlags isFsi (tcConfigB: TcConfigBuilder) = let debug = [ - CompilerOption("debug", tagNone, OptionSwitch(SetDebugSwitch tcConfigB None), None, Some(FSComp.SR.optsDebugPM ())) + CompilerOption( + "debug", + tagNone, + OptionSwitch(SetDebugSwitch tcConfigB None), + None, + Some(FSComp.SR.optsDebugPM (formatOptionSwitch tcConfigB.debuginfo)) + ) CompilerOption( "debug", @@ -1036,7 +1050,13 @@ let codeGenerationFlags isFsi (tcConfigB: TcConfigBuilder) = let embed = [ - CompilerOption("embed", tagNone, OptionSwitch(SetEmbedAllSourceSwitch tcConfigB), None, Some(FSComp.SR.optsEmbedAllSource ())) + CompilerOption( + "embed", + tagNone, + OptionSwitch(SetEmbedAllSourceSwitch tcConfigB), + None, + Some(FSComp.SR.optsEmbedAllSource (formatOptionSwitch tcConfigB.embedAllSource)) + ) CompilerOption("embed", tagFileList, OptionStringList tcConfigB.AddEmbeddedSourceFile, None, Some(FSComp.SR.optsEmbedSource ())) @@ -1045,19 +1065,37 @@ let codeGenerationFlags isFsi (tcConfigB: TcConfigBuilder) = let codegen = [ - CompilerOption("optimize", tagNone, OptionSwitch(SetOptimizeSwitch tcConfigB), None, Some(FSComp.SR.optsOptimize ())) + CompilerOption( + "optimize", + tagNone, + OptionSwitch(SetOptimizeSwitch tcConfigB), + None, + Some(FSComp.SR.optsOptimize (formatOptionSwitch (tcConfigB.optSettings <> OptimizationSettings.Defaults))) + ) - CompilerOption("tailcalls", tagNone, OptionSwitch(SetTailcallSwitch tcConfigB), None, Some(FSComp.SR.optsTailcalls ())) + CompilerOption( + "tailcalls", + tagNone, + OptionSwitch(SetTailcallSwitch tcConfigB), + None, + Some(FSComp.SR.optsTailcalls (formatOptionSwitch tcConfigB.emitTailcalls)) + ) CompilerOption( "deterministic", tagNone, OptionSwitch(SetDeterministicSwitch tcConfigB), None, - Some(FSComp.SR.optsDeterministic ()) + Some(FSComp.SR.optsDeterministic (formatOptionSwitch tcConfigB.deterministic)) ) - CompilerOption("realsig", tagNone, OptionSwitch(SetRealsig tcConfigB), None, Some(FSComp.SR.optsRealsig ())) + CompilerOption( + "realsig", + tagNone, + OptionSwitch(SetRealsig tcConfigB), + None, + Some(FSComp.SR.optsRealsig (formatOptionSwitch tcConfigB.realsig)) + ) CompilerOption("pathmap", tagPathMap, OptionStringList(AddPathMapping tcConfigB), None, Some(FSComp.SR.optsPathMap ())) @@ -1066,7 +1104,11 @@ let codeGenerationFlags isFsi (tcConfigB: TcConfigBuilder) = tagNone, OptionSwitch(crossOptimizeSwitch tcConfigB), None, - Some(FSComp.SR.optsCrossoptimize ()) + Some( + FSComp.SR.optsCrossoptimize ( + formatOptionSwitch (Option.defaultValue false tcConfigB.optSettings.crossAssemblyOptimizationUser) + ) + ) ) CompilerOption( @@ -1144,7 +1186,7 @@ let languageFlags tcConfigB = tagNone, OptionSwitch(fun switch -> tcConfigB.checkOverflow <- (switch = OptionSwitch.On)), None, - Some(FSComp.SR.optsChecked ()) + Some(FSComp.SR.optsChecked (formatOptionSwitch tcConfigB.checkOverflow)) ) CompilerOption("define", tagString, OptionString(defineSymbol tcConfigB), None, Some(FSComp.SR.optsDefine ())) @@ -1156,7 +1198,7 @@ let languageFlags tcConfigB = tagNone, OptionSwitch(fun switch -> tcConfigB.strictIndentation <- Some(switch = OptionSwitch.On)), None, - Some(FSComp.SR.optsStrictIndentation ()) + Some(FSComp.SR.optsStrictIndentation (formatOptionSwitch (Option.defaultValue false tcConfigB.strictIndentation))) ) ] @@ -1328,7 +1370,7 @@ let advancedFlagsFsc tcConfigB = tagNone, OptionSwitch(useHighEntropyVASwitch tcConfigB), None, - Some(FSComp.SR.optsUseHighEntropyVA ()) + Some(FSComp.SR.optsUseHighEntropyVA (formatOptionSwitch tcConfigB.useHighEntropyVA)) ) CompilerOption( @@ -1344,7 +1386,7 @@ let advancedFlagsFsc tcConfigB = tagNone, OptionSwitch(fun switch -> tcConfigB.emitDebugInfoInQuotations <- switch = OptionSwitch.On), None, - Some(FSComp.SR.optsEmitDebugInfoInQuotations ()) + Some(FSComp.SR.optsEmitDebugInfoInQuotations (formatOptionSwitch tcConfigB.emitDebugInfoInQuotations)) ) ] diff --git a/src/Compiler/Driver/CompilerOptions.fsi b/src/Compiler/Driver/CompilerOptions.fsi index bb2034b93d5..7baefaa5aa1 100644 --- a/src/Compiler/Driver/CompilerOptions.fsi +++ b/src/Compiler/Driver/CompilerOptions.fsi @@ -87,6 +87,8 @@ val ignoreFailureOnMono1_1_16: (unit -> unit) -> unit val mutable enableConsoleColoring: bool +val formatOptionSwitch: bool -> string + val DoWithColor: ConsoleColor -> (unit -> 'T) -> 'T val DoWithDiagnosticColor: FSharpDiagnosticSeverity -> (unit -> 'T) -> 'T diff --git a/src/Compiler/FSComp.txt b/src/Compiler/FSComp.txt index f5522147e8c..c0f9a8a4f1a 100644 --- a/src/Compiler/FSComp.txt +++ b/src/Compiler/FSComp.txt @@ -850,12 +850,12 @@ optsBuildConsole,"Build a console executable" optsBuildWindows,"Build a Windows executable" optsBuildLibrary,"Build a library (Short form: -a)" optsBuildModule,"Build a module that can be added to another assembly" -optsDelaySign,"Delay-sign the assembly using only the public portion of the strong name key" -optsPublicSign,"Public-sign the assembly using only the public portion of the strong name key, and mark the assembly as signed" +optsDelaySign,"Delay-sign the assembly using only the public portion of the strong name key (%s by default)" +optsPublicSign,"Public-sign the assembly using only the public portion of the strong name key, and mark the assembly as signed (%s by default)" 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" +optsCompressMetadata,"Compress interface and optimization data files (%s by default)" 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" @@ -867,30 +867,30 @@ optsWin32icon,"Specify a Win32 icon file (.ico)" optsWin32res,"Specify a Win32 resource file (.res)" optsWin32manifest,"Specify a Win32 manifest file" optsNowin32manifest,"Do not include the default Win32 manifest" -optsEmbedAllSource,"Embed all source files in the portable PDB file" +optsEmbedAllSource,"Embed all source files in the portable PDB file (%s by default)" optsEmbedSource,"Embed specific source files in the portable PDB file" optsSourceLink,"Source link information file to embed in the portable PDB file" 1001,optsPdbMatchesOutputFileName,"The pdb output file name cannot match the build output filename use --pdb:filename.pdb" srcFileTooLarge,"Source file is too large to embed in a portable PDB" optsResource,"Embed the specified managed resource" optsLinkresource,"Link the specified resource to this assembly where the resinfo format is [,[,public|private]]" -optsDebugPM,"Emit debug information (Short form: -g)" +optsDebugPM,"Emit debug information (Short form: -g) (%s by default)" optsDebug,"Specify debugging type: full, portable, embedded, pdbonly. ('%s' is the default if no debugging type specified and enables attaching a debugger to a running program, 'portable' is a cross-platform format, 'embedded' is a cross-platform format embedded into the output file)." -optsOptimize,"Enable optimizations (Short form: -O)" -optsTailcalls,"Enable or disable tailcalls" -optsDeterministic,"Produce a deterministic assembly (including module version GUID and timestamp)" -optsRealsig,"Generate assembly with IL visibility that matches the source code visibility" -optsRefOnly,"Produce a reference assembly, instead of a full assembly, as the primary output" +optsOptimize,"Enable optimizations (Short form: -O) (%s by default)" +optsTailcalls,"Enable or disable tailcalls (%s by default)" +optsDeterministic,"Produce a deterministic assembly (including module version GUID and timestamp) (%s by default)" +optsRealsig,"Generate assembly with IL visibility that matches the source code visibility (%s by default)" +optsRefOnly,"Produce a reference assembly, instead of a full assembly, as the primary output (%s by default)" optsRefOut,"Produce a reference assembly with the specified file path." optsPathMap,"Maps physical paths to source path names output by the compiler" -optsCrossoptimize,"Enable or disable cross-module optimizations" +optsCrossoptimize,"Enable or disable cross-module optimizations (%s by default)" optsReflectionFree,"Disable implicit generation of constructs using reflection" -optsWarnaserrorPM,"Report all warnings as errors" +optsWarnaserrorPM,"Report all warnings as errors (%s by default)" optsWarnaserror,"Report specific warnings as errors" optsWarn,"Set a warning level (0-5)" optsNowarn,"Disable specific warning messages" optsWarnOn,"Enable specific warnings that may be off by default" -optsChecked,"Generate overflow checks" +optsChecked,"Generate overflow checks (%s by default)" optsDefine,"Define conditional compilation symbols (Short form: -d)" optsMlcompatibility,"Ignore ML compatibility warnings" optsNologo,"Suppress compiler copyright message" @@ -925,11 +925,11 @@ optsInternalNoDescription,"The command-line option '%s' is for test purposes onl optsDCLONoDescription,"The command-line option '%s' has been deprecated" optsDCLODeprecatedSuggestAlternative,"The command-line option '%s' has been deprecated. Use '%s' instead." optsDCLOHtmlDoc,"The command-line option '%s' has been deprecated. HTML document generation is now part of the F# Power Pack, via the tool FsHtmlDoc.exe." -optsConsoleColors,"Output warning and error messages in color" -optsUseHighEntropyVA,"Enable high-entropy ASLR" +optsConsoleColors,"Output warning and error messages in color (%s by default)" +optsUseHighEntropyVA,"Enable high-entropy ASLR (%s by default)" optsSubSystemVersion,"Specify subsystem version of this assembly" optsTargetProfile,"Specify target framework profile of this assembly. Valid values are mscorlib, netcore or netstandard. Default - mscorlib" -optsEmitDebugInfoInQuotations,"Emit debug information in quotations" +optsEmitDebugInfoInQuotations,"Emit debug information in quotations (%s by default)" 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." @@ -1557,12 +1557,12 @@ csTypeHasNullAsExtraValue,"The type '%s' supports 'null' but a non-null type is 3352,typrelInterfaceMemberNoMostSpecificImplementation,"Interface member '%s' does not have a most specific implementation." 3353,fsiInvalidDirective,"Invalid directive '#%s %s'" useSdkRefs,"Use reference assemblies for .NET framework references when available (Enabled by default)." -optsCheckNulls,"Enable nullness declarations and checks" +optsCheckNulls,"Enable nullness declarations and checks (%s by default)" fSharpBannerVersion,"%s for F# %s" optsGetLangVersions,"Display the allowed values for language version." optsSetLangVersion,"Specify language version such as 'latest' or 'preview'." optsSupportedLangVersions,"Supported language versions:" -optsStrictIndentation,"Override indentation rules implied by the language version" +optsStrictIndentation,"Override indentation rules implied by the language version (%s by default)" nativeResourceFormatError,"Stream does not begin with a null resource and is not in '.RES' format." nativeResourceHeaderMalformed,"Resource header beginning at offset %s is malformed." formatDashItem," - %s" diff --git a/src/Compiler/Interactive/FSIstrings.txt b/src/Compiler/Interactive/FSIstrings.txt index 2340214f8d5..a40f6fffaab 100644 --- a/src/Compiler/Interactive/FSIstrings.txt +++ b/src/Compiler/Interactive/FSIstrings.txt @@ -13,10 +13,10 @@ fsiLoad,"#load the given file on startup" fsiRemaining,"Treat remaining arguments as command line arguments, accessed using fsi.CommandLineArgs" fsiHelp,"Display this usage message (Short form: -?)" fsiExec,"Exit fsi after loading the files or running the .fsx script given on the command line" -fsiGui,"Execute interactions on a Windows Forms event loop (on by default)" +fsiGui,"Execute interactions on a Windows Forms event loop (%s by default)" fsiQuiet,"Suppress fsi writing to stdout" -fsiReadline,"Support TAB completion in console (on by default)" -fsiEmitDebugInfoInQuotations,"Emit debug information in quotations" +fsiReadline,"Support TAB completion in console (%s by default)" +fsiEmitDebugInfoInQuotations,"Emit debug information in quotations (%s by default)" fsiBanner3,"For help type #help;;" fsiConsoleProblem,"A problem occurred starting the F# Interactive process. This may be due to a known problem with background process console support for Unicode-enabled applications on some Windows systems. Try selecting Tools->Options->F# Interactive for Visual Studio and enter '--fsi-server-no-unicode'." 2301,fsiInvalidAssembly,"'%s' is not a valid assembly name" @@ -53,9 +53,9 @@ fsiFailedToResolveAssembly,"Failed to resolve assembly '%s'" fsiBindingSessionTo,"Binding session to '%s'..." fsiProductName,"Microsoft (R) F# Interactive version %s" fsiProductNameCommunity,"F# Interactive for F# %s" -shadowCopyReferences,"Prevents references from being locked by the F# Interactive process" +shadowCopyReferences,"Prevents references from being locked by the F# Interactive process (%s by default)" fsiOperationCouldNotBeCompleted,"Operation could not be completed due to earlier error" fsiOperationFailed,"Operation failed. The error text has been printed in the error stream. To return the corresponding FSharpDiagnostic use the EvalInteractionNonThrowing, EvalScriptNonThrowing or EvalExpressionNonThrowing" -fsiMultiAssemblyEmitOption,"Emit multiple assemblies (on by default)" +fsiMultiAssemblyEmitOption,"Emit multiple assemblies (%s by default)" 2304,fsiEntryPointWontBeInvoked,"Functions with [] are not invoked in FSI. '%s' was not invoked. Execute '%s ' in order to invoke '%s' with the appropriate string array of command line arguments." fsiDetailedHelpLink,"See https://learn.microsoft.com/dotnet/fsharp/language-reference/fsharp-interactive-options for more details." \ No newline at end of file diff --git a/src/Compiler/Interactive/fsi.fs b/src/Compiler/Interactive/fsi.fs index 08bbb9f98ab..7c634ca81d6 100644 --- a/src/Compiler/Interactive/fsi.fs +++ b/src/Compiler/Interactive/fsi.fs @@ -1135,7 +1135,7 @@ type internal FsiCommandLineOptions(fsi: FsiEvaluationSessionHostConfig, argv: s tagNone, OptionSwitch(fun flag -> gui <- (flag = OptionSwitch.On)), None, - Some(FSIstrings.SR.fsiGui ()) + Some(FSIstrings.SR.fsiGui (formatOptionSwitch gui)) ) CompilerOption("quiet", "", OptionUnit(fun () -> tcConfigB.noFeedback <- true), None, Some(FSIstrings.SR.fsiQuiet ())) CompilerOption( @@ -1143,28 +1143,28 @@ type internal FsiCommandLineOptions(fsi: FsiEvaluationSessionHostConfig, argv: s tagNone, OptionSwitch(fun flag -> enableConsoleKeyProcessing <- (flag = OptionSwitch.On)), None, - Some(FSIstrings.SR.fsiReadline ()) + Some(FSIstrings.SR.fsiReadline (formatOptionSwitch enableConsoleKeyProcessing)) ) CompilerOption( "quotations-debug", tagNone, OptionSwitch(fun switch -> tcConfigB.emitDebugInfoInQuotations <- switch = OptionSwitch.On), None, - Some(FSIstrings.SR.fsiEmitDebugInfoInQuotations ()) + Some(FSIstrings.SR.fsiEmitDebugInfoInQuotations (formatOptionSwitch tcConfigB.emitDebugInfoInQuotations)) ) CompilerOption( "shadowcopyreferences", tagNone, OptionSwitch(fun flag -> tcConfigB.shadowCopyReferences <- flag = OptionSwitch.On), None, - Some(FSIstrings.SR.shadowCopyReferences ()) + Some(FSIstrings.SR.shadowCopyReferences (formatOptionSwitch tcConfigB.shadowCopyReferences)) ) CompilerOption( "multiemit", tagNone, OptionSwitch(fun flag -> tcConfigB.fsiMultiAssemblyEmit <- flag = OptionSwitch.On), None, - Some(FSIstrings.SR.fsiMultiAssemblyEmitOption ()) + Some(FSIstrings.SR.fsiMultiAssemblyEmitOption (formatOptionSwitch tcConfigB.fsiMultiAssemblyEmit)) ) ] ) diff --git a/src/Compiler/Interactive/xlf/FSIstrings.txt.cs.xlf b/src/Compiler/Interactive/xlf/FSIstrings.txt.cs.xlf index f34d1d6f7de..afcff9f805d 100644 --- a/src/Compiler/Interactive/xlf/FSIstrings.txt.cs.xlf +++ b/src/Compiler/Interactive/xlf/FSIstrings.txt.cs.xlf @@ -38,8 +38,8 @@ - Emit multiple assemblies (on by default) - Vygenerovat více sestavení (ve výchozím nastavení zapnuto) + Emit multiple assemblies ({0} by default) + Emit multiple assemblies ({0} by default) @@ -113,8 +113,8 @@ - Execute interactions on a Windows Forms event loop (on by default) - Provést interakce u smyčky událostí modelu Windows Forms (ve výchozím nastavení zapnuté) + Execute interactions on a Windows Forms event loop ({0} by default) + Execute interactions on a Windows Forms event loop ({0} by default) @@ -123,13 +123,13 @@ - Support TAB completion in console (on by default) - Podpora dokončování pomocí tabulátorů v konzole (ve výchozím nastavení zapnuté) + Support TAB completion in console ({0} by default) + Support TAB completion in console ({0} by default) - Emit debug information in quotations - Generovat ladicí informace v uvozovkách + Emit debug information in quotations ({0} by default) + Emit debug information in quotations ({0} by default) @@ -298,8 +298,8 @@ - Prevents references from being locked by the F# Interactive process - Znemožňuje zamknutí referencí procesem F# Interactive. + Prevents references from being locked by the F# Interactive process ({0} by default) + Prevents references from being locked by the F# Interactive process ({0} by default) diff --git a/src/Compiler/Interactive/xlf/FSIstrings.txt.de.xlf b/src/Compiler/Interactive/xlf/FSIstrings.txt.de.xlf index 8a295c31994..3eb197a047d 100644 --- a/src/Compiler/Interactive/xlf/FSIstrings.txt.de.xlf +++ b/src/Compiler/Interactive/xlf/FSIstrings.txt.de.xlf @@ -38,8 +38,8 @@ - Emit multiple assemblies (on by default) - Ausgeben mehrerer Assemblys (standardmäßig aktiviert) + Emit multiple assemblies ({0} by default) + Emit multiple assemblies ({0} by default) @@ -113,8 +113,8 @@ - Execute interactions on a Windows Forms event loop (on by default) - Interaktionen in einer Windows Forms-Ereignisschleife ausführen (standardmäßig aktiviert) + Execute interactions on a Windows Forms event loop ({0} by default) + Execute interactions on a Windows Forms event loop ({0} by default) @@ -123,13 +123,13 @@ - Support TAB completion in console (on by default) - Vervollständigung mit der TAB-TASTE in der Konsole unterstützen (standardmäßig aktiviert) + Support TAB completion in console ({0} by default) + Support TAB completion in console ({0} by default) - Emit debug information in quotations - Debugginginformationen in Anführungszeichen ausgeben + Emit debug information in quotations ({0} by default) + Emit debug information in quotations ({0} by default) @@ -298,8 +298,8 @@ - Prevents references from being locked by the F# Interactive process - Verhindert, dass Verweise vom F# Interactive-Prozess gesperrt werden. + Prevents references from being locked by the F# Interactive process ({0} by default) + Prevents references from being locked by the F# Interactive process ({0} by default) diff --git a/src/Compiler/Interactive/xlf/FSIstrings.txt.es.xlf b/src/Compiler/Interactive/xlf/FSIstrings.txt.es.xlf index 23932efb4a6..0ad15542bb1 100644 --- a/src/Compiler/Interactive/xlf/FSIstrings.txt.es.xlf +++ b/src/Compiler/Interactive/xlf/FSIstrings.txt.es.xlf @@ -38,8 +38,8 @@ - Emit multiple assemblies (on by default) - Emitir varios ensamblados (activado de forma predeterminada) + Emit multiple assemblies ({0} by default) + Emit multiple assemblies ({0} by default) @@ -113,8 +113,8 @@ - Execute interactions on a Windows Forms event loop (on by default) - Ejecutar interacciones en un bucle de evento de Windows Forms (activado de forma predeterminada) + Execute interactions on a Windows Forms event loop ({0} by default) + Execute interactions on a Windows Forms event loop ({0} by default) @@ -123,13 +123,13 @@ - Support TAB completion in console (on by default) - Admitir finalización con TAB en la consola (activada de forma predeterminada) + Support TAB completion in console ({0} by default) + Support TAB completion in console ({0} by default) - Emit debug information in quotations - Emitir información de depuración en expresiones de código delimitadas + Emit debug information in quotations ({0} by default) + Emit debug information in quotations ({0} by default) @@ -298,8 +298,8 @@ - Prevents references from being locked by the F# Interactive process - Impide que el proceso de F# interactivo bloquee las referencias + Prevents references from being locked by the F# Interactive process ({0} by default) + Prevents references from being locked by the F# Interactive process ({0} by default) diff --git a/src/Compiler/Interactive/xlf/FSIstrings.txt.fr.xlf b/src/Compiler/Interactive/xlf/FSIstrings.txt.fr.xlf index 1e2032619de..270a902e005 100644 --- a/src/Compiler/Interactive/xlf/FSIstrings.txt.fr.xlf +++ b/src/Compiler/Interactive/xlf/FSIstrings.txt.fr.xlf @@ -38,8 +38,8 @@ - Emit multiple assemblies (on by default) - Émettre plusieurs assemblées (activés par défaut) + Emit multiple assemblies ({0} by default) + Emit multiple assemblies ({0} by default) @@ -113,8 +113,8 @@ - Execute interactions on a Windows Forms event loop (on by default) - Exécute des interactions dans une boucle d'événements Windows Forms (activé par default) + Execute interactions on a Windows Forms event loop ({0} by default) + Execute interactions on a Windows Forms event loop ({0} by default) @@ -123,13 +123,13 @@ - Support TAB completion in console (on by default) - Prend en charge la saisie semi-automatique via la touche Tab dans la console (activée par défaut) + Support TAB completion in console ({0} by default) + Support TAB completion in console ({0} by default) - Emit debug information in quotations - Émettre les informations de débogage entre quotations + Emit debug information in quotations ({0} by default) + Emit debug information in quotations ({0} by default) @@ -298,8 +298,8 @@ - Prevents references from being locked by the F# Interactive process - Empêche le blocage des références par le processus de F# Interactive + Prevents references from being locked by the F# Interactive process ({0} by default) + Prevents references from being locked by the F# Interactive process ({0} by default) diff --git a/src/Compiler/Interactive/xlf/FSIstrings.txt.it.xlf b/src/Compiler/Interactive/xlf/FSIstrings.txt.it.xlf index 80dc7d6509a..c4f58ffb2e4 100644 --- a/src/Compiler/Interactive/xlf/FSIstrings.txt.it.xlf +++ b/src/Compiler/Interactive/xlf/FSIstrings.txt.it.xlf @@ -38,8 +38,8 @@ - Emit multiple assemblies (on by default) - Creare più assembly (attivato per impostazione predefinita) + Emit multiple assemblies ({0} by default) + Emit multiple assemblies ({0} by default) @@ -113,8 +113,8 @@ - Execute interactions on a Windows Forms event loop (on by default) - Esegue interazioni in un ciclo di eventi di Windows Forms (abilitata per impostazione predefinita) + Execute interactions on a Windows Forms event loop ({0} by default) + Execute interactions on a Windows Forms event loop ({0} by default) @@ -123,13 +123,13 @@ - Support TAB completion in console (on by default) - Supporta completamento con tasto TAB in console (abilitata per impostazione predefinita) + Support TAB completion in console ({0} by default) + Support TAB completion in console ({0} by default) - Emit debug information in quotations - Crea informazioni di debug in quotation + Emit debug information in quotations ({0} by default) + Emit debug information in quotations ({0} by default) @@ -298,8 +298,8 @@ - Prevents references from being locked by the F# Interactive process - Impedisce che i riferimenti vengano bloccati dal processo F# Interactive + Prevents references from being locked by the F# Interactive process ({0} by default) + Prevents references from being locked by the F# Interactive process ({0} by default) diff --git a/src/Compiler/Interactive/xlf/FSIstrings.txt.ja.xlf b/src/Compiler/Interactive/xlf/FSIstrings.txt.ja.xlf index aab77e35fb2..2fa2f345369 100644 --- a/src/Compiler/Interactive/xlf/FSIstrings.txt.ja.xlf +++ b/src/Compiler/Interactive/xlf/FSIstrings.txt.ja.xlf @@ -38,8 +38,8 @@ - Emit multiple assemblies (on by default) - 複数のアセンブリを出力する (既定ではオン) + Emit multiple assemblies ({0} by default) + Emit multiple assemblies ({0} by default) @@ -113,8 +113,8 @@ - Execute interactions on a Windows Forms event loop (on by default) - Windows フォーム イベント ループでの対話の実行 (既定でオン) + Execute interactions on a Windows Forms event loop ({0} by default) + Execute interactions on a Windows Forms event loop ({0} by default) @@ -123,13 +123,13 @@ - Support TAB completion in console (on by default) - コンソールでの TAB 補完のサポート (既定でオン) + Support TAB completion in console ({0} by default) + Support TAB completion in console ({0} by default) - Emit debug information in quotations - デバッグ情報を引用符で囲んで生成します + Emit debug information in quotations ({0} by default) + Emit debug information in quotations ({0} by default) @@ -298,8 +298,8 @@ - Prevents references from being locked by the F# Interactive process - 参照が F# インタラクティブ プロセスによってロックされないようにします。 + Prevents references from being locked by the F# Interactive process ({0} by default) + Prevents references from being locked by the F# Interactive process ({0} by default) diff --git a/src/Compiler/Interactive/xlf/FSIstrings.txt.ko.xlf b/src/Compiler/Interactive/xlf/FSIstrings.txt.ko.xlf index fc80e805ced..1bc10708ee6 100644 --- a/src/Compiler/Interactive/xlf/FSIstrings.txt.ko.xlf +++ b/src/Compiler/Interactive/xlf/FSIstrings.txt.ko.xlf @@ -38,8 +38,8 @@ - Emit multiple assemblies (on by default) - 여러 어셈블리 내보내기(기본적으로 켜져 있음) + Emit multiple assemblies ({0} by default) + Emit multiple assemblies ({0} by default) @@ -113,8 +113,8 @@ - Execute interactions on a Windows Forms event loop (on by default) - Windows Forms 이벤트 루프에서 상호 작용을 실행합니다(기본값: 설정). + Execute interactions on a Windows Forms event loop ({0} by default) + Execute interactions on a Windows Forms event loop ({0} by default) @@ -123,13 +123,13 @@ - Support TAB completion in console (on by default) - 콘솔에서 Tab 키 완성 기능을 지원합니다(기본값: 설정). + Support TAB completion in console ({0} by default) + Support TAB completion in console ({0} by default) - Emit debug information in quotations - 인용구의 디버그 정보를 내보냅니다. + Emit debug information in quotations ({0} by default) + Emit debug information in quotations ({0} by default) @@ -298,8 +298,8 @@ - Prevents references from being locked by the F# Interactive process - 참조가 F# 대화형 프로세스에 의해 잠기지 않도록 합니다. + Prevents references from being locked by the F# Interactive process ({0} by default) + Prevents references from being locked by the F# Interactive process ({0} by default) diff --git a/src/Compiler/Interactive/xlf/FSIstrings.txt.pl.xlf b/src/Compiler/Interactive/xlf/FSIstrings.txt.pl.xlf index 57d8b491f45..63e8a54937d 100644 --- a/src/Compiler/Interactive/xlf/FSIstrings.txt.pl.xlf +++ b/src/Compiler/Interactive/xlf/FSIstrings.txt.pl.xlf @@ -38,8 +38,8 @@ - Emit multiple assemblies (on by default) - Emituj wiele zestawów (domyślnie włączone) + Emit multiple assemblies ({0} by default) + Emit multiple assemblies ({0} by default) @@ -113,8 +113,8 @@ - Execute interactions on a Windows Forms event loop (on by default) - Wykonaj interakcje w pętli zdarzenia Windows Forms (domyślnie włączone) + Execute interactions on a Windows Forms event loop ({0} by default) + Execute interactions on a Windows Forms event loop ({0} by default) @@ -123,13 +123,13 @@ - Support TAB completion in console (on by default) - Obsługa uzupełniania po naciśnięciu klawisza TAB w konsoli (domyślnie włączona) + Support TAB completion in console ({0} by default) + Support TAB completion in console ({0} by default) - Emit debug information in quotations - Emituj informacje debugowania w cudzysłowach + Emit debug information in quotations ({0} by default) + Emit debug information in quotations ({0} by default) @@ -298,8 +298,8 @@ - Prevents references from being locked by the F# Interactive process - Uniemożliwia blokowanie odwołań przez proces narzędzia F# Interactive + Prevents references from being locked by the F# Interactive process ({0} by default) + Prevents references from being locked by the F# Interactive process ({0} by default) diff --git a/src/Compiler/Interactive/xlf/FSIstrings.txt.pt-BR.xlf b/src/Compiler/Interactive/xlf/FSIstrings.txt.pt-BR.xlf index c9869893e0d..29b3d014cbd 100644 --- a/src/Compiler/Interactive/xlf/FSIstrings.txt.pt-BR.xlf +++ b/src/Compiler/Interactive/xlf/FSIstrings.txt.pt-BR.xlf @@ -38,8 +38,8 @@ - Emit multiple assemblies (on by default) - Emitir várias montagens (ativadas por padrão) + Emit multiple assemblies ({0} by default) + Emit multiple assemblies ({0} by default) @@ -113,8 +113,8 @@ - Execute interactions on a Windows Forms event loop (on by default) - Execute interações em um loop de eventos do Windows Forms (por padrão) + Execute interactions on a Windows Forms event loop ({0} by default) + Execute interactions on a Windows Forms event loop ({0} by default) @@ -123,13 +123,13 @@ - Support TAB completion in console (on by default) - Suportar a conclusão TAB no console (por padrão) + Support TAB completion in console ({0} by default) + Support TAB completion in console ({0} by default) - Emit debug information in quotations - Emitir informações de depuração entre aspas + Emit debug information in quotations ({0} by default) + Emit debug information in quotations ({0} by default) @@ -298,8 +298,8 @@ - Prevents references from being locked by the F# Interactive process - Impede que as referências sejam bloqueadas pelo processo de F# interativo + Prevents references from being locked by the F# Interactive process ({0} by default) + Prevents references from being locked by the F# Interactive process ({0} by default) diff --git a/src/Compiler/Interactive/xlf/FSIstrings.txt.ru.xlf b/src/Compiler/Interactive/xlf/FSIstrings.txt.ru.xlf index ca55edd31df..a00fdf36c9e 100644 --- a/src/Compiler/Interactive/xlf/FSIstrings.txt.ru.xlf +++ b/src/Compiler/Interactive/xlf/FSIstrings.txt.ru.xlf @@ -38,8 +38,8 @@ - Emit multiple assemblies (on by default) - Выпуск нескольких сборок (включено по умолчанию) + Emit multiple assemblies ({0} by default) + Emit multiple assemblies ({0} by default) @@ -113,8 +113,8 @@ - Execute interactions on a Windows Forms event loop (on by default) - Выполнение взаимодействий при зацикливании события Windows Forms (включено по умолчанию) + Execute interactions on a Windows Forms event loop ({0} by default) + Execute interactions on a Windows Forms event loop ({0} by default) @@ -123,13 +123,13 @@ - Support TAB completion in console (on by default) - Поддержка заполнения нажатием клавиши TAB в консоли (включено по умолчанию) + Support TAB completion in console ({0} by default) + Support TAB completion in console ({0} by default) - Emit debug information in quotations - Вывод отладочной информации в кавычках + Emit debug information in quotations ({0} by default) + Emit debug information in quotations ({0} by default) @@ -298,8 +298,8 @@ - Prevents references from being locked by the F# Interactive process - Предотвращает блокировку ссылок интерактивным процессом F#. + Prevents references from being locked by the F# Interactive process ({0} by default) + Prevents references from being locked by the F# Interactive process ({0} by default) diff --git a/src/Compiler/Interactive/xlf/FSIstrings.txt.tr.xlf b/src/Compiler/Interactive/xlf/FSIstrings.txt.tr.xlf index cbab7d0b0ae..15a485e8909 100644 --- a/src/Compiler/Interactive/xlf/FSIstrings.txt.tr.xlf +++ b/src/Compiler/Interactive/xlf/FSIstrings.txt.tr.xlf @@ -38,8 +38,8 @@ - Emit multiple assemblies (on by default) - Birden çok bütünleştirilmiş kod göster (varsayılan olarak açık) + Emit multiple assemblies ({0} by default) + Emit multiple assemblies ({0} by default) @@ -113,8 +113,8 @@ - Execute interactions on a Windows Forms event loop (on by default) - Etkileşimleri Windows Forms olay döngüsünde yürüt (varsayılan seçenek olarak açık) + Execute interactions on a Windows Forms event loop ({0} by default) + Execute interactions on a Windows Forms event loop ({0} by default) @@ -123,13 +123,13 @@ - Support TAB completion in console (on by default) - Konsolda SEKME ile tamamlamayı destekle (varsayılan seçenek olarak açık) + Support TAB completion in console ({0} by default) + Support TAB completion in console ({0} by default) - Emit debug information in quotations - Tırnak içindeki hata ayıklama bilgilerini yay + Emit debug information in quotations ({0} by default) + Emit debug information in quotations ({0} by default) @@ -298,8 +298,8 @@ - Prevents references from being locked by the F# Interactive process - Başvuruların F# Etkileşimli işlemi tarafından kilitlenmesini engeller + Prevents references from being locked by the F# Interactive process ({0} by default) + Prevents references from being locked by the F# Interactive process ({0} by default) diff --git a/src/Compiler/Interactive/xlf/FSIstrings.txt.zh-Hans.xlf b/src/Compiler/Interactive/xlf/FSIstrings.txt.zh-Hans.xlf index 1da5881d776..a8342a21e03 100644 --- a/src/Compiler/Interactive/xlf/FSIstrings.txt.zh-Hans.xlf +++ b/src/Compiler/Interactive/xlf/FSIstrings.txt.zh-Hans.xlf @@ -38,8 +38,8 @@ - Emit multiple assemblies (on by default) - 发出多个程序集(默认打开) + Emit multiple assemblies ({0} by default) + Emit multiple assemblies ({0} by default) @@ -113,8 +113,8 @@ - Execute interactions on a Windows Forms event loop (on by default) - 在 Windows 窗体事件循环中执行交互(默认情况下启用) + Execute interactions on a Windows Forms event loop ({0} by default) + Execute interactions on a Windows Forms event loop ({0} by default) @@ -123,13 +123,13 @@ - Support TAB completion in console (on by default) - 支持控制台中的 Tab 完成操作(默认情况下启用) + Support TAB completion in console ({0} by default) + Support TAB completion in console ({0} by default) - Emit debug information in quotations - 发出用引号引起来的调试信息 + Emit debug information in quotations ({0} by default) + Emit debug information in quotations ({0} by default) @@ -298,8 +298,8 @@ - Prevents references from being locked by the F# Interactive process - 防止引用被 F# 交互窗口进程锁定 + Prevents references from being locked by the F# Interactive process ({0} by default) + Prevents references from being locked by the F# Interactive process ({0} by default) diff --git a/src/Compiler/Interactive/xlf/FSIstrings.txt.zh-Hant.xlf b/src/Compiler/Interactive/xlf/FSIstrings.txt.zh-Hant.xlf index bec99354ad2..9df8f03da70 100644 --- a/src/Compiler/Interactive/xlf/FSIstrings.txt.zh-Hant.xlf +++ b/src/Compiler/Interactive/xlf/FSIstrings.txt.zh-Hant.xlf @@ -38,8 +38,8 @@ - Emit multiple assemblies (on by default) - 發出多組件 (預設為開啟) + Emit multiple assemblies ({0} by default) + Emit multiple assemblies ({0} by default) @@ -113,8 +113,8 @@ - Execute interactions on a Windows Forms event loop (on by default) - 在 Windows Forms 事件迴圈上執行互動 (預設為開啟) + Execute interactions on a Windows Forms event loop ({0} by default) + Execute interactions on a Windows Forms event loop ({0} by default) @@ -123,13 +123,13 @@ - Support TAB completion in console (on by default) - 支援主控台中的 TAB 鍵自動完成 (預設為開啟) + Support TAB completion in console ({0} by default) + Support TAB completion in console ({0} by default) - Emit debug information in quotations - 發出在引號內的偵錯資訊 + Emit debug information in quotations ({0} by default) + Emit debug information in quotations ({0} by default) @@ -298,8 +298,8 @@ - Prevents references from being locked by the F# Interactive process - 避免參考遭 F# 互動處理序封鎖 + Prevents references from being locked by the F# Interactive process ({0} by default) + Prevents references from being locked by the F# Interactive process ({0} by default) diff --git a/src/Compiler/xlf/FSComp.txt.cs.xlf b/src/Compiler/xlf/FSComp.txt.cs.xlf index 1531db70738..044a9c461f4 100644 --- a/src/Compiler/xlf/FSComp.txt.cs.xlf +++ b/src/Compiler/xlf/FSComp.txt.cs.xlf @@ -908,8 +908,8 @@ - Enable nullness declarations and checks - Enable nullness declarations and checks + Enable nullness declarations and checks ({0} by default) + Enable nullness declarations and checks ({0} by default) @@ -918,8 +918,8 @@ - Compress interface and optimization data files - Komprimovat datové soubory rozhraní a optimalizace + Compress interface and optimization data files ({0} by default) + Compress interface and optimization data files ({0} by default) @@ -948,13 +948,13 @@ - Generate assembly with IL visibility that matches the source code visibility - Vygenerovat sestavení s viditelností IL, které odpovídá viditelnosti zdrojového kódu + Generate assembly with IL visibility that matches the source code visibility ({0} by default) + Generate assembly with IL visibility that matches the source code visibility ({0} by default) - Produce a reference assembly, instead of a full assembly, as the primary output - Vytvoří referenční sestavení místo úplného sestavení jako primární výstup. + Produce a reference assembly, instead of a full assembly, as the primary output ({0} by default) + Produce a reference assembly, instead of a full assembly, as the primary output ({0} by default) @@ -978,8 +978,8 @@ - Override indentation rules implied by the language version - Přepsat pravidla odsazení implikovaná verzí jazyka + Override indentation rules implied by the language version ({0} by default) + Override indentation rules implied by the language version ({0} by default) @@ -5828,13 +5828,13 @@ - Delay-sign the assembly using only the public portion of the strong name key - Vytvoří zpožděný podpis sestavení jenom s využitím veřejné části klíče silného názvu. + Delay-sign the assembly using only the public portion of the strong name key ({0} by default) + Delay-sign the assembly using only the public portion of the strong name key ({0} by default) - Public-sign the assembly using only the public portion of the strong name key, and mark the assembly as signed - Vytvoří veřejný podpis sestavení jenom s využitím veřejné části klíče silného názvu a označí sestavení jako podepsané. + Public-sign the assembly using only the public portion of the strong name key, and mark the assembly as signed ({0} by default) + Public-sign the assembly using only the public portion of the strong name key, and mark the assembly as signed ({0} by default) @@ -5893,8 +5893,8 @@ - Embed all source files in the portable PDB file - Vložit všechny zdrojové soubory do souboru PDB typu Portable + Embed all source files in the portable PDB file ({0} by default) + Embed all source files in the portable PDB file ({0} by default) @@ -5923,8 +5923,8 @@ - Emit debug information (Short form: -g) - Generuje ladicí informace (krátký tvar: -g). + Emit debug information (Short form: -g) ({0} by default) + Emit debug information (Short form: -g) ({0} by default) @@ -5933,28 +5933,28 @@ - Enable optimizations (Short form: -O) - Povolit optimalizace (krátký tvar: -O) + Enable optimizations (Short form: -O) ({0} by default) + Enable optimizations (Short form: -O) ({0} by default) - Enable or disable tailcalls - Zapnout nebo vypnout volání funkce Tail + Enable or disable tailcalls ({0} by default) + Enable or disable tailcalls ({0} by default) - Produce a deterministic assembly (including module version GUID and timestamp) - Vytvoří deterministické sestavení (včetně GUID verze modulu a časového razítka). + Produce a deterministic assembly (including module version GUID and timestamp) ({0} by default) + Produce a deterministic assembly (including module version GUID and timestamp) ({0} by default) - Enable or disable cross-module optimizations - Povoluje nebo zakazuje optimalizaci mezi moduly. + Enable or disable cross-module optimizations ({0} by default) + Enable or disable cross-module optimizations ({0} by default) - Report all warnings as errors - Oznamovat všechna upozornění jako chyby + Report all warnings as errors ({0} by default) + Report all warnings as errors ({0} by default) @@ -5978,8 +5978,8 @@ - Generate overflow checks - Generovat kontroly přetečení + Generate overflow checks ({0} by default) + Generate overflow checks ({0} by default) @@ -6163,13 +6163,13 @@ - Output warning and error messages in color - Barevně rozlišená upozornění výstupu a chybové zprávy + Output warning and error messages in color ({0} by default) + Output warning and error messages in color ({0} by default) - Enable high-entropy ASLR - Povolit technologii ASLR s vysokou entropií + Enable high-entropy ASLR ({0} by default) + Enable high-entropy ASLR ({0} by default) @@ -6183,8 +6183,8 @@ - Emit debug information in quotations - Generovat ladicí informace v uvozovkách + Emit debug information in quotations ({0} by default) + Emit debug information in quotations ({0} by default) diff --git a/src/Compiler/xlf/FSComp.txt.de.xlf b/src/Compiler/xlf/FSComp.txt.de.xlf index 232b9023663..b8e33044bc8 100644 --- a/src/Compiler/xlf/FSComp.txt.de.xlf +++ b/src/Compiler/xlf/FSComp.txt.de.xlf @@ -908,8 +908,8 @@ - Enable nullness declarations and checks - Enable nullness declarations and checks + Enable nullness declarations and checks ({0} by default) + Enable nullness declarations and checks ({0} by default) @@ -918,8 +918,8 @@ - Compress interface and optimization data files - Komprimieren von Schnittstellen- und Optimierungsdatendateien + Compress interface and optimization data files ({0} by default) + Compress interface and optimization data files ({0} by default) @@ -948,13 +948,13 @@ - Generate assembly with IL visibility that matches the source code visibility - Assembly mit IL-Sichtbarkeit generieren, die der Quellcodesichtbarkeit entspricht + Generate assembly with IL visibility that matches the source code visibility ({0} by default) + Generate assembly with IL visibility that matches the source code visibility ({0} by default) - Produce a reference assembly, instead of a full assembly, as the primary output - Erstellen einer Referenzassembly anstelle einer vollständigen Assembly als primäre Ausgabe + Produce a reference assembly, instead of a full assembly, as the primary output ({0} by default) + Produce a reference assembly, instead of a full assembly, as the primary output ({0} by default) @@ -978,8 +978,8 @@ - Override indentation rules implied by the language version - Von der Sprachversion implizierte Einzugsregeln überschreiben + Override indentation rules implied by the language version ({0} by default) + Override indentation rules implied by the language version ({0} by default) @@ -5828,13 +5828,13 @@ - Delay-sign the assembly using only the public portion of the strong name key - Assembly nur mit dem öffentlichen Teil des Schlüssels für einen starken Namen verzögert signieren + Delay-sign the assembly using only the public portion of the strong name key ({0} by default) + Delay-sign the assembly using only the public portion of the strong name key ({0} by default) - Public-sign the assembly using only the public portion of the strong name key, and mark the assembly as signed - Assembly mithilfe nur des öffentlichen Teils des Schlüssels für einen starken Namen öffentlich signieren und als signiert markieren + Public-sign the assembly using only the public portion of the strong name key, and mark the assembly as signed ({0} by default) + Public-sign the assembly using only the public portion of the strong name key, and mark the assembly as signed ({0} by default) @@ -5893,8 +5893,8 @@ - Embed all source files in the portable PDB file - Alle Quelldateien in der portierbaren PDB-Datei einbetten + Embed all source files in the portable PDB file ({0} by default) + Embed all source files in the portable PDB file ({0} by default) @@ -5923,8 +5923,8 @@ - Emit debug information (Short form: -g) - Debuginformationen ausgeben (Kurzform: -g) + Emit debug information (Short form: -g) ({0} by default) + Emit debug information (Short form: -g) ({0} by default) @@ -5933,28 +5933,28 @@ - Enable optimizations (Short form: -O) - Optimierungen aktivieren (Kurzform: -O) + Enable optimizations (Short form: -O) ({0} by default) + Enable optimizations (Short form: -O) ({0} by default) - Enable or disable tailcalls - Endeaufrufe aktivieren oder deaktivieren + Enable or disable tailcalls ({0} by default) + Enable or disable tailcalls ({0} by default) - Produce a deterministic assembly (including module version GUID and timestamp) - Deterministische Assembly erstellen (einschließlich Modulversions-GUID und Zeitstempel) + Produce a deterministic assembly (including module version GUID and timestamp) ({0} by default) + Produce a deterministic assembly (including module version GUID and timestamp) ({0} by default) - Enable or disable cross-module optimizations - Modulübergreifende Optimierungen aktivieren oder deaktivieren + Enable or disable cross-module optimizations ({0} by default) + Enable or disable cross-module optimizations ({0} by default) - Report all warnings as errors - Alle Warnungen als Fehler melden + Report all warnings as errors ({0} by default) + Report all warnings as errors ({0} by default) @@ -5978,8 +5978,8 @@ - Generate overflow checks - Überlaufprüfungen generieren + Generate overflow checks ({0} by default) + Generate overflow checks ({0} by default) @@ -6163,13 +6163,13 @@ - Output warning and error messages in color - Warnungen und Fehlermeldungen farbig ausgeben + Output warning and error messages in color ({0} by default) + Output warning and error messages in color ({0} by default) - Enable high-entropy ASLR - ASLR mit hoher Entropie aktivieren + Enable high-entropy ASLR ({0} by default) + Enable high-entropy ASLR ({0} by default) @@ -6183,8 +6183,8 @@ - Emit debug information in quotations - Debugginginformationen in Anführungszeichen ausgeben + Emit debug information in quotations ({0} by default) + Emit debug information in quotations ({0} by default) diff --git a/src/Compiler/xlf/FSComp.txt.es.xlf b/src/Compiler/xlf/FSComp.txt.es.xlf index e36ffcc1a4d..cbb8274fd80 100644 --- a/src/Compiler/xlf/FSComp.txt.es.xlf +++ b/src/Compiler/xlf/FSComp.txt.es.xlf @@ -908,8 +908,8 @@ - Enable nullness declarations and checks - Enable nullness declarations and checks + Enable nullness declarations and checks ({0} by default) + Enable nullness declarations and checks ({0} by default) @@ -918,8 +918,8 @@ - Compress interface and optimization data files - Comprimir archivos de datos de interfaz y optimización + Compress interface and optimization data files ({0} by default) + Compress interface and optimization data files ({0} by default) @@ -948,13 +948,13 @@ - Generate assembly with IL visibility that matches the source code visibility - Generación de un ensamblado con visibilidad IL que coincida con la visibilidad del código fuente + Generate assembly with IL visibility that matches the source code visibility ({0} by default) + Generate assembly with IL visibility that matches the source code visibility ({0} by default) - Produce a reference assembly, instead of a full assembly, as the primary output - Generar un ensamblado de referencia, en lugar de un ensamblado completo, como salida principal + Produce a reference assembly, instead of a full assembly, as the primary output ({0} by default) + Produce a reference assembly, instead of a full assembly, as the primary output ({0} by default) @@ -978,8 +978,8 @@ - Override indentation rules implied by the language version - Invalidar reglas de sangría implícitas por la versión del lenguaje + Override indentation rules implied by the language version ({0} by default) + Override indentation rules implied by the language version ({0} by default) @@ -5828,13 +5828,13 @@ - Delay-sign the assembly using only the public portion of the strong name key - Retrasar la signatura del ensamblado usando solo la parte pública de la clave de nombre seguro + Delay-sign the assembly using only the public portion of the strong name key ({0} by default) + Delay-sign the assembly using only the public portion of the strong name key ({0} by default) - Public-sign the assembly using only the public portion of the strong name key, and mark the assembly as signed - Firmar el ensamblado usando solo la parte pública de la clave de nombre seguro y marcarlo como firmado + Public-sign the assembly using only the public portion of the strong name key, and mark the assembly as signed ({0} by default) + Public-sign the assembly using only the public portion of the strong name key, and mark the assembly as signed ({0} by default) @@ -5893,8 +5893,8 @@ - Embed all source files in the portable PDB file - Inserta todos los archivos de código fuente en el archivo PDB portable. + Embed all source files in the portable PDB file ({0} by default) + Embed all source files in the portable PDB file ({0} by default) @@ -5923,8 +5923,8 @@ - Emit debug information (Short form: -g) - Emitir información de depuración (forma corta: -g) + Emit debug information (Short form: -g) ({0} by default) + Emit debug information (Short form: -g) ({0} by default) @@ -5933,28 +5933,28 @@ - Enable optimizations (Short form: -O) - Habilitar optimizaciones (forma corta: -O) + Enable optimizations (Short form: -O) ({0} by default) + Enable optimizations (Short form: -O) ({0} by default) - Enable or disable tailcalls - Habilitar o deshabilitar llamadas de cola + Enable or disable tailcalls ({0} by default) + Enable or disable tailcalls ({0} by default) - Produce a deterministic assembly (including module version GUID and timestamp) - Generar un ensamblado determinista (con el GUID y la marca de tiempo de la versión del módulo) + Produce a deterministic assembly (including module version GUID and timestamp) ({0} by default) + Produce a deterministic assembly (including module version GUID and timestamp) ({0} by default) - Enable or disable cross-module optimizations - Habilitar o deshabilitar optimizaciones entre módulos + Enable or disable cross-module optimizations ({0} by default) + Enable or disable cross-module optimizations ({0} by default) - Report all warnings as errors - Notificar todas las advertencias como errores + Report all warnings as errors ({0} by default) + Report all warnings as errors ({0} by default) @@ -5978,8 +5978,8 @@ - Generate overflow checks - Generar comprobaciones de desbordamiento + Generate overflow checks ({0} by default) + Generate overflow checks ({0} by default) @@ -6163,13 +6163,13 @@ - Output warning and error messages in color - Advertencia de salida y mensajes de error en color + Output warning and error messages in color ({0} by default) + Output warning and error messages in color ({0} by default) - Enable high-entropy ASLR - Habilitar ASLR de alta entropía + Enable high-entropy ASLR ({0} by default) + Enable high-entropy ASLR ({0} by default) @@ -6183,8 +6183,8 @@ - Emit debug information in quotations - Emitir información de depuración en expresiones de código delimitadas + Emit debug information in quotations ({0} by default) + Emit debug information in quotations ({0} by default) diff --git a/src/Compiler/xlf/FSComp.txt.fr.xlf b/src/Compiler/xlf/FSComp.txt.fr.xlf index 25e8fc5614e..7424a9be7be 100644 --- a/src/Compiler/xlf/FSComp.txt.fr.xlf +++ b/src/Compiler/xlf/FSComp.txt.fr.xlf @@ -908,8 +908,8 @@ - Enable nullness declarations and checks - Enable nullness declarations and checks + Enable nullness declarations and checks ({0} by default) + Enable nullness declarations and checks ({0} by default) @@ -918,8 +918,8 @@ - Compress interface and optimization data files - Compresser les fichiers de données d’interface et d’optimisation + Compress interface and optimization data files ({0} by default) + Compress interface and optimization data files ({0} by default) @@ -948,13 +948,13 @@ - Generate assembly with IL visibility that matches the source code visibility - Générer un assembly avec une visibilité IL qui correspond à la visibilité du code source + Generate assembly with IL visibility that matches the source code visibility ({0} by default) + Generate assembly with IL visibility that matches the source code visibility ({0} by default) - Produce a reference assembly, instead of a full assembly, as the primary output - Produire un assembly de référence, au lieu d’un assembly complet, en tant que sortie principale + Produce a reference assembly, instead of a full assembly, as the primary output ({0} by default) + Produce a reference assembly, instead of a full assembly, as the primary output ({0} by default) @@ -978,8 +978,8 @@ - Override indentation rules implied by the language version - Remplacer les règles d'indentation impliquées par la version linguistique + Override indentation rules implied by the language version ({0} by default) + Override indentation rules implied by the language version ({0} by default) @@ -5828,13 +5828,13 @@ - Delay-sign the assembly using only the public portion of the strong name key - Différer la signature de l'assembly en utilisant uniquement la partie publique de la clé de nom fort + Delay-sign the assembly using only the public portion of the strong name key ({0} by default) + Delay-sign the assembly using only the public portion of the strong name key ({0} by default) - Public-sign the assembly using only the public portion of the strong name key, and mark the assembly as signed - Signer publiquement l'assembly en utilisant uniquement la partie publique de la clé de nom fort, et marquer l'assembly comme signé + Public-sign the assembly using only the public portion of the strong name key, and mark the assembly as signed ({0} by default) + Public-sign the assembly using only the public portion of the strong name key, and mark the assembly as signed ({0} by default) @@ -5893,8 +5893,8 @@ - Embed all source files in the portable PDB file - Incorporer tous les fichiers sources dans le fichier PDB portable + Embed all source files in the portable PDB file ({0} by default) + Embed all source files in the portable PDB file ({0} by default) @@ -5923,8 +5923,8 @@ - Emit debug information (Short form: -g) - Émettre les informations de débogage (forme abrégée : -g) + Emit debug information (Short form: -g) ({0} by default) + Emit debug information (Short form: -g) ({0} by default) @@ -5933,28 +5933,28 @@ - Enable optimizations (Short form: -O) - Activer les optimisations (forme abrégée : -O) + Enable optimizations (Short form: -O) ({0} by default) + Enable optimizations (Short form: -O) ({0} by default) - Enable or disable tailcalls - Activer ou désactiver les appels tail + Enable or disable tailcalls ({0} by default) + Enable or disable tailcalls ({0} by default) - Produce a deterministic assembly (including module version GUID and timestamp) - Produire un assembly déterministe (en incluant le GUID et l'horodateur de la version du module) + Produce a deterministic assembly (including module version GUID and timestamp) ({0} by default) + Produce a deterministic assembly (including module version GUID and timestamp) ({0} by default) - Enable or disable cross-module optimizations - Activer ou désactiver les optimisations entre modules + Enable or disable cross-module optimizations ({0} by default) + Enable or disable cross-module optimizations ({0} by default) - Report all warnings as errors - Signaler tous les avertissements comme des erreurs + Report all warnings as errors ({0} by default) + Report all warnings as errors ({0} by default) @@ -5978,8 +5978,8 @@ - Generate overflow checks - Générer des contrôles de dépassement de capacité + Generate overflow checks ({0} by default) + Generate overflow checks ({0} by default) @@ -6163,13 +6163,13 @@ - Output warning and error messages in color - Générer les messages d'avertissement et d'erreur en couleur + Output warning and error messages in color ({0} by default) + Output warning and error messages in color ({0} by default) - Enable high-entropy ASLR - Activer la randomisation du format d'espace d'adresse d'entropie élevée + Enable high-entropy ASLR ({0} by default) + Enable high-entropy ASLR ({0} by default) @@ -6183,8 +6183,8 @@ - Emit debug information in quotations - Émettre les informations de débogage entre quotations + Emit debug information in quotations ({0} by default) + Emit debug information in quotations ({0} by default) diff --git a/src/Compiler/xlf/FSComp.txt.it.xlf b/src/Compiler/xlf/FSComp.txt.it.xlf index c439eed4de1..78e635516fe 100644 --- a/src/Compiler/xlf/FSComp.txt.it.xlf +++ b/src/Compiler/xlf/FSComp.txt.it.xlf @@ -908,8 +908,8 @@ - Enable nullness declarations and checks - Enable nullness declarations and checks + Enable nullness declarations and checks ({0} by default) + Enable nullness declarations and checks ({0} by default) @@ -918,8 +918,8 @@ - Compress interface and optimization data files - File di dati di compressione dell’interfaccia e ottimizzazione + Compress interface and optimization data files ({0} by default) + Compress interface and optimization data files ({0} by default) @@ -948,13 +948,13 @@ - Generate assembly with IL visibility that matches the source code visibility - Genera l'assembly con visibilità IL corrispondente alla visibilità del codice sorgente + Generate assembly with IL visibility that matches the source code visibility ({0} by default) + Generate assembly with IL visibility that matches the source code visibility ({0} by default) - Produce a reference assembly, instead of a full assembly, as the primary output - Produce un assembly di riferimento, anziché un assembly completo, come output primario + Produce a reference assembly, instead of a full assembly, as the primary output ({0} by default) + Produce a reference assembly, instead of a full assembly, as the primary output ({0} by default) @@ -978,8 +978,8 @@ - Override indentation rules implied by the language version - Ignora le regole di rientro implicite nella versione del linguaggio + Override indentation rules implied by the language version ({0} by default) + Override indentation rules implied by the language version ({0} by default) @@ -5828,13 +5828,13 @@ - Delay-sign the assembly using only the public portion of the strong name key - Ritarda la firma dell'assembly utilizzando solo la parte pubblica della chiave con nome sicuro + Delay-sign the assembly using only the public portion of the strong name key ({0} by default) + Delay-sign the assembly using only the public portion of the strong name key ({0} by default) - Public-sign the assembly using only the public portion of the strong name key, and mark the assembly as signed - Firma pubblicamente l'assembly usando solo la parte pubblica della chiave con nome sicuro e contrassegna l'assembly come firmato + Public-sign the assembly using only the public portion of the strong name key, and mark the assembly as signed ({0} by default) + Public-sign the assembly using only the public portion of the strong name key, and mark the assembly as signed ({0} by default) @@ -5893,8 +5893,8 @@ - Embed all source files in the portable PDB file - Incorpora tutti i file di origine nel file PDB portabile + Embed all source files in the portable PDB file ({0} by default) + Embed all source files in the portable PDB file ({0} by default) @@ -5923,8 +5923,8 @@ - Emit debug information (Short form: -g) - Crea informazioni di debug (forma breve: -g) + Emit debug information (Short form: -g) ({0} by default) + Emit debug information (Short form: -g) ({0} by default) @@ -5933,28 +5933,28 @@ - Enable optimizations (Short form: -O) - Abilita le ottimizzazioni (forma breve: -O) + Enable optimizations (Short form: -O) ({0} by default) + Enable optimizations (Short form: -O) ({0} by default) - Enable or disable tailcalls - Abilita o disabilita le chiamate tail + Enable or disable tailcalls ({0} by default) + Enable or disable tailcalls ({0} by default) - Produce a deterministic assembly (including module version GUID and timestamp) - Produce un assembly (che include GUID e timestamp della versione del modulo) + Produce a deterministic assembly (including module version GUID and timestamp) ({0} by default) + Produce a deterministic assembly (including module version GUID and timestamp) ({0} by default) - Enable or disable cross-module optimizations - Abilita o disabilita le ottimizzazioni tra i moduli + Enable or disable cross-module optimizations ({0} by default) + Enable or disable cross-module optimizations ({0} by default) - Report all warnings as errors - Segnala tutti gli avvisi come errori + Report all warnings as errors ({0} by default) + Report all warnings as errors ({0} by default) @@ -5978,8 +5978,8 @@ - Generate overflow checks - Genera controlli dell'overflow + Generate overflow checks ({0} by default) + Generate overflow checks ({0} by default) @@ -6163,13 +6163,13 @@ - Output warning and error messages in color - Visualizzare messaggi di errore e di avviso a colori + Output warning and error messages in color ({0} by default) + Output warning and error messages in color ({0} by default) - Enable high-entropy ASLR - Abilita ASLR a entropia elevata + Enable high-entropy ASLR ({0} by default) + Enable high-entropy ASLR ({0} by default) @@ -6183,8 +6183,8 @@ - Emit debug information in quotations - Crea informazioni di debug in quotation + Emit debug information in quotations ({0} by default) + Emit debug information in quotations ({0} by default) diff --git a/src/Compiler/xlf/FSComp.txt.ja.xlf b/src/Compiler/xlf/FSComp.txt.ja.xlf index 06487230d19..47e87ffde18 100644 --- a/src/Compiler/xlf/FSComp.txt.ja.xlf +++ b/src/Compiler/xlf/FSComp.txt.ja.xlf @@ -908,8 +908,8 @@ - Enable nullness declarations and checks - Enable nullness declarations and checks + Enable nullness declarations and checks ({0} by default) + Enable nullness declarations and checks ({0} by default) @@ -918,8 +918,8 @@ - Compress interface and optimization data files - インターフェイスと最適化データ ファイルを圧縮する + Compress interface and optimization data files ({0} by default) + Compress interface and optimization data files ({0} by default) @@ -948,13 +948,13 @@ - Generate assembly with IL visibility that matches the source code visibility - ソース コードの可視性と一致する IL 可視性を持つアセンブリを生成します + Generate assembly with IL visibility that matches the source code visibility ({0} by default) + Generate assembly with IL visibility that matches the source code visibility ({0} by default) - Produce a reference assembly, instead of a full assembly, as the primary output - 完全なアセンブリではなく、参照アセンブリをプライマリ出力として生成します + Produce a reference assembly, instead of a full assembly, as the primary output ({0} by default) + Produce a reference assembly, instead of a full assembly, as the primary output ({0} by default) @@ -978,8 +978,8 @@ - Override indentation rules implied by the language version - 言語バージョンによって暗黙的に指定されたインデント規則をオーバーライドする + Override indentation rules implied by the language version ({0} by default) + Override indentation rules implied by the language version ({0} by default) @@ -5828,13 +5828,13 @@ - Delay-sign the assembly using only the public portion of the strong name key - 厳密名キーのパブリックな部分のみを使ってアセンブリを遅延署名します + Delay-sign the assembly using only the public portion of the strong name key ({0} by default) + Delay-sign the assembly using only the public portion of the strong name key ({0} by default) - Public-sign the assembly using only the public portion of the strong name key, and mark the assembly as signed - 厳密な名前のキーの公開部分のみを使ってアセンブリを公開署名し、アセンブリを署名済みとしてマークします + Public-sign the assembly using only the public portion of the strong name key, and mark the assembly as signed ({0} by default) + Public-sign the assembly using only the public portion of the strong name key, and mark the assembly as signed ({0} by default) @@ -5893,8 +5893,8 @@ - Embed all source files in the portable PDB file - 移植可能な PDB ファイル内にすべてのソース ファイルを埋め込む + Embed all source files in the portable PDB file ({0} by default) + Embed all source files in the portable PDB file ({0} by default) @@ -5923,8 +5923,8 @@ - Emit debug information (Short form: -g) - デバッグ情報を生成します (短い形式: -g) + Emit debug information (Short form: -g) ({0} by default) + Emit debug information (Short form: -g) ({0} by default) @@ -5933,28 +5933,28 @@ - Enable optimizations (Short form: -O) - 最適化を有効にします (短い形式: -O) + Enable optimizations (Short form: -O) ({0} by default) + Enable optimizations (Short form: -O) ({0} by default) - Enable or disable tailcalls - tail の呼び出しを有効または無効にします + Enable or disable tailcalls ({0} by default) + Enable or disable tailcalls ({0} by default) - Produce a deterministic assembly (including module version GUID and timestamp) - 決定論的アセンブリを作成します (モジュール バージョン GUID やタイムスタンプなど) + Produce a deterministic assembly (including module version GUID and timestamp) ({0} by default) + Produce a deterministic assembly (including module version GUID and timestamp) ({0} by default) - Enable or disable cross-module optimizations - モジュール間の最適化を有効または無効にします + Enable or disable cross-module optimizations ({0} by default) + Enable or disable cross-module optimizations ({0} by default) - Report all warnings as errors - すべての警告をエラーとして報告する + Report all warnings as errors ({0} by default) + Report all warnings as errors ({0} by default) @@ -5978,8 +5978,8 @@ - Generate overflow checks - オーバーフロー チェックの生成 + Generate overflow checks ({0} by default) + Generate overflow checks ({0} by default) @@ -6163,13 +6163,13 @@ - Output warning and error messages in color - 警告メッセージとエラー メッセージを色つきで表示します + Output warning and error messages in color ({0} by default) + Output warning and error messages in color ({0} by default) - Enable high-entropy ASLR - 高エントロピ ASLR の有効化 + Enable high-entropy ASLR ({0} by default) + Enable high-entropy ASLR ({0} by default) @@ -6183,8 +6183,8 @@ - Emit debug information in quotations - デバッグ情報を引用符で囲んで生成します + Emit debug information in quotations ({0} by default) + Emit debug information in quotations ({0} by default) diff --git a/src/Compiler/xlf/FSComp.txt.ko.xlf b/src/Compiler/xlf/FSComp.txt.ko.xlf index 2fe10e6fae1..c30cc41398c 100644 --- a/src/Compiler/xlf/FSComp.txt.ko.xlf +++ b/src/Compiler/xlf/FSComp.txt.ko.xlf @@ -908,8 +908,8 @@ - Enable nullness declarations and checks - Enable nullness declarations and checks + Enable nullness declarations and checks ({0} by default) + Enable nullness declarations and checks ({0} by default) @@ -918,8 +918,8 @@ - Compress interface and optimization data files - 인터페이스 및 최적화 데이터 파일 압축 + Compress interface and optimization data files ({0} by default) + Compress interface and optimization data files ({0} by default) @@ -948,13 +948,13 @@ - Generate assembly with IL visibility that matches the source code visibility - 소스 코드 표시 유형과 일치하는 IL 표시 유형을 사용하여 어셈블리 생성 + Generate assembly with IL visibility that matches the source code visibility ({0} by default) + Generate assembly with IL visibility that matches the source code visibility ({0} by default) - Produce a reference assembly, instead of a full assembly, as the primary output - 주 출력으로 전체 어셈블리 대신 참조 어셈블리를 생성합니다. + Produce a reference assembly, instead of a full assembly, as the primary output ({0} by default) + Produce a reference assembly, instead of a full assembly, as the primary output ({0} by default) @@ -978,8 +978,8 @@ - Override indentation rules implied by the language version - 언어 버전에 포함된 들여쓰기 규칙 재정의 + Override indentation rules implied by the language version ({0} by default) + Override indentation rules implied by the language version ({0} by default) @@ -5828,13 +5828,13 @@ - Delay-sign the assembly using only the public portion of the strong name key - 강력한 이름 키의 공개 부분만 사용하여 어셈블리 서명을 연기합니다. + Delay-sign the assembly using only the public portion of the strong name key ({0} by default) + Delay-sign the assembly using only the public portion of the strong name key ({0} by default) - Public-sign the assembly using only the public portion of the strong name key, and mark the assembly as signed - 강력한 이름 키의 공개 부분만 사용하여 어셈블리를 공개 서명하고, 어셈블리를 서명됨으로 표시합니다. + Public-sign the assembly using only the public portion of the strong name key, and mark the assembly as signed ({0} by default) + Public-sign the assembly using only the public portion of the strong name key, and mark the assembly as signed ({0} by default) @@ -5893,8 +5893,8 @@ - Embed all source files in the portable PDB file - 이식 가능한 PDB 파일에 모든 소스 파일 포함 + Embed all source files in the portable PDB file ({0} by default) + Embed all source files in the portable PDB file ({0} by default) @@ -5923,8 +5923,8 @@ - Emit debug information (Short form: -g) - 디버그 정보를 내보냅니다(약식: -g). + Emit debug information (Short form: -g) ({0} by default) + Emit debug information (Short form: -g) ({0} by default) @@ -5933,28 +5933,28 @@ - Enable optimizations (Short form: -O) - 최적화를 사용합니다(약식: -O). + Enable optimizations (Short form: -O) ({0} by default) + Enable optimizations (Short form: -O) ({0} by default) - Enable or disable tailcalls - 마무리 호출을 사용하거나 사용하지 않습니다. + Enable or disable tailcalls ({0} by default) + Enable or disable tailcalls ({0} by default) - Produce a deterministic assembly (including module version GUID and timestamp) - 결정적 어셈블리(모듈 버전 GUID 및 타임스탬프 포함) 생성 + Produce a deterministic assembly (including module version GUID and timestamp) ({0} by default) + Produce a deterministic assembly (including module version GUID and timestamp) ({0} by default) - Enable or disable cross-module optimizations - 크로스 모듈을 최적화하거나 최적화하지 않습니다. + Enable or disable cross-module optimizations ({0} by default) + Enable or disable cross-module optimizations ({0} by default) - Report all warnings as errors - 모든 경고를 오류로 보고합니다. + Report all warnings as errors ({0} by default) + Report all warnings as errors ({0} by default) @@ -5978,8 +5978,8 @@ - Generate overflow checks - 오버플로 검사를 생성합니다. + Generate overflow checks ({0} by default) + Generate overflow checks ({0} by default) @@ -6163,13 +6163,13 @@ - Output warning and error messages in color - 경고 및 오류 메시지를 색으로 구분하여 출력 + Output warning and error messages in color ({0} by default) + Output warning and error messages in color ({0} by default) - Enable high-entropy ASLR - 높은 엔트로피 ASLR 사용 + Enable high-entropy ASLR ({0} by default) + Enable high-entropy ASLR ({0} by default) @@ -6183,8 +6183,8 @@ - Emit debug information in quotations - 인용구의 디버그 정보를 내보냅니다. + Emit debug information in quotations ({0} by default) + Emit debug information in quotations ({0} by default) diff --git a/src/Compiler/xlf/FSComp.txt.pl.xlf b/src/Compiler/xlf/FSComp.txt.pl.xlf index 1f353b7e3ec..b1a404bc0b0 100644 --- a/src/Compiler/xlf/FSComp.txt.pl.xlf +++ b/src/Compiler/xlf/FSComp.txt.pl.xlf @@ -908,8 +908,8 @@ - Enable nullness declarations and checks - Enable nullness declarations and checks + Enable nullness declarations and checks ({0} by default) + Enable nullness declarations and checks ({0} by default) @@ -918,8 +918,8 @@ - Compress interface and optimization data files - Kompresuj pliki danych interfejsu i optymalizacji + Compress interface and optimization data files ({0} by default) + Compress interface and optimization data files ({0} by default) @@ -948,13 +948,13 @@ - Generate assembly with IL visibility that matches the source code visibility - Generuj zestaw z widocznością IL zgodną z widocznością kodu źródłowego + Generate assembly with IL visibility that matches the source code visibility ({0} by default) + Generate assembly with IL visibility that matches the source code visibility ({0} by default) - Produce a reference assembly, instead of a full assembly, as the primary output - Utwórz zestaw odwołania zamiast pełnego zestawu jako podstawowe dane wyjściowe + Produce a reference assembly, instead of a full assembly, as the primary output ({0} by default) + Produce a reference assembly, instead of a full assembly, as the primary output ({0} by default) @@ -978,8 +978,8 @@ - Override indentation rules implied by the language version - Zastąp reguły wcięć implikowane przez wersję językową + Override indentation rules implied by the language version ({0} by default) + Override indentation rules implied by the language version ({0} by default) @@ -5828,13 +5828,13 @@ - Delay-sign the assembly using only the public portion of the strong name key - Podpisz zestaw z opóźnieniem, używając tylko publicznej części klucza o silnej nazwie + Delay-sign the assembly using only the public portion of the strong name key ({0} by default) + Delay-sign the assembly using only the public portion of the strong name key ({0} by default) - Public-sign the assembly using only the public portion of the strong name key, and mark the assembly as signed - Podpisz zestaw na użytek publiczny za pomocą tylko publicznej części klucza o silnej nazwie i oznacz zestaw jako podpisany + Public-sign the assembly using only the public portion of the strong name key, and mark the assembly as signed ({0} by default) + Public-sign the assembly using only the public portion of the strong name key, and mark the assembly as signed ({0} by default) @@ -5893,8 +5893,8 @@ - Embed all source files in the portable PDB file - Osadź wszystkie pliki źródłowe w przenośnym pliku PDB + Embed all source files in the portable PDB file ({0} by default) + Embed all source files in the portable PDB file ({0} by default) @@ -5923,8 +5923,8 @@ - Emit debug information (Short form: -g) - Emituj informacje debugowania (krótka wersja: -g) + Emit debug information (Short form: -g) ({0} by default) + Emit debug information (Short form: -g) ({0} by default) @@ -5933,28 +5933,28 @@ - Enable optimizations (Short form: -O) - Włącz optymalizacje (krótka wersja: -O) + Enable optimizations (Short form: -O) ({0} by default) + Enable optimizations (Short form: -O) ({0} by default) - Enable or disable tailcalls - Włącz lub wyłącz wywołania tail + Enable or disable tailcalls ({0} by default) + Enable or disable tailcalls ({0} by default) - Produce a deterministic assembly (including module version GUID and timestamp) - Utwórz zestaw deterministyczny (łącznie z sygnaturą czasową i identyfikatorem GUID wersji modułu) + Produce a deterministic assembly (including module version GUID and timestamp) ({0} by default) + Produce a deterministic assembly (including module version GUID and timestamp) ({0} by default) - Enable or disable cross-module optimizations - Włącz lub wyłącz optymalizacje między modułami + Enable or disable cross-module optimizations ({0} by default) + Enable or disable cross-module optimizations ({0} by default) - Report all warnings as errors - Raportuj wszystkie ostrzeżenia jako błędy + Report all warnings as errors ({0} by default) + Report all warnings as errors ({0} by default) @@ -5978,8 +5978,8 @@ - Generate overflow checks - Generuj operacje sprawdzenia przepełnienia + Generate overflow checks ({0} by default) + Generate overflow checks ({0} by default) @@ -6163,13 +6163,13 @@ - Output warning and error messages in color - Ostrzeżenia i komunikaty o błędzie wyróżnione kolorem + Output warning and error messages in color ({0} by default) + Output warning and error messages in color ({0} by default) - Enable high-entropy ASLR - Włącz losowe generowanie układu przestrzeni adresowej o wysokiej entropii + Enable high-entropy ASLR ({0} by default) + Enable high-entropy ASLR ({0} by default) @@ -6183,8 +6183,8 @@ - Emit debug information in quotations - Emituj informacje debugowania w cudzysłowach + Emit debug information in quotations ({0} by default) + Emit debug information in quotations ({0} by default) diff --git a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf index 232a3798b4d..c3be9642f81 100644 --- a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf +++ b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf @@ -908,8 +908,8 @@ - Enable nullness declarations and checks - Enable nullness declarations and checks + Enable nullness declarations and checks ({0} by default) + Enable nullness declarations and checks ({0} by default) @@ -918,8 +918,8 @@ - Compress interface and optimization data files - Compactar arquivos de dados de otimização e interface + Compress interface and optimization data files ({0} by default) + Compress interface and optimization data files ({0} by default) @@ -948,13 +948,13 @@ - Generate assembly with IL visibility that matches the source code visibility - Gerar um assembly com visibilidade IL que corresponda à visibilidade do código-fonte. + Generate assembly with IL visibility that matches the source code visibility ({0} by default) + Generate assembly with IL visibility that matches the source code visibility ({0} by default) - Produce a reference assembly, instead of a full assembly, as the primary output - Produzir um assembly de referência, em vez de um assembly completo, como a saída primária + Produce a reference assembly, instead of a full assembly, as the primary output ({0} by default) + Produce a reference assembly, instead of a full assembly, as the primary output ({0} by default) @@ -978,8 +978,8 @@ - Override indentation rules implied by the language version - Substituir regras de recuo implícitas pela versão da linguagem + Override indentation rules implied by the language version ({0} by default) + Override indentation rules implied by the language version ({0} by default) @@ -5828,13 +5828,13 @@ - Delay-sign the assembly using only the public portion of the strong name key - Assinatura atrasada do assembly usando somente a parte pública da chave de nome forte + Delay-sign the assembly using only the public portion of the strong name key ({0} by default) + Delay-sign the assembly using only the public portion of the strong name key ({0} by default) - Public-sign the assembly using only the public portion of the strong name key, and mark the assembly as signed - Assine de forma pública o assembly usando a única parte pública da chave de nome forte e marque o assembly como assinado + Public-sign the assembly using only the public portion of the strong name key, and mark the assembly as signed ({0} by default) + Public-sign the assembly using only the public portion of the strong name key, and mark the assembly as signed ({0} by default) @@ -5893,8 +5893,8 @@ - Embed all source files in the portable PDB file - Inserir todos os arquivos de origem no arquivo PDB portátil + Embed all source files in the portable PDB file ({0} by default) + Embed all source files in the portable PDB file ({0} by default) @@ -5923,8 +5923,8 @@ - Emit debug information (Short form: -g) - Emita as informação de depuração (Forma abreviada: -g) + Emit debug information (Short form: -g) ({0} by default) + Emit debug information (Short form: -g) ({0} by default) @@ -5933,28 +5933,28 @@ - Enable optimizations (Short form: -O) - Habilite otimizações (Forma abreviada: -O) + Enable optimizations (Short form: -O) ({0} by default) + Enable optimizations (Short form: -O) ({0} by default) - Enable or disable tailcalls - Habilitar ou desabilitar tailcalls + Enable or disable tailcalls ({0} by default) + Enable or disable tailcalls ({0} by default) - Produce a deterministic assembly (including module version GUID and timestamp) - Produzir um assembly determinístico (incluindo GUID de versão de módulo e carimbo de data/hora) + Produce a deterministic assembly (including module version GUID and timestamp) ({0} by default) + Produce a deterministic assembly (including module version GUID and timestamp) ({0} by default) - Enable or disable cross-module optimizations - Habilite ou desabilite otimizações de módulo cruzado + Enable or disable cross-module optimizations ({0} by default) + Enable or disable cross-module optimizations ({0} by default) - Report all warnings as errors - Relatar todos os avisos como erros + Report all warnings as errors ({0} by default) + Report all warnings as errors ({0} by default) @@ -5978,8 +5978,8 @@ - Generate overflow checks - Gerar verificações de estouro + Generate overflow checks ({0} by default) + Generate overflow checks ({0} by default) @@ -6163,13 +6163,13 @@ - Output warning and error messages in color - Mensagens de aviso e erro de saída em cores + Output warning and error messages in color ({0} by default) + Output warning and error messages in color ({0} by default) - Enable high-entropy ASLR - Habilitar ASLR de alta entropia + Enable high-entropy ASLR ({0} by default) + Enable high-entropy ASLR ({0} by default) @@ -6183,8 +6183,8 @@ - Emit debug information in quotations - Emitir informações de depuração entre aspas + Emit debug information in quotations ({0} by default) + Emit debug information in quotations ({0} by default) diff --git a/src/Compiler/xlf/FSComp.txt.ru.xlf b/src/Compiler/xlf/FSComp.txt.ru.xlf index 2d174a1d325..9da18bd9abf 100644 --- a/src/Compiler/xlf/FSComp.txt.ru.xlf +++ b/src/Compiler/xlf/FSComp.txt.ru.xlf @@ -908,8 +908,8 @@ - Enable nullness declarations and checks - Enable nullness declarations and checks + Enable nullness declarations and checks ({0} by default) + Enable nullness declarations and checks ({0} by default) @@ -918,8 +918,8 @@ - Compress interface and optimization data files - Сжатие файлов данных интерфейса и оптимизации + Compress interface and optimization data files ({0} by default) + Compress interface and optimization data files ({0} by default) @@ -948,13 +948,13 @@ - Generate assembly with IL visibility that matches the source code visibility - Создать сборку с видимостью IL, соответствующей видимости исходного кода + Generate assembly with IL visibility that matches the source code visibility ({0} by default) + Generate assembly with IL visibility that matches the source code visibility ({0} by default) - Produce a reference assembly, instead of a full assembly, as the primary output - Создайте базовую сборку вместо полной сборки в качестве основных выходных данных + Produce a reference assembly, instead of a full assembly, as the primary output ({0} by default) + Produce a reference assembly, instead of a full assembly, as the primary output ({0} by default) @@ -978,8 +978,8 @@ - Override indentation rules implied by the language version - Переопределить правила отступов, предусмотренные версией языка + Override indentation rules implied by the language version ({0} by default) + Override indentation rules implied by the language version ({0} by default) @@ -5828,13 +5828,13 @@ - Delay-sign the assembly using only the public portion of the strong name key - Использовать отложенную подпись для сборки, используя только открытую часть ключа строгого имени + Delay-sign the assembly using only the public portion of the strong name key ({0} by default) + Delay-sign the assembly using only the public portion of the strong name key ({0} by default) - Public-sign the assembly using only the public portion of the strong name key, and mark the assembly as signed - Выполнить общедоступную подпись сборки, используя только открытую часть ключа строгого имени, и пометить сборку как подписанную + Public-sign the assembly using only the public portion of the strong name key, and mark the assembly as signed ({0} by default) + Public-sign the assembly using only the public portion of the strong name key, and mark the assembly as signed ({0} by default) @@ -5893,8 +5893,8 @@ - Embed all source files in the portable PDB file - Внедрить все исходные файлы в переносимый PDB-файл + Embed all source files in the portable PDB file ({0} by default) + Embed all source files in the portable PDB file ({0} by default) @@ -5923,8 +5923,8 @@ - Emit debug information (Short form: -g) - Вывод отладочной информации (краткая форма: -g) + Emit debug information (Short form: -g) ({0} by default) + Emit debug information (Short form: -g) ({0} by default) @@ -5933,28 +5933,28 @@ - Enable optimizations (Short form: -O) - Включить оптимизацию (краткая форма: -O) + Enable optimizations (Short form: -O) ({0} by default) + Enable optimizations (Short form: -O) ({0} by default) - Enable or disable tailcalls - Включение или отключение концевых вызовов + Enable or disable tailcalls ({0} by default) + Enable or disable tailcalls ({0} by default) - Produce a deterministic assembly (including module version GUID and timestamp) - Создать детерминированную сборку (включая GUID версии модуля и метку времени) + Produce a deterministic assembly (including module version GUID and timestamp) ({0} by default) + Produce a deterministic assembly (including module version GUID and timestamp) ({0} by default) - Enable or disable cross-module optimizations - Включение или отключение межмодульной оптимизации + Enable or disable cross-module optimizations ({0} by default) + Enable or disable cross-module optimizations ({0} by default) - Report all warnings as errors - Обрабатывать все предупреждения как ошибки + Report all warnings as errors ({0} by default) + Report all warnings as errors ({0} by default) @@ -5978,8 +5978,8 @@ - Generate overflow checks - Сформировать проверки переполнений + Generate overflow checks ({0} by default) + Generate overflow checks ({0} by default) @@ -6163,13 +6163,13 @@ - Output warning and error messages in color - Цветные выходные предупреждения и сообщения об ошибках + Output warning and error messages in color ({0} by default) + Output warning and error messages in color ({0} by default) - Enable high-entropy ASLR - Включить технологию ASLR с высокой энтропией + Enable high-entropy ASLR ({0} by default) + Enable high-entropy ASLR ({0} by default) @@ -6183,8 +6183,8 @@ - Emit debug information in quotations - Вывод отладочной информации в кавычках + Emit debug information in quotations ({0} by default) + Emit debug information in quotations ({0} by default) diff --git a/src/Compiler/xlf/FSComp.txt.tr.xlf b/src/Compiler/xlf/FSComp.txt.tr.xlf index 6f81b800ddb..4b383d721d7 100644 --- a/src/Compiler/xlf/FSComp.txt.tr.xlf +++ b/src/Compiler/xlf/FSComp.txt.tr.xlf @@ -908,8 +908,8 @@ - Enable nullness declarations and checks - Enable nullness declarations and checks + Enable nullness declarations and checks ({0} by default) + Enable nullness declarations and checks ({0} by default) @@ -918,8 +918,8 @@ - Compress interface and optimization data files - Arabirim ve iyileştirme veri dosyalarını sıkıştır + Compress interface and optimization data files ({0} by default) + Compress interface and optimization data files ({0} by default) @@ -948,13 +948,13 @@ - Generate assembly with IL visibility that matches the source code visibility - Kaynak kodu görünürlüğüyle eşleşen IL görünürlüğüne sahip bütünleştirilmiş kod oluşturma + Generate assembly with IL visibility that matches the source code visibility ({0} by default) + Generate assembly with IL visibility that matches the source code visibility ({0} by default) - Produce a reference assembly, instead of a full assembly, as the primary output - Birincil çıktı olarak, tam bir derleme yerine, başvuru bütünleştirilmiş kodu üretin + Produce a reference assembly, instead of a full assembly, as the primary output ({0} by default) + Produce a reference assembly, instead of a full assembly, as the primary output ({0} by default) @@ -978,8 +978,8 @@ - Override indentation rules implied by the language version - Dil sürümü tarafından kapsanan girinti kurallarını geçersiz kıl + Override indentation rules implied by the language version ({0} by default) + Override indentation rules implied by the language version ({0} by default) @@ -5828,13 +5828,13 @@ - Delay-sign the assembly using only the public portion of the strong name key - Derlemeyi tanımlayıcı ad anahtarının yalnızca ortak kısmını kullanarak gecikmeli imzala + Delay-sign the assembly using only the public portion of the strong name key ({0} by default) + Delay-sign the assembly using only the public portion of the strong name key ({0} by default) - Public-sign the assembly using only the public portion of the strong name key, and mark the assembly as signed - Tanımlayıcı ad anahtarının yalnızca genel bölümünü kullanarak, bütünleştirilmiş kodu genel olarak imzala ve bütünleştirilmiş kodu imzalanmış olarak işaretle + Public-sign the assembly using only the public portion of the strong name key, and mark the assembly as signed ({0} by default) + Public-sign the assembly using only the public portion of the strong name key, and mark the assembly as signed ({0} by default) @@ -5893,8 +5893,8 @@ - Embed all source files in the portable PDB file - Tüm kaynak dosyaları taşınabilir PDB dosyasına ekle + Embed all source files in the portable PDB file ({0} by default) + Embed all source files in the portable PDB file ({0} by default) @@ -5923,8 +5923,8 @@ - Emit debug information (Short form: -g) - Hata ayıklama bilgilerini yay (Kısa biçimi: -g) + Emit debug information (Short form: -g) ({0} by default) + Emit debug information (Short form: -g) ({0} by default) @@ -5933,28 +5933,28 @@ - Enable optimizations (Short form: -O) - İyileştirmeleri etkinleştir (Kısa biçimi: -O) + Enable optimizations (Short form: -O) ({0} by default) + Enable optimizations (Short form: -O) ({0} by default) - Enable or disable tailcalls - Tail çağrılarını etkinleştir veya devre dışı bırak + Enable or disable tailcalls ({0} by default) + Enable or disable tailcalls ({0} by default) - Produce a deterministic assembly (including module version GUID and timestamp) - Belirleyici bir bütünleştirilmiş kod oluşturun (modül sürümü GUID'i ve zaman damgası dahil) + Produce a deterministic assembly (including module version GUID and timestamp) ({0} by default) + Produce a deterministic assembly (including module version GUID and timestamp) ({0} by default) - Enable or disable cross-module optimizations - Modüller arası iyileştirmeleri etkinleştir veya devre dışı bırak + Enable or disable cross-module optimizations ({0} by default) + Enable or disable cross-module optimizations ({0} by default) - Report all warnings as errors - Tüm uyarıları hata olarak bildir + Report all warnings as errors ({0} by default) + Report all warnings as errors ({0} by default) @@ -5978,8 +5978,8 @@ - Generate overflow checks - Taşma denetimleri oluştur + Generate overflow checks ({0} by default) + Generate overflow checks ({0} by default) @@ -6163,13 +6163,13 @@ - Output warning and error messages in color - Renkli çıkış uyarısı ve hata iletileri + Output warning and error messages in color ({0} by default) + Output warning and error messages in color ({0} by default) - Enable high-entropy ASLR - Yüksek entropili ASLR'yi etkinleştir + Enable high-entropy ASLR ({0} by default) + Enable high-entropy ASLR ({0} by default) @@ -6183,8 +6183,8 @@ - Emit debug information in quotations - Tırnak içindeki hata ayıklama bilgilerini yay + Emit debug information in quotations ({0} by default) + Emit debug information in quotations ({0} by default) diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf index 0c0d5e1a2ee..d38b026f117 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf @@ -908,8 +908,8 @@ - Enable nullness declarations and checks - Enable nullness declarations and checks + Enable nullness declarations and checks ({0} by default) + Enable nullness declarations and checks ({0} by default) @@ -918,8 +918,8 @@ - Compress interface and optimization data files - 压缩接口和优化数据文件 + Compress interface and optimization data files ({0} by default) + Compress interface and optimization data files ({0} by default) @@ -948,13 +948,13 @@ - Generate assembly with IL visibility that matches the source code visibility - 生成具有与源代码可见性匹配的 IL 可见性的程序集 + Generate assembly with IL visibility that matches the source code visibility ({0} by default) + Generate assembly with IL visibility that matches the source code visibility ({0} by default) - Produce a reference assembly, instead of a full assembly, as the primary output - 生成引用程序集而不是完整程序集作为主输出 + Produce a reference assembly, instead of a full assembly, as the primary output ({0} by default) + Produce a reference assembly, instead of a full assembly, as the primary output ({0} by default) @@ -978,8 +978,8 @@ - Override indentation rules implied by the language version - 替代语言版本隐含的缩进规则 + Override indentation rules implied by the language version ({0} by default) + Override indentation rules implied by the language version ({0} by default) @@ -5828,13 +5828,13 @@ - Delay-sign the assembly using only the public portion of the strong name key - 仅使用强名称密钥的公共部分对程序集进行延迟签名 + Delay-sign the assembly using only the public portion of the strong name key ({0} by default) + Delay-sign the assembly using only the public portion of the strong name key ({0} by default) - Public-sign the assembly using only the public portion of the strong name key, and mark the assembly as signed - 仅使用强名称密钥的公用部分对该程序集进行公开签名, 并将该程序集标记为已签名 + Public-sign the assembly using only the public portion of the strong name key, and mark the assembly as signed ({0} by default) + Public-sign the assembly using only the public portion of the strong name key, and mark the assembly as signed ({0} by default) @@ -5893,8 +5893,8 @@ - Embed all source files in the portable PDB file - 将所有源文件嵌入可移植 PDB 文件 + Embed all source files in the portable PDB file ({0} by default) + Embed all source files in the portable PDB file ({0} by default) @@ -5923,8 +5923,8 @@ - Emit debug information (Short form: -g) - 发出调试信息(缩写: -g) + Emit debug information (Short form: -g) ({0} by default) + Emit debug information (Short form: -g) ({0} by default) @@ -5933,28 +5933,28 @@ - Enable optimizations (Short form: -O) - 启用优化(缩写: -O) + Enable optimizations (Short form: -O) ({0} by default) + Enable optimizations (Short form: -O) ({0} by default) - Enable or disable tailcalls - 启用或禁用尾调用 + Enable or disable tailcalls ({0} by default) + Enable or disable tailcalls ({0} by default) - Produce a deterministic assembly (including module version GUID and timestamp) - 产生确定性的程序集(包括模块版本 GUID 和时间戳) + Produce a deterministic assembly (including module version GUID and timestamp) ({0} by default) + Produce a deterministic assembly (including module version GUID and timestamp) ({0} by default) - Enable or disable cross-module optimizations - 启用或禁用跨模块优化 + Enable or disable cross-module optimizations ({0} by default) + Enable or disable cross-module optimizations ({0} by default) - Report all warnings as errors - 将所有警告报告为错误 + Report all warnings as errors ({0} by default) + Report all warnings as errors ({0} by default) @@ -5978,8 +5978,8 @@ - Generate overflow checks - 生成溢出检查 + Generate overflow checks ({0} by default) + Generate overflow checks ({0} by default) @@ -6163,13 +6163,13 @@ - Output warning and error messages in color - 以彩色输出警告和错误消息 + Output warning and error messages in color ({0} by default) + Output warning and error messages in color ({0} by default) - Enable high-entropy ASLR - 启用高熵 ASLR + Enable high-entropy ASLR ({0} by default) + Enable high-entropy ASLR ({0} by default) @@ -6183,8 +6183,8 @@ - Emit debug information in quotations - 发出用引号引起来的调试信息 + Emit debug information in quotations ({0} by default) + Emit debug information in quotations ({0} by default) diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf index cfd80e7e706..cbb001aef87 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf @@ -908,8 +908,8 @@ - Enable nullness declarations and checks - Enable nullness declarations and checks + Enable nullness declarations and checks ({0} by default) + Enable nullness declarations and checks ({0} by default) @@ -918,8 +918,8 @@ - Compress interface and optimization data files - 壓縮介面和最佳化資料檔案 + Compress interface and optimization data files ({0} by default) + Compress interface and optimization data files ({0} by default) @@ -948,13 +948,13 @@ - Generate assembly with IL visibility that matches the source code visibility - 產生具有符合原始程式碼可見度的 IL 可見度組件 + Generate assembly with IL visibility that matches the source code visibility ({0} by default) + Generate assembly with IL visibility that matches the source code visibility ({0} by default) - Produce a reference assembly, instead of a full assembly, as the primary output - 產生參考組件,而非完整組件作為主要輸出 + Produce a reference assembly, instead of a full assembly, as the primary output ({0} by default) + Produce a reference assembly, instead of a full assembly, as the primary output ({0} by default) @@ -978,8 +978,8 @@ - Override indentation rules implied by the language version - 覆寫語言版本隱含的縮排規則 + Override indentation rules implied by the language version ({0} by default) + Override indentation rules implied by the language version ({0} by default) @@ -5828,13 +5828,13 @@ - Delay-sign the assembly using only the public portion of the strong name key - 只使用強式名稱金鑰的公開金鑰延遲簽署組件 + Delay-sign the assembly using only the public portion of the strong name key ({0} by default) + Delay-sign the assembly using only the public portion of the strong name key ({0} by default) - Public-sign the assembly using only the public portion of the strong name key, and mark the assembly as signed - 僅使用強式名稱金鑰的公開金鑰公開簽署組件,並將組件標記為已簽署 + Public-sign the assembly using only the public portion of the strong name key, and mark the assembly as signed ({0} by default) + Public-sign the assembly using only the public portion of the strong name key, and mark the assembly as signed ({0} by default) @@ -5893,8 +5893,8 @@ - Embed all source files in the portable PDB file - 內嵌可攜式 PDB 檔案中的所有來源檔案 + Embed all source files in the portable PDB file ({0} by default) + Embed all source files in the portable PDB file ({0} by default) @@ -5923,8 +5923,8 @@ - Emit debug information (Short form: -g) - 發出偵錯資訊 (簡短形式: -g) + Emit debug information (Short form: -g) ({0} by default) + Emit debug information (Short form: -g) ({0} by default) @@ -5933,28 +5933,28 @@ - Enable optimizations (Short form: -O) - 啟用最佳化 (簡短形式: -O) + Enable optimizations (Short form: -O) ({0} by default) + Enable optimizations (Short form: -O) ({0} by default) - Enable or disable tailcalls - 啟用或停用 Tail 呼叫 + Enable or disable tailcalls ({0} by default) + Enable or disable tailcalls ({0} by default) - Produce a deterministic assembly (including module version GUID and timestamp) - 產生確定性組件 (包括模組版本 GUID 及時間戳記) + Produce a deterministic assembly (including module version GUID and timestamp) ({0} by default) + Produce a deterministic assembly (including module version GUID and timestamp) ({0} by default) - Enable or disable cross-module optimizations - 啟用或停用跨模組最佳化 + Enable or disable cross-module optimizations ({0} by default) + Enable or disable cross-module optimizations ({0} by default) - Report all warnings as errors - 將所有警告回報為錯誤 + Report all warnings as errors ({0} by default) + Report all warnings as errors ({0} by default) @@ -5978,8 +5978,8 @@ - Generate overflow checks - 產生溢位核對 + Generate overflow checks ({0} by default) + Generate overflow checks ({0} by default) @@ -6163,13 +6163,13 @@ - Output warning and error messages in color - 輸出彩色的警告和錯誤訊息 + Output warning and error messages in color ({0} by default) + Output warning and error messages in color ({0} by default) - Enable high-entropy ASLR - 啟用高熵 ASLR + Enable high-entropy ASLR ({0} by default) + Enable high-entropy ASLR ({0} by default) @@ -6183,8 +6183,8 @@ - Emit debug information in quotations - 發出在引號內的偵錯資訊 + Emit debug information in quotations ({0} by default) + Emit debug information in quotations ({0} by default) 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 75e32680e65..beafa217722 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 @@ -9,13 +9,14 @@ Copyright (c) Microsoft Corporation. All Rights Reserved. --target:library Build a library (Short form: -a) --target:module Build a module that can be added to another assembly --delaysign[+|-] Delay-sign the assembly using only the public portion of the strong name key + (off by default) --publicsign[+|-] Public-sign the assembly using only the public portion of the strong name - key, and mark the assembly as signed + key, and mark the assembly as signed (off by default) --doc: Write the xmldoc of the assembly to the given file --keyfile: Specify a strong name key file --platform: Limit which platforms this code can run on: x86, x64, Arm, Arm64, Itanium, anycpu32bitpreferred, or anycpu. The default is anycpu. ---compressmetadata[+|-] Compress interface and optimization data files +--compressmetadata[+|-] Compress interface and optimization data files (on by default) --nooptimizationdata Only include optimization information essential for implementing inlined constructs. Inhibits cross-module inlining but improves binary compatibility. @@ -26,7 +27,7 @@ Copyright (c) Microsoft Corporation. All Rights Reserved. signature files --nocopyfsharpcore Don't copy FSharp.Core.dll along the produced binaries --refonly[+|-] Produce a reference assembly, instead of a full assembly, as the primary - output + output (off by default) --refout: Produce a reference assembly with the specified file path. @@ -47,41 +48,42 @@ Copyright (c) Microsoft Corporation. All Rights Reserved. - CODE GENERATION - ---debug[+|-] Emit debug information (Short form: -g) +--debug[+|-] Emit debug information (Short form: -g) (off by default) --debug:{full|pdbonly|portable|embedded} Specify debugging type: full, portable, embedded, pdbonly. ('full' is the default if no debugging type specified and enables attaching a debugger to a running program, 'portable' is a cross-platform format, 'embedded' is a cross-platform format embedded into the output file). ---embed[+|-] Embed all source files in the portable PDB file +--embed[+|-] Embed all source files in the portable PDB file (off by default) --embed: Embed specific source files in the portable PDB file --sourcelink: Source link information file to embed in the portable PDB file ---optimize[+|-] Enable optimizations (Short form: -O) ---tailcalls[+|-] Enable or disable tailcalls +--optimize[+|-] Enable optimizations (Short form: -O) (on by default) +--tailcalls[+|-] Enable or disable tailcalls (on by default) --deterministic[+|-] Produce a deterministic assembly (including module version GUID and - timestamp) + timestamp) (off by default) --realsig[+|-] Generate assembly with IL visibility that matches the source code visibility + (off by default) --pathmap: Maps physical paths to source path names output by the compiler ---crossoptimize[+|-] Enable or disable cross-module optimizations +--crossoptimize[+|-] Enable or disable cross-module optimizations (on by default) --reflectionfree Disable implicit generation of constructs using reflection - ERRORS AND WARNINGS - ---warnaserror[+|-] Report all warnings as errors +--warnaserror[+|-] Report all warnings as errors (off by default) --warnaserror[+|-]: Report specific warnings as errors --warn: Set a warning level (0-5) --nowarn: Disable specific warning messages --warnon: Enable specific warnings that may be off by default ---checknulls[+|-] Enable nullness declarations and checks ---consolecolors[+|-] Output warning and error messages in color +--checknulls[+|-] Enable nullness declarations and checks (off by default) +--consolecolors[+|-] Output warning and error messages in color (on by default) - LANGUAGE - --langversion:? Display the allowed values for language version. --langversion:{version|latest|preview} Specify language version such as 'latest' or 'preview'. ---checked[+|-] Generate overflow checks +--checked[+|-] Generate overflow checks (off by default) --define: Define conditional compilation symbols (Short form: -d) --mlcompatibility Ignore ML compatibility warnings ---strict-indentation[+|-] Override indentation rules implied by the language version +--strict-indentation[+|-] Override indentation rules implied by the language version (off by default) - MISCELLANEOUS - @@ -111,6 +113,6 @@ Copyright (c) Microsoft Corporation. All Rights Reserved. --staticlink: Statically link the given assembly and all referenced DLLs that depend on this assembly. Use an assembly name e.g. mylib, not a DLL name. --pdb: Name the output debug file ---highentropyva[+|-] Enable high-entropy ASLR +--highentropyva[+|-] Enable high-entropy ASLR (off by default) --subsystemversion: Specify subsystem version of this assembly ---quotations-debug[+|-] Emit debug information in quotations +--quotations-debug[+|-] Emit debug information in quotations (off by default) diff --git a/tests/FSharp.Compiler.Service.Tests/expected-help-output.bsl b/tests/FSharp.Compiler.Service.Tests/expected-help-output.bsl index 61cf7105859..318bb051e59 100644 --- a/tests/FSharp.Compiler.Service.Tests/expected-help-output.bsl +++ b/tests/FSharp.Compiler.Service.Tests/expected-help-output.bsl @@ -10,11 +10,11 @@ another assembly --delaysign[+|-] Delay-sign the assembly using only the public portion of the strong - name key + name key (off by default) --publicsign[+|-] Public-sign the assembly using only the public portion of the strong name key, and mark the assembly as - signed + signed (off by default) --doc: Write the xmldoc of the assembly to the given file --keyfile: Specify a strong name key file @@ -23,7 +23,7 @@ Itanium, anycpu32bitpreferred, or anycpu. The default is anycpu. --compressmetadata[+|-] Compress interface and optimization - data files + data files (on by default) --nooptimizationdata Only include optimization information essential for implementing inlined constructs. @@ -41,7 +41,7 @@ produced binaries --refonly[+|-] Produce a reference assembly, instead of a full assembly, as the - primary output + primary output (off by default) --refout: Produce a reference assembly with the specified file path. @@ -69,7 +69,7 @@ - CODE GENERATION - --debug[+|-] Emit debug information (Short form: - -g) + -g) (off by default) --debug:{full|pdbonly|portable|embedded} Specify debugging type: full, portable, embedded, pdbonly. ('full' is the default if no debugging type @@ -80,39 +80,41 @@ cross-platform format embedded into the output file). --embed[+|-] Embed all source files in the - portable PDB file + portable PDB file (off by default) --embed: Embed specific source files in the portable PDB file --sourcelink: Source link information file to embed in the portable PDB file --optimize[+|-] Enable optimizations (Short form: - -O) ---tailcalls[+|-] Enable or disable tailcalls + -O) (off by default) +--tailcalls[+|-] Enable or disable tailcalls (on by + default) --deterministic[+|-] Produce a deterministic assembly (including module version GUID and - timestamp) + timestamp) (off by default) --realsig[+|-] Generate assembly with IL visibility that matches the source code - visibility + visibility (off by default) --pathmap: Maps physical paths to source path names output by the compiler --crossoptimize[+|-] Enable or disable cross-module - optimizations + optimizations (off by default) --reflectionfree Disable implicit generation of constructs using reflection - ERRORS AND WARNINGS - ---warnaserror[+|-] Report all warnings as errors +--warnaserror[+|-] Report all warnings as errors (off + by default) --warnaserror[+|-]: Report specific warnings as errors --warn: Set a warning level (0-5) --nowarn: Disable specific warning messages --warnon: Enable specific warnings that may be off by default --checknulls[+|-] Enable nullness declarations and - checks + checks (off by default) --consolecolors[+|-] Output warning and error messages in - color + color (on by default) - LANGUAGE - @@ -120,12 +122,14 @@ language version. --langversion:{version|latest|preview} Specify language version such as 'latest' or 'preview'. ---checked[+|-] Generate overflow checks +--checked[+|-] Generate overflow checks (off by + default) --define: Define conditional compilation symbols (Short form: -d) --mlcompatibility Ignore ML compatibility warnings --strict-indentation[+|-] Override indentation rules implied - by the language version + by the language version (off by + default) - MISCELLANEOUS - @@ -173,7 +177,9 @@ on this assembly. Use an assembly name e.g. mylib, not a DLL name. --pdb: Name the output debug file ---highentropyva[+|-] Enable high-entropy ASLR +--highentropyva[+|-] Enable high-entropy ASLR (off by + default) --subsystemversion: Specify subsystem version of this assembly --quotations-debug[+|-] Emit debug information in quotations + (off by default) diff --git a/tests/fsharpqa/Source/CompilerOptions/fsi/help/help40-nologo.437.1033.bsl b/tests/fsharpqa/Source/CompilerOptions/fsi/help/help40-nologo.437.1033.bsl index ef072f38185..b8e35227384 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsi/help/help40-nologo.437.1033.bsl +++ b/tests/fsharpqa/Source/CompilerOptions/fsi/help/help40-nologo.437.1033.bsl @@ -18,7 +18,7 @@ Usage: fsiAnyCpu [script.fsx []] - CODE GENERATION - --debug[+|-] Emit debug information (Short form: - -g) + -g) (on by default) --debug:{full|pdbonly|portable|embedded} Specify debugging type: full, portable, embedded, pdbonly. ('pdbonly' is the default if no @@ -29,33 +29,35 @@ Usage: fsiAnyCpu [script.fsx []] a cross-platform format embedded into the output file). --optimize[+|-] Enable optimizations (Short form: - -O) ---tailcalls[+|-] Enable or disable tailcalls + -O) (on by default) +--tailcalls[+|-] Enable or disable tailcalls (on by + default) --deterministic[+|-] Produce a deterministic assembly (including module version GUID and - timestamp) + timestamp) (off by default) --realsig[+|-] Generate assembly with IL visibility that matches the source code - visibility + visibility (off by default) --pathmap: Maps physical paths to source path names output by the compiler --crossoptimize[+|-] Enable or disable cross-module - optimizations + optimizations (on by default) --reflectionfree Disable implicit generation of constructs using reflection - ERRORS AND WARNINGS - ---warnaserror[+|-] Report all warnings as errors +--warnaserror[+|-] Report all warnings as errors (off + by default) --warnaserror[+|-]: Report specific warnings as errors --warn: Set a warning level (0-5) --nowarn: Disable specific warning messages --warnon: Enable specific warnings that may be off by default --checknulls[+|-] Enable nullness declarations and - checks + checks (off by default) --consolecolors[+|-] Output warning and error messages in - color + color (on by default) - LANGUAGE - @@ -63,12 +65,14 @@ Usage: fsiAnyCpu [script.fsx []] language version. --langversion:{version|latest|preview} Specify language version such as 'latest' or 'preview'. ---checked[+|-] Generate overflow checks +--checked[+|-] Generate overflow checks (off by + default) --define: Define conditional compilation symbols (Short form: -d) --mlcompatibility Ignore ML compatibility warnings --strict-indentation[+|-] Override indentation rules implied - by the language version + by the language version (off by + default) - MISCELLANEOUS - @@ -110,9 +114,11 @@ Usage: fsiAnyCpu [script.fsx []] --readline[+|-] Support TAB completion in console (on by default) --quotations-debug[+|-] Emit debug information in quotations + (off by default) --shadowcopyreferences[+|-] Prevents references from being locked by the F# Interactive process + (off by default) --multiemit[+|-] Emit multiple assemblies (on by default) -See https://learn.microsoft.com/dotnet/fsharp/language-reference/fsharp-interactive-options for more details. \ No newline at end of file +See https://learn.microsoft.com/dotnet/fsharp/language-reference/fsharp-interactive-options for more details. diff --git a/tests/fsharpqa/Source/CompilerOptions/fsi/help/help40.437.1033.bsl b/tests/fsharpqa/Source/CompilerOptions/fsi/help/help40.437.1033.bsl index 63845b3e13a..7c8c9a4f4ba 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsi/help/help40.437.1033.bsl +++ b/tests/fsharpqa/Source/CompilerOptions/fsi/help/help40.437.1033.bsl @@ -1,4 +1,4 @@ -Microsoft (R) F# Interactive version 10.2.3 for F# 4.5 +Microsoft (R) F# Interactive version 13.9.200.0 for F# 9.0 Copyright (c) Microsoft Corporation. All Rights Reserved. Usage: fsiAnyCpu [script.fsx []] @@ -20,7 +20,7 @@ Usage: fsiAnyCpu [script.fsx []] - CODE GENERATION - --debug[+|-] Emit debug information (Short form: - -g) + -g) (on by default) --debug:{full|pdbonly|portable|embedded} Specify debugging type: full, portable, embedded, pdbonly. ('pdbonly' is the default if no @@ -31,33 +31,35 @@ Usage: fsiAnyCpu [script.fsx []] a cross-platform format embedded into the output file). --optimize[+|-] Enable optimizations (Short form: - -O) ---tailcalls[+|-] Enable or disable tailcalls + -O) (on by default) +--tailcalls[+|-] Enable or disable tailcalls (on by + default) --deterministic[+|-] Produce a deterministic assembly (including module version GUID and - timestamp) + timestamp) (off by default) --realsig[+|-] Generate assembly with IL visibility that matches the source code - visibility + visibility (off by default) --pathmap: Maps physical paths to source path names output by the compiler --crossoptimize[+|-] Enable or disable cross-module - optimizations + optimizations (on by default) --reflectionfree Disable implicit generation of constructs using reflection - ERRORS AND WARNINGS - ---warnaserror[+|-] Report all warnings as errors +--warnaserror[+|-] Report all warnings as errors (off + by default) --warnaserror[+|-]: Report specific warnings as errors --warn: Set a warning level (0-5) --nowarn: Disable specific warning messages --warnon: Enable specific warnings that may be off by default --checknulls[+|-] Enable nullness declarations and - checks + checks (off by default) --consolecolors[+|-] Output warning and error messages in - color + color (on by default) - LANGUAGE - @@ -65,12 +67,14 @@ Usage: fsiAnyCpu [script.fsx []] language version. --langversion:{version|latest|preview} Specify language version such as 'latest' or 'preview'. ---checked[+|-] Generate overflow checks +--checked[+|-] Generate overflow checks (off by + default) --define: Define conditional compilation symbols (Short form: -d) --mlcompatibility Ignore ML compatibility warnings --strict-indentation[+|-] Override indentation rules implied - by the language version + by the language version (off by + default) - MISCELLANEOUS - @@ -112,9 +116,11 @@ Usage: fsiAnyCpu [script.fsx []] --readline[+|-] Support TAB completion in console (on by default) --quotations-debug[+|-] Emit debug information in quotations + (off by default) --shadowcopyreferences[+|-] Prevents references from being locked by the F# Interactive process + (off by default) --multiemit[+|-] Emit multiple assemblies (on by default) -See https://learn.microsoft.com/dotnet/fsharp/language-reference/fsharp-interactive-options for more details. \ No newline at end of file +See https://learn.microsoft.com/dotnet/fsharp/language-reference/fsharp-interactive-options for more details. From 65a9f1ef5e060ca396e0c3a5521a43e1b966ba67 Mon Sep 17 00:00:00 2001 From: Jakub Majocha <1760221+majocha@users.noreply.github.com> Date: Mon, 16 Dec 2024 19:23:39 +0100 Subject: [PATCH 02/19] Parallelize tests (#17872) * rebase * orchestrate instead of Async.Sleep * xunit customizations behind conditional compilation * make console capture explicit * diff * try fix test * lazy pattern * reenable extras * test temptath * cleaup test dir * remove unneeded file * fix merge * another shot at fixing gc test * another attempt at improving Async.Parallel test * smaller diff * restore test * restore tests * diff * unblock service tests * rename attributes * fix * revert - should now work without * add comment * diff * diff Co-authored-by: Petr * just exclude gc test * diff * exclude test case * try to trigger clr error in ci * try unflake test * unflake asyncmemo * ilverify * fix merge * some cleanup * Update tests/fsharp/Compiler/CodeGen/EmittedIL/DeterministicTests.fs Co-authored-by: Petr * remove timeout * Make FsiTests sequential * restore ci throttling * min diff * add comment * bring down the parallelizm a notch on mac and linux --------- Co-authored-by: Petr Co-authored-by: Vlad Zarytovskii Co-authored-by: Kevin Ransom (msft) --- eng/Build.ps1 | 50 +++--- eng/build.sh | 3 +- .../FSharp.Build.UnitTests.fsproj | 8 +- .../FSharp.Build.UnitTests/xunit.runner.json | 5 + .../CompilerOptions/fsc/misc/utf8output.fs | 1 + .../CompilerOptions/fsc/times/times.fs | 2 + .../CompilerService/AsyncMemoize.fs | 2 +- .../AttributeUsage/AssemblyVersion04.fs | 2 +- .../Events/Basic/Basic.fs | 1 + .../FSharpChecker/TransparentCompiler.fs | 5 +- ...rnTypeDirectedPartialActivePatternTests.fs | 2 + .../SequenceExpressionTests.fs | 2 + .../Miscellaneous/FsharpSuiteMigrated.fs | 8 +- .../Miscellaneous/MigratedCoreTests.fs | 40 +++-- .../TypeChecks/Graph/Utils.fs | 4 +- .../xunit.runner.json | 3 +- .../DependencyManagerInteractiveTests.fs | 1 + ...ompiler.Private.Scripting.UnitTests.fsproj | 2 +- .../xunit.runner.json | 7 +- .../AssemblyContentProviderTests.fs | 2 +- .../AssemblyInfo.fs | 7 - tests/FSharp.Compiler.Service.Tests/Common.fs | 2 +- .../FSharp.Compiler.Service.Tests.fsproj | 1 - .../FileSystemTests.fs | 2 + .../FsiHelpTests.fs | 1 - .../FSharp.Compiler.Service.Tests/FsiTests.fs | 10 +- .../ModuleReaderCancellationTests.fs | 2 + .../PerfTests.fs | 3 +- .../ProjectAnalysisTests.fs | 69 ++++---- .../ScriptOptionsTests.fs | 2 + .../xunit.runner.json | 3 +- .../FSharp.Core.UnitTests.fsproj | 2 +- .../FSharp.Core/ComparersRegression.fs | 1 + .../Microsoft.FSharp.Control/AsyncType.fs | 5 +- .../Microsoft.FSharp.Control/Cancellation.fs | 2 +- .../MailboxProcessorType.fs | 1 + .../Microsoft.FSharp.Control/Tasks.fs | 3 +- .../Microsoft.FSharp.Control/TasksDynamic.fs | 5 +- tests/FSharp.Core.UnitTests/xunit.runner.json | 3 +- tests/FSharp.Test.Utilities/CompilerAssert.fs | 3 +- .../FSharp.Test.Utilities.fsproj | 5 +- tests/FSharp.Test.Utilities/ILChecker.fs | 3 +- tests/FSharp.Test.Utilities/Peverifier.fs | 3 +- .../ProjectGeneration.fs | 5 +- tests/FSharp.Test.Utilities/ScriptHelpers.fs | 2 +- tests/FSharp.Test.Utilities/TestFramework.fs | 17 +- tests/FSharp.Test.Utilities/Utilities.fs | 6 +- tests/FSharp.Test.Utilities/XunitHelpers.fs | 162 +++++++++++++++++- tests/FSharp.Test.Utilities/XunitSetup.fs | 5 + .../CodeGen/EmittedIL/DeterministicTests.fs | 2 +- tests/fsharp/FSharpSuite.Tests.fsproj | 1 - tests/fsharp/TypeProviderTests.fs | 2 +- tests/fsharp/XunitHelpers.fs | 8 - tests/fsharp/tests.fs | 2 +- tests/fsharp/xunit.runner.json | 3 +- tests/scripts/scriptlib.fsx | 13 +- 56 files changed, 351 insertions(+), 165 deletions(-) create mode 100644 tests/FSharp.Build.UnitTests/xunit.runner.json delete mode 100644 tests/FSharp.Compiler.Service.Tests/AssemblyInfo.fs delete mode 100644 tests/fsharp/XunitHelpers.fs diff --git a/eng/Build.ps1 b/eng/Build.ps1 index 9d137104b9c..feaf768f4f2 100644 --- a/eng/Build.ps1 +++ b/eng/Build.ps1 @@ -362,14 +362,16 @@ function VerifyAssemblyVersionsAndSymbols() { } } -function TestUsingMSBuild([string] $testProject, [string] $targetFramework, [string]$testadapterpath, [boolean] $asBackgroundJob = $false) { +function TestUsingMSBuild([string] $testProject, [string] $targetFramework, [string]$testadapterpath, [boolean] $asBackgroundJob = $false, [string] $settings = "") { $dotnetPath = InitializeDotNetCli $dotnetExe = Join-Path $dotnetPath "dotnet.exe" $projectName = [System.IO.Path]::GetFileNameWithoutExtension($testProject) - $testLogPath = "$ArtifactsDir\TestResults\$configuration\${projectName}_$targetFramework.xml" + # {assembly} and {framework} will expand respectively. See https://github.com/spekt/testlogger/wiki/Logger-Configuration#logfilepath + # This is useful to deconflict log filenames when there are many test assemblies, e.g. when testing a whole solution. + $testLogPath = "$ArtifactsDir\TestResults\$configuration\{assembly}_{framework}.xml" $testBinLogPath = "$LogDir\${projectName}_$targetFramework.binlog" $args = "test $testProject -c $configuration -f $targetFramework -v n --test-adapter-path $testadapterpath --logger ""xunit;LogFilePath=$testLogPath"" /bl:$testBinLogPath" - $args += " --blame --results-directory $ArtifactsDir\TestResults\$configuration -p:vstestusemsbuildoutput=false" + $args += " --blame --blame-hang-timeout 5minutes --results-directory $ArtifactsDir\TestResults\$configuration -p:vstestusemsbuildoutput=true" if (-not $noVisualStudio -or $norestore) { $args += " --no-restore" @@ -379,17 +381,20 @@ function TestUsingMSBuild([string] $testProject, [string] $targetFramework, [str $args += " --no-build" } + $args += " $settings" + if ($asBackgroundJob) { + Write-Host Write-Host("Starting on the background: $args") Write-Host("------------------------------------") - $bgJob = Start-Job -ScriptBlock { - & $using:dotnetExe test $using:testProject -c $using:configuration -f $using:targetFramework -v n --test-adapter-path $using:testadapterpath --logger "xunit;LogFilePath=$using:testLogPath" /bl:$using:testBinLogPath --blame --results-directory $using:ArtifactsDir\TestResults\$using:configuration + Start-Job -ScriptBlock { + $argArray = $using:args -Split " " + & $using:dotnetExe $argArray if ($LASTEXITCODE -ne 0) { throw "Command failed to execute with exit code $($LASTEXITCODE): $using:dotnetExe $using:args" } } - return $bgJob - } else{ + } else { Write-Host("$args") Exec-Console $dotnetExe $args } @@ -595,21 +600,20 @@ try { $script:BuildCategory = "Test" $script:BuildMessage = "Failure running tests" - if ($testCoreClr) { - $bgJob = TestUsingMSBuild -testProject "$RepoRoot\tests\fsharp\FSharpSuite.Tests.fsproj" -targetFramework $script:coreclrTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharpSuite.Tests\" -asBackgroundJob $true - - TestUsingMSBuild -testProject "$RepoRoot\tests\FSharp.Compiler.ComponentTests\FSharp.Compiler.ComponentTests.fsproj" -targetFramework $script:coreclrTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.ComponentTests\" - TestUsingMSBuild -testProject "$RepoRoot\tests\FSharp.Compiler.Service.Tests\FSharp.Compiler.Service.Tests.fsproj" -targetFramework $script:coreclrTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.Service.Tests\" - TestUsingMSBuild -testProject "$RepoRoot\tests\FSharp.Compiler.Private.Scripting.UnitTests\FSharp.Compiler.Private.Scripting.UnitTests.fsproj" -targetFramework $script:coreclrTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.Private.Scripting.UnitTests\" - TestUsingMSBuild -testProject "$RepoRoot\tests\FSharp.Build.UnitTests\FSharp.Build.UnitTests.fsproj" -targetFramework $script:coreclrTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Build.UnitTests\" - TestUsingMSBuild -testProject "$RepoRoot\tests\FSharp.Core.UnitTests\FSharp.Core.UnitTests.fsproj" -targetFramework $script:coreclrTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Core.UnitTests\" + function Receive($job) { + while($job.HasMoreData) { + Receive-Job $job | Write-Host + Start-Sleep -Seconds 1 + } + Receive-Job $job -Wait -ErrorAction Stop + } - # Collect output from background jobs - Wait-job $bgJob | out-null - Receive-Job $bgJob -ErrorAction Stop + if ($testCoreClr) { + $cpuLimit = if ($ci) { "-m:2 -- xUnit.MaxParallelThreads=0.25x" } else { "" } + TestUsingMSBuild -testProject "$RepoRoot\FSharp.sln" -targetFramework $script:coreclrTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.ComponentTests\" -settings $cpuLimit } - if ($testDesktop) { + if ($testDesktop -and $ci) { $bgJob = TestUsingMSBuild -testProject "$RepoRoot\tests\fsharp\FSharpSuite.Tests.fsproj" -targetFramework $script:desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharpSuite.Tests\" -asBackgroundJob $true TestUsingMSBuild -testProject "$RepoRoot\tests\FSharp.Compiler.ComponentTests\FSharp.Compiler.ComponentTests.fsproj" -targetFramework $script:desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.ComponentTests\" @@ -618,9 +622,11 @@ try { TestUsingMSBuild -testProject "$RepoRoot\tests\FSharp.Build.UnitTests\FSharp.Build.UnitTests.fsproj" -targetFramework $script:desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Build.UnitTests\" TestUsingMSBuild -testProject "$RepoRoot\tests\FSharp.Core.UnitTests\FSharp.Core.UnitTests.fsproj" -targetFramework $script:desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Core.UnitTests\" - # Collect output from background jobs - Wait-job $bgJob | out-null - Receive-Job $bgJob -ErrorAction Stop + Receive -job $bgJob + } + + if ($testDesktop -and -not $ci ) { + TestUsingMSBuild -testProject "$RepoRoot\FSharp.sln" -targetFramework $script:desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.ComponentTests\" } if ($testFSharpQA) { diff --git a/eng/build.sh b/eng/build.sh index e6e27732c8f..b377904e2a6 100755 --- a/eng/build.sh +++ b/eng/build.sh @@ -219,7 +219,8 @@ function Test() { projectname=$(basename -- "$testproject") projectname="${projectname%.*}" testlogpath="$artifacts_dir/TestResults/$configuration/${projectname}_$targetframework.xml" - args="test \"$testproject\" --no-restore --no-build -c $configuration -f $targetframework --test-adapter-path . --logger \"xunit;LogFilePath=$testlogpath\" --blame --results-directory $artifacts_dir/TestResults/$configuration -p:vstestusemsbuildoutput=false" + args="test \"$testproject\" --no-restore --no-build -c $configuration -f $targetframework --test-adapter-path . --logger \"xunit;LogFilePath=$testlogpath\" --blame-hang-timeout 5minutes --results-directory $artifacts_dir/TestResults/$configuration -p:vstestusemsbuildoutput=false" + args+=" -- xUnit.MaxParallelThreads=3" "$DOTNET_INSTALL_DIR/dotnet" $args || exit $? } diff --git a/tests/FSharp.Build.UnitTests/FSharp.Build.UnitTests.fsproj b/tests/FSharp.Build.UnitTests/FSharp.Build.UnitTests.fsproj index e689cf1bf39..853737b3ca8 100644 --- a/tests/FSharp.Build.UnitTests/FSharp.Build.UnitTests.fsproj +++ b/tests/FSharp.Build.UnitTests/FSharp.Build.UnitTests.fsproj @@ -4,7 +4,7 @@ net472;$(FSharpNetCoreProductTargetFramework) - $(FSharpNetCoreProductTargetFramework) + $(FSharpNetCoreProductTargetFramework) Library true xunit @@ -18,6 +18,12 @@ + + + PreserveNewest + + + diff --git a/tests/FSharp.Build.UnitTests/xunit.runner.json b/tests/FSharp.Build.UnitTests/xunit.runner.json new file mode 100644 index 00000000000..b01c50a3cb5 --- /dev/null +++ b/tests/FSharp.Build.UnitTests/xunit.runner.json @@ -0,0 +1,5 @@ +{ + "$schema": "https://xunit.net/schema/current/xunit.runner.schema.json", + "appDomain": "denied", + "parallelizeAssembly": true +} diff --git a/tests/FSharp.Compiler.ComponentTests/CompilerOptions/fsc/misc/utf8output.fs b/tests/FSharp.Compiler.ComponentTests/CompilerOptions/fsc/misc/utf8output.fs index 6c6216a8377..c17a5c01f07 100644 --- a/tests/FSharp.Compiler.ComponentTests/CompilerOptions/fsc/misc/utf8output.fs +++ b/tests/FSharp.Compiler.ComponentTests/CompilerOptions/fsc/misc/utf8output.fs @@ -7,6 +7,7 @@ open FSharp.Test open FSharp.Test.Compiler open System +[] module utf8output = [] diff --git a/tests/FSharp.Compiler.ComponentTests/CompilerOptions/fsc/times/times.fs b/tests/FSharp.Compiler.ComponentTests/CompilerOptions/fsc/times/times.fs index b18e5472ec0..7b137c24c15 100644 --- a/tests/FSharp.Compiler.ComponentTests/CompilerOptions/fsc/times/times.fs +++ b/tests/FSharp.Compiler.ComponentTests/CompilerOptions/fsc/times/times.fs @@ -8,6 +8,8 @@ open FSharp.Test.Compiler open System open System.IO +// reportTime uses global state. +[] module times = // This test was automatically generated (moved from FSharpQA suite - CompilerOptions/fsc/times) diff --git a/tests/FSharp.Compiler.ComponentTests/CompilerService/AsyncMemoize.fs b/tests/FSharp.Compiler.ComponentTests/CompilerService/AsyncMemoize.fs index cdc7bdb1400..3e940c51ea6 100644 --- a/tests/FSharp.Compiler.ComponentTests/CompilerService/AsyncMemoize.fs +++ b/tests/FSharp.Compiler.ComponentTests/CompilerService/AsyncMemoize.fs @@ -28,7 +28,7 @@ let internal observe (cache: AsyncMemoize<_,_,_>) = cache.Event.Add arrivals.Post - let next () = collected.Receive(10_000) + let next () = collected.Receive() next diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/CustomAttributes/AttributeUsage/AssemblyVersion04.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/CustomAttributes/AttributeUsage/AssemblyVersion04.fs index 2a67d906999..fd876e72abb 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/CustomAttributes/AttributeUsage/AssemblyVersion04.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/CustomAttributes/AttributeUsage/AssemblyVersion04.fs @@ -14,5 +14,5 @@ let success = asm.Version.Major = 1 && asm.Version.Minor = 2 && asm.Version.Build = 3 && - (abs (asm.Version.Revision - (int defaultRevision))) < 10 // default value is seconds in the current day / 2. Check if within 10 sec of that. + (abs (asm.Version.Revision - (int defaultRevision))) < 60 // default value is seconds in the current day / 2. Check if within 60 sec of that. if success then () else failwith "Failed: 1" \ No newline at end of file diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/Events/Basic/Basic.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/Events/Basic/Basic.fs index 87d12baea7c..caede79cd6b 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/Events/Basic/Basic.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/Events/Basic/Basic.fs @@ -6,6 +6,7 @@ open Xunit open FSharp.Test open FSharp.Test.Compiler +[] module Events = let verifyCompile compilation = diff --git a/tests/FSharp.Compiler.ComponentTests/FSharpChecker/TransparentCompiler.fs b/tests/FSharp.Compiler.ComponentTests/FSharpChecker/TransparentCompiler.fs index 4b5987f65e5..b523b814b72 100644 --- a/tests/FSharp.Compiler.ComponentTests/FSharpChecker/TransparentCompiler.fs +++ b/tests/FSharp.Compiler.ComponentTests/FSharpChecker/TransparentCompiler.fs @@ -1,4 +1,5 @@ -module FSharpChecker.TransparentCompiler +[] +module FSharpChecker.TransparentCompiler open System.Collections.Concurrent open System.Diagnostics @@ -991,6 +992,8 @@ type private LoadClosureTestShim(currentFileSystem: IFileSystem) = ?shouldShadowCopy = shouldShadowCopy ) +// Because it is mutating FileSystem! +[] module TestsMutatingFileSystem = [] diff --git a/tests/FSharp.Compiler.ComponentTests/Language/BooleanReturningAndReturnTypeDirectedPartialActivePatternTests.fs b/tests/FSharp.Compiler.ComponentTests/Language/BooleanReturningAndReturnTypeDirectedPartialActivePatternTests.fs index 6562e347bbd..8ae8d85db6e 100644 --- a/tests/FSharp.Compiler.ComponentTests/Language/BooleanReturningAndReturnTypeDirectedPartialActivePatternTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/Language/BooleanReturningAndReturnTypeDirectedPartialActivePatternTests.fs @@ -1,5 +1,7 @@ // Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. +// Because of shared fsi session. +[] module Language.BooleanReturningAndReturnTypeDirectedPartialActivePatternTests open Xunit diff --git a/tests/FSharp.Compiler.ComponentTests/Language/SequenceExpressions/SequenceExpressionTests.fs b/tests/FSharp.Compiler.ComponentTests/Language/SequenceExpressions/SequenceExpressionTests.fs index 6d46a3718f0..9d98106bcdb 100644 --- a/tests/FSharp.Compiler.ComponentTests/Language/SequenceExpressions/SequenceExpressionTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/Language/SequenceExpressions/SequenceExpressionTests.fs @@ -1,5 +1,7 @@ // Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. +// Run sequentially because of shared fsiSession. +[] module Language.SequenceExpression.SequenceExpressionTests open FSharp.Test diff --git a/tests/FSharp.Compiler.ComponentTests/Miscellaneous/FsharpSuiteMigrated.fs b/tests/FSharp.Compiler.ComponentTests/Miscellaneous/FsharpSuiteMigrated.fs index 5ab961176f5..8ab6a4ac584 100644 --- a/tests/FSharp.Compiler.ComponentTests/Miscellaneous/FsharpSuiteMigrated.fs +++ b/tests/FSharp.Compiler.ComponentTests/Miscellaneous/FsharpSuiteMigrated.fs @@ -36,13 +36,15 @@ module ScriptRunner = let res = evalScriptFromDiskInSharedSession engine cu match res with | CompilationResult.Failure _ -> res - | CompilationResult.Success s -> + | CompilationResult.Success _ -> if capture.OutText |> TestFramework.outputPassed then res else - failwith $"Results looked correct, but 'TEST PASSED OK' was not printed. Result: %A{s}" + failwith $"Results looked correct, but 'TEST PASSED OK' was not printed." - | _ -> failwith $"Compilation unit other than fsharp is not supported, cannot process %A{cu}" + | _ -> + printfn $"Cannot process %A{cu}" + failwith $"Compilation unit other than fsharp is not supported." /// This test file was created by porting over (slower) FsharpSuite.Tests /// In order to minimize human error, the test definitions have been copy-pasted and this adapter provides implementations of the test functions diff --git a/tests/FSharp.Compiler.ComponentTests/Miscellaneous/MigratedCoreTests.fs b/tests/FSharp.Compiler.ComponentTests/Miscellaneous/MigratedCoreTests.fs index 2d9c6657901..d0cd80472f1 100644 --- a/tests/FSharp.Compiler.ComponentTests/Miscellaneous/MigratedCoreTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/Miscellaneous/MigratedCoreTests.fs @@ -93,14 +93,17 @@ let ``comprehensions-FSC_OPTIMIZED`` () = singleTestBuildAndRun "core/comprehens [] let ``comprehensions-FSI`` () = singleTestBuildAndRun "core/comprehensions" FSI -[] -let ``comprehensionshw-FSC_DEBUG`` () = singleTestBuildAndRun "core/comprehensions-hw" FSC_DEBUG +// Cancels default token. +[] +module Comprehensionshw = + [] + let ``comprehensionshw-FSC_DEBUG`` () = singleTestBuildAndRun "core/comprehensions-hw" FSC_DEBUG -[] -let ``comprehensionshw-FSC_OPTIMIZED`` () = singleTestBuildAndRun "core/comprehensions-hw" FSC_OPTIMIZED + [] + let ``comprehensionshw-FSC_OPTIMIZED`` () = singleTestBuildAndRun "core/comprehensions-hw" FSC_OPTIMIZED -[] -let ``comprehensionshw-FSI`` () = singleTestBuildAndRun "core/comprehensions-hw" FSI + [] + let ``comprehensionshw-FSI`` () = singleTestBuildAndRun "core/comprehensions-hw" FSI [] let ``genericmeasures-FSC_DEBUG`` () = singleTestBuildAndRun "core/genericmeasures" FSC_DEBUG @@ -375,18 +378,21 @@ let ``recordResolution-FSC_OPTIMIZED`` () = singleTestBuildAndRun "core/recordRe [] let ``recordResolution-FSI`` () = singleTestBuildAndRun "core/recordResolution" FSI -// This test has hardcoded expectations about current synchronization context -// Will be moved out of FsharpSuite.Tests in a later phase for desktop framework -[] -let ``control-FSC_OPTIMIZED`` () = singleTestBuildAndRun "core/control" FSC_OPTIMIZED +// Cancels default token. +[] +module CoreControl = + // This test has hardcoded expectations about current synchronization context + // Will be moved out of FsharpSuite.Tests in a later phase for desktop framework + [] + let ``control-FSC_OPTIMIZED`` () = singleTestBuildAndRun "core/control" FSC_OPTIMIZED -[] -let ``control-FSI`` () = singleTestBuildAndRun "core/control" FSI + [] + let ``control-FSI`` () = singleTestBuildAndRun "core/control" FSI -[] -let ``control --tailcalls`` () = - let cfg = "core/control" - singleTestBuildAndRunAux cfg ["--tailcalls"] FSC_OPTIMIZED + [] + let ``control --tailcalls`` () = + let cfg = "core/control" + singleTestBuildAndRunAux cfg ["--tailcalls"] FSC_OPTIMIZED [] let ``controlChamenos-FSC_OPTIMIZED`` () = @@ -401,7 +407,7 @@ let ``controlChamenos-FSI`` () = [] let ``controlMailbox-FSC_OPTIMIZED`` () = singleTestBuildAndRun "core/controlMailbox" FSC_OPTIMIZED -[] +[] let ``controlMailbox-FSI`` () = singleTestBuildAndRun "core/controlMailbox" FSI [] diff --git a/tests/FSharp.Compiler.ComponentTests/TypeChecks/Graph/Utils.fs b/tests/FSharp.Compiler.ComponentTests/TypeChecks/Graph/Utils.fs index d14ddb44de1..02dd073625d 100644 --- a/tests/FSharp.Compiler.ComponentTests/TypeChecks/Graph/Utils.fs +++ b/tests/FSharp.Compiler.ComponentTests/TypeChecks/Graph/Utils.fs @@ -5,7 +5,7 @@ open FSharp.Compiler.GraphChecking open FSharp.Compiler.Text open FSharp.Compiler.Syntax -let private checker = FSharpChecker.Create() +open FSharp.Test let parseSourceCode (name: string, code: string) = let sourceText = SourceText.ofString code @@ -16,7 +16,7 @@ let parseSourceCode (name: string, code: string) = } let result = - checker.ParseFile(name, sourceText, parsingOptions) |> Async.RunSynchronously + CompilerAssert.Checker.ParseFile(name, sourceText, parsingOptions) |> Async.RunSynchronously result.ParseTree diff --git a/tests/FSharp.Compiler.ComponentTests/xunit.runner.json b/tests/FSharp.Compiler.ComponentTests/xunit.runner.json index d1866b85c61..b01c50a3cb5 100644 --- a/tests/FSharp.Compiler.ComponentTests/xunit.runner.json +++ b/tests/FSharp.Compiler.ComponentTests/xunit.runner.json @@ -1,6 +1,5 @@ { "$schema": "https://xunit.net/schema/current/xunit.runner.schema.json", "appDomain": "denied", - "parallelizeTestCollections": false, - "maxParallelThreads": 1 + "parallelizeAssembly": true } diff --git a/tests/FSharp.Compiler.Private.Scripting.UnitTests/DependencyManagerInteractiveTests.fs b/tests/FSharp.Compiler.Private.Scripting.UnitTests/DependencyManagerInteractiveTests.fs index 20c5919e00e..7f320fea23f 100644 --- a/tests/FSharp.Compiler.Private.Scripting.UnitTests/DependencyManagerInteractiveTests.fs +++ b/tests/FSharp.Compiler.Private.Scripting.UnitTests/DependencyManagerInteractiveTests.fs @@ -26,6 +26,7 @@ module Native = type scriptHost (?langVersion: LangVersion) = inherit FSharpScript(langVersion=defaultArg langVersion LangVersion.Preview) +[] type DependencyManagerInteractiveTests() = let getValue ((value: Result), (errors: FSharpDiagnostic[])) = diff --git a/tests/FSharp.Compiler.Private.Scripting.UnitTests/FSharp.Compiler.Private.Scripting.UnitTests.fsproj b/tests/FSharp.Compiler.Private.Scripting.UnitTests/FSharp.Compiler.Private.Scripting.UnitTests.fsproj index a3ac4bd6d1a..e0d064e12f9 100644 --- a/tests/FSharp.Compiler.Private.Scripting.UnitTests/FSharp.Compiler.Private.Scripting.UnitTests.fsproj +++ b/tests/FSharp.Compiler.Private.Scripting.UnitTests/FSharp.Compiler.Private.Scripting.UnitTests.fsproj @@ -3,7 +3,7 @@ net472;$(FSharpNetCoreProductTargetFramework) - $(FSharpNetCoreProductTargetFramework) + $(FSharpNetCoreProductTargetFramework) Library true xunit diff --git a/tests/FSharp.Compiler.Private.Scripting.UnitTests/xunit.runner.json b/tests/FSharp.Compiler.Private.Scripting.UnitTests/xunit.runner.json index b180883cc0f..b01c50a3cb5 100644 --- a/tests/FSharp.Compiler.Private.Scripting.UnitTests/xunit.runner.json +++ b/tests/FSharp.Compiler.Private.Scripting.UnitTests/xunit.runner.json @@ -1,6 +1,5 @@ { - "$schema": "https://xunit.net/schema/current/xunit.runner.schema.json", - "appDomain": "denied", - "parallelizeTestCollections": false, - "maxParallelThreads": 1 + "$schema": "https://xunit.net/schema/current/xunit.runner.schema.json", + "appDomain": "denied", + "parallelizeAssembly": true } diff --git a/tests/FSharp.Compiler.Service.Tests/AssemblyContentProviderTests.fs b/tests/FSharp.Compiler.Service.Tests/AssemblyContentProviderTests.fs index cb4521b7af4..eabf028393c 100644 --- a/tests/FSharp.Compiler.Service.Tests/AssemblyContentProviderTests.fs +++ b/tests/FSharp.Compiler.Service.Tests/AssemblyContentProviderTests.fs @@ -22,7 +22,7 @@ let private projectOptions : FSharpProjectOptions = UnresolvedReferences = None Stamp = None } -let private checker = FSharpChecker.Create(useTransparentCompiler=CompilerAssertHelpers.UseTransparentCompiler) +let private checker = FSharpChecker.Create(useTransparentCompiler = CompilerAssertHelpers.UseTransparentCompiler) let private assertAreEqual (expected, actual) = if actual <> expected then diff --git a/tests/FSharp.Compiler.Service.Tests/AssemblyInfo.fs b/tests/FSharp.Compiler.Service.Tests/AssemblyInfo.fs deleted file mode 100644 index 3433f928ba4..00000000000 --- a/tests/FSharp.Compiler.Service.Tests/AssemblyInfo.fs +++ /dev/null @@ -1,7 +0,0 @@ -module FSharp.Compiler.Service.Tests.AssemblyInfo - -open Xunit - -[] - -do() diff --git a/tests/FSharp.Compiler.Service.Tests/Common.fs b/tests/FSharp.Compiler.Service.Tests/Common.fs index 18276ae39a9..8ccb19b0f85 100644 --- a/tests/FSharp.Compiler.Service.Tests/Common.fs +++ b/tests/FSharp.Compiler.Service.Tests/Common.fs @@ -31,7 +31,7 @@ type Async with task.Result // Create one global interactive checker instance -let checker = FSharpChecker.Create(useTransparentCompiler=FSharp.Compiler.CompilerConfig.FSharpExperimentalFeaturesEnabledAutomatically) +let checker = FSharpChecker.Create(useTransparentCompiler = FSharp.Test.CompilerAssertHelpers.UseTransparentCompiler) type TempFile(ext, contents: string) = let tmpFile = Path.ChangeExtension(getTemporaryFileName (), ext) diff --git a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj index fc64abb4138..57ce88d8f02 100644 --- a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj +++ b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj @@ -19,7 +19,6 @@ Never - XunitSetup.fs diff --git a/tests/FSharp.Compiler.Service.Tests/FileSystemTests.fs b/tests/FSharp.Compiler.Service.Tests/FileSystemTests.fs index e11d97096f8..4d191dcc7cb 100644 --- a/tests/FSharp.Compiler.Service.Tests/FileSystemTests.fs +++ b/tests/FSharp.Compiler.Service.Tests/FileSystemTests.fs @@ -25,6 +25,8 @@ let file2 = """ module File2 let B = File1.A + File1.A""" +// FileSystem is a global shared resource. +[] type internal MyFileSystem() = inherit DefaultFileSystem() static member FilesCache = dict [(fileName1, file1); (fileName2, file2)] diff --git a/tests/FSharp.Compiler.Service.Tests/FsiHelpTests.fs b/tests/FSharp.Compiler.Service.Tests/FsiHelpTests.fs index d17b3421ed9..110cc1a09e7 100644 --- a/tests/FSharp.Compiler.Service.Tests/FsiHelpTests.fs +++ b/tests/FSharp.Compiler.Service.Tests/FsiHelpTests.fs @@ -3,7 +3,6 @@ open FSharp.Test.Assert open Xunit -[] module FsiHelpTests = [] diff --git a/tests/FSharp.Compiler.Service.Tests/FsiTests.fs b/tests/FSharp.Compiler.Service.Tests/FsiTests.fs index f6a785af4f1..bb3e8407d6f 100644 --- a/tests/FSharp.Compiler.Service.Tests/FsiTests.fs +++ b/tests/FSharp.Compiler.Service.Tests/FsiTests.fs @@ -14,21 +14,17 @@ type Sentinel () = module MyModule = let test(x: int) = () -[] +// Running in parallel is unstable with occasional System.IO.FileLoadException: Could not load file or assembly 'FSI-ASSEMBLY... +[] module FsiTests = let createFsiSession (useOneDynamicAssembly: bool) = - // Initialize output and input streams - let inStream = new StringReader("") - let outStream = new CompilerOutputStream() - let errStream = new CompilerOutputStream() - // Build command line arguments & start FSI session let argv = [| "C:\\fsi.exe" |] let allArgs = Array.append argv [|"--noninteractive"; if useOneDynamicAssembly then "--multiemit-" else "--multiemit+" |] let fsiConfig = FsiEvaluationSession.GetDefaultConfiguration() - FsiEvaluationSession.Create(fsiConfig, allArgs, inStream, new StreamWriter(outStream), new StreamWriter(errStream), collectible = true) + FsiEvaluationSession.Create(fsiConfig, allArgs, stdin, stdout, stderr, collectible = true) [] let ``No bound values at the start of FSI session`` () = diff --git a/tests/FSharp.Compiler.Service.Tests/ModuleReaderCancellationTests.fs b/tests/FSharp.Compiler.Service.Tests/ModuleReaderCancellationTests.fs index 995d9dabfb2..62e36de58b9 100644 --- a/tests/FSharp.Compiler.Service.Tests/ModuleReaderCancellationTests.fs +++ b/tests/FSharp.Compiler.Service.Tests/ModuleReaderCancellationTests.fs @@ -1,3 +1,5 @@ +// Sequential execution because of shared mutable state. +[] module FSharp.Compiler.Service.Tests.ModuleReaderCancellationTests open System diff --git a/tests/FSharp.Compiler.Service.Tests/PerfTests.fs b/tests/FSharp.Compiler.Service.Tests/PerfTests.fs index aa270182895..8a9ac73740a 100644 --- a/tests/FSharp.Compiler.Service.Tests/PerfTests.fs +++ b/tests/FSharp.Compiler.Service.Tests/PerfTests.fs @@ -1,4 +1,5 @@ -module FSharp.Compiler.Service.Tests.PerfTests +[] +module FSharp.Compiler.Service.Tests.PerfTests open Xunit open FSharp.Test.Assert diff --git a/tests/FSharp.Compiler.Service.Tests/ProjectAnalysisTests.fs b/tests/FSharp.Compiler.Service.Tests/ProjectAnalysisTests.fs index dfce65ef186..1570cd34d0c 100644 --- a/tests/FSharp.Compiler.Service.Tests/ProjectAnalysisTests.fs +++ b/tests/FSharp.Compiler.Service.Tests/ProjectAnalysisTests.fs @@ -105,28 +105,31 @@ let ``Test project1 whole project errors`` () = wholeProjectResults.Diagnostics[0].Range.StartColumn |> shouldEqual 43 wholeProjectResults.Diagnostics[0].Range.EndColumn |> shouldEqual 44 -[] -let ``Test project1 and make sure TcImports gets cleaned up`` () = +[] +module ClearLanguageServiceRootCachesTest = + [] + let ``Test project1 and make sure TcImports gets cleaned up`` () = - // A private checker for this test. - let checker = FSharpChecker.Create() + // A private checker for this test. + let checker = FSharpChecker.Create() - let test () = - let _, checkFileAnswer = checker.ParseAndCheckFileInProject(Project1.fileName1, 0, Project1.fileSource1, Project1.options) |> Async.RunImmediate - match checkFileAnswer with - | FSharpCheckFileAnswer.Aborted -> failwith "should not be aborted" - | FSharpCheckFileAnswer.Succeeded checkFileResults -> - let tcImportsOpt = checkFileResults.TryGetCurrentTcImports () - Assert.True tcImportsOpt.IsSome - let weakTcImports = WeakReference tcImportsOpt.Value - Assert.True weakTcImports.IsAlive - weakTcImports - - // Here we are only keeping a handle to weakTcImports and nothing else - let weakTcImports = test () - checker.InvalidateConfiguration Project1.options - checker.ClearLanguageServiceRootCachesAndCollectAndFinalizeAllTransients() - System.Threading.SpinWait.SpinUntil(fun () -> not weakTcImports.IsAlive) + let test () = + let _, checkFileAnswer = checker.ParseAndCheckFileInProject(Project1.fileName1, 0, Project1.fileSource1, Project1.options) |> Async.RunImmediate + match checkFileAnswer with + | FSharpCheckFileAnswer.Aborted -> failwith "should not be aborted" + | FSharpCheckFileAnswer.Succeeded checkFileResults -> + let tcImportsOpt = checkFileResults.TryGetCurrentTcImports () + Assert.True tcImportsOpt.IsSome + let weakTcImports = WeakReference tcImportsOpt.Value + Assert.True weakTcImports.IsAlive + weakTcImports + + // Here we are only keeping a handle to weakTcImports and nothing else + let weakTcImports = test () + checker.InvalidateConfiguration Project1.options + checker.ClearLanguageServiceRootCachesAndCollectAndFinalizeAllTransients() + GC.Collect() + System.Threading.SpinWait.SpinUntil(fun () -> not weakTcImports.IsAlive) [] let ``Test Project1 should have protected FullName and TryFullName return same results`` () = @@ -5788,18 +5791,20 @@ let checkContentAsScript content = | FSharpCheckFileAnswer.Aborted -> failwith "no check results" | FSharpCheckFileAnswer.Succeeded r -> r -[] -let ``References from #r nuget are included in script project options`` () = - let checkResults = checkContentAsScript """ -#i "nuget:https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json" -#r "nuget: Dapper" -""" - let assemblyNames = - checkResults.ProjectContext.GetReferencedAssemblies() - |> Seq.choose (fun f -> f.FileName |> Option.map Path.GetFileName) - |> Seq.distinct - printfn "%s" (assemblyNames |> String.concat "\n") - Assert.Contains("Dapper.dll", assemblyNames) +[] +module ScriptClosureCacheUse = + [] + let ``References from #r nuget are included in script project options`` () = + let checkResults = checkContentAsScript """ + #i "nuget:https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json" + #r "nuget: Dapper" + """ + let assemblyNames = + checkResults.ProjectContext.GetReferencedAssemblies() + |> Seq.choose (fun f -> f.FileName |> Option.map Path.GetFileName) + |> Seq.distinct + printfn "%s" (assemblyNames |> String.concat "\n") + Assert.Contains("Dapper.dll", assemblyNames) module internal EmptyProject = let base2 = getTemporaryFileName () diff --git a/tests/FSharp.Compiler.Service.Tests/ScriptOptionsTests.fs b/tests/FSharp.Compiler.Service.Tests/ScriptOptionsTests.fs index 328272defb8..43dfe12a0c0 100644 --- a/tests/FSharp.Compiler.Service.Tests/ScriptOptionsTests.fs +++ b/tests/FSharp.Compiler.Service.Tests/ScriptOptionsTests.fs @@ -1,3 +1,5 @@ +// Because of script closure cache. +[] module FSharp.Compiler.Service.Tests.ScriptOptionsTests open Xunit diff --git a/tests/FSharp.Compiler.Service.Tests/xunit.runner.json b/tests/FSharp.Compiler.Service.Tests/xunit.runner.json index 2b65d19ea3e..b01c50a3cb5 100644 --- a/tests/FSharp.Compiler.Service.Tests/xunit.runner.json +++ b/tests/FSharp.Compiler.Service.Tests/xunit.runner.json @@ -1,4 +1,5 @@ { "$schema": "https://xunit.net/schema/current/xunit.runner.schema.json", - "appDomain": "denied" + "appDomain": "denied", + "parallelizeAssembly": true } diff --git a/tests/FSharp.Core.UnitTests/FSharp.Core.UnitTests.fsproj b/tests/FSharp.Core.UnitTests/FSharp.Core.UnitTests.fsproj index 305d234a837..3e6bbbd282d 100644 --- a/tests/FSharp.Core.UnitTests/FSharp.Core.UnitTests.fsproj +++ b/tests/FSharp.Core.UnitTests/FSharp.Core.UnitTests.fsproj @@ -4,7 +4,7 @@ $(FSharpNetCoreProductTargetFramework);net472 - $(FSharpNetCoreProductTargetFramework) + $(FSharpNetCoreProductTargetFramework) Library FSharp.Core.UnitTests diff --git a/tests/FSharp.Core.UnitTests/FSharp.Core/ComparersRegression.fs b/tests/FSharp.Core.UnitTests/FSharp.Core/ComparersRegression.fs index a8e42790090..59497654b5b 100644 --- a/tests/FSharp.Core.UnitTests/FSharp.Core/ComparersRegression.fs +++ b/tests/FSharp.Core.UnitTests/FSharp.Core/ComparersRegression.fs @@ -1747,6 +1747,7 @@ module ComparersRegression = open ComparersRegression open Xunit +[] type GeneratedTests () = let _ = () // ------------------------------------------------------------------------------ diff --git a/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Control/AsyncType.fs b/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Control/AsyncType.fs index 97ea8fca1a8..ef75dff9e00 100644 --- a/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Control/AsyncType.fs +++ b/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Control/AsyncType.fs @@ -11,6 +11,8 @@ open Xunit open System.Threading open System.Threading.Tasks +// Cancels default token. +[] module AsyncType = type ExpectedContinuation = Success | Exception | Cancellation @@ -38,8 +40,7 @@ module AsyncType = async { return () } |> expect Success - - +[] type AsyncType() = let ignoreSynchCtx f = diff --git a/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Control/Cancellation.fs b/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Control/Cancellation.fs index b4a75843369..3fc449546e1 100644 --- a/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Control/Cancellation.fs +++ b/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Control/Cancellation.fs @@ -9,7 +9,7 @@ open FSharp.Test open System.Threading open System.Threading.Tasks - +[] type CancellationType() = let ordered() = diff --git a/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Control/MailboxProcessorType.fs b/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Control/MailboxProcessorType.fs index 1e2fcd58545..4dd7797ae9f 100644 --- a/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Control/MailboxProcessorType.fs +++ b/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Control/MailboxProcessorType.fs @@ -24,6 +24,7 @@ type StartImmediateThreadInfo = type StartImmediateMessage = | GetThreadInfo of AsyncReplyChannel +[] type MailboxProcessorType() = let getSimpleMailbox() = diff --git a/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Control/Tasks.fs b/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Control/Tasks.fs index 8097c2d10f5..cce271d58bb 100644 --- a/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Control/Tasks.fs +++ b/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Control/Tasks.fs @@ -192,6 +192,7 @@ module Helpers = let require x msg = if not x then failwith msg let failtest str = raise (TestException str) +[] type Basics() = [] member _.testShortCircuitResult() = @@ -1201,8 +1202,6 @@ type Basics() = } |> ignore -[] -type BasicsNotInParallel() = [] member _.testTaskUsesSyncContext() = diff --git a/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Control/TasksDynamic.fs b/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Control/TasksDynamic.fs index 7f844e99d96..430b1b526e4 100644 --- a/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Control/TasksDynamic.fs +++ b/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Control/TasksDynamic.fs @@ -313,6 +313,7 @@ module Helpers = let require x msg = if not x then failwith msg let failtest str = raise (TestException str) +[] type Basics() = [] member _.testShortCircuitResult() = @@ -1259,10 +1260,6 @@ type Basics() = } |> ignore - -[] -type BasicsNotInParallel() = - [] member _.testTaskUsesSyncContext() = printfn "Running testBackgroundTask..." diff --git a/tests/FSharp.Core.UnitTests/xunit.runner.json b/tests/FSharp.Core.UnitTests/xunit.runner.json index d1866b85c61..b01c50a3cb5 100644 --- a/tests/FSharp.Core.UnitTests/xunit.runner.json +++ b/tests/FSharp.Core.UnitTests/xunit.runner.json @@ -1,6 +1,5 @@ { "$schema": "https://xunit.net/schema/current/xunit.runner.schema.json", "appDomain": "denied", - "parallelizeTestCollections": false, - "maxParallelThreads": 1 + "parallelizeAssembly": true } diff --git a/tests/FSharp.Test.Utilities/CompilerAssert.fs b/tests/FSharp.Test.Utilities/CompilerAssert.fs index 5253ef16934..0f7baf597fb 100644 --- a/tests/FSharp.Test.Utilities/CompilerAssert.fs +++ b/tests/FSharp.Test.Utilities/CompilerAssert.fs @@ -622,8 +622,7 @@ module CompilerAssertHelpers = let runtimeconfigPath = Path.ChangeExtension(outputFilePath, ".runtimeconfig.json") File.WriteAllText(runtimeconfigPath, runtimeconfig) #endif - let timeout = 30000 - let rc, output, errors = Commands.executeProcess fileName arguments (Path.GetDirectoryName(outputFilePath)) timeout + let rc, output, errors = Commands.executeProcess fileName arguments (Path.GetDirectoryName(outputFilePath)) let output = String.Join(Environment.NewLine, output) let errors = String.Join(Environment.NewLine, errors) ExitCode rc, output, errors diff --git a/tests/FSharp.Test.Utilities/FSharp.Test.Utilities.fsproj b/tests/FSharp.Test.Utilities/FSharp.Test.Utilities.fsproj index 52c1893073c..e16ac79fc6a 100644 --- a/tests/FSharp.Test.Utilities/FSharp.Test.Utilities.fsproj +++ b/tests/FSharp.Test.Utilities/FSharp.Test.Utilities.fsproj @@ -10,8 +10,11 @@ true false false + false $(OtherFlags) --warnon:1182 true + + XUNIT_EXTRAS @@ -105,7 +108,7 @@ - + diff --git a/tests/FSharp.Test.Utilities/ILChecker.fs b/tests/FSharp.Test.Utilities/ILChecker.fs index de0fbd8050b..b47ae4409f0 100644 --- a/tests/FSharp.Test.Utilities/ILChecker.fs +++ b/tests/FSharp.Test.Utilities/ILChecker.fs @@ -15,8 +15,7 @@ module ILChecker = let private exec exe args = let arguments = args |> String.concat " " - let timeout = 30000 - let exitCode, _output, errors = Commands.executeProcess exe arguments "" timeout + let exitCode, _output, errors = Commands.executeProcess exe arguments "" let errors = errors |> String.concat Environment.NewLine errors, exitCode diff --git a/tests/FSharp.Test.Utilities/Peverifier.fs b/tests/FSharp.Test.Utilities/Peverifier.fs index f3ccc7de2b1..0591a435484 100644 --- a/tests/FSharp.Test.Utilities/Peverifier.fs +++ b/tests/FSharp.Test.Utilities/Peverifier.fs @@ -24,8 +24,7 @@ module PEVerifier = let private exec exe args = let arguments = args |> String.concat " " - let timeout = 30000 - let exitCode, _output, errors = Commands.executeProcess exe arguments "" timeout + let exitCode, _output, errors = Commands.executeProcess exe arguments "" let errors = errors |> String.concat Environment.NewLine errors, exitCode diff --git a/tests/FSharp.Test.Utilities/ProjectGeneration.fs b/tests/FSharp.Test.Utilities/ProjectGeneration.fs index 197788b0e2e..fc110ded6b6 100644 --- a/tests/FSharp.Test.Utilities/ProjectGeneration.fs +++ b/tests/FSharp.Test.Utilities/ProjectGeneration.fs @@ -32,6 +32,7 @@ open FSharp.Compiler.Text open Xunit open FSharp.Test.Utilities + open OpenTelemetry open OpenTelemetry.Resources open OpenTelemetry.Trace @@ -349,11 +350,11 @@ type SyntheticProject = UnresolvedReferences = None OriginalLoadReferences = [] Stamp = None } - - + OptionsCache.GetOrAdd(key, factory).Value + member this.GetAllProjects() = [ this for p in this.DependsOn do diff --git a/tests/FSharp.Test.Utilities/ScriptHelpers.fs b/tests/FSharp.Test.Utilities/ScriptHelpers.fs index f060cb91398..aa0593fa090 100644 --- a/tests/FSharp.Test.Utilities/ScriptHelpers.fs +++ b/tests/FSharp.Test.Utilities/ScriptHelpers.fs @@ -100,4 +100,4 @@ module TestHelpers = | Ok(value) -> value | Error ex -> raise ex - let ignoreValue x = getValue x |> ignore + let ignoreValue = getValue >> ignore diff --git a/tests/FSharp.Test.Utilities/TestFramework.fs b/tests/FSharp.Test.Utilities/TestFramework.fs index f50452eff9e..38976846a4a 100644 --- a/tests/FSharp.Test.Utilities/TestFramework.fs +++ b/tests/FSharp.Test.Utilities/TestFramework.fs @@ -4,12 +4,11 @@ module TestFramework open System open System.IO -open System.Reflection open System.Diagnostics +open System.Reflection open Scripting open Xunit open FSharp.Compiler.IO -open Xunit.Sdk let getShortId() = Guid.NewGuid().ToString().[..7] @@ -64,7 +63,7 @@ module Commands = // Execute the process pathToExe passing the arguments: arguments with the working directory: workingDir timeout after timeout milliseconds -1 = wait forever // returns exit code, stdio and stderr as string arrays - let executeProcess pathToExe arguments workingDir (timeout:int) = + let executeProcess pathToExe arguments workingDir = let commandLine = ResizeArray() let errorsList = ResizeArray() let outputList = ResizeArray() @@ -103,11 +102,7 @@ module Commands = if p.Start() then p.BeginOutputReadLine() p.BeginErrorReadLine() - if not(p.WaitForExit(timeout)) then - // Timed out resolving throw a diagnostic. - raise (new TimeoutException(sprintf "Timeout executing command '%s' '%s'" (psi.FileName) (psi.Arguments))) - else - p.WaitForExit() + p.WaitForExit() #if DEBUG let workingDir' = if workingDir = "" @@ -564,8 +559,7 @@ module Command = | Output r -> use writer = openWrite r use outFile = redirectTo writer - use toLog = redirectToLog () - fCont { cmdArgs with RedirectOutput = Some (outFile.Post); RedirectError = Some (toLog.Post) } + fCont { cmdArgs with RedirectOutput = Some (outFile.Post); RedirectError = Some ignore } | OutputAndError (r1,r2) -> use writer1 = openWrite r1 use writer2 = openWrite r2 @@ -579,8 +573,7 @@ module Command = | Error r -> use writer = openWrite r use outFile = redirectTo writer - use toLog = redirectToLog () - fCont { cmdArgs with RedirectOutput = Some (toLog.Post); RedirectError = Some (outFile.Post) } + fCont { cmdArgs with RedirectOutput = Some ignore; RedirectError = Some (outFile.Post) } let exec cmdArgs = log "%s" (logExec dir path args redirect) diff --git a/tests/FSharp.Test.Utilities/Utilities.fs b/tests/FSharp.Test.Utilities/Utilities.fs index 484ee6049e2..f48c0eac880 100644 --- a/tests/FSharp.Test.Utilities/Utilities.fs +++ b/tests/FSharp.Test.Utilities/Utilities.fs @@ -18,6 +18,7 @@ open System.Collections.Generic open FSharp.Compiler.CodeAnalysis open Newtonsoft.Json open Newtonsoft.Json.Linq +open Xunit.Sdk type TheoryForNETCOREAPPAttribute() = @@ -42,7 +43,7 @@ type FactForDESKTOPAttribute() = module Utilities = type Async with - static member RunImmediate (computation: Async<'T>, ?cancellationToken ) = + static member RunImmediate (computation: Async<'T>, ?cancellationToken) = let cancellationToken = defaultArg cancellationToken Async.DefaultCancellationToken let ts = TaskCompletionSource<'T>() let task = ts.Task @@ -215,8 +216,7 @@ let main argv = 0""" File.WriteAllText(directoryBuildPropsFileName, directoryBuildProps) File.WriteAllText(directoryBuildTargetsFileName, directoryBuildTargets) - let timeout = 120000 - let exitCode, dotnetoutput, dotneterrors = Commands.executeProcess config.DotNetExe "build" projectDirectory timeout + let exitCode, dotnetoutput, dotneterrors = Commands.executeProcess config.DotNetExe "build" projectDirectory if exitCode <> 0 || errors.Length > 0 then errors <- dotneterrors diff --git a/tests/FSharp.Test.Utilities/XunitHelpers.fs b/tests/FSharp.Test.Utilities/XunitHelpers.fs index cda74f7867c..7a41338200a 100644 --- a/tests/FSharp.Test.Utilities/XunitHelpers.fs +++ b/tests/FSharp.Test.Utilities/XunitHelpers.fs @@ -1,3 +1,7 @@ +#if XUNIT_EXTRAS +#nowarn "0044" +#endif + namespace FSharp.Test open System @@ -6,7 +10,13 @@ open Xunit.Abstractions open TestFramework -/// Installs console support for parallel test runs. +/// Disables custom internal parallelization added with XUNIT_EXTRAS. +/// Execute test cases in a class or a module one by one instead of all at once. Allow other collections to run simultaneously. +[] +type RunTestCasesInSequenceAttribute() = inherit Attribute() + +#if !XUNIT_EXTRAS +/// Installs console support for parallel test runs and conditionally enables optional xUnit customizations. type FSharpXunitFramework(sink: IMessageSink) = inherit XunitTestFramework(sink) do @@ -21,3 +31,153 @@ type FSharpXunitFramework(sink: IMessageSink) = cleanUpTemporaryDirectoryOfThisTestRun () base.Dispose() +#else + +// To use xUnit means to customize it. The following abomination adds 2 features: +// - Capturing full console output individually for each test case, viewable in Test Explorer as test stdout. +// - Internally parallelize test classes and theories. Test cases and theory cases included in a single class or F# module can execute simultaneously + +/// Passes captured console output to xUnit. +type ConsoleCapturingTestRunner(test, messageBus, testClass, constructorArguments, testMethod, testMethodArguments, skipReason, beforeAfterAttributes, aggregator, cancellationTokenSource) = + inherit XunitTestRunner(test, messageBus, testClass, constructorArguments, testMethod, testMethodArguments, skipReason, beforeAfterAttributes, aggregator, cancellationTokenSource) + + member _.BaseInvokeTestMethodAsync aggregator = base.InvokeTestMethodAsync aggregator + override this.InvokeTestAsync (aggregator: ExceptionAggregator) = + task { + use capture = new TestConsole.ExecutionCapture() + let! executionTime = this.BaseInvokeTestMethodAsync aggregator + let output = + seq { + capture.OutText + if not (String.IsNullOrEmpty capture.ErrorText) then + "" + "=========== Standard Error ===========" + "" + capture.ErrorText + } |> String.concat Environment.NewLine + return executionTime, output + } + +module TestCaseCustomizations = + // Internally parallelize test classes and theories. + // Based on https://www.meziantou.net/parallelize-test-cases-execution-in-xunit.htm + // The trick is to assign a unique test collection to each case. + // Since test collection is xUnit's unit of parallelization, it will execute everything in parallel including theory cases. + let rewriteTestMethod (testCase: ITestCase) : ITestMethod = + let canFullyParallelize = + // does not belong to a defined collection + isNull testCase.TestMethod.TestClass.TestCollection.CollectionDefinition + && testCase.TestMethod.TestClass.Class.GetCustomAttributes(typeof) |> Seq.isEmpty + // is not marked with `[]` attribute + && testCase.TestMethod.Method.GetCustomAttributes(typeof) |> Seq.isEmpty + && testCase.TestMethod.TestClass.Class.GetCustomAttributes(typeof) |> Seq.isEmpty + + if canFullyParallelize then + let oldTestMethod = testCase.TestMethod + let oldTestClass = oldTestMethod.TestClass + let oldTestCollection = oldTestMethod.TestClass.TestCollection + + // Create a new collection with a unique id for the test case. + let newTestCollection = + new TestCollection( + oldTestCollection.TestAssembly, + oldTestCollection.CollectionDefinition, + oldTestCollection.DisplayName, + Guid.NewGuid() + ) + + let newTestClass = new TestClass(newTestCollection, oldTestClass.Class) + TestMethod(newTestClass, oldTestMethod.Method) + else + testCase.TestMethod + +type CustomTestCase = + inherit XunitTestCase + // xUinit demands this constructor for deserialization. + new() = { inherit XunitTestCase() } + + new(sink: IMessageSink, md, mdo, testMethod, testMethodArgs) = { inherit XunitTestCase(sink, md, mdo, testMethod, testMethodArgs) } + + override testCase.RunAsync (_, bus, args, aggregator, cts) = + let runner : XunitTestCaseRunner = + { new XunitTestCaseRunner(testCase, testCase.DisplayName, testCase.SkipReason, args, testCase.TestMethodArguments, bus, aggregator, cts) with + override this.CreateTestRunner(test, bus, testCase, args, testMethod, methodArgs, skipReason, attrs, aggregator, cts) = + ConsoleCapturingTestRunner(test, bus, testCase, args, testMethod, methodArgs, skipReason, attrs, aggregator, cts) + } + runner.RunAsync() + + // Initialize is ensured by xUnit to run once before any property access. + override testCase.Initialize () = + base.Initialize() + testCase.TestMethod <- TestCaseCustomizations.rewriteTestMethod testCase + +type CustomTheoryTestCase = + inherit XunitTheoryTestCase + new() = { inherit XunitTheoryTestCase() } + + new(sink: IMessageSink, md, mdo, testMethod) = { inherit XunitTheoryTestCase(sink, md, mdo, testMethod) } + + override testCase.RunAsync (sink, bus, args, aggregator, cts) = + let runner : XunitTestCaseRunner = + { new XunitTheoryTestCaseRunner(testCase, testCase.DisplayName, testCase.SkipReason, args, sink, bus, aggregator, cts) with + override this.CreateTestRunner(test, bus, testCase, args, testMethod, methodArgs, skipReason, attrs, aggregator, cts) = + ConsoleCapturingTestRunner(test, bus, testCase, args, testMethod, methodArgs, skipReason, attrs, aggregator, cts) + } + runner.RunAsync() + + override testCase.Initialize () = + base.Initialize() + testCase.TestMethod <- TestCaseCustomizations.rewriteTestMethod testCase + +/// `XunitTestFramework` providing parallel console support and conditionally enabling optional xUnit customizations. +type FSharpXunitFramework(sink: IMessageSink) = + inherit XunitTestFramework(sink) + do + // Because xUnit v2 lacks assembly fixture, the next best place to ensure things get called + // right at the start of the test run is here in the constructor. + // This gets executed once per test assembly. + log "FSharpXunitFramework with XUNIT_EXTRAS installing TestConsole redirection" + TestConsole.install() + + interface IDisposable with + member _.Dispose() = + cleanUpTemporaryDirectoryOfThisTestRun () + base.Dispose() + + override this.CreateDiscoverer (assemblyInfo) = + { new XunitTestFrameworkDiscoverer(assemblyInfo, this.SourceInformationProvider, this.DiagnosticMessageSink) with + override _.FindTestsForType (testClass, includeSourceInformation, messageBus, options) = + // Intercepts test discovery messages to augment test cases with additional capabilities. + let customizingBus = + { new IMessageBus with + member _.QueueMessage (message: IMessageSinkMessage) = + match message with + | :? ITestCaseDiscoveryMessage as discoveryMessage -> + let customized: ITestCase = + match discoveryMessage.TestCase with + | :? XunitTheoryTestCase -> + new CustomTheoryTestCase( + sink, + options.MethodDisplayOrDefault(), + options.MethodDisplayOptionsOrDefault(), + discoveryMessage.TestCase.TestMethod, + SourceInformation = discoveryMessage.TestCase.SourceInformation + ) + | :? XunitTestCase -> + new CustomTestCase( + sink, + options.MethodDisplayOrDefault(), + options.MethodDisplayOptionsOrDefault(), + discoveryMessage.TestCase.TestMethod, + discoveryMessage.TestCase.TestMethodArguments, + SourceInformation = discoveryMessage.TestCase.SourceInformation + ) + | testCase -> testCase + messageBus.QueueMessage(TestCaseDiscoveryMessage customized) + | _ -> + messageBus.QueueMessage message + member _.Dispose () = messageBus.Dispose() } + base.FindTestsForType(testClass, includeSourceInformation, customizingBus, options) + } + +#endif diff --git a/tests/FSharp.Test.Utilities/XunitSetup.fs b/tests/FSharp.Test.Utilities/XunitSetup.fs index fb43569b1d0..97b4adbba01 100644 --- a/tests/FSharp.Test.Utilities/XunitSetup.fs +++ b/tests/FSharp.Test.Utilities/XunitSetup.fs @@ -2,6 +2,11 @@ namespace FSharp.Test open Xunit +/// Exclude from parallelization. Execute test cases in sequence and do not run any other collections at the same time. +/// see https://github.com/xunit/xunit/issues/1999#issuecomment-522635397 +[] +type NotThreadSafeResourceCollection = class end + module XUnitSetup = [] diff --git a/tests/fsharp/Compiler/CodeGen/EmittedIL/DeterministicTests.fs b/tests/fsharp/Compiler/CodeGen/EmittedIL/DeterministicTests.fs index 057004ff01f..c29c0ecb8a5 100644 --- a/tests/fsharp/Compiler/CodeGen/EmittedIL/DeterministicTests.fs +++ b/tests/fsharp/Compiler/CodeGen/EmittedIL/DeterministicTests.fs @@ -8,7 +8,7 @@ open FSharp.Test.Compiler open Xunit - +[] module DeterministicTests = let commonOptions = ["--refonly";"--deterministic";"--nooptimizationdata"] diff --git a/tests/fsharp/FSharpSuite.Tests.fsproj b/tests/fsharp/FSharpSuite.Tests.fsproj index dc8fb5a164e..753af0ce4aa 100644 --- a/tests/fsharp/FSharpSuite.Tests.fsproj +++ b/tests/fsharp/FSharpSuite.Tests.fsproj @@ -20,7 +20,6 @@ XunitSetup.fs - diff --git a/tests/fsharp/TypeProviderTests.fs b/tests/fsharp/TypeProviderTests.fs index ab9f2e7e5ef..8ce84d59338 100644 --- a/tests/fsharp/TypeProviderTests.fs +++ b/tests/fsharp/TypeProviderTests.fs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. +// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. #if INTERACTIVE //#r @"../../release/net40/bin/FSharp.Compiler.dll" diff --git a/tests/fsharp/XunitHelpers.fs b/tests/fsharp/XunitHelpers.fs deleted file mode 100644 index 6bfb5031f13..00000000000 --- a/tests/fsharp/XunitHelpers.fs +++ /dev/null @@ -1,8 +0,0 @@ -namespace Xunit - -open Xunit - -module Assert = - - [] - do() diff --git a/tests/fsharp/tests.fs b/tests/fsharp/tests.fs index 8b13fc003a3..0dc078e506c 100644 --- a/tests/fsharp/tests.fs +++ b/tests/fsharp/tests.fs @@ -763,7 +763,7 @@ module CoreTests = #endif -#if !NETCOREAPP +#if !NETCOREAPP [] let quotes () = let cfg = testConfig "core/quotes" diff --git a/tests/fsharp/xunit.runner.json b/tests/fsharp/xunit.runner.json index c222a4167a8..f47fec5d745 100644 --- a/tests/fsharp/xunit.runner.json +++ b/tests/fsharp/xunit.runner.json @@ -1,4 +1,5 @@ { "$schema": "https://xunit.net/schema/current/xunit.runner.schema.json", - "appDomain": "denied" + "appDomain": "denied", + "parallelizeAssembly": true } \ No newline at end of file diff --git a/tests/scripts/scriptlib.fsx b/tests/scripts/scriptlib.fsx index 04b23a93fa8..ea1a5a63737 100644 --- a/tests/scripts/scriptlib.fsx +++ b/tests/scripts/scriptlib.fsx @@ -31,7 +31,7 @@ module Scripting = let info = ProcessStartInfo(Arguments=arguments, UseShellExecute=false, RedirectStandardOutput=true, RedirectStandardError=true, CreateNoWindow=true, FileName=fileName) - let p = new Process(StartInfo=info) + use p = new Process(StartInfo=info) p.OutputDataReceived.Add(fun x -> processWriteMessage stdout x.Data) p.ErrorDataReceived.Add(fun x -> processWriteMessage stderr x.Data) if p.Start() then @@ -121,7 +121,7 @@ module Scripting = ignore envs // work out what to do about this - let p = new Process() + use p = new Process() p.EnableRaisingEvents <- true p.StartInfo <- processInfo let out = StringBuilder() @@ -163,11 +163,14 @@ module Scripting = p.WaitForExit() + printf $"{string out}" + eprintf $"{string err}" + match p.ExitCode with | 0 -> Success(string out) | errCode -> - let msg = sprintf "Error running command '%s' with args '%s' in directory '%s'.\n---- stdout below --- \n%s\n---- stderr below --- \n%s " exePath arguments workDir (out.ToString()) (err.ToString()) + let msg = sprintf "Error running command '%s' with args '%s' in directory '%s'" exePath arguments workDir ErrorLevel (msg, errCode) type OutPipe (writer: TextWriter) = @@ -177,8 +180,6 @@ module Scripting = let redirectTo (writer: TextWriter) = new OutPipe (writer) - let redirectToLog () = redirectTo System.Console.Out - #if !NETCOREAPP let defaultPlatform = match Environment.OSVersion.Platform, Environment.Is64BitOperatingSystem with @@ -192,7 +193,7 @@ module Scripting = let info = ProcessStartInfo(Arguments=arguments, UseShellExecute=false, RedirectStandardOutput=true, RedirectStandardError=true,RedirectStandardInput=true, CreateNoWindow=true, FileName=fileName) - let p = new Process(StartInfo=info) + use p = new Process(StartInfo=info) if p.Start() then async { try From 9d6d41de9180514b85a4a230c080f49776c7d100 Mon Sep 17 00:00:00 2001 From: Jakub Majocha <1760221+majocha@users.noreply.github.com> Date: Tue, 17 Dec 2024 15:14:55 +0100 Subject: [PATCH 03/19] Exclude FileSystemTests from parallelization (#18153) * exempt FileSystemTests from parallelization * tune down linux test parallelism --- eng/build.sh | 2 +- tests/FSharp.Compiler.Service.Tests/FileSystemTests.fs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/eng/build.sh b/eng/build.sh index b377904e2a6..43016b9b621 100755 --- a/eng/build.sh +++ b/eng/build.sh @@ -220,7 +220,7 @@ function Test() { projectname="${projectname%.*}" testlogpath="$artifacts_dir/TestResults/$configuration/${projectname}_$targetframework.xml" args="test \"$testproject\" --no-restore --no-build -c $configuration -f $targetframework --test-adapter-path . --logger \"xunit;LogFilePath=$testlogpath\" --blame-hang-timeout 5minutes --results-directory $artifacts_dir/TestResults/$configuration -p:vstestusemsbuildoutput=false" - args+=" -- xUnit.MaxParallelThreads=3" + args+=" -- xUnit.MaxParallelThreads=2" "$DOTNET_INSTALL_DIR/dotnet" $args || exit $? } diff --git a/tests/FSharp.Compiler.Service.Tests/FileSystemTests.fs b/tests/FSharp.Compiler.Service.Tests/FileSystemTests.fs index 4d191dcc7cb..0e2a4adf4ae 100644 --- a/tests/FSharp.Compiler.Service.Tests/FileSystemTests.fs +++ b/tests/FSharp.Compiler.Service.Tests/FileSystemTests.fs @@ -1,4 +1,6 @@ -module FSharp.Compiler.Service.Tests.FileSystemTests +// FileSystem is a global shared resource. +[] +module FSharp.Compiler.Service.Tests.FileSystemTests open Xunit open FSharp.Test.Assert @@ -25,8 +27,6 @@ let file2 = """ module File2 let B = File1.A + File1.A""" -// FileSystem is a global shared resource. -[] type internal MyFileSystem() = inherit DefaultFileSystem() static member FilesCache = dict [(fileName1, file1); (fileName2, file2)] From 20a327e95c160c3049e0f819f43276b3faef2789 Mon Sep 17 00:00:00 2001 From: Petr Pokorny Date: Tue, 17 Dec 2024 17:36:44 +0100 Subject: [PATCH 04/19] Move INTERNAL.md to internal wiki (#18155) --- INTERNAL.md | 163 +--------------------------------------------------- 1 file changed, 1 insertion(+), 162 deletions(-) diff --git a/INTERNAL.md b/INTERNAL.md index af78c3c968e..f0dd741c913 100644 --- a/INTERNAL.md +++ b/INTERNAL.md @@ -1,164 +1,3 @@ # Links for internal team members to find build definitions, etc. -Note that usually only the most recent link in each section is interesting. Older links are included for reference only. - -## PR Build Definition - -The PR build definition can be found [here](https://dev.azure.com/dnceng/internal/_build?definitionId=499&_a=summary) or by -navigating through an existing PR. - -There is also a duplicate scouting PR build that is identical to the normal PR build _except_ that it uses a different Windows -machine queue that always has the next preview build of Visual Studio installed. This is to hopefully get ahead of any breaking -API changes. That build definition is [here](https://dev.azure.com/dnceng/public/_build?definitionId=961). - -## Signed Build Definitions - -[VS 16.4 to current](https://dev.azure.com/dnceng/internal/_build?definitionId=499&_a=summary) - -[VS 15.7 to 16.3](https://dev.azure.com/devdiv/DevDiv/_build/index?definitionId=8978) - -[VS 15.6](https://dev.azure.com/devdiv/DevDiv/_build?definitionId=7239) - -[VS 15.0 to 15.5](https://dev.azure.com/devdiv/DevDiv/_build?definitionId=5037) - -## Branch auto-merge definitions - -Branch auto-merge definitions are specified [here](https://github.com/dotnet/roslyn-tools/blob/master/src/GitHubCreateMergePRs/config.xml). - -## VS Insertion Generators - -VS 16.4 to current - part of the build definition. [See below](#vs-insertions-as-part-of-the-build-definition). - -The following insertion generators are automatically invoked upon successful completion of a signed build in each of -their respective branches. - -[VS 16.3](https://dev.azure.com/devdiv/DevDiv/_release?definitionId=1839&_a=releases) - -[VS 16.2](https://dev.azure.com/devdiv/DevDiv/_release?definitionId=1699&_a=releases) - -[VS 16.1](https://dev.azure.com/devdiv/DevDiv/_release?definitionId=1669&_a=releases) - -VS 16.0 and prior were done manually. - -## VS Insertions as part of the build definition - -Starting with the 16.4 release and moving forwards, the VS insertion is generated as part of the build. The relevant -bits can be found near the bottom of [`azure-pipelines.yml`](azure-pipelines.yml) under the `VS Insertion` header. The -interesting parameters are `componentBranchName` and `insertTargetBranch`. In short, when an internal [signed build](https://dev.azure.com/dnceng/internal/_build?definitionId=499&_a=summary) -completes and the name of the branch built exactly equals the value in the `componentBranchName` parameter, a component -insertion into VS will be created into the `insertTargetBranch` branch. The link to the insertion PR will be found -near the bottom of the build under the title 'Insert into VS'. Examine the log for 'Insert VS Payload' and near the -bottom you'll see a line that looks like `Created request #xxxxxx at https://...`. - -Insertions generated to any `rel/*` branch will have to be manually verified and merged, and they'll be listed -[here](https://dev.azure.com/devdiv/DevDiv/_git/VS/pullrequests?createdBy=122d5278-3e55-4868-9d40-1e28c2515fc4&_a=active). -Note that insertions for other teams will also be listed. - -Insertions to any other VS branch (e.g., `main`) will have the auto-merge flag set and should handle themselves, but -it's a good idea to check the previous link for any old or stalled insertions into VS `main`. - -### What has to be done regularly - -1. Go to [signed builds](https://dev.azure.com/dnceng/internal/_build?definitionId=499&_a=summary) and make sure latest one for both main and release branches are passing. -2. Go to [insertion PRs](https://dev.azure.com/devdiv/DevDiv/_git/VS/pullrequests?createdBy=122d5278-3e55-4868-9d40-1e28c2515fc4&_a=active) and find the latest insertion PR for current release branch. (E.g. `Insert F# dev17.13 20241128.1 Payload into main`) -3. Check CI is passing and all comments are resolved. -4. Check that F# package version is not downgraded (unless that's intended for some reason) by the PR. -5. Approve it. -6. Abandon any older unmerged PRs that shouldn't be inserted. - -## Preparing for a new VS release branch - -### When a VS branch snaps from `main` to `rel/d*` and switches to ask mode: - -Update the `insertTargetBranch` value at the bottom of `azure-pipelines.yml` in the appropriate release branch. E.g., when VS 17.3 snapped and switched to ask mode, [this PR](https://github.com/dotnet/fsharp/pull/13456/files) correctly updates the insertion target so that future builds from that F# branch will get auto-inserted to VS. - -### When VS `main` is open for insertions for preview releases of VS: - -0. Disable auto-merges from `main` to **current** release branch, please make a change for the following file and create a pull request: -https://github.com/dotnet/roslyn-tools/blob/6d7c182c46f8319d7922561e2c1586c7aadce19e/src/GitHubCreateMergePRs/config.xml#L52-L74 -> You should comment out the `main -> release/devXX.X` flow until step #4 is completed (``) -2. Create a new `release/dev*` branch (e.g., `release/dev17.4`) and initially set its HEAD commit to that of the previous release (e.g., `release/dev17.3` in this case). - ```console - git checkout -b release/dev17.4 - git reset --hard upstream/release/dev17.3 - git push --set-upstream upstream release/dev17.4 - ``` -3. Update versions in both `main` and new release branch **they need to match, so release notes bot knows which changelog file to check** -4. Update target insertion branches in the `azure-pipelines.yml`: - 1. F# release branch - ```yaml - # Release branch for F# - # Should be 'current' release branch name, i.e. 'release/dev17.10' in dotnet/fsharp/refs/heads/main, 'release/dev17.10' in dotnet/fsharp/refs/heads/release/dev17.10 and 'release/dev17.9' in dotnet/fsharp/refs/heads/release/dev17.9 - # Should **never** be 'main' in dotnet/fsharp/refs/heads/main, since it will start inserting to VS twice. - - name: FSharpReleaseBranchName - value: release/dev17.13 - ``` - 2. VS insertion branch - ```yaml - # VS Insertion branch name (NOT the same as F# branch) - # Should be previous release branch or 'main' in 'main' and 'main' in release branch - # (since for all *new* release branches we insert into VS main and for all *previous* releases we insert into corresponding VS release), - # i.e. 'rel/d17.9' *or* 'main' in dotnet/fsharp/refs/heads/main and 'main' in F# dotnet/fsharp/refs/heads/release/dev17.10 (latest release branch) - - name: VSInsertionTargetBranchName - value: main - ``` - > [!NOTE] Note - > For the **old** release branch `VSInsertionTargetBranchName` should point to corresponding VS release target branch (e.g. should be `rel/d17.13` in the F# repo branch `release/dev17.13`) - > For both `main` and **new** release branch `VSInsertionTargetBranchName` should be `main`. - > - > `FSharpReleaseBranchName` should **always** be the most recent in `main` and corresponding release branch name in release branches. - - 3. Oneloc branch: - ```yaml - # Localization: we only run it for specific release branches - - ${{ if eq(variables['Build.SourceBranch'], 'refs/heads/release/dev17.13') }}: - ``` -5. Set the new branch to receive auto-merges from `main`, and also set the old release branch to flow into the new one. [This PR](https://github.com/dotnet/roslyn-tools/pull/1245/files) is a good example of what to do when a new `release/dev17.4` branch is created that should receive merges from both `main` and the previous release branch, `release/dev17.3`. Old release branch should stop receiving updates from the `main`. - -6. Set the packages from the new branch to flow into the correct package feeds via the `darc` tool. To do this: - - 1. To use `darc` you need to be a member of the `dotnetes-maestro-users` entitlement. You can request access at [coreidentity.microsoft.com](https://coreidentity.microsoft.com/manage/Entitlement/entitlement/dotnetesmaes-z54r) - 2. Ensure the latest `darc` tool is installed by running `eng/common/darc-init.ps1`. - 3. (only needed once) Run the command `darc authenticate`. A text file will be opened with instructions on how to populate access tokens. - 4. Check the current package/channel subscriptions by running `darc get-default-channels --source-repo fsharp`. For this example, notice that the latest subscription shows the F# branch `release/dev17.3` is getting added to the `VS 17.3` channel. - 5. Get the list of `darc` channels and determine the appropriate one to use for the new branch via the command `darc get-channels`. For this example, notice that a channel named `VS 17.4` is listed. - 6. Add the new F# branch to the appropriate `darc` channel. In this example, run `darc add-default-channel --channel "VS 17.4" --branch release/dev17.4 --repo https://github.com/dotnet/fsharp` - 7. Ensure the subscription was added by repeating step 3 above. - 8. Note, the help in the `darc` tool is really good. E.g., you can simply run `darc` to see a list of all commands available, and if you run `darc ` with no arguments, you'll be given a list of arguments you can use. - 9. Ensure that version numbers are bumped for a new branch. - 10. Change needed subscriptions for arcade and SDK: - 1. `darc get-subscriptions --target-repo fsharp`, and then use `darc update-subscription --id ` for corresponding channels (e.g. target new VS channel to specific SDK channel, or set up arcade auto-merges to release/* or main branch, depending on the timeline of release/upgrade cycle). - 2. If new subscription needs to be added, the following command should be used `darc add-subscription --source-repo https://github.com/dotnet/arcade --target-repo https://github.com/dotnet/fsharp --target-branch --channel "" --update-frequency everyDay --standard-automerge - 11. Update mibc and other dependencies if needed, refer to https://github.com/dotnet/arcade/blob/main/Documentation/Darc.md#updating-dependencies-in-your-local-repository for more information - -## Labeling issues on GitHub - -Assign appropriate `Area-*` label to bugs, feature improvements and feature requests issues alike. List of `Area` labels with descriptions can be found [here](https://github.com/dotnet/fsharp/labels?q=Area). These areas are laid out to follow the logical organization of the code. - -To find all existing open issues without assigned `Area` label, use [this query](https://github.com/dotnet/fsharp/issues?q=is%3Aissue+is%3Aopen+-label%3AArea-AOT+-label%3AArea-Async+-label%3AArea-Build+-label%3AArea-Compiler+-label%3AArea-Compiler-Checking+-label%3AArea-Compiler-CodeGen+-label%3AArea-Compiler-HashCompare+-label%3AArea-Compiler-ImportAndInterop+-label%3AArea-Compiler-Optimization+-label%3AArea-Compiler-Options+-label%3AArea-Compiler-PatternMatching+-label%3AArea-Compiler-Service+-label%3AArea-Compiler-SigFileGen+-label%3AArea-Compiler-SRTP+-label%3AArea-Compiler-StateMachines+-label%3AArea-Compiler-Syntax+-label%3AArea-ComputationExpressions+-label%3AArea-Debug+-label%3AArea-DependencyManager+-label%3AArea-Diagnostics+-label%3AArea-FCS+-label%3AArea-FSC+-label%3AArea-FSI+-label%3AArea-Infrastructure+-label%3AArea-LangService-API+-label%3AArea-LangService-AutoComplete+-label%3AArea-LangService-BlockStructure+-label%3AArea-LangService-CodeLens+-label%3AArea-LangService-Colorization+-label%3AArea-LangService-Diagnostics+-label%3AArea-LangService-FindAllReferences+-label%3AArea-LangService-Navigation+-label%3AArea-LangService-QuickFixes+-label%3AArea-LangService-RenameSymbol+-label%3AArea-LangService-ToolTips+-label%3AArea-LangService-UnusedDeclarations+-label%3AArea-LangService-UnusedOpens+-label%3AArea-Library+-label%3AArea-ProjectsAndBuild+-label%3AArea-Queries+-label%3AArea-Quotations+-label%3AArea-SetupAndDelivery+-label%3AArea-Testing+-label%3AArea-TypeProviders+-label%3AArea-UoM+-label%3AArea-VS+-label%3AArea-VS-Editor+-label%3AArea-VS-FSI+-label%3AArea-XmlDocs) - -Since github issue filtering is currently not flexible enough, that query was generated by pasting output of this PowerShell command to the search box (might need to be rerun if new kinds of `Area` labels are added): -```ps1 -Invoke-WebRequest -Uri "https://api.github.com/repos/dotnet/fsharp/labels?per_page=100" | ConvertFrom-Json | % { $_.name } | ? { $_.StartsWith("Area-") } | % { Write-Host -NoNewLine ('-label:"' + $_ + '" ') } -``` - -## Fix problems with the internal source mirror - -The repo is [here](https://dev.azure.com/dnceng/internal/_git/dotnet-fsharp), the CI is [here](https://dnceng.visualstudio.com/internal/_build?definitionId=499). - -If something breaks in the CI there and you want to experiment, the general workflow is the following: -1. Make a branch -2. Make a change -3. Run the build from your branch. If needed, set the "skipTests" variable to "true" - can save time at this stage. -4. Once the problem and the fix is identified, make a PR to THIS (dotnet/fsharp) repo - it will propagate to the internal mirror just afterwards. -5. Delete all your work in the internal repo. - -**DO NOT** try to push to the internal repo - this will mess up the flows. **DO NOT** create PRs to not confuse anyone. - -You need the following permissions to do the above investigations: -- "Generic contribute" -- "Create branch" -- "Queue builds" -- "Edit queue build configuration" - -If anything, reach out to the "First Responders" team. +Moved [here](https://dev.azure.com/devdiv/DevDiv/_wiki/wikis/DevDiv.wiki/44702/FSharp) From beee039e7843b83f20495dbb784141912f942b28 Mon Sep 17 00:00:00 2001 From: Jakub Majocha <1760221+majocha@users.noreply.github.com> Date: Wed, 18 Dec 2024 19:30:59 +0100 Subject: [PATCH 05/19] FSI: improve thread-safety (#18152) * improve concurrent dynamicAssemblyId access in fsi * thread-safe fsi xmlDocCache --- src/Compiler/Interactive/fsi.fs | 8 ++++---- src/Compiler/Interactive/fsihelp.fs | 18 ++++++++---------- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/src/Compiler/Interactive/fsi.fs b/src/Compiler/Interactive/fsi.fs index 7c634ca81d6..c31f210022f 100644 --- a/src/Compiler/Interactive/fsi.fs +++ b/src/Compiler/Interactive/fsi.fs @@ -1797,6 +1797,9 @@ type internal FsiDynamicCompiler let multiAssemblyName = ilxMainModule.ManifestOfAssembly.Name + // The name of the assembly is "FSI-ASSEMBLY" for all submissions. This number is used for the Version + let dynamicAssemblyId = Interlocked.Increment &dynamicAssemblyId + // Adjust the assembly name of this fragment, and add InternalsVisibleTo attributes to // allow internals access by all future assemblies with the same name (and only differing in version) let manifest = @@ -1811,13 +1814,10 @@ type internal FsiDynamicCompiler { manifest with Name = multiAssemblyName // Because the coreclr loader will not load a higher assembly make versions go downwards - Version = Some(parseILVersion $"0.0.0.{maxVersion - dynamicAssemblyId}") + Version = Some(parseILVersion $"0.0.0.{maxVersion - dynamicAssemblyId % maxVersion}") CustomAttrsStored = storeILCustomAttrs (mkILCustomAttrs attrs) } - // The name of the assembly is "FSI-ASSEMBLY" for all submissions. This number is used for the Version - dynamicAssemblyId <- (dynamicAssemblyId + 1) % maxVersion - let ilxMainModule = { ilxMainModule with Manifest = Some manifest diff --git a/src/Compiler/Interactive/fsihelp.fs b/src/Compiler/Interactive/fsihelp.fs index eb1efd22ed7..f21da3ab441 100644 --- a/src/Compiler/Interactive/fsihelp.fs +++ b/src/Compiler/Interactive/fsihelp.fs @@ -14,6 +14,7 @@ open FSharp.Compiler.IO module Parser = open System.Xml + open System.Collections.Concurrent type Help = { @@ -79,22 +80,19 @@ module Parser = let s = if idx > 0 then s.Substring(0, idx) else s s - let xmlDocCache = Dictionary() + let xmlDocCache = ConcurrentDictionary>() let tryGetXmlDocument xmlPath = - try - match xmlDocCache.TryGetValue(xmlPath) with - | true, value -> - let xmlDocument = XmlDocument() - xmlDocument.LoadXml(value) - Some xmlDocument - | _ -> + let valueFactory xmlPath = + lazy use stream = FileSystem.OpenFileForReadShim(xmlPath) let rawXml = stream.ReadAllText() let xmlDocument = XmlDocument() xmlDocument.LoadXml(rawXml) - xmlDocCache.Add(xmlPath, rawXml) - Some xmlDocument + xmlDocument + + try + Some(xmlDocCache.GetOrAdd(xmlPath, valueFactory).Value) with _ -> None From bae73d350230cd68fdb6d730bbaaad454c6f99c0 Mon Sep 17 00:00:00 2001 From: Eugene Auduchinok Date: Wed, 18 Dec 2024 21:57:31 +0100 Subject: [PATCH 06/19] Symbols: try to use ValReprInfoForDisplay in Mfv.CurriedParameterGroups (#18124) --- .../.FSharp.Compiler.Service/9.0.200.md | 1 + src/Compiler/Symbols/Symbols.fs | 2 +- src/Compiler/TypedTree/TypedTreeBasics.fs | 11 +++-- src/Compiler/TypedTree/TypedTreeBasics.fsi | 2 + .../FSharp.Compiler.Service.Tests/Symbols.fs | 40 +++++++++++++++++++ 5 files changed, 49 insertions(+), 7 deletions(-) diff --git a/docs/release-notes/.FSharp.Compiler.Service/9.0.200.md b/docs/release-notes/.FSharp.Compiler.Service/9.0.200.md index 4029c80e146..cab4ac0fd9d 100644 --- a/docs/release-notes/.FSharp.Compiler.Service/9.0.200.md +++ b/docs/release-notes/.FSharp.Compiler.Service/9.0.200.md @@ -17,6 +17,7 @@ * Add missing nullable-metadata for C# consumers of records,exceptions and DU subtypes generated from F# code. [PR #18079](https://github.com/dotnet/fsharp/pull/18079) * Fix a race condition in file book keeping in the compiler service ([#18008](https://github.com/dotnet/fsharp/pull/18008)) * Fix trimming '%' characters when lowering interpolated string to a concat call [PR #18123](https://github.com/dotnet/fsharp/pull/18123) +* Symbols: try to use ValReprInfoForDisplay in Mfv.CurriedParameterGroups ([PR #18124](https://github.com/dotnet/fsharp/pull/18124)) * Shim/file system: fix leaks of the shim [PR #18144](https://github.com/dotnet/fsharp/pull/18144) ### Added diff --git a/src/Compiler/Symbols/Symbols.fs b/src/Compiler/Symbols/Symbols.fs index 95427b7914f..c2772cf8736 100644 --- a/src/Compiler/Symbols/Symbols.fs +++ b/src/Compiler/Symbols/Symbols.fs @@ -2135,7 +2135,7 @@ type FSharpMemberOrFunctionOrValue(cenv, d:FSharpMemberOrValData, item) = |> makeReadOnlyCollection | V v -> - match v.ValReprInfo with + match tryGetArityOfValForDisplay v.Deref with | None -> let _, tau = v.GeneralizedType if isFunTy cenv.g tau then diff --git a/src/Compiler/TypedTree/TypedTreeBasics.fs b/src/Compiler/TypedTree/TypedTreeBasics.fs index 0ad62482b6a..582d6767d7e 100644 --- a/src/Compiler/TypedTree/TypedTreeBasics.fs +++ b/src/Compiler/TypedTree/TypedTreeBasics.fs @@ -62,13 +62,12 @@ let arityOfVal (v: Val) = | None -> ValReprInfo.emptyValData | Some info -> info +let tryGetArityOfValForDisplay (v: Val) = + v.ValReprInfoForDisplay + |> Option.orElseWith (fun _ -> v.ValReprInfo) + let arityOfValForDisplay (v: Val) = - match v.ValReprInfoForDisplay with - | Some info -> info - | None -> - match v.ValReprInfo with - | None -> ValReprInfo.emptyValData - | Some info -> info + tryGetArityOfValForDisplay v |> Option.defaultValue ValReprInfo.emptyValData let tupInfoRef = TupInfo.Const false diff --git a/src/Compiler/TypedTree/TypedTreeBasics.fsi b/src/Compiler/TypedTree/TypedTreeBasics.fsi index c064be67c9e..6984d5c64fb 100644 --- a/src/Compiler/TypedTree/TypedTreeBasics.fsi +++ b/src/Compiler/TypedTree/TypedTreeBasics.fsi @@ -45,6 +45,8 @@ val nameOfVal: v: Val -> string val arityOfVal: v: Val -> ValReprInfo +val tryGetArityOfValForDisplay: v: Val -> ValReprInfo option + val arityOfValForDisplay: v: Val -> ValReprInfo val tupInfoRef: TupInfo diff --git a/tests/FSharp.Compiler.Service.Tests/Symbols.fs b/tests/FSharp.Compiler.Service.Tests/Symbols.fs index 7e01b64f1df..25617ca1235 100644 --- a/tests/FSharp.Compiler.Service.Tests/Symbols.fs +++ b/tests/FSharp.Compiler.Service.Tests/Symbols.fs @@ -787,6 +787,46 @@ type T() = assertRange (9, 19) (9, 20) mProp + + [] + let ``Repr info 01`` () = + let _, checkResults = + getParseAndCheckResults """ +module Module + +let f x = () +""" + let mfv = findSymbolByName "f" checkResults :?> FSharpMemberOrFunctionOrValue + let param = mfv.CurriedParameterGroups[0][0] + param.Name.Value |> shouldEqual "x" + + [] + let ``Repr info 02`` () = + let _, checkResults = + getParseAndCheckResults """ +module Module + +do + let f x = () + () +""" + let mfv = findSymbolByName "f" checkResults :?> FSharpMemberOrFunctionOrValue + let param = mfv.CurriedParameterGroups[0][0] + param.Name.Value |> shouldEqual "x" + + [] + let ``Repr info 03`` () = + let _, checkResults = + getParseAndCheckResults """ +module Module + +type T() = + let f x = () +""" + let mfv = findSymbolByName "f" checkResults :?> FSharpMemberOrFunctionOrValue + let param = mfv.CurriedParameterGroups[0][0] + param.Name.Value |> shouldEqual "x" + module GetValSignatureText = let private assertSignature (expected:string) source (lineNumber, column, line, identifier) = let _, checkResults = getParseAndCheckResults source From c13108db0f7e4a9be6a65635604758de95b43c81 Mon Sep 17 00:00:00 2001 From: Eugene Auduchinok Date: Thu, 19 Dec 2024 13:39:07 +0100 Subject: [PATCH 07/19] Completion: fix qualified completion in sequence expressions (#18111) --- .../.FSharp.Compiler.Service/9.0.200.md | 1 + src/Compiler/Service/ServiceParseTreeWalk.fs | 6 --- .../CompletionTests.fs | 37 +++++++++++++++++++ 3 files changed, 38 insertions(+), 6 deletions(-) diff --git a/docs/release-notes/.FSharp.Compiler.Service/9.0.200.md b/docs/release-notes/.FSharp.Compiler.Service/9.0.200.md index cab4ac0fd9d..b2aed017570 100644 --- a/docs/release-notes/.FSharp.Compiler.Service/9.0.200.md +++ b/docs/release-notes/.FSharp.Compiler.Service/9.0.200.md @@ -17,6 +17,7 @@ * Add missing nullable-metadata for C# consumers of records,exceptions and DU subtypes generated from F# code. [PR #18079](https://github.com/dotnet/fsharp/pull/18079) * Fix a race condition in file book keeping in the compiler service ([#18008](https://github.com/dotnet/fsharp/pull/18008)) * Fix trimming '%' characters when lowering interpolated string to a concat call [PR #18123](https://github.com/dotnet/fsharp/pull/18123) +* Completion: fix qualified completion in sequence expressions [PR #18111](https://github.com/dotnet/fsharp/pull/18111) * Symbols: try to use ValReprInfoForDisplay in Mfv.CurriedParameterGroups ([PR #18124](https://github.com/dotnet/fsharp/pull/18124)) * Shim/file system: fix leaks of the shim [PR #18144](https://github.com/dotnet/fsharp/pull/18144) diff --git a/src/Compiler/Service/ServiceParseTreeWalk.fs b/src/Compiler/Service/ServiceParseTreeWalk.fs index 4c55c78a437..b55844e51ae 100644 --- a/src/Compiler/Service/ServiceParseTreeWalk.fs +++ b/src/Compiler/Service/ServiceParseTreeWalk.fs @@ -388,12 +388,6 @@ module SyntaxTraversal = seq { match expr with | SynExpr.Sequential(expr1 = expr1; expr2 = SynExpr.Sequential _ as expr2) -> - // It's a nested sequential expression. - // Visit it, but make defaultTraverse do nothing, - // since we're going to traverse its descendants ourselves. - yield dive expr expr.Range (fun expr -> visitor.VisitExpr(path, traverseSynExpr path, (fun _ -> None), expr)) - - // Now traverse its descendants. let path = SyntaxNode.SynExpr expr :: path yield dive expr1 expr1.Range (traverseSynExpr path) yield! traverseSequentials path expr2 diff --git a/tests/FSharp.Compiler.Service.Tests/CompletionTests.fs b/tests/FSharp.Compiler.Service.Tests/CompletionTests.fs index 7666fb005a1..38c6812728d 100644 --- a/tests/FSharp.Compiler.Service.Tests/CompletionTests.fs +++ b/tests/FSharp.Compiler.Service.Tests/CompletionTests.fs @@ -97,3 +97,40 @@ let ``Type decl - Record - Field type 01`` () = type Record = { Field: } """ assertHasItemWithNames ["string"] info + + +[] +let ``Expr - Qualifier 01`` () = + let info = + getCompletionInfo "s.Trim(). " (3, 13) """ +let f (s: string) = + s.Trim(). + s.Trim() + s.Trim() + () +""" + assertHasItemWithNames ["Length"] info + +[] +let ``Expr - Qualifier 02`` () = + let info = + getCompletionInfo "s.Trim(). " (4, 13) """ +let f (s: string) = + s.Trim() + s.Trim(). + s.Trim() + () +""" + assertHasItemWithNames ["Length"] info + +[] +let ``Expr - Qualifier 03`` () = + let info = + getCompletionInfo "s.Trim(). " (5, 13) """ +let f (s: string) = + s.Trim() + s.Trim() + s.Trim(). + () +""" + assertHasItemWithNames ["Length"] info From 3285c75deb53359206019ea909ba91374df8fae2 Mon Sep 17 00:00:00 2001 From: Vlad Zarytovskii Date: Fri, 20 Dec 2024 10:00:40 +0100 Subject: [PATCH 08/19] Support ValueOption + Struct attribute as optional parameter (#18098) --- .../.FSharp.Compiler.Service/9.0.200.md | 3 + docs/release-notes/.FSharp.Core/9.0.200.md | 3 +- docs/release-notes/.Language/preview.md | 2 + src/Compiler/Checking/CheckDeclarations.fs | 40 +- src/Compiler/Checking/CheckPatterns.fs | 34 +- src/Compiler/Checking/MethodCalls.fs | 76 ++- .../Driver/GraphChecking/TrieMapping.fs | 30 +- src/Compiler/FSComp.txt | 3 +- src/Compiler/Facilities/LanguageFeatures.fs | 3 + src/Compiler/Facilities/LanguageFeatures.fsi | 1 + src/Compiler/SyntaxTree/SyntaxTreeOps.fs | 14 + src/Compiler/SyntaxTree/SyntaxTreeOps.fsi | 2 + src/Compiler/TypedTree/TypedTreeOps.fs | 6 + src/Compiler/TypedTree/TypedTreeOps.fsi | 9 + src/Compiler/xlf/FSComp.txt.cs.xlf | 11 +- src/Compiler/xlf/FSComp.txt.de.xlf | 11 +- src/Compiler/xlf/FSComp.txt.es.xlf | 11 +- src/Compiler/xlf/FSComp.txt.fr.xlf | 11 +- src/Compiler/xlf/FSComp.txt.it.xlf | 11 +- src/Compiler/xlf/FSComp.txt.ja.xlf | 11 +- src/Compiler/xlf/FSComp.txt.ko.xlf | 11 +- src/Compiler/xlf/FSComp.txt.pl.xlf | 11 +- src/Compiler/xlf/FSComp.txt.pt-BR.xlf | 11 +- src/Compiler/xlf/FSComp.txt.ru.xlf | 11 +- src/Compiler/xlf/FSComp.txt.tr.xlf | 11 +- src/Compiler/xlf/FSComp.txt.zh-Hans.xlf | 11 +- src/Compiler/xlf/FSComp.txt.zh-Hant.xlf | 11 +- src/FSharp.Core/prim-types.fs | 2 +- src/FSharp.Core/prim-types.fsi | 2 +- .../OptionalArguments/OptionalArguments.fs | 494 ++++++++++++++++++ .../WarnForAttributeAlias.fs | 39 ++ .../WarnForAutoOpenAttributeAlias.fs | 23 - .../FSharp.Compiler.ComponentTests.fsproj | 2 +- 33 files changed, 782 insertions(+), 149 deletions(-) create mode 100644 tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/TypeAbbreviations/WarnForAttributeAlias.fs delete mode 100644 tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/TypeAbbreviations/WarnForAutoOpenAttributeAlias.fs diff --git a/docs/release-notes/.FSharp.Compiler.Service/9.0.200.md b/docs/release-notes/.FSharp.Compiler.Service/9.0.200.md index b2aed017570..740c18edcbc 100644 --- a/docs/release-notes/.FSharp.Compiler.Service/9.0.200.md +++ b/docs/release-notes/.FSharp.Compiler.Service/9.0.200.md @@ -31,6 +31,7 @@ * Adding warning when consuming generic method returning T|null for types not supporting nullness (structs,anons,tuples) ([PR #18057](https://github.com/dotnet/fsharp/pull/18057)) * Sink: report SynPat.ArrayOrList type ([PR #18127](https://github.com/dotnet/fsharp/pull/18127)) * Show the default value of compiler options ([PR #18054](https://github.com/dotnet/fsharp/pull/18054)) +* Support ValueOption + Struct attribute as optional parameter for methods ([Language suggestion #1136](https://github.com/fsharp/fslang-suggestions/issues/1136), [PR #18098](https://github.com/dotnet/fsharp/pull/18098)) ### Changed @@ -51,3 +52,5 @@ * Make ILTypeDef base type calculation lazy. ([PR #18005](https://github.com/dotnet/fsharp/pull/18005)) ### Breaking Changes + +* Aliasing `StructAttribute` will now produce a warning (part of [Language suggestion #1136](https://github.com/fsharp/fslang-suggestions/issues/1136), [PR #18098](https://github.com/dotnet/fsharp/pull/18098)) \ No newline at end of file diff --git a/docs/release-notes/.FSharp.Core/9.0.200.md b/docs/release-notes/.FSharp.Core/9.0.200.md index fdcc65f5537..9ee215274b5 100644 --- a/docs/release-notes/.FSharp.Core/9.0.200.md +++ b/docs/release-notes/.FSharp.Core/9.0.200.md @@ -6,8 +6,9 @@ ### Added ### Changed + * String function changed to guarantee a non-null string return type ([PR #17809](https://github.com/dotnet/fsharp/pull/17809)) +* Add Parameters as valid target for the Struct attribute ([Language suggestion #1136](https://github.com/fsharp/fslang-suggestions/issues/1136), [PR #18098](https://github.com/dotnet/fsharp/pull/18098)) ### Breaking Changes - diff --git a/docs/release-notes/.Language/preview.md b/docs/release-notes/.Language/preview.md index 0d882e20bbe..d6ef41c3d57 100644 --- a/docs/release-notes/.Language/preview.md +++ b/docs/release-notes/.Language/preview.md @@ -3,8 +3,10 @@ * Better generic unmanaged structs handling. ([Language suggestion #692](https://github.com/fsharp/fslang-suggestions/issues/692), [PR #12154](https://github.com/dotnet/fsharp/pull/12154)) * Deprecate places where `seq` can be omitted. ([Language suggestion #1033](https://github.com/fsharp/fslang-suggestions/issues/1033), [PR #17772](https://github.com/dotnet/fsharp/pull/17772)) * Added type conversions cache, only enabled for compiler runs ([PR#17668](https://github.com/dotnet/fsharp/pull/17668)) +* Support ValueOption + Struct attribute as optional parameter for methods ([Language suggestion #1136](https://github.com/fsharp/fslang-suggestions/issues/1136), [PR #18098](https://github.com/dotnet/fsharp/pull/18098)) ### Fixed + * Warn on uppercase identifiers in patterns. ([PR #15816](https://github.com/dotnet/fsharp/pull/15816)) ### Changed diff --git a/src/Compiler/Checking/CheckDeclarations.fs b/src/Compiler/Checking/CheckDeclarations.fs index 80c1a656c2d..bec5c9d9966 100644 --- a/src/Compiler/Checking/CheckDeclarations.fs +++ b/src/Compiler/Checking/CheckDeclarations.fs @@ -3222,34 +3222,40 @@ module EstablishTypeDefinitionCores = ignore inSig #endif - // This case deals with ordinary type and measure abbreviations - if not hasMeasureableAttr then + // This case deals with ordinary type and measure abbreviations + if not hasMeasureableAttr then let kind = if hasMeasureAttr then TyparKind.Measure else TyparKind.Type let ty, _ = TcTypeOrMeasureAndRecover (Some kind) cenv NoNewTypars checkConstraints ItemOccurrence.UseInType WarnOnIWSAM.No envinner tpenv rhsType - // Give a warning if `AutoOpenAttribute` is being aliased. + + // Give a warning if `AutoOpenAttribute` or `StructAttribute` is being aliased. // If the user were to alias the `Microsoft.FSharp.Core.AutoOpenAttribute` type, it would not be detected by the project graph dependency resolution algorithm. - match stripTyEqns g ty with - | AppTy g (tcref, _) when not tcref.IsErased -> - match tcref.CompiledRepresentation with - | CompiledTypeRepr.ILAsmOpen _ -> () - | CompiledTypeRepr.ILAsmNamed _ -> - if tcref.CompiledRepresentationForNamedType.FullName = g.attrib_AutoOpenAttribute.TypeRef.FullName then - warning(Error(FSComp.SR.chkAutoOpenAttributeInTypeAbbrev(), tycon.Id.idRange)) - | _ -> () - - if not firstPass then - let ftyvs = freeInTypeLeftToRight g false ty + + let inline checkAttributeAliased ty (tycon: Tycon) (attrib: BuiltinAttribInfo) = + match stripTyEqns g ty with + | AppTy g (tcref, _) when not tcref.IsErased -> + match tcref.CompiledRepresentation with + | CompiledTypeRepr.ILAsmOpen _ -> () + | CompiledTypeRepr.ILAsmNamed _ -> + if tcref.CompiledRepresentationForNamedType.FullName = attrib.TypeRef.FullName then + warning(Error(FSComp.SR.chkAttributeAliased(attrib.TypeRef.FullName), tycon.Id.idRange)) + | _ -> () + + checkAttributeAliased ty tycon g.attrib_AutoOpenAttribute + checkAttributeAliased ty tycon g.attrib_StructAttribute + + if not firstPass then + let ftyvs = freeInTypeLeftToRight g false ty let typars = tycon.Typars m - if ftyvs.Length <> typars.Length then + if ftyvs.Length <> typars.Length then errorR(Deprecated(FSComp.SR.tcTypeAbbreviationHasTypeParametersMissingOnType(), tycon.Range)) if firstPass then tycon.SetTypeAbbrev (Some ty) | _ -> () - - with RecoverableException exn -> + + with RecoverableException exn -> errorRecovery exn m // Third phase: check and publish the super types. Run twice, once before constraints are established diff --git a/src/Compiler/Checking/CheckPatterns.fs b/src/Compiler/Checking/CheckPatterns.fs index 0c496517fd4..487c66b0c8c 100644 --- a/src/Compiler/Checking/CheckPatterns.fs +++ b/src/Compiler/Checking/CheckPatterns.fs @@ -58,6 +58,14 @@ let UnifyRefTupleType contextInfo (cenv: cenv) denv m ty ps = AddCxTypeEqualsType contextInfo denv cenv.css m ty (TType_tuple (tupInfoRef, ptys)) ptys +let inline mkOptionalParamTyBasedOnAttribute (g: TcGlobals) tyarg attribs = + if g.langVersion.SupportsFeature(LanguageFeature.SupportValueOptionsAsOptionalParameters) + && findSynAttribute "StructAttribute" attribs + then + mkValueOptionTy g tyarg + else + mkOptionTy g tyarg + let rec TryAdjustHiddenVarNameToCompGenName (cenv: cenv) env (id: Ident) altNameRefCellOpt = match altNameRefCellOpt with | Some ({contents = SynSimplePatAlternativeIdInfo.Undecided altId } as altNameRefCell) -> @@ -75,7 +83,7 @@ let rec TryAdjustHiddenVarNameToCompGenName (cenv: cenv) env (id: Ident) altName | None -> None /// Bind the patterns used in a lambda. Not clear why we don't use TcPat. -and TcSimplePat optionalArgsOK checkConstraints (cenv: cenv) ty env patEnv p = +and TcSimplePat optionalArgsOK checkConstraints (cenv: cenv) ty env patEnv p (attribs: SynAttributes) = let g = cenv.g let (TcPatLinearEnv(tpenv, names, takenNames)) = patEnv @@ -85,14 +93,17 @@ and TcSimplePat optionalArgsOK checkConstraints (cenv: cenv) ty env patEnv p = // Check to see if pattern translation decides to use an alternative identifier. match TryAdjustHiddenVarNameToCompGenName cenv env id altNameRefCellOpt with | Some altId -> - TcSimplePat optionalArgsOK checkConstraints cenv ty env patEnv (SynSimplePat.Id (altId, None, isCompGen, isMemberThis, isOpt, m) ) + TcSimplePat optionalArgsOK checkConstraints cenv ty env patEnv (SynSimplePat.Id (altId, None, isCompGen, isMemberThis, isOpt, m) ) attribs | None -> if isOpt then if not optionalArgsOK then errorR(Error(FSComp.SR.tcOptionalArgsOnlyOnMembers(), m)) let tyarg = NewInferenceType g - UnifyTypes cenv env m ty (mkOptionTy g tyarg) + + let optionalParamTy = mkOptionalParamTyBasedOnAttribute g tyarg attribs + + UnifyTypes cenv env m ty optionalParamTy let vFlags = TcPatValFlags (ValInline.Optional, permitInferTypars, noArgOrRetAttribs, false, None, isCompGen) let _, names, takenNames = TcPatBindingName cenv env id ty isMemberThis None None vFlags (names, takenNames) @@ -104,20 +115,23 @@ and TcSimplePat optionalArgsOK checkConstraints (cenv: cenv) ty env patEnv p = match p with // Optional arguments on members - | SynSimplePat.Id(_, _, _, _, true, _) -> UnifyTypes cenv env m ty (mkOptionTy g ctyR) + | SynSimplePat.Id(_, _, _, _, true, _) -> + let optionalParamTy = mkOptionalParamTyBasedOnAttribute g ctyR attribs + + UnifyTypes cenv env m ty optionalParamTy | _ -> UnifyTypes cenv env m ty ctyR let patEnvR = TcPatLinearEnv(tpenv, names, takenNames) - + // Ensure the untyped typar name sticks match cty, ty with | SynType.Var(typar = SynTypar(ident = untypedIdent)), TType_var(typar = typedTp) -> typedTp.SetIdent(untypedIdent) | _ -> () - TcSimplePat optionalArgsOK checkConstraints cenv ty env patEnvR p + TcSimplePat optionalArgsOK checkConstraints cenv ty env patEnvR p attribs - | SynSimplePat.Attrib (p, _, _) -> - TcSimplePat optionalArgsOK checkConstraints cenv ty env patEnv p + | SynSimplePat.Attrib (p, pattribs, _) -> + TcSimplePat optionalArgsOK checkConstraints cenv ty env patEnv p pattribs // raise an error if any optional args precede any non-optional args and ValidateOptArgOrder (synSimplePats: SynSimplePats) = @@ -166,12 +180,12 @@ and TcSimplePats (cenv: cenv) optionalArgsOK checkConstraints ty env patEnv synS [id.idText], patEnvR | SynSimplePats.SimplePats (pats = [synSimplePat]) -> - let v, patEnv = TcSimplePat optionalArgsOK checkConstraints cenv ty env patEnv synSimplePat + let v, patEnv = TcSimplePat optionalArgsOK checkConstraints cenv ty env patEnv synSimplePat [] [v], patEnv | SynSimplePats.SimplePats (ps, _, m) -> let ptys = UnifyRefTupleType env.eContextInfo cenv env.DisplayEnv m ty ps - let ps', patEnvR = (patEnv, List.zip ptys ps) ||> List.mapFold (fun patEnv (ty, pat) -> TcSimplePat optionalArgsOK checkConstraints cenv ty env patEnv pat) + let ps', patEnvR = (patEnv, List.zip ptys ps) ||> List.mapFold (fun patEnv (ty, pat) -> TcSimplePat optionalArgsOK checkConstraints cenv ty env patEnv pat []) ps', patEnvR and TcSimplePatsOfUnknownType (cenv: cenv) optionalArgsOK checkConstraints env tpenv (pat: SynPat) = diff --git a/src/Compiler/Checking/MethodCalls.fs b/src/Compiler/Checking/MethodCalls.fs index 3343f7dbac3..4c561dd7fee 100644 --- a/src/Compiler/Checking/MethodCalls.fs +++ b/src/Compiler/Checking/MethodCalls.fs @@ -328,21 +328,46 @@ let AdjustCalledArgTypeForTypeDirectedConversionsAndAutoQuote (infoReader: InfoR else AdjustRequiredTypeForTypeDirectedConversions infoReader ad true false calledArgTy callerArgTy m +let inline tryDestOptionalTy g ty = + if isOptionTy g ty then + destOptionTy g ty + elif g.langVersion.SupportsFeature LanguageFeature.SupportValueOptionsAsOptionalParameters && isValueOptionTy g ty then + destValueOptionTy g ty + else + ty + +let inline mkOptionalTy (g: TcGlobals) ty = + if g.langVersion.SupportsFeature LanguageFeature.SupportValueOptionsAsOptionalParameters && isValueOptionTy g ty then + mkValueOptionTy g ty + else + mkOptionTy g ty + +let inline mkOptionalNone (g: TcGlobals) ty calledArgTy mMethExpr = + if g.langVersion.SupportsFeature LanguageFeature.SupportValueOptionsAsOptionalParameters && isValueOptionTy g ty then + mkValueNone g calledArgTy mMethExpr + else + mkNone g calledArgTy mMethExpr + + /// Adjust the called argument type to take into account whether the caller's argument is CSharpMethod(?arg=Some(3)) or CSharpMethod(arg=1) let AdjustCalledArgTypeForOptionals (infoReader: InfoReader) ad enforceNullableOptionalsKnownTypes (calledArg: CalledArg) calledArgTy (callerArg: CallerArg<_>) = let g = infoReader.g let m = callerArg.Range let callerArgTy = callerArg.CallerArgumentType - if callerArg.IsExplicitOptional then - match calledArg.OptArgInfo with + if callerArg.IsExplicitOptional then + match calledArg.OptArgInfo with // CSharpMethod(?x = arg), optional C#-style argument, may have nullable type - | CallerSide _ -> + | CallerSide _ -> if g.langVersion.SupportsFeature LanguageFeature.NullableOptionalInterop then - if isNullableTy g calledArgTy then - mkOptionTy g (destNullableTy g calledArgTy), TypeDirectedConversionUsed.No, None - else - mkOptionTy g calledArgTy, TypeDirectedConversionUsed.No, None + + let calledArgTy = + if isNullableTy g calledArgTy then + destNullableTy g calledArgTy + else + calledArgTy + + mkOptionalTy g calledArgTy, TypeDirectedConversionUsed.No, None else calledArgTy, TypeDirectedConversionUsed.No, None @@ -392,11 +417,7 @@ let AdjustCalledArgTypeForOptionals (infoReader: InfoReader) ad enforceNullableO // FSharpMethod(x = arg), optional F#-style argument, should have option type | CalleeSide -> - let calledArgTy2 = - if isOptionTy g calledArgTy then - destOptionTy g calledArgTy - else - calledArgTy + let calledArgTy2 = tryDestOptionalTy g calledArgTy AdjustCalledArgTypeForTypeDirectedConversionsAndAutoQuote infoReader ad callerArgTy calledArgTy2 calledArg m // F# supports adhoc conversions at some specific points @@ -1476,11 +1497,7 @@ let rec GetDefaultExpressionForCallerSideOptionalArg tcFieldInit g (calledArg: C /// can be used with 'CalleeSide' optional arguments let GetDefaultExpressionForCalleeSideOptionalArg g (calledArg: CalledArg) eCallerMemberName (mMethExpr: range) = let calledArgTy = calledArg.CalledArgumentType - let calledNonOptTy = - if isOptionTy g calledArgTy then - destOptionTy g calledArgTy - else - calledArgTy // should be unreachable + let calledNonOptTy = tryDestOptionalTy g calledArgTy match calledArg.CallerInfo, eCallerMemberName with | CallerLineNumber, _ when typeEquiv g calledNonOptTy g.int_ty -> @@ -1494,7 +1511,8 @@ let GetDefaultExpressionForCalleeSideOptionalArg g (calledArg: CalledArg) eCalle let memberNameExpr = Expr.Const (Const.String callerName, mMethExpr, calledNonOptTy) mkSome g calledNonOptTy memberNameExpr mMethExpr | _ -> - mkNone g calledNonOptTy mMethExpr + mkOptionalNone g calledArgTy calledNonOptTy mMethExpr + /// Get the expression that must be inserted on the caller side for an optional arg where /// no caller argument has been provided. @@ -1573,20 +1591,24 @@ let AdjustCallerArgForOptional tcVal tcFieldInit eCallerMemberName (infoReader: // AdjustCallerArgExpr later on will deal with any nullable conversion callerArgExpr - | CalleeSide -> - if isOptCallerArg then + | CalleeSide -> + if isOptCallerArg then // FSharpMethod(?x=b) --> FSharpMethod(?x=b) - callerArgExpr - else + callerArgExpr + else // FSharpMethod(x=b) when FSharpMethod(A) --> FSharpMethod(?x=Some(b :> A)) - if isOptionTy g calledArgTy then - let calledNonOptTy = destOptionTy g calledArgTy + if isOptionTy g calledArgTy then + let calledNonOptTy = destOptionTy g calledArgTy let _, callerArgExpr2 = AdjustCallerArgExpr tcVal g amap infoReader ad isOutArg calledNonOptTy reflArgInfo callerArgTy m callerArgExpr mkSome g calledNonOptTy callerArgExpr2 m - else + elif g.langVersion.SupportsFeature(LanguageFeature.SupportValueOptionsAsOptionalParameters) && isValueOptionTy g calledArgTy then + let calledNonOptTy = destValueOptionTy g calledArgTy + let _, callerArgExpr2 = AdjustCallerArgExpr tcVal g amap infoReader ad isOutArg calledNonOptTy reflArgInfo callerArgTy m callerArgExpr + mkValueSome g calledNonOptTy callerArgExpr2 m + else assert false - callerArgExpr // defensive code - this case is unreachable - + callerArgExpr // defensive code - this case is unreachable + let callerArg2 = CallerArg(tyOfExpr g callerArgExpr2, m, isOptCallerArg, callerArgExpr2) { assignedArg with CallerArg=callerArg2 } diff --git a/src/Compiler/Driver/GraphChecking/TrieMapping.fs b/src/Compiler/Driver/GraphChecking/TrieMapping.fs index 95b22637e9a..215f8a2dae6 100644 --- a/src/Compiler/Driver/GraphChecking/TrieMapping.fs +++ b/src/Compiler/Driver/GraphChecking/TrieMapping.fs @@ -5,6 +5,7 @@ open System.Collections.Immutable open System.Text open FSharp.Compiler.IO open FSharp.Compiler.Syntax +open FSharp.Compiler.SyntaxTreeOps [] module private ImmutableHashSet = @@ -15,34 +16,7 @@ module private ImmutableHashSet = /// Create a new HashSet<'T> with zero elements. let empty () = ImmutableHashSet.Empty -let autoOpenShapes = - set - [| - "FSharp.Core.AutoOpenAttribute" - "Core.AutoOpenAttribute" - "AutoOpenAttribute" - "FSharp.Core.AutoOpen" - "Core.AutoOpen" - "AutoOpen" - |] - -/// This isn't bullet proof, we do prompt a warning when the user is aliasing the AutoOpenAttribute. -let isAutoOpenAttribute (attribute: SynAttribute) = - match attribute.ArgExpr with - | SynExpr.Const(constant = SynConst.Unit) - | SynExpr.Const(constant = SynConst.String _) - | SynExpr.Paren(expr = SynExpr.Const(constant = SynConst.String _)) -> - let attributeName = - attribute.TypeName.LongIdent - |> List.map (fun ident -> ident.idText) - |> String.concat "." - - autoOpenShapes.Contains attributeName - | _ -> false - -let isAnyAttributeAutoOpen (attributes: SynAttributes) = - attributes - |> List.exists (fun (atl: SynAttributeList) -> List.exists isAutoOpenAttribute atl.Attributes) +let isAnyAttributeAutoOpen (attributes: SynAttributes) = findSynAttribute "AutoOpen" attributes /// Checks to see if the top level ModuleOrNamespace exposes content that could be inferred by any of the subsequent files. /// This can happen when a `namespace global` is used, or when a module (with a single ident name) has the `[]` attribute. diff --git a/src/Compiler/FSComp.txt b/src/Compiler/FSComp.txt index c0f9a8a4f1a..f16be8658dd 100644 --- a/src/Compiler/FSComp.txt +++ b/src/Compiler/FSComp.txt @@ -1736,7 +1736,7 @@ featureEscapeBracesInFormattableString,"Escapes curly braces before calling Form 3558,chkExplicitFieldsDeclarationsOnStaticClasses,"If a type uses both [] and [] attributes, it means it is static. Explicit field declarations are not allowed." 3559,typrelNeverRefinedAwayFromTop,"A type has been implicitly inferred as 'obj', which may be unintended. Consider adding explicit type annotations. You can disable this warning by using '#nowarn \"3559\"' or '--nowarn:3559'." 3560,tcCopyAndUpdateRecordChangesAllFields,"This copy-and-update record expression changes all fields of record type '%s'. Consider using the record construction syntax instead." -3561,chkAutoOpenAttributeInTypeAbbrev,"FSharp.Core.AutoOpenAttribute should not be aliased." +3561,chkAttributeAliased,"%s should not be aliased." 3562,parsUnexpectedEndOfFileElif,"Unexpected end of input in 'else if' or 'elif' branch of conditional expression. Expected 'elif then ' or 'else if then '." 3563,lexInvalidIdentifier,"This is not a valid identifier" 3564,parsMissingUnionCaseName,"Missing union case name" @@ -1790,3 +1790,4 @@ featureUseTypeSubsumptionCache,"Use type conversion cache during compilation" featureDontWarnOnUppercaseIdentifiersInBindingPatterns,"Don't warn on uppercase identifiers in binding patterns" 3873,chkDeprecatePlacesWhereSeqCanBeOmitted,"This construct is deprecated. Sequence expressions should be of the form 'seq {{ ... }}'" featureDeprecatePlacesWhereSeqCanBeOmitted,"Deprecate places where 'seq' can be omitted" +featureSupportValueOptionsAsOptionalParameters,"Support ValueOption as valid type for optional member parameters" diff --git a/src/Compiler/Facilities/LanguageFeatures.fs b/src/Compiler/Facilities/LanguageFeatures.fs index 0e2783796af..5401ea26a1b 100644 --- a/src/Compiler/Facilities/LanguageFeatures.fs +++ b/src/Compiler/Facilities/LanguageFeatures.fs @@ -97,6 +97,7 @@ type LanguageFeature = | DontWarnOnUppercaseIdentifiersInBindingPatterns | UseTypeSubsumptionCache | DeprecatePlacesWhereSeqCanBeOmitted + | SupportValueOptionsAsOptionalParameters /// LanguageVersion management type LanguageVersion(versionText) = @@ -225,6 +226,7 @@ type LanguageVersion(versionText) = LanguageFeature.AllowObjectExpressionWithoutOverrides, previewVersion LanguageFeature.DontWarnOnUppercaseIdentifiersInBindingPatterns, previewVersion LanguageFeature.DeprecatePlacesWhereSeqCanBeOmitted, previewVersion + LanguageFeature.SupportValueOptionsAsOptionalParameters, previewVersion ] static let defaultLanguageVersion = LanguageVersion("default") @@ -385,6 +387,7 @@ type LanguageVersion(versionText) = FSComp.SR.featureDontWarnOnUppercaseIdentifiersInBindingPatterns () | LanguageFeature.UseTypeSubsumptionCache -> FSComp.SR.featureUseTypeSubsumptionCache () | LanguageFeature.DeprecatePlacesWhereSeqCanBeOmitted -> FSComp.SR.featureDeprecatePlacesWhereSeqCanBeOmitted () + | LanguageFeature.SupportValueOptionsAsOptionalParameters -> FSComp.SR.featureSupportValueOptionsAsOptionalParameters () /// Get a version string associated with the given feature. static member GetFeatureVersionString feature = diff --git a/src/Compiler/Facilities/LanguageFeatures.fsi b/src/Compiler/Facilities/LanguageFeatures.fsi index bc361ba1337..90572888001 100644 --- a/src/Compiler/Facilities/LanguageFeatures.fsi +++ b/src/Compiler/Facilities/LanguageFeatures.fsi @@ -88,6 +88,7 @@ type LanguageFeature = | DontWarnOnUppercaseIdentifiersInBindingPatterns | UseTypeSubsumptionCache | DeprecatePlacesWhereSeqCanBeOmitted + | SupportValueOptionsAsOptionalParameters /// LanguageVersion management type LanguageVersion = diff --git a/src/Compiler/SyntaxTree/SyntaxTreeOps.fs b/src/Compiler/SyntaxTree/SyntaxTreeOps.fs index 7b392487adb..ffb9bd65647 100644 --- a/src/Compiler/SyntaxTree/SyntaxTreeOps.fs +++ b/src/Compiler/SyntaxTree/SyntaxTreeOps.fs @@ -107,6 +107,20 @@ let rec pushUnaryArg expr arg = errorR (Error(FSComp.SR.tcDotLambdaAtNotSupportedExpression (), expr.Range)) expr +/// CAUTION: This function operates over the untyped tree, so should be used only when absolutely necessary. It doesn't verify assembly origine nor does it respect type aliases. +/// Also, keep in mind that it will only check last part of the assembly (with or without the `Attribute` suffix). +let inline findSynAttribute (attrName: string) (synAttrs: SynAttributes) = + let attributesToSearch = + if attrName.EndsWith("Attribute") then + set [ attrName; attrName.Substring(0, attrName.Length - 9) ] + else + set [ attrName; attrName + "Attribute" ] + + synAttrs + |> List.exists (fun synAttr -> + synAttr.Attributes + |> List.exists (fun attr -> attributesToSearch.Contains(attr.TypeName.LongIdent |> List.last |> _.idText))) + [] let (|SynSingleIdent|_|) x = match x with diff --git a/src/Compiler/SyntaxTree/SyntaxTreeOps.fsi b/src/Compiler/SyntaxTree/SyntaxTreeOps.fsi index 3ca2b58be43..49190452b4f 100644 --- a/src/Compiler/SyntaxTree/SyntaxTreeOps.fsi +++ b/src/Compiler/SyntaxTree/SyntaxTreeOps.fsi @@ -44,6 +44,8 @@ val mkSynCompGenSimplePatVar: id: Ident -> SynSimplePat val pushUnaryArg: expr: SynExpr -> arg: Ident -> SynExpr +val inline findSynAttribute: attrName: string -> synAttrs: SynAttributes -> bool + /// Match a long identifier, including the case for single identifiers which gets a more optimized node in the syntax tree. [] val (|LongOrSingleIdent|_|): diff --git a/src/Compiler/TypedTree/TypedTreeOps.fs b/src/Compiler/TypedTree/TypedTreeOps.fs index d383130d0ee..ca7292c6369 100644 --- a/src/Compiler/TypedTree/TypedTreeOps.fs +++ b/src/Compiler/TypedTree/TypedTreeOps.fs @@ -3887,10 +3887,16 @@ let mkSome g ty arg m = mkUnionCaseExpr(mkSomeCase g, [ty], [arg], m) let mkNone g ty m = mkUnionCaseExpr(mkNoneCase g, [ty], [], m) +let mkValueNoneCase (g: TcGlobals) = mkUnionCaseRef g.valueoption_tcr_canon "ValueNone" + let mkValueSomeCase (g: TcGlobals) = mkUnionCaseRef g.valueoption_tcr_canon "ValueSome" let mkAnySomeCase g isStruct = (if isStruct then mkValueSomeCase g else mkSomeCase g) +let mkValueSome g ty arg m = mkUnionCaseExpr(mkValueSomeCase g, [ty], [arg], m) + +let mkValueNone g ty m = mkUnionCaseExpr(mkValueNoneCase g, [ty], [], m) + type ValRef with member vref.IsDispatchSlot = match vref.MemberInfo with diff --git a/src/Compiler/TypedTree/TypedTreeOps.fsi b/src/Compiler/TypedTree/TypedTreeOps.fsi index 8b2cf510ac9..bda6c2c3187 100755 --- a/src/Compiler/TypedTree/TypedTreeOps.fsi +++ b/src/Compiler/TypedTree/TypedTreeOps.fsi @@ -1911,12 +1911,21 @@ val mkNoneCase: TcGlobals -> UnionCaseRef /// Create the union case 'Some(expr)' for an option type val mkSomeCase: TcGlobals -> UnionCaseRef +/// Create the struct union case 'ValueNone' for a voption type +val mkValueNoneCase: TcGlobals -> UnionCaseRef + /// Create the struct union case 'ValueSome(expr)' for a voption type val mkValueSomeCase: TcGlobals -> UnionCaseRef /// Create the struct union case 'Some' or 'ValueSome(expr)' for a voption type val mkAnySomeCase: TcGlobals -> isStruct: bool -> UnionCaseRef +/// Create the expression 'ValueSome(expr)' +val mkValueSome: TcGlobals -> TType -> Expr -> range -> Expr + +/// Create the struct expression 'ValueNone' for an voption type +val mkValueNone: TcGlobals -> TType -> range -> Expr + /// Create the expression '[]' for a list type val mkNil: TcGlobals -> range -> TType -> Expr diff --git a/src/Compiler/xlf/FSComp.txt.cs.xlf b/src/Compiler/xlf/FSComp.txt.cs.xlf index 044a9c461f4..750326328a6 100644 --- a/src/Compiler/xlf/FSComp.txt.cs.xlf +++ b/src/Compiler/xlf/FSComp.txt.cs.xlf @@ -37,9 +37,9 @@ Pokud typ používá atribut [<Sealed>] i [<AbstractClass>], znamená to, že je statický. Další konstruktor není povolený. - - FSharp.Core.AutoOpenAttribute should not be aliased. - FSharp.Core.AutoOpenAttribute by neměl mít alias. + + {0} should not be aliased. + {0} should not be aliased. @@ -612,6 +612,11 @@ reprezentace struktury aktivních vzorů + + Support ValueOption as valid type for optional member parameters + Support ValueOption as valid type for optional member parameters + + Union case test properties Vlastnosti testu případu sjednocení diff --git a/src/Compiler/xlf/FSComp.txt.de.xlf b/src/Compiler/xlf/FSComp.txt.de.xlf index b8e33044bc8..a32c7962125 100644 --- a/src/Compiler/xlf/FSComp.txt.de.xlf +++ b/src/Compiler/xlf/FSComp.txt.de.xlf @@ -37,9 +37,9 @@ Wenn ein Typ sowohl das Attribute [<Sealed>] wie auch [<AbstractClass>] verwendet, bedeutet dies, dass er statisch ist. Ein zusätzlicher Konstruktor ist nicht zulässig. - - FSharp.Core.AutoOpenAttribute should not be aliased. - FSharp.Core.AutoOpenAttribute darf kein Alias sein. + + {0} should not be aliased. + {0} should not be aliased. @@ -612,6 +612,11 @@ Strukturdarstellung für aktive Muster + + Support ValueOption as valid type for optional member parameters + Support ValueOption as valid type for optional member parameters + + Union case test properties Eigenschaften von Union-Falltests diff --git a/src/Compiler/xlf/FSComp.txt.es.xlf b/src/Compiler/xlf/FSComp.txt.es.xlf index cbb8274fd80..37b48d83ec3 100644 --- a/src/Compiler/xlf/FSComp.txt.es.xlf +++ b/src/Compiler/xlf/FSComp.txt.es.xlf @@ -37,9 +37,9 @@ Si un tipo usa los atributos [<Sealed>] y [<AbstractClass>], significa que es estático. No se permite un constructor adicional. - - FSharp.Core.AutoOpenAttribute should not be aliased. - FSharp.Core.AutoOpenAttribute no debe tener alias. + + {0} should not be aliased. + {0} should not be aliased. @@ -612,6 +612,11 @@ representación de struct para modelos activos + + Support ValueOption as valid type for optional member parameters + Support ValueOption as valid type for optional member parameters + + Union case test properties Propiedades de prueba de caso de unión diff --git a/src/Compiler/xlf/FSComp.txt.fr.xlf b/src/Compiler/xlf/FSComp.txt.fr.xlf index 7424a9be7be..333b320a1eb 100644 --- a/src/Compiler/xlf/FSComp.txt.fr.xlf +++ b/src/Compiler/xlf/FSComp.txt.fr.xlf @@ -37,9 +37,9 @@ Si un type utilise les attributs [<Sealed>] et [<AbstractClass>], cela signifie qu’il est statique. Un constructeur supplémentaire n’est pas autorisé. - - FSharp.Core.AutoOpenAttribute should not be aliased. - FSharp.Core.AutoOpenAttribute ne doit pas avoir d'alias. + + {0} should not be aliased. + {0} should not be aliased. @@ -612,6 +612,11 @@ représentation de structure pour les modèles actifs + + Support ValueOption as valid type for optional member parameters + Support ValueOption as valid type for optional member parameters + + Union case test properties Propriétés du test de cas d’union diff --git a/src/Compiler/xlf/FSComp.txt.it.xlf b/src/Compiler/xlf/FSComp.txt.it.xlf index 78e635516fe..7d5c4093770 100644 --- a/src/Compiler/xlf/FSComp.txt.it.xlf +++ b/src/Compiler/xlf/FSComp.txt.it.xlf @@ -37,9 +37,9 @@ Se un tipo usa entrambi gli attributi [<Sealed>] e [<AbstractClass>], significa che è statico. Non sono ammessi costruttori aggiuntivi. - - FSharp.Core.AutoOpenAttribute should not be aliased. - Non sono consentiti alias per FSharp.Core.AutoOpenAttribute. + + {0} should not be aliased. + {0} should not be aliased. @@ -612,6 +612,11 @@ rappresentazione struct per criteri attivi + + Support ValueOption as valid type for optional member parameters + Support ValueOption as valid type for optional member parameters + + Union case test properties Proprietà test case di unione diff --git a/src/Compiler/xlf/FSComp.txt.ja.xlf b/src/Compiler/xlf/FSComp.txt.ja.xlf index 47e87ffde18..35898789fc9 100644 --- a/src/Compiler/xlf/FSComp.txt.ja.xlf +++ b/src/Compiler/xlf/FSComp.txt.ja.xlf @@ -37,9 +37,9 @@ 型が [<Sealed>] と [<AbstractClass>] の両方の属性を使用する場合、それは静的であることを意味します。追加のコンストラクターは許可されていません。 - - FSharp.Core.AutoOpenAttribute should not be aliased. - FSharp.Core.AutoOpenAttribute にエイリアスを設定することはできません。 + + {0} should not be aliased. + {0} should not be aliased. @@ -612,6 +612,11 @@ アクティブなパターンの構造体表現 + + Support ValueOption as valid type for optional member parameters + Support ValueOption as valid type for optional member parameters + + Union case test properties ユニオン ケースのテスト プロパティ diff --git a/src/Compiler/xlf/FSComp.txt.ko.xlf b/src/Compiler/xlf/FSComp.txt.ko.xlf index c30cc41398c..fa1d20d2ccf 100644 --- a/src/Compiler/xlf/FSComp.txt.ko.xlf +++ b/src/Compiler/xlf/FSComp.txt.ko.xlf @@ -37,9 +37,9 @@ 형식이 [<Sealed>] 및 [<AbstractClass>] 특성을 모두 사용하는 경우 정적임을 의미합니다. 추가 생성자는 허용되지 않습니다. - - FSharp.Core.AutoOpenAttribute should not be aliased. - FSharp.Core.AutoOpenAttribute는 별칭을 지정할 수 없습니다. + + {0} should not be aliased. + {0} should not be aliased. @@ -612,6 +612,11 @@ 활성 패턴에 대한 구조체 표현 + + Support ValueOption as valid type for optional member parameters + Support ValueOption as valid type for optional member parameters + + Union case test properties 공용 구조체 사례 테스트 속성 diff --git a/src/Compiler/xlf/FSComp.txt.pl.xlf b/src/Compiler/xlf/FSComp.txt.pl.xlf index b1a404bc0b0..404c55b08c1 100644 --- a/src/Compiler/xlf/FSComp.txt.pl.xlf +++ b/src/Compiler/xlf/FSComp.txt.pl.xlf @@ -37,9 +37,9 @@ Jeśli typ używa obu [<Sealed>] i [< AbstractClass>] atrybutów, oznacza to, że jest statyczny. Konstruktor jest również niedozwolony. - - FSharp.Core.AutoOpenAttribute should not be aliased. - Element FSharp.Core.AutoOpenAttribute nie powinien mieć aliasu. + + {0} should not be aliased. + {0} should not be aliased. @@ -612,6 +612,11 @@ reprezentacja struktury aktywnych wzorców + + Support ValueOption as valid type for optional member parameters + Support ValueOption as valid type for optional member parameters + + Union case test properties Właściwości testowe przypadku unii diff --git a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf index c3be9642f81..7f47aab104e 100644 --- a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf +++ b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf @@ -37,9 +37,9 @@ Se um tipo usa os atributos [<Sealed>] e [<AbstractClass>], significa que é estático. Construtor adicional não é permitido. - - FSharp.Core.AutoOpenAttribute should not be aliased. - FSharp.Core.AutoOpenAttribute não deve ter alias. + + {0} should not be aliased. + {0} should not be aliased. @@ -612,6 +612,11 @@ representação estrutural para padrões ativos + + Support ValueOption as valid type for optional member parameters + Support ValueOption as valid type for optional member parameters + + Union case test properties Propriedades de teste de caso de união diff --git a/src/Compiler/xlf/FSComp.txt.ru.xlf b/src/Compiler/xlf/FSComp.txt.ru.xlf index 9da18bd9abf..1b4631d4070 100644 --- a/src/Compiler/xlf/FSComp.txt.ru.xlf +++ b/src/Compiler/xlf/FSComp.txt.ru.xlf @@ -37,9 +37,9 @@ Если тип использует атрибуты [<Sealed>] и [<AbstractClass>], это означает, что он статический. Дополнительный конструктор не разрешен. - - FSharp.Core.AutoOpenAttribute should not be aliased. - FSharp.Core.AutoOpenAttribute не должен быть псевдонимом. + + {0} should not be aliased. + {0} should not be aliased. @@ -612,6 +612,11 @@ представление структуры для активных шаблонов + + Support ValueOption as valid type for optional member parameters + Support ValueOption as valid type for optional member parameters + + Union case test properties Свойства теста союзного случая diff --git a/src/Compiler/xlf/FSComp.txt.tr.xlf b/src/Compiler/xlf/FSComp.txt.tr.xlf index 4b383d721d7..67ebaebfab3 100644 --- a/src/Compiler/xlf/FSComp.txt.tr.xlf +++ b/src/Compiler/xlf/FSComp.txt.tr.xlf @@ -37,9 +37,9 @@ Bir tür, hem [<Sealed>] hem de [< AbstractClass>] özniteliklerini kullanıyorsa bu statik olduğu anlamına gelir. Ek oluşturucuya izin verilmez. - - FSharp.Core.AutoOpenAttribute should not be aliased. - FSharp.Core.AutoOpenAttribute diğer adlı olamaz. + + {0} should not be aliased. + {0} should not be aliased. @@ -612,6 +612,11 @@ etkin desenler için yapı gösterimi + + Support ValueOption as valid type for optional member parameters + Support ValueOption as valid type for optional member parameters + + Union case test properties Birleşim durumu test özellikleri diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf index d38b026f117..4b7924b2f93 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf @@ -37,9 +37,9 @@ 如果类型同时使用 [<Sealed>] 和 [<AbstractClass>] 属性,则表示它是静态的。不允许使用其他构造函数。 - - FSharp.Core.AutoOpenAttribute should not be aliased. - FSharp.Core.AutoOpenAttribute 不应为别名。 + + {0} should not be aliased. + {0} should not be aliased. @@ -612,6 +612,11 @@ 活动模式的结构表示形式 + + Support ValueOption as valid type for optional member parameters + Support ValueOption as valid type for optional member parameters + + Union case test properties 联合用例测试属性 diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf index cbb001aef87..5937af812f0 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf @@ -37,9 +37,9 @@ 如果類型同時使用 [<Sealed>] 和 [<AbstractClass>] 屬性,表示其為靜態。不允許其他建構函式。 - - FSharp.Core.AutoOpenAttribute should not be aliased. - 不應別名化 FSharp.Core.AutoOpenAttribute。 + + {0} should not be aliased. + {0} should not be aliased. @@ -612,6 +612,11 @@ 現用模式的結構表示法 + + Support ValueOption as valid type for optional member parameters + Support ValueOption as valid type for optional member parameters + + Union case test properties 聯集案例測試屬性 diff --git a/src/FSharp.Core/prim-types.fs b/src/FSharp.Core/prim-types.fs index 7c5f12f764d..7f1b0a122ad 100644 --- a/src/FSharp.Core/prim-types.fs +++ b/src/FSharp.Core/prim-types.fs @@ -183,7 +183,7 @@ namespace Microsoft.FSharp.Core inherit Attribute() member _.CompiledName = compiledName - [] + [] [] type StructAttribute() = inherit Attribute() diff --git a/src/FSharp.Core/prim-types.fsi b/src/FSharp.Core/prim-types.fsi index 15264b3a14e..a992a0204e0 100644 --- a/src/FSharp.Core/prim-types.fsi +++ b/src/FSharp.Core/prim-types.fsi @@ -200,7 +200,7 @@ namespace Microsoft.FSharp.Core /// Adding this attribute to a type causes it to be represented using a CLI struct. /// /// Attributes - [] + [] [] type StructAttribute = inherit Attribute diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/MemberDefinitions/OptionalArguments/OptionalArguments.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/MemberDefinitions/OptionalArguments/OptionalArguments.fs index 48cbd63e1e2..c0604630d56 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/MemberDefinitions/OptionalArguments/OptionalArguments.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/MemberDefinitions/OptionalArguments/OptionalArguments.fs @@ -115,4 +115,498 @@ module MemberDefinitions_OptionalArguments = |> verifyCompileAndRun |> shouldSucceed + [] + let ``Optional Arguments can't be a ValueOption+StructAttribute attribute with langversion=9`` () = + let source = + FSharp """ +module Program +type X() = + static member M([] ?x) = + match x with + | ValueSome x -> printfn "VSome %A" x + | ValueNone -> printfn "VNone" +[] +let main _ = + X.M(ValueSome 1) + X.M(ValueNone) + X.M() + 0 + """ + source + |> asLibrary + |> withLangVersion90 + |> withNoWarn 25 + |> compile + |> shouldFail + |> withDiagnostics [ + Error 1, Line 6, Col 11, Line 6, Col 22, "This expression was expected to have type + ''a option' +but here has type + ''b voption' " + Error 1, Line 7, Col 11, Line 7, Col 20, "This expression was expected to have type + ''a option' +but here has type + ''b voption' "] + + [] + let ``Optional Arguments wrap Option`` () = + let source = + FSharp """ +module Program +type X() = + static member M(?x) = + match x with + | Some x -> printfn "Some %A" x + | None -> printfn "None" + +[] +let main _ = + X.M(Some 1) + X.M(None) + X.M(1) + X.M() + 0 + """ + source + |> asExe + |> withLangVersionPreview + |> withNoWarn 25 + |> compile + |> shouldSucceed + |> run + |> shouldSucceed + |> withOutputContainsAllInOrder ["Some Some 1"; "Some None"; "Some 1"; "None"] + + [] + let ``Optional Arguments wrap ValueOption`` () = + let source = + FSharp """ +module Program +type X() = + static member M(?x) = + match x with + | Some x -> printfn "Some %A" x + | None -> printfn "None" + +[] +let main _ = + X.M(ValueSome 1) + X.M(ValueNone) + X.M(1) + X.M() + 0 + """ + source + |> asExe + |> withLangVersionPreview + |> withNoWarn 25 + |> compile + |> shouldSucceed + |> run + |> shouldSucceed + |> withOutputContainsAllInOrder ["Some ValueSome 1"; "Some ValueNone"; "Some 1"; "None"] + + [] + let ``Optional Struct Arguments wrap Option`` () = + let source = + FSharp """ +module Program +type X() = + static member M([] ?x) = + match x with + | ValueSome x -> printfn "VSome %A" x + | ValueNone -> printfn "VNone" + +[] +let main _ = + X.M(Some 1) + X.M(None) + X.M(1) + X.M() + 0 + """ + source + |> asExe + |> withLangVersionPreview + |> withNoWarn 25 + |> compile + |> shouldSucceed + |> run + |> shouldSucceed + |> withOutputContainsAllInOrder ["VSome Some 1"; "VSome None"; "VSome 1"; "VNone"] + + [] + let ``Optional Struct Arguments wrap ValueOption`` () = + let source = + FSharp """ +module Program +type X() = + static member M([] ?x) = + match x with + | ValueSome x -> printfn "VSome %A" x + | ValueNone -> printfn "VNone" + +[] +let main _ = + X.M(ValueSome 1) + X.M(ValueNone) + X.M(1) + X.M() + 0 + """ + source + |> asExe + |> withLangVersionPreview + |> withNoWarn 25 + |> compile + |> shouldSucceed + |> run + |> shouldSucceed + |> withOutputContainsAllInOrder ["VSome ValueSome 1"; "VSome ValueNone"; "VSome 1"; "VNone"] + + + [] + let ``Optional Arguments can be a ValueOption+StructAttribute attribute with langversion=preview`` () = + let source = + FSharp """ +module Program +type X() = + static member M([] ?x) = + match x with + | ValueSome x -> printfn "VSome %A" x + | ValueNone -> printfn "VNone" + +[] +let main _ = + X.M(ValueSome 1) + X.M(ValueNone) + X.M(1) + X.M() + 0 + """ + let compilation = + source + |> withLangVersionPreview + |> asExe + |> compile + + compilation + |> shouldSucceed + |> run + |> shouldSucceed + |> withOutputContainsAllInOrder ["VSome ValueSome 1"; "VSome ValueNone"; "VSome 1"; "VNone"] + |> verifyIL [""" +.method public static void M(valuetype [FSharp.Core]Microsoft.FSharp.Core.FSharpValueOption`1 x) cil managed +{ + .param [1] + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.OptionalArgumentAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.StructAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 4 + .locals init (!!a V_0, + class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4,class [runtime]System.IO.TextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit> V_1, + class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4 V_2) + IL_0000: ldarga.s x + IL_0002: call instance int32 valuetype [FSharp.Core]Microsoft.FSharp.Core.FSharpValueOption`1::get_Tag() + IL_0007: ldc.i4.0 + IL_0008: bne.un.s IL_000c + + IL_000a: br.s IL_0032 + + IL_000c: ldarga.s x + IL_000e: call instance !0 valuetype [FSharp.Core]Microsoft.FSharp.Core.FSharpValueOption`1::get_Item() + IL_0013: stloc.0 + IL_0014: ldstr "VSome %A" + IL_0019: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5,class [runtime]System.IO.TextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit,!!a>::.ctor(string) + IL_001e: stloc.1 + IL_001f: call class [netstandard]System.IO.TextWriter [netstandard]System.Console::get_Out() + IL_0024: ldloc.1 + IL_0025: call !!0 [FSharp.Core]Microsoft.FSharp.Core.PrintfModule::PrintFormatLineToTextWriter>(class [runtime]System.IO.TextWriter, + class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_002a: ldloc.0 + IL_002b: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_0030: pop + IL_0031: ret + + IL_0032: ldstr "VNone" + IL_0037: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_003c: stloc.2 + IL_003d: call class [netstandard]System.IO.TextWriter [netstandard]System.Console::get_Out() + IL_0042: ldloc.2 + IL_0043: call !!0 [FSharp.Core]Microsoft.FSharp.Core.PrintfModule::PrintFormatLineToTextWriter(class [runtime]System.IO.TextWriter, + class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_0048: pop + IL_0049: ret +} + """] + + + [] + let ``Optional Arguments can be a ValueOption+Struct attribute with langversion=preview`` () = + let source = + FSharp """ +module Program +type X() = + static member M([] ?x) = + match x with + | ValueSome x -> printfn "VSome %A" x + | ValueNone -> printfn "VNone" + +[] +let main _ = + X.M(ValueSome 1) + X.M(ValueNone) + X.M(1) + X.M() + 0 + """ + let compilation = + source + |> withLangVersionPreview + |> asExe + |> compile + + compilation + |> shouldSucceed + |> run + |> shouldSucceed + |> withOutputContainsAllInOrder ["VSome ValueSome 1"; "VSome ValueNone"; "VSome 1"; "VNone"] + |> verifyIL [""" +.method public static void M(valuetype [FSharp.Core]Microsoft.FSharp.Core.FSharpValueOption`1 x) cil managed +{ + .param [1] + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.OptionalArgumentAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.StructAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 4 + .locals init (!!a V_0, + class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4,class [runtime]System.IO.TextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit> V_1, + class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4 V_2) + IL_0000: ldarga.s x + IL_0002: call instance int32 valuetype [FSharp.Core]Microsoft.FSharp.Core.FSharpValueOption`1::get_Tag() + IL_0007: ldc.i4.0 + IL_0008: bne.un.s IL_000c + + IL_000a: br.s IL_0032 + + IL_000c: ldarga.s x + IL_000e: call instance !0 valuetype [FSharp.Core]Microsoft.FSharp.Core.FSharpValueOption`1::get_Item() + IL_0013: stloc.0 + IL_0014: ldstr "VSome %A" + IL_0019: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5,class [runtime]System.IO.TextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit,!!a>::.ctor(string) + IL_001e: stloc.1 + IL_001f: call class [netstandard]System.IO.TextWriter [netstandard]System.Console::get_Out() + IL_0024: ldloc.1 + IL_0025: call !!0 [FSharp.Core]Microsoft.FSharp.Core.PrintfModule::PrintFormatLineToTextWriter>(class [runtime]System.IO.TextWriter, + class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_002a: ldloc.0 + IL_002b: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_0030: pop + IL_0031: ret + + IL_0032: ldstr "VNone" + IL_0037: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_003c: stloc.2 + IL_003d: call class [netstandard]System.IO.TextWriter [netstandard]System.Console::get_Out() + IL_0042: ldloc.2 + IL_0043: call !!0 [FSharp.Core]Microsoft.FSharp.Core.PrintfModule::PrintFormatLineToTextWriter(class [runtime]System.IO.TextWriter, + class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_0048: pop + IL_0049: ret +} + """] + + [] + let ``Optional Arguments in constructor wrap Option`` () = + let source = + FSharp """ +module Program +type X<'T>(?x: 'T) = + member _.M() = + match x with + | Some x -> printfn "Some %A" x + | None -> printfn "None" + +[] +let main _ = + X(Some 1).M() + X(None).M() + X(1).M() + X().M() + 0 + """ + let compilation = + source + |> withLangVersionPreview + |> asExe + |> compile + + compilation + |> shouldSucceed + |> run + |> shouldSucceed + |> withOutputContainsAllInOrder ["Some Some 1"; "Some None"; "Some 1"; "None"] + + [] + let ``Optional Arguments in constructor wrap ValueOption`` () = + let source = + FSharp """ +module Program +type X<'T>(?x: 'T) = + member _.M() = + match x with + | Some x -> printfn "Some %A" x + | None -> printfn "None" + +[] +let main _ = + X(ValueSome 1).M() + X(ValueNone).M() + X(1).M() + X().M() + 0 + """ + let compilation = + source + |> withLangVersionPreview + |> asExe + |> compile + + compilation + |> shouldSucceed + |> run + |> shouldSucceed + |> withOutputContainsAllInOrder ["Some ValueSome 1"; "Some ValueNone"; "Some 1"; "None"] + + [] + let ``Optional Struct Arguments in constructor wrap Option`` () = + let source = + FSharp """ +module Program +type X<'T>([] ?x: 'T) = + member _.M() = + match x with + | ValueSome x -> printfn "VSome %A" x + | ValueNone -> printfn "VNone" + +[] +let main _ = + X(Some 1).M() + X(None).M() + X(1).M() + X().M() + 0 + """ + let compilation = + source + |> withLangVersionPreview + |> asExe + |> compile + + compilation + |> shouldSucceed + |> run + |> shouldSucceed + |> withOutputContainsAllInOrder ["VSome Some 1"; "VSome None"; "VSome 1"; "VNone"] + + [] + let ``Optional Struct Arguments in constructor wrap ValueOption`` () = + let source = + FSharp """ +module Program +type X<'T>([] ?x: 'T) = + member _.M() = + match x with + | ValueSome x -> printfn "VSome %A" x + | ValueNone -> printfn "VNone" + +[] +let main _ = + X(ValueSome 1).M() + X(ValueNone).M() + X(1).M() + X().M() + 0 + """ + let compilation = + source + |> withLangVersionPreview + |> asExe + |> compile + + compilation + |> shouldSucceed + |> run + |> shouldSucceed + |> withOutputContainsAllInOrder ["VSome ValueSome 1"; "VSome ValueNone"; "VSome 1"; "VNone"] + + [] + let ``Optional Arguments in constructor can be a ValueOption+StructAttribute attribute with langversion=preview`` () = + let source = + FSharp """ +module Program +type X<'T>([] ?x: 'T) = + member _.M() = + match x with + | ValueSome x -> printfn "VSome %A" x + | ValueNone -> printfn "VNone" + +[] +let main _ = + X(ValueSome 1).M() + X(ValueNone).M() + X(1).M() + X().M() + 0 + """ + let compilation = + source + |> withLangVersionPreview + |> asExe + |> compile + + compilation + |> shouldSucceed + |> run + |> shouldSucceed + |> withOutputContainsAllInOrder ["VSome ValueSome 1"; "VSome ValueNone"; "VSome 1"; "VNone"] + + [] + let ``Optional Arguments in constructor can't be a ValueOption+StructAttribute attribute with langversion=90`` () = + let source = + FSharp """ +module Program +type X<'T>([] ?x: 'T) = + member _.M() = + match x with + | ValueSome x -> printfn "VSome %A" x + | ValueNone -> printfn "VNone" + +[] +let main _ = + X(ValueSome 1).M() + X(ValueNone).M() + X(1).M() + X().M() + 0 + """ + let compilation = + source + |> withLangVersion90 + |> withNoWarn 25 + |> asLibrary + |> compile + + compilation + |> shouldFail + |> withDiagnostics [ + Error 1, Line 6, Col 11, Line 6, Col 22, "This expression was expected to have type + ''T option' +but here has type + ''a voption' " + Error 1, Line 7, Col 11, Line 7, Col 20, "This expression was expected to have type + ''T option' +but here has type + ''a voption' " + ] \ No newline at end of file diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/TypeAbbreviations/WarnForAttributeAlias.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/TypeAbbreviations/WarnForAttributeAlias.fs new file mode 100644 index 00000000000..2edc2107284 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/TypeAbbreviations/WarnForAttributeAlias.fs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. + +namespace Conformance.BasicGrammarElements + +open Xunit +open FSharp.Test.Compiler + +module WarnForAttributeAlias = + [] + let ``Warn user when aliasing FSharp_Core_AutoOpenAttribute`` () = + Fsx """ +type ByItsOwnNatureUnBottledAttribute = Microsoft.FSharp.Core.AutoOpenAttribute + +[] +module Foo = + let bar = 0 +""" + |> withLangVersion80 + |> compile + |> shouldFail + |> withDiagnostics [ + (Warning 3561, Line 2, Col 6, Line 2, Col 38, "Microsoft.FSharp.Core.AutoOpenAttribute should not be aliased."); + ] + + [] + let ``Warn user when aliasing FSharp_Core_StructAttribute`` () = + Fsx """ +type ByItsOwnNatureUnBottledAttribute = StructAttribute + +[] +module Foo = + let bar = 0 +""" + |> withLangVersion80 + |> compile + |> shouldFail + |> withDiagnostics [ + (Warning 3561, Line 2, Col 6, Line 2, Col 38, "Microsoft.FSharp.Core.StructAttribute should not be aliased."); + ] diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/TypeAbbreviations/WarnForAutoOpenAttributeAlias.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/TypeAbbreviations/WarnForAutoOpenAttributeAlias.fs deleted file mode 100644 index b1d60d36842..00000000000 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/TypeAbbreviations/WarnForAutoOpenAttributeAlias.fs +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. - -namespace Conformance.BasicGrammarElements - -open Xunit -open FSharp.Test.Compiler - -module WarnForAutoOpenAttributeAlias = - [] - let ``Warn user when aliasing FSharp_Core_AutoOpenAttribute`` () = - Fsx """ -type ByItsOwnNatureUnBottledAttribute = Microsoft.FSharp.Core.AutoOpenAttribute - -[] -module Foo = - let bar = 0 -""" - |> withLangVersion80 - |> compile - |> shouldFail - |> withDiagnostics [ - (Warning 3561, Line 2, Col 6, Line 2, Col 38, "FSharp.Core.AutoOpenAttribute should not be aliased."); - ] diff --git a/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj b/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj index e8f044ed2f4..3ff3f070dc0 100644 --- a/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj +++ b/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj @@ -73,7 +73,7 @@ - + From 00647fbfc681ecd73e3e76035bde309ee521f257 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Fri, 20 Dec 2024 11:33:23 +0100 Subject: [PATCH 09/19] Update dependencies from https://github.com/dotnet/source-build-reference-packages build 20241219.1 (#18167) Microsoft.SourceBuild.Intermediate.source-build-reference-packages From Version 9.0.0-alpha.1.24604.1 -> To Version 9.0.0-alpha.1.24619.1 Co-authored-by: dotnet-maestro[bot] --- eng/Version.Details.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 3e30f878be3..394b3a663cf 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -1,9 +1,9 @@ - + https://github.com/dotnet/source-build-reference-packages - c81acaa80719d0ecfadfe41e3c0e3548bdc4e78d + e2b1d16fd66540b3a5813ec0ac1fd166688c3e0a From 2c3bdcb3b6b9038acd76ecae5f4721614e71ea23 Mon Sep 17 00:00:00 2001 From: Matt Thalman Date: Fri, 20 Dec 2024 06:04:23 -0600 Subject: [PATCH 10/19] Upgrade some runtime packages (#18166) --- eng/Versions.props | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/Versions.props b/eng/Versions.props index cd72f859965..1f711df8fe4 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -76,15 +76,15 @@ 8.0.0 - 4.5.1 + 4.6.0 $(SystemPackageVersionVersion) $(SystemPackageVersionVersion) $(SystemPackageVersionVersion) $(SystemPackageVersionVersion) - 4.5.5 + 4.6.0 4.7.0 $(SystemPackageVersionVersion) - 6.0.0 + 6.1.0 $(SystemPackageVersionVersion) 4.5.0 1.6.0 From 1d520c57d54f3ff9ee28392d0fcadd0e1174540a Mon Sep 17 00:00:00 2001 From: Jakub Majocha <1760221+majocha@users.noreply.github.com> Date: Tue, 31 Dec 2024 15:09:24 +0100 Subject: [PATCH 11/19] deparallelize net9.0 in ci (#18169) --- eng/Build.ps1 | 2 +- eng/build.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/eng/Build.ps1 b/eng/Build.ps1 index feaf768f4f2..32dcca19336 100644 --- a/eng/Build.ps1 +++ b/eng/Build.ps1 @@ -609,7 +609,7 @@ try { } if ($testCoreClr) { - $cpuLimit = if ($ci) { "-m:2 -- xUnit.MaxParallelThreads=0.25x" } else { "" } + $cpuLimit = if ($ci) { "-m:1 -- xUnit.MaxParallelThreads=1" } else { "" } TestUsingMSBuild -testProject "$RepoRoot\FSharp.sln" -targetFramework $script:coreclrTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.ComponentTests\" -settings $cpuLimit } diff --git a/eng/build.sh b/eng/build.sh index 43016b9b621..1263445973f 100755 --- a/eng/build.sh +++ b/eng/build.sh @@ -220,7 +220,7 @@ function Test() { projectname="${projectname%.*}" testlogpath="$artifacts_dir/TestResults/$configuration/${projectname}_$targetframework.xml" args="test \"$testproject\" --no-restore --no-build -c $configuration -f $targetframework --test-adapter-path . --logger \"xunit;LogFilePath=$testlogpath\" --blame-hang-timeout 5minutes --results-directory $artifacts_dir/TestResults/$configuration -p:vstestusemsbuildoutput=false" - args+=" -- xUnit.MaxParallelThreads=2" + args+=" -- xUnit.MaxParallelThreads=1" "$DOTNET_INSTALL_DIR/dotnet" $args || exit $? } From 44fda9287217597446d8426f615b7fd2be0580b4 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Wed, 1 Jan 2025 22:52:10 -0800 Subject: [PATCH 12/19] Update dependencies from https://github.com/dotnet/arcade build 20241223.3 (#18193) Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 9.0.0-beta.24572.2 -> To Version 9.0.0-beta.24623.3 Co-authored-by: dotnet-maestro[bot] --- eng/Version.Details.xml | 8 ++-- eng/common/cross/toolchain.cmake | 67 +++++++++++++++----------------- eng/common/tools.ps1 | 2 +- eng/common/tools.sh | 2 +- global.json | 2 +- 5 files changed, 38 insertions(+), 43 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 394b3a663cf..5aee1113c4f 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -42,14 +42,14 @@ - + https://github.com/dotnet/arcade - b41381d5cd633471265e9cd72e933a7048e03062 + e0e05154656254a735ebf19ffa5a37a8b915039b - + https://github.com/dotnet/arcade - b41381d5cd633471265e9cd72e933a7048e03062 + e0e05154656254a735ebf19ffa5a37a8b915039b diff --git a/eng/common/cross/toolchain.cmake b/eng/common/cross/toolchain.cmake index 9a4e285a5ae..9a7ecfbd42c 100644 --- a/eng/common/cross/toolchain.cmake +++ b/eng/common/cross/toolchain.cmake @@ -40,7 +40,7 @@ if(TARGET_ARCH_NAME STREQUAL "arm") set(TOOLCHAIN "arm-linux-gnueabihf") endif() if(TIZEN) - set(TIZEN_TOOLCHAIN "armv7hl-tizen-linux-gnueabihf/9.2.0") + set(TIZEN_TOOLCHAIN "armv7hl-tizen-linux-gnueabihf") endif() elseif(TARGET_ARCH_NAME STREQUAL "arm64") set(CMAKE_SYSTEM_PROCESSOR aarch64) @@ -49,7 +49,7 @@ elseif(TARGET_ARCH_NAME STREQUAL "arm64") elseif(LINUX) set(TOOLCHAIN "aarch64-linux-gnu") if(TIZEN) - set(TIZEN_TOOLCHAIN "aarch64-tizen-linux-gnu/9.2.0") + set(TIZEN_TOOLCHAIN "aarch64-tizen-linux-gnu") endif() elseif(FREEBSD) set(triple "aarch64-unknown-freebsd12") @@ -58,7 +58,7 @@ elseif(TARGET_ARCH_NAME STREQUAL "armel") set(CMAKE_SYSTEM_PROCESSOR armv7l) set(TOOLCHAIN "arm-linux-gnueabi") if(TIZEN) - set(TIZEN_TOOLCHAIN "armv7l-tizen-linux-gnueabi/9.2.0") + set(TIZEN_TOOLCHAIN "armv7l-tizen-linux-gnueabi") endif() elseif(TARGET_ARCH_NAME STREQUAL "armv6") set(CMAKE_SYSTEM_PROCESSOR armv6l) @@ -81,7 +81,7 @@ elseif(TARGET_ARCH_NAME STREQUAL "riscv64") else() set(TOOLCHAIN "riscv64-linux-gnu") if(TIZEN) - set(TIZEN_TOOLCHAIN "riscv64-tizen-linux-gnu/13.1.0") + set(TIZEN_TOOLCHAIN "riscv64-tizen-linux-gnu") endif() endif() elseif(TARGET_ARCH_NAME STREQUAL "s390x") @@ -98,7 +98,7 @@ elseif(TARGET_ARCH_NAME STREQUAL "x64") elseif(LINUX) set(TOOLCHAIN "x86_64-linux-gnu") if(TIZEN) - set(TIZEN_TOOLCHAIN "x86_64-tizen-linux-gnu/9.2.0") + set(TIZEN_TOOLCHAIN "x86_64-tizen-linux-gnu") endif() elseif(FREEBSD) set(triple "x86_64-unknown-freebsd12") @@ -115,7 +115,7 @@ elseif(TARGET_ARCH_NAME STREQUAL "x86") set(TOOLCHAIN "i686-linux-gnu") endif() if(TIZEN) - set(TIZEN_TOOLCHAIN "i586-tizen-linux-gnu/9.2.0") + set(TIZEN_TOOLCHAIN "i586-tizen-linux-gnu") endif() else() message(FATAL_ERROR "Arch is ${TARGET_ARCH_NAME}. Only arm, arm64, armel, armv6, ppc64le, riscv64, s390x, x64 and x86 are supported!") @@ -127,30 +127,25 @@ endif() # Specify include paths if(TIZEN) - if(TARGET_ARCH_NAME STREQUAL "arm") - include_directories(SYSTEM ${CROSS_ROOTFS}/usr/lib/gcc/${TIZEN_TOOLCHAIN}/include/c++/) - include_directories(SYSTEM ${CROSS_ROOTFS}/usr/lib/gcc/${TIZEN_TOOLCHAIN}/include/c++/armv7hl-tizen-linux-gnueabihf) - endif() - if(TARGET_ARCH_NAME STREQUAL "armel") - include_directories(SYSTEM ${CROSS_ROOTFS}/usr/lib/gcc/${TIZEN_TOOLCHAIN}/include/c++/) - include_directories(SYSTEM ${CROSS_ROOTFS}/usr/lib/gcc/${TIZEN_TOOLCHAIN}/include/c++/armv7l-tizen-linux-gnueabi) - endif() - if(TARGET_ARCH_NAME STREQUAL "arm64") - include_directories(SYSTEM ${CROSS_ROOTFS}/usr/lib64/gcc/${TIZEN_TOOLCHAIN}/include/c++/) - include_directories(SYSTEM ${CROSS_ROOTFS}/usr/lib64/gcc/${TIZEN_TOOLCHAIN}/include/c++/aarch64-tizen-linux-gnu) - endif() - if(TARGET_ARCH_NAME STREQUAL "x86") - include_directories(SYSTEM ${CROSS_ROOTFS}/usr/lib/gcc/${TIZEN_TOOLCHAIN}/include/c++/) - include_directories(SYSTEM ${CROSS_ROOTFS}/usr/lib/gcc/${TIZEN_TOOLCHAIN}/include/c++/i586-tizen-linux-gnu) - endif() - if(TARGET_ARCH_NAME STREQUAL "x64") - include_directories(SYSTEM ${CROSS_ROOTFS}/usr/lib64/gcc/${TIZEN_TOOLCHAIN}/include/c++/) - include_directories(SYSTEM ${CROSS_ROOTFS}/usr/lib64/gcc/${TIZEN_TOOLCHAIN}/include/c++/x86_64-tizen-linux-gnu) - endif() - if(TARGET_ARCH_NAME STREQUAL "riscv64") - include_directories(SYSTEM ${CROSS_ROOTFS}/usr/lib64/gcc/${TIZEN_TOOLCHAIN}/include/c++/) - include_directories(SYSTEM ${CROSS_ROOTFS}/usr/lib64/gcc/${TIZEN_TOOLCHAIN}/include/c++/riscv64-tizen-linux-gnu) + function(find_toolchain_dir prefix) + # Dynamically find the version subdirectory + file(GLOB DIRECTORIES "${prefix}/*") + list(GET DIRECTORIES 0 FIRST_MATCH) + get_filename_component(TOOLCHAIN_VERSION ${FIRST_MATCH} NAME) + + set(TIZEN_TOOLCHAIN_PATH "${prefix}/${TOOLCHAIN_VERSION}" PARENT_SCOPE) + endfunction() + + if(TARGET_ARCH_NAME MATCHES "^(arm|armel|x86)$") + find_toolchain_dir("${CROSS_ROOTFS}/usr/lib/gcc/${TIZEN_TOOLCHAIN}") + else() + find_toolchain_dir("${CROSS_ROOTFS}/usr/lib64/gcc/${TIZEN_TOOLCHAIN}") endif() + + message(STATUS "TIZEN_TOOLCHAIN_PATH set to: ${TIZEN_TOOLCHAIN_PATH}") + + include_directories(SYSTEM ${TIZEN_TOOLCHAIN_PATH}/include/c++) + include_directories(SYSTEM ${TIZEN_TOOLCHAIN_PATH}/include/c++/${TIZEN_TOOLCHAIN}) endif() if(ANDROID) @@ -272,21 +267,21 @@ endif() if(TARGET_ARCH_NAME MATCHES "^(arm|armel)$") if(TIZEN) - add_toolchain_linker_flag("-B${CROSS_ROOTFS}/usr/lib/gcc/${TIZEN_TOOLCHAIN}") + add_toolchain_linker_flag("-B${TIZEN_TOOLCHAIN_PATH}") add_toolchain_linker_flag("-L${CROSS_ROOTFS}/lib") add_toolchain_linker_flag("-L${CROSS_ROOTFS}/usr/lib") - add_toolchain_linker_flag("-L${CROSS_ROOTFS}/usr/lib/gcc/${TIZEN_TOOLCHAIN}") + add_toolchain_linker_flag("-L${TIZEN_TOOLCHAIN_PATH}") endif() elseif(TARGET_ARCH_NAME MATCHES "^(arm64|x64|riscv64)$") if(TIZEN) - add_toolchain_linker_flag("-B${CROSS_ROOTFS}/usr/lib64/gcc/${TIZEN_TOOLCHAIN}") + add_toolchain_linker_flag("-B${TIZEN_TOOLCHAIN_PATH}") add_toolchain_linker_flag("-L${CROSS_ROOTFS}/lib64") add_toolchain_linker_flag("-L${CROSS_ROOTFS}/usr/lib64") - add_toolchain_linker_flag("-L${CROSS_ROOTFS}/usr/lib64/gcc/${TIZEN_TOOLCHAIN}") + add_toolchain_linker_flag("-L${TIZEN_TOOLCHAIN_PATH}") add_toolchain_linker_flag("-Wl,--rpath-link=${CROSS_ROOTFS}/lib64") add_toolchain_linker_flag("-Wl,--rpath-link=${CROSS_ROOTFS}/usr/lib64") - add_toolchain_linker_flag("-Wl,--rpath-link=${CROSS_ROOTFS}/usr/lib64/gcc/${TIZEN_TOOLCHAIN}") + add_toolchain_linker_flag("-Wl,--rpath-link=${TIZEN_TOOLCHAIN_PATH}") endif() elseif(TARGET_ARCH_NAME STREQUAL "s390x") add_toolchain_linker_flag("--target=${TOOLCHAIN}") @@ -297,10 +292,10 @@ elseif(TARGET_ARCH_NAME STREQUAL "x86") endif() add_toolchain_linker_flag(-m32) if(TIZEN) - add_toolchain_linker_flag("-B${CROSS_ROOTFS}/usr/lib/gcc/${TIZEN_TOOLCHAIN}") + add_toolchain_linker_flag("-B${TIZEN_TOOLCHAIN_PATH}") add_toolchain_linker_flag("-L${CROSS_ROOTFS}/lib") add_toolchain_linker_flag("-L${CROSS_ROOTFS}/usr/lib") - add_toolchain_linker_flag("-L${CROSS_ROOTFS}/usr/lib/gcc/${TIZEN_TOOLCHAIN}") + add_toolchain_linker_flag("-L${TIZEN_TOOLCHAIN_PATH}") endif() elseif(ILLUMOS) add_toolchain_linker_flag("-L${CROSS_ROOTFS}/lib/amd64") diff --git a/eng/common/tools.ps1 b/eng/common/tools.ps1 index aa94fb17459..a46b6deb759 100644 --- a/eng/common/tools.ps1 +++ b/eng/common/tools.ps1 @@ -320,7 +320,7 @@ function InstallDotNet([string] $dotnetRoot, $variations += @($installParameters) $dotnetBuilds = $installParameters.Clone() - $dotnetbuilds.AzureFeed = "https://dotnetbuilds.azureedge.net/public" + $dotnetbuilds.AzureFeed = "https://ci.dot.net/public" $variations += @($dotnetBuilds) if ($runtimeSourceFeed) { diff --git a/eng/common/tools.sh b/eng/common/tools.sh index 00473c9f918..1159726a10f 100755 --- a/eng/common/tools.sh +++ b/eng/common/tools.sh @@ -232,7 +232,7 @@ function InstallDotNet { local public_location=("${installParameters[@]}") variations+=(public_location) - local dotnetbuilds=("${installParameters[@]}" --azure-feed "https://dotnetbuilds.azureedge.net/public") + local dotnetbuilds=("${installParameters[@]}" --azure-feed "https://ci.dot.net/public") variations+=(dotnetbuilds) if [[ -n "${6:-}" ]]; then diff --git a/global.json b/global.json index 9a3de25e397..23eae505b33 100644 --- a/global.json +++ b/global.json @@ -17,7 +17,7 @@ "perl": "5.38.2.2" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.24572.2", + "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.24623.3", "Microsoft.DotNet.Helix.Sdk": "8.0.0-beta.23255.2" } } From d4fe1aba2e436abd824e42e6771e3b7c73338368 Mon Sep 17 00:00:00 2001 From: Petr Pokorny Date: Thu, 2 Jan 2025 08:57:36 +0100 Subject: [PATCH 13/19] Update System.Memory package only for source build (#18188) Co-authored-by: Kevin Ransom (msft) --- eng/Versions.props | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/eng/Versions.props b/eng/Versions.props index 1f711df8fe4..7727e2eda17 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -81,7 +81,8 @@ $(SystemPackageVersionVersion) $(SystemPackageVersionVersion) $(SystemPackageVersionVersion) - 4.6.0 + 4.5.5 + 4.6.0 4.7.0 $(SystemPackageVersionVersion) 6.1.0 From b1659a129b4d18eee79ffa84f19238fb3087bca5 Mon Sep 17 00:00:00 2001 From: Jakub Majocha <1760221+majocha@users.noreply.github.com> Date: Thu, 2 Jan 2025 15:27:43 +0100 Subject: [PATCH 14/19] fix cancellation deadlock (#18178) --- src/Compiler/Facilities/BuildGraph.fs | 67 +++++++++------------------ 1 file changed, 21 insertions(+), 46 deletions(-) diff --git a/src/Compiler/Facilities/BuildGraph.fs b/src/Compiler/Facilities/BuildGraph.fs index d390c340b57..db77f52ea10 100644 --- a/src/Compiler/Facilities/BuildGraph.fs +++ b/src/Compiler/Facilities/BuildGraph.fs @@ -3,7 +3,6 @@ module FSharp.Compiler.BuildGraph open System.Threading -open System.Threading.Tasks open System.Globalization [] @@ -40,55 +39,31 @@ type GraphNode<'T> private (computation: Async<'T>, cachedResult: ValueOption<'T cachedResultNode else async { + let! ct = Async.CancellationToken Interlocked.Increment(&requestCount) |> ignore + let enter = semaphore.WaitAsync(ct) try - let! ct = Async.CancellationToken - - // We must set 'taken' before any implicit cancellation checks - // occur, making sure we are under the protection of the 'try'. - // For example, NodeCode's 'try/finally' (TryFinally) uses async.TryFinally which does - // implicit cancellation checks even before the try is entered, as do the - // de-sugaring of 'do!' and other NodeCode constructs. - let mutable taken = false - - try - do! - semaphore - .WaitAsync(ct) - .ContinueWith( - (fun _ -> taken <- true), - (TaskContinuationOptions.NotOnCanceled - ||| TaskContinuationOptions.NotOnFaulted - ||| TaskContinuationOptions.ExecuteSynchronously) - ) - |> Async.AwaitTask - - match cachedResult with - | ValueSome value -> return value - | _ -> - let tcs = TaskCompletionSource<'T>() - - Async.StartWithContinuations( - async { - Thread.CurrentThread.CurrentUICulture <- GraphNode.culture - return! computation - }, - (fun res -> - cachedResult <- ValueSome res - cachedResultNode <- async.Return res - computation <- Unchecked.defaultof<_> - tcs.SetResult(res)), - (fun ex -> tcs.SetException(ex)), - (fun _ -> tcs.SetCanceled()), - ct - ) - - return! tcs.Task |> Async.AwaitTask - finally - if taken then - semaphore.Release() |> ignore + do! enter |> Async.AwaitTask + + match cachedResult with + | ValueSome value -> return value + | _ -> + Thread.CurrentThread.CurrentUICulture <- GraphNode.culture + let! result = computation + cachedResult <- ValueSome result + cachedResultNode <- async.Return result + computation <- Unchecked.defaultof<_> + return result finally + // At this point, the semaphore awaiter is either already completed or about to get canceled. + // If calling Wait() does not throw an exception it means the semaphore was successfully taken and needs to be released. + try + enter.Wait() + semaphore.Release() |> ignore + with _ -> + () + Interlocked.Decrement(&requestCount) |> ignore } From 749853e179ad3d10a2c10b95fc2c0631422f3037 Mon Sep 17 00:00:00 2001 From: Eugene Auduchinok Date: Thu, 2 Jan 2025 15:48:07 +0100 Subject: [PATCH 15/19] Cancellable: add safer APIs to check the token (#18175) --- docs/release-notes/.FSharp.Compiler.Service/9.0.200.md | 1 + src/Compiler/Utilities/Cancellable.fs | 7 +++++++ src/Compiler/Utilities/Cancellable.fsi | 4 ++++ ...rp.Compiler.Service.SurfaceArea.netstandard20.debug.bsl | 3 +++ ....Compiler.Service.SurfaceArea.netstandard20.release.bsl | 3 +++ 5 files changed, 18 insertions(+) diff --git a/docs/release-notes/.FSharp.Compiler.Service/9.0.200.md b/docs/release-notes/.FSharp.Compiler.Service/9.0.200.md index 740c18edcbc..3faf69c220d 100644 --- a/docs/release-notes/.FSharp.Compiler.Service/9.0.200.md +++ b/docs/release-notes/.FSharp.Compiler.Service/9.0.200.md @@ -32,6 +32,7 @@ * Sink: report SynPat.ArrayOrList type ([PR #18127](https://github.com/dotnet/fsharp/pull/18127)) * Show the default value of compiler options ([PR #18054](https://github.com/dotnet/fsharp/pull/18054)) * Support ValueOption + Struct attribute as optional parameter for methods ([Language suggestion #1136](https://github.com/fsharp/fslang-suggestions/issues/1136), [PR #18098](https://github.com/dotnet/fsharp/pull/18098)) +* Cancellable: add safer APIs to check the token ([PR #18175](https://github.com/dotnet/fsharp/pull/18175)) ### Changed diff --git a/src/Compiler/Utilities/Cancellable.fs b/src/Compiler/Utilities/Cancellable.fs index b3531c74890..8f14b5ddbfe 100644 --- a/src/Compiler/Utilities/Cancellable.fs +++ b/src/Compiler/Utilities/Cancellable.fs @@ -14,6 +14,8 @@ type Cancellable = tokenHolder.Value |> ValueOption.defaultWith (fun () -> if guard then failwith msg else CancellationToken.None) + static member HasCancellationToken = tokenHolder.Value.IsSome + static member Token = ensureToken "Token not available outside of Cancellable computation." static member UsingToken(ct) = @@ -28,6 +30,11 @@ type Cancellable = let token = ensureToken "CheckAndThrow invoked outside of Cancellable computation." token.ThrowIfCancellationRequested() + static member TryCheckAndThrow() = + match tokenHolder.Value with + | ValueNone -> () + | ValueSome token -> token.ThrowIfCancellationRequested() + namespace Internal.Utilities.Library open System diff --git a/src/Compiler/Utilities/Cancellable.fsi b/src/Compiler/Utilities/Cancellable.fsi index 32d1d6e0a04..c5a8d9627ea 100644 --- a/src/Compiler/Utilities/Cancellable.fsi +++ b/src/Compiler/Utilities/Cancellable.fsi @@ -7,8 +7,12 @@ open System.Threading type Cancellable = /// For use in testing only. Cancellable.token should be set only by the cancellable computation. static member internal UsingToken: CancellationToken -> IDisposable + + static member HasCancellationToken: bool static member Token: CancellationToken + static member CheckAndThrow: unit -> unit + static member TryCheckAndThrow: unit -> unit namespace Internal.Utilities.Library diff --git a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.debug.bsl b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.debug.bsl index c3b65b8e378..db4105530c8 100644 --- a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.debug.bsl +++ b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.debug.bsl @@ -2011,9 +2011,12 @@ FSharp.Compiler.AbstractIL.ILBinaryReader: FSharp.Compiler.AbstractIL.ILBinaryRe FSharp.Compiler.AbstractIL.ILBinaryReader: FSharp.Compiler.AbstractIL.ILBinaryReader+MetadataOnlyFlag FSharp.Compiler.AbstractIL.ILBinaryReader: FSharp.Compiler.AbstractIL.ILBinaryReader+ReduceMemoryFlag FSharp.Compiler.AbstractIL.ILBinaryReader: FSharp.Compiler.AbstractIL.ILBinaryReader+Shim +FSharp.Compiler.Cancellable: Boolean HasCancellationToken +FSharp.Compiler.Cancellable: Boolean get_HasCancellationToken() FSharp.Compiler.Cancellable: System.Threading.CancellationToken Token FSharp.Compiler.Cancellable: System.Threading.CancellationToken get_Token() FSharp.Compiler.Cancellable: Void CheckAndThrow() +FSharp.Compiler.Cancellable: Void TryCheckAndThrow() FSharp.Compiler.CodeAnalysis.DelayedILModuleReader: System.String OutputFile FSharp.Compiler.CodeAnalysis.DelayedILModuleReader: System.String get_OutputFile() FSharp.Compiler.CodeAnalysis.DelayedILModuleReader: Void .ctor(System.String, Microsoft.FSharp.Core.FSharpFunc`2[System.Threading.CancellationToken,Microsoft.FSharp.Core.FSharpOption`1[System.IO.Stream]]) diff --git a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.release.bsl b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.release.bsl index c3b65b8e378..db4105530c8 100644 --- a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.release.bsl +++ b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.release.bsl @@ -2011,9 +2011,12 @@ FSharp.Compiler.AbstractIL.ILBinaryReader: FSharp.Compiler.AbstractIL.ILBinaryRe FSharp.Compiler.AbstractIL.ILBinaryReader: FSharp.Compiler.AbstractIL.ILBinaryReader+MetadataOnlyFlag FSharp.Compiler.AbstractIL.ILBinaryReader: FSharp.Compiler.AbstractIL.ILBinaryReader+ReduceMemoryFlag FSharp.Compiler.AbstractIL.ILBinaryReader: FSharp.Compiler.AbstractIL.ILBinaryReader+Shim +FSharp.Compiler.Cancellable: Boolean HasCancellationToken +FSharp.Compiler.Cancellable: Boolean get_HasCancellationToken() FSharp.Compiler.Cancellable: System.Threading.CancellationToken Token FSharp.Compiler.Cancellable: System.Threading.CancellationToken get_Token() FSharp.Compiler.Cancellable: Void CheckAndThrow() +FSharp.Compiler.Cancellable: Void TryCheckAndThrow() FSharp.Compiler.CodeAnalysis.DelayedILModuleReader: System.String OutputFile FSharp.Compiler.CodeAnalysis.DelayedILModuleReader: System.String get_OutputFile() FSharp.Compiler.CodeAnalysis.DelayedILModuleReader: Void .ctor(System.String, Microsoft.FSharp.Core.FSharpFunc`2[System.Threading.CancellationToken,Microsoft.FSharp.Core.FSharpOption`1[System.IO.Stream]]) From 4c6ed372ac779ffdd2ca2f9c726eea94ec6cfc98 Mon Sep 17 00:00:00 2001 From: Brian Rourke Boll Date: Mon, 6 Jan 2025 08:52:39 -0500 Subject: [PATCH 16/19] Wrap arg in parens when needed when adding `new` keyword (#18179) --- docs/release-notes/.VisualStudio/17.13.md | 1 + ...eywordToDisposableConstructorInvocation.fs | 103 ++++++++++++++-- ...dToDisposableConstructorInvocationTests.fs | 113 ++++++++++++++++++ 3 files changed, 209 insertions(+), 8 deletions(-) diff --git a/docs/release-notes/.VisualStudio/17.13.md b/docs/release-notes/.VisualStudio/17.13.md index dae07600e1b..3d773a92b2f 100644 --- a/docs/release-notes/.VisualStudio/17.13.md +++ b/docs/release-notes/.VisualStudio/17.13.md @@ -1,4 +1,5 @@ ### Fixed +* Wrap arg in parens when needed when adding `new` keyword. ([PR #18179](https://github.com/dotnet/fsharp/pull/18179)) ### Added * Code fix for adding missing `seq`. ([PR #17772](https://github.com/dotnet/fsharp/pull/17772)) diff --git a/vsintegration/src/FSharp.Editor/CodeFixes/AddNewKeywordToDisposableConstructorInvocation.fs b/vsintegration/src/FSharp.Editor/CodeFixes/AddNewKeywordToDisposableConstructorInvocation.fs index 188645d2d62..af0309b1810 100644 --- a/vsintegration/src/FSharp.Editor/CodeFixes/AddNewKeywordToDisposableConstructorInvocation.fs +++ b/vsintegration/src/FSharp.Editor/CodeFixes/AddNewKeywordToDisposableConstructorInvocation.fs @@ -5,6 +5,9 @@ namespace Microsoft.VisualStudio.FSharp.Editor open System.Composition open System.Collections.Immutable +open FSharp.Compiler.Syntax +open FSharp.Compiler.Text + open Microsoft.CodeAnalysis.Text open Microsoft.CodeAnalysis.CodeFixes @@ -24,11 +27,95 @@ type internal AddNewKeywordCodeFixProvider() = interface IFSharpCodeFixProvider with member _.GetCodeFixIfAppliesAsync context = - CancellableTask.singleton ( - ValueSome - { - Name = CodeFix.AddNewKeyword - Message = title - Changes = [ TextChange(TextSpan(context.Span.Start, 0), "new ") ] - } - ) + cancellableTask { + let! sourceText = context.GetSourceTextAsync() + let! parseFileResults = context.Document.GetFSharpParseResultsAsync(nameof AddNewKeywordCodeFixProvider) + + let getSourceLineStr line = + sourceText.Lines[Line.toZ line].ToString() + + let range = + RoslynHelpers.TextSpanToFSharpRange(context.Document.FilePath, context.Span, sourceText) + + // Constructor arg + // Qualified.Constructor arg + // Constructor arg + // Qualified.Constructor arg + let matchingApp path node = + let (|TargetTy|_|) expr = + match expr with + | SynExpr.Ident id -> Some(SynType.LongIdent(SynLongIdent([ id ], [], []))) + | SynExpr.LongIdent(longDotId = longDotId) -> Some(SynType.LongIdent longDotId) + | SynExpr.TypeApp(SynExpr.Ident id, lessRange, typeArgs, commaRanges, greaterRange, _, range) -> + Some( + SynType.App( + SynType.LongIdent(SynLongIdent([ id ], [], [])), + Some lessRange, + typeArgs, + commaRanges, + greaterRange, + false, + range + ) + ) + | SynExpr.TypeApp(SynExpr.LongIdent(longDotId = longDotId), lessRange, typeArgs, commaRanges, greaterRange, _, range) -> + Some( + SynType.App(SynType.LongIdent longDotId, Some lessRange, typeArgs, commaRanges, greaterRange, false, range) + ) + | _ -> None + + match node with + | SyntaxNode.SynExpr(SynExpr.App(funcExpr = TargetTy targetTy; argExpr = argExpr; range = m)) when + m |> Range.equals range + -> + Some(targetTy, argExpr, path) + | _ -> None + + match (range.Start, parseFileResults.ParseTree) ||> ParsedInput.tryPick matchingApp with + | None -> return ValueNone + | Some(targetTy, argExpr, path) -> + // Adding `new` may require additional parentheses: https://github.com/dotnet/fsharp/issues/15622 + let needsParens = + let newExpr = SynExpr.New(false, targetTy, argExpr, range) + + argExpr + |> SynExpr.shouldBeParenthesizedInContext getSourceLineStr (SyntaxNode.SynExpr newExpr :: path) + + let newText = + let targetTyText = + sourceText.ToString(RoslynHelpers.FSharpRangeToTextSpan(sourceText, targetTy.Range)) + + // Constructor namedArg → new Constructor(namedArg) + // Constructor "literal" → new Constructor "literal" + // Constructor () → new Constructor () + // Constructor() → new Constructor() + // Constructor → new Constructor + // ····indentedArg ····(indentedArg) + let textBetween = + let range = + Range.mkRange context.Document.FilePath targetTy.Range.End argExpr.Range.Start + + if needsParens && range.StartLine = range.EndLine then + "" + else + sourceText.ToString(RoslynHelpers.FSharpRangeToTextSpan(sourceText, range)) + + let argExprText = + let originalArgText = + sourceText.ToString(RoslynHelpers.FSharpRangeToTextSpan(sourceText, argExpr.Range)) + + if needsParens then + $"(%s{originalArgText})" + else + originalArgText + + $"new %s{targetTyText}%s{textBetween}%s{argExprText}" + + return + ValueSome + { + Name = CodeFix.AddNewKeyword + Message = title + Changes = [ TextChange(context.Span, newText) ] + } + } diff --git a/vsintegration/tests/FSharp.Editor.Tests/CodeFixes/AddNewKeywordToDisposableConstructorInvocationTests.fs b/vsintegration/tests/FSharp.Editor.Tests/CodeFixes/AddNewKeywordToDisposableConstructorInvocationTests.fs index 2709d139387..0fee7c9527b 100644 --- a/vsintegration/tests/FSharp.Editor.Tests/CodeFixes/AddNewKeywordToDisposableConstructorInvocationTests.fs +++ b/vsintegration/tests/FSharp.Editor.Tests/CodeFixes/AddNewKeywordToDisposableConstructorInvocationTests.fs @@ -29,3 +29,116 @@ let sr = new System.IO.StreamReader "test.txt" let actual = codeFix |> tryFix code Auto Assert.Equal(expected, actual) + +[] +let ``Fixes FS0760 — type app`` () = + let code = + """ +let _ = System.Threading.Tasks.Task(fun _ -> 3) +""" + + let expected = + Some + { + Message = "Add 'new' keyword" + FixedCode = + """ +let _ = new System.Threading.Tasks.Task(fun _ -> 3) +""" + } + + let actual = codeFix |> tryFix code Auto + + Assert.Equal(expected, actual) + +[] +let ``Fixes FS0760 — keeps space`` () = + let code = + """ +let stream = System.IO.MemoryStream () +""" + + let expected = + Some + { + Message = "Add 'new' keyword" + FixedCode = + """ +let stream = new System.IO.MemoryStream () +""" + } + + let actual = codeFix |> tryFix code Auto + + Assert.Equal(expected, actual) + +[] +let ``Fixes FS0760 — does not add space`` () = + let code = + """ +let stream = System.IO.MemoryStream() +""" + + let expected = + Some + { + Message = "Add 'new' keyword" + FixedCode = + """ +let stream = new System.IO.MemoryStream() +""" + } + + let actual = codeFix |> tryFix code Auto + + Assert.Equal(expected, actual) + +[] +let ``Fixes FS0760 — adds parentheses when needed`` () = + let code = + """ +let path = "test.txt" +let sr = System.IO.StreamReader path +""" + + let expected = + Some + { + Message = "Add 'new' keyword" + FixedCode = + """ +let path = "test.txt" +let sr = new System.IO.StreamReader(path) +""" + } + + let actual = codeFix |> tryFix code Auto + + Assert.Equal(expected, actual) + +[] +let ``Fixes FS0760 — adds parentheses when needed and keeps indentation`` () = + let code = + """ +let path = "test.txt" +let sr = + System.IO.StreamReader + path +""" + + let expected = + Some + { + Message = "Add 'new' keyword" + FixedCode = + """ +let path = "test.txt" +let sr = + new System.IO.StreamReader + (path) +""" + } + + let actual = codeFix |> tryFix code Auto + + Assert.Equal(expected, actual) From 2ece1645242ba4b6532080b43d9ca494989ab9f9 Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Mon, 6 Jan 2025 06:02:00 -0800 Subject: [PATCH 17/19] Cleanup scripts (#18192) --- .fantomasignore | 1 - scripts/Add-VisualStudioComponents.ps1 | 29 - scripts/Install-VisualFSharpNightly.ps1 | 43 - scripts/Uninstall-VisualFSharpNightly.ps1 | 17 - scripts/VerifyAllTranslations.fsx | 38 - scripts/diff-fsharp-repos.sh | 112 --- scripts/dotnet-install.ps1 | 503 ----------- scripts/dotnet-install.sh | 997 ---------------------- scripts/init-tools.cmd | 38 - scripts/init-tools.sh | 176 ---- scripts/install-dotnetcli.ps1 | 11 - scripts/verify-translations.cmd | 3 - 12 files changed, 1968 deletions(-) delete mode 100644 scripts/Add-VisualStudioComponents.ps1 delete mode 100644 scripts/Install-VisualFSharpNightly.ps1 delete mode 100644 scripts/Uninstall-VisualFSharpNightly.ps1 delete mode 100644 scripts/VerifyAllTranslations.fsx delete mode 100755 scripts/diff-fsharp-repos.sh delete mode 100644 scripts/dotnet-install.ps1 delete mode 100755 scripts/dotnet-install.sh delete mode 100644 scripts/init-tools.cmd delete mode 100644 scripts/init-tools.sh delete mode 100644 scripts/install-dotnetcli.ps1 delete mode 100644 scripts/verify-translations.cmd diff --git a/.fantomasignore b/.fantomasignore index 157526b39c0..b901c74bd99 100644 --- a/.fantomasignore +++ b/.fantomasignore @@ -4,7 +4,6 @@ buildtools/ docs/ eng/ fcs-samples/ -scripts/ setup/ tests/ vsintegration/* diff --git a/scripts/Add-VisualStudioComponents.ps1 b/scripts/Add-VisualStudioComponents.ps1 deleted file mode 100644 index 481041a0958..00000000000 --- a/scripts/Add-VisualStudioComponents.ps1 +++ /dev/null @@ -1,29 +0,0 @@ -# run this in PowerShell as Administrator -# it will launch Visual Studio Installer and prompt you to add -# all artifacts required to build Visual F# - -if (-not (Get-Module -ListAvailable -Name VSSetup)) { - Install-Module VSSetup -Scope CurrentUser -} -$vs = Get-VSSetupInstance - -& "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vs_installershell.exe" modify ` - --installPath $vs.InstallationPath ` - --add Microsoft.Net.Component.4.6.2.SDK ` - --add Microsoft.Net.Core.Component.SDK ` - --add Microsoft.Component.NetFX.Core.Runtime ` - --add Microsoft.VisualStudio.Component.FSharp ` - --add Microsoft.VisualStudio.Component.VC.ATL ` - --add Microsoft.VisualStudio.Component.VSSDK ` - --add Microsoft.Component.MSBuild ` - --add Microsoft.VisualStudio.Component.NuGet ` - --add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 ` - --add Microsoft.VisualStudio.Component.Windows10SDK.14393 ` - --add Microsoft.VisualStudio.Component.Windows81SDK ` - --add Microsoft.VisualStudio.Component.PortableLibrary ` - --add Microsoft.Net.Component.4.TargetingPack ` - --add Microsoft.Net.Component.4.5.TargetingPack ` - --add Microsoft.Net.Component.4.5.1.TargetingPack ` - --add Microsoft.Net.Component.4.6.TargetingPack ` - --add Microsoft.Net.Component.4.6.1.TargetingPack ` - --add Microsoft.Net.Component.4.6.2.TargetingPack ` diff --git a/scripts/Install-VisualFSharpNightly.ps1 b/scripts/Install-VisualFSharpNightly.ps1 deleted file mode 100644 index 4478671ddce..00000000000 --- a/scripts/Install-VisualFSharpNightly.ps1 +++ /dev/null @@ -1,43 +0,0 @@ -# installs a nightly VisualFSharp build -# the latest version is installed if not specified - -# https://blogs.msdn.microsoft.com/dotnet/2017/03/14/announcing-nightly-releases-for-the-visual-f-tools/ -# https://dotnet.myget.org/feed/fsharp/package/vsix/VisualFSharp - -# requires Visual Studio Setup PowerShell Module -# https://github.com/Microsoft/vssetup.powershell -# Install-Module VSSetup -Scope CurrentUser - -[CmdletBinding()] -param ( - [Parameter()] [string] $InstanceId, - [Parameter()] [string] $Version, - [switch] $Quiet -) - -$feed = 'https://dotnet.myget.org/F/fsharp/vsix' -$wc = New-Object Net.Webclient -if(-not $Version){ - $Version = ($wc.DownloadString($feed) -as [xml]).feed.entry.Vsix.Version -} -$file = 'VisualFSharp-' + $Version + '.vsix' -$tempfile = [IO.Path]::Combine([IO.Path]::GetTempPath(), $file) -$logFile = [IO.Path]::ChangeExtension($tempfile, '.txt') -$wc.DownloadFile($feed + '/' + $file, $tempfile) -$vs = Get-VSSetupInstance -[array]$argumentList = "/logFile:`"$logFile`"" -$argumentList += "/appidinstallpath:`"$($vs.InstallationPath)\Common7\IDE\devenv.exe`"" -$skuName = $vs.Product.Id.Replace("Microsoft.VisualStudio.Product.","") -$argumentList += "/skuName:$skuName" -$argumentList += "/skuVersion:`"$($vs.Product.Version)`"" -$argumentList += "/appidname:`"Microsoft $($vs.DisplayName)`"" -if(-not $InstanceId){ - $InstanceId = $vs.InstanceId -} -$argumentList += "/instanceIds:$InstanceId" -if($Quiet.IsPresent){ - $argumentList += "/quiet" -} -$argumentList += $tempfile -Start-Process (Join-Path $vs.InstallationPath 'Common7\IDE\VSIXInstaller.exe') -Wait -ArgumentList $argumentList -Remove-Item $tempfile \ No newline at end of file diff --git a/scripts/Uninstall-VisualFSharpNightly.ps1 b/scripts/Uninstall-VisualFSharpNightly.ps1 deleted file mode 100644 index 7478613a37e..00000000000 --- a/scripts/Uninstall-VisualFSharpNightly.ps1 +++ /dev/null @@ -1,17 +0,0 @@ -[CmdletBinding()] -param ( - [Parameter()] [string] $InstanceId, - [Parameter()] [string] $Version, - [switch] $Quiet -) - -$vs = Get-VSSetupInstance -[array]$argumentList = '/u:VisualFSharp' -if(-not $InstanceId){ - $InstanceId = $vs.InstanceId -} -$argumentList += "/instanceIds:$InstanceId" -if($Quiet.IsPresent){ - $argumentList += "/quiet" -} -Start-Process (Join-Path $vs.InstallationPath 'Common7\IDE\VSIXInstaller.exe') -ArgumentList $argumentList -Wait \ No newline at end of file diff --git a/scripts/VerifyAllTranslations.fsx b/scripts/VerifyAllTranslations.fsx deleted file mode 100644 index 5c19dd08154..00000000000 --- a/scripts/VerifyAllTranslations.fsx +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. - -// verifies that all translations in all .xlf files have `state="translated"`. - -#r "System.Xml.Linq" - -open System -open System.IO -open System.Xml.Linq - -// usage: fsi VerifyAllTranslations.fsx -- baseDirectory -let baseDirectory = - Environment.GetCommandLineArgs() - |> Seq.skipWhile ((<>) "--") - |> Seq.skip 1 - |> Seq.head - -let hasUntranslatedStrings (xlfFile:string) = - let doc = XDocument.Load(xlfFile) - let untranslatedStates = - doc.Root.Descendants() - |> Seq.filter (fun (elem:XElement) -> elem.Name.LocalName = "target") - |> Seq.map (fun (elem:XElement) -> elem.Attribute(XName.op_Implicit("state"))) - |> Seq.filter (isNull >> not) - |> Seq.map (fun (attr:XAttribute) -> attr.Value) - |> Seq.filter ((<>) "translated") - Seq.length untranslatedStates > 0 - -let filesWithMissingTranslations = - Directory.EnumerateFiles(baseDirectory, "*.xlf", SearchOption.AllDirectories) - |> Seq.filter hasUntranslatedStrings - |> Seq.toList - -match filesWithMissingTranslations with -| [] -> printfn "All .xlf files have translations assigned." -| _ -> - printfn "The following .xlf files have untranslated strings (state != 'translated'):\n\t%s" (String.Join("\n\t", filesWithMissingTranslations)) - Environment.Exit(1) diff --git a/scripts/diff-fsharp-repos.sh b/scripts/diff-fsharp-repos.sh deleted file mode 100755 index 42c381f6bf9..00000000000 --- a/scripts/diff-fsharp-repos.sh +++ /dev/null @@ -1,112 +0,0 @@ -#!/bin/sh -# Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. - -# This script generates a patch by comparing the contents of the fsharp/fsharp -# and Microsoft/visualfsharp GitHub repositories. The resulting patch can be applied, -# if desired, to one of the repositories to synchronize changes in one direction; -# CAUTION MUST BE TAKEN though, since this script generates the patch in a way that -# ignores any ordering of commits in the repos -- so it could also end up reverting -# changes that were actually needed. -# The produced patch is primarily useful for examining differences between two repos -# and making it easier to submit targeted PRs to manually synchronize changes. - -# Helper function to clean up after we're done (or if there's an error). -cleanup () { - # Leave the working directory, then delete it. - { popd && rm -rf "$tmpdir"; } || printf "Unable to clean up temp directory '%s'\n" "$tmpdir" -} - -# Helper function to print an error message and exit with a non-zero error code. -failwith () { - printf "Error: %s\n" "$1" >&2 - cleanup - exit 1 -} - -# Delete the .git folder from a folder containing an extracted/cloned repository. -remove_git () { - { pushd "$1" && rm -rf .git && popd; } || \ - { printf "Error: Couldn't remove .git from '%s'\n" "$1"; cleanup_error; } -} - -# Delete "don't care" files from a folder containing an extracted/cloned repository. -# These are files with known differences between the two repos, but where we don't care -# about those differences for the purposes of generating a patch. -remove_irrelevant_files () { - if pushd "$1"; then - # TODO: Use 'for in _ do' syntax here instead? Maybe read the list from a separate text file? - # If any of the files in here can't be removed, ignore the failure and keep going. - rm .travis.yml - rm CHANGELOG.md - rm CONTRIBUTING.md - rm README.md - - popd - fi -} - -# Options for controlling the behavior of this script. -tmpdir="diff_tmp" # name of temp folder to create and work in -fetch_source_by_cloning=1 # git diff doesn't seem to like curl+tar, so clone with git for now. -github_org1="fsharp" -github_repo1="fsharp" -github_org2="Microsoft" -github_repo2="visualfsharp" -repo_dir1="${github_org1}_${github_repo1}" -repo_dir2="${github_org2}_${github_repo2}" -include_all_changes=0 # If set to 1, file additions/deletions will also be included in the patch. -patch_path="../${github_repo1}-${github_repo2}.patch" - -# Create a temporary directory to work in. -if ! mkdir "$tmpdir"; then - printf "Unable to create temp directory '%s' (does it already exist?)\n" "$tmpdir" - exit 1 -fi - -# Enter the temporary directory. -if ! pushd "$tmpdir"; then - printf "Can't enter temp directory '%s'\n" "$tmpdir" - exit 1 -fi - -# We can either fetch the source from the target repos by cloning them, -# or simply by downloading an archive/tarball of the current 'master' branches. -if [ "$fetch_source_by_cloning" = '1' ]; then - # Clone folders with git. - # The code above using curl and tar should work, but git diff doesn't seem to like it. - { git clone "https://github.com/${github_org1}/${github_repo1}.git" "$repo_dir1" && \ - git clone "https://github.com/${github_org2}/${github_repo2}.git" "$repo_dir2"; } || - { printf "Unable to clone one or more of the target repositories.\n" && cleanup_error; } - - # Enter each cloned repo and delete the .git folder to eliminate a bunch of garbage in the patch. - remove_git "$repo_dir1" - remove_git "$repo_dir2" -else - # Download source tarballs for both repos. - repo_archive1="$repo_dir1.zip" - repo_archive2="$repo_dir2.zip" - { curl -L -o "$repo_archive1" "https://github.com/${github_org1}/${github_repo1}/archive/master.zip" && \ - curl -L -o "$repo_archive2" "https://github.com/${github_org2}/${github_repo2}/archive/master.zip"; } || \ - { printf "Couldn't download one or more of the source tarballs.\n" && cleanup_error; } - - # Extract the contents of the source tarballs. - { mkdir "$repo_dir1" && tar -xzf "$repo_archive1" -C "$repo_dir1" && \ - mkdir "$repo_dir2" && tar -xzf "$repo_archive2" -C "$repo_dir2"; } || \ - { printf "Couldn't extract one or more of the source tarballs.\n" && cleanup_error; } -fi - -# Remove unwanted/"don't care" files from both repos. -remove_irrelevant_files "$repo_dir1" -remove_irrelevant_files "$repo_dir2" - -# Use git-diff to compare the two source trees and create a patch. -# Note, the 'git diff' command returns with non-zero exit code if there are any warnings emitted, -# which there will be -- so we can't really check the exit code to see if it succeeded' -if [ "$include_all_changes" != '1' ]; then - diff_filter_arg="--diff-filter=ad" -fi - -git diff --diff-algorithm=minimal "$diff_filter_arg" --no-index -- "$repo_dir1" "$repo_dir2" > "$patch_path" - -# Cleanup the temp folder. -cleanup diff --git a/scripts/dotnet-install.ps1 b/scripts/dotnet-install.ps1 deleted file mode 100644 index e0e8d6800cd..00000000000 --- a/scripts/dotnet-install.ps1 +++ /dev/null @@ -1,503 +0,0 @@ -# -# Copyright (c) .NET Foundation and contributors. All rights reserved. -# Licensed under the MIT license. See LICENSE file in the project root for full license information. -# - -<# -.SYNOPSIS - Installs dotnet cli -.DESCRIPTION - Installs dotnet cli. If dotnet installation already exists in the given directory - it will update it only if the requested version differs from the one already installed. -.PARAMETER Channel - Default: LTS - Download from the Channel specified. Possible values: - - Current - most current release - - LTS - most current supported release - - 2-part version in a format A.B - represents a specific release - examples: 2.0; 1.0 - - Branch name - examples: release/2.0.0; Master -.PARAMETER Version - Default: latest - Represents a build version on specific channel. Possible values: - - latest - most latest build on specific channel - - coherent - most latest coherent build on specific channel - coherent applies only to SDK downloads - - 3-part version in a format A.B.C - represents specific version of build - examples: 2.0.0-preview2-006120; 1.1.0 -.PARAMETER InstallDir - Default: %LocalAppData%\Microsoft\dotnet - Path to where to install dotnet. Note that binaries will be placed directly in a given directory. -.PARAMETER Architecture - Default: - this value represents currently running OS architecture - Architecture of dotnet binaries to be installed. - Possible values are: , x64 and x86 -.PARAMETER SharedRuntime - Default: false - Installs just the shared runtime bits, not the entire SDK -.PARAMETER DryRun - If set it will not perform installation but instead display what command line to use to consistently install - currently requested version of dotnet cli. In example if you specify version 'latest' it will display a link - with specific version so that this command can be used deterministically in a build script. - It also displays binaries location if you prefer to install or download it yourself. -.PARAMETER NoPath - By default this script will set environment variable PATH for the current process to the binaries folder inside installation folder. - If set it will display binaries location but not set any environment variable. -.PARAMETER Verbose - Displays diagnostics information. -.PARAMETER AzureFeed - Default: https://dotnetcli.azureedge.net/dotnet - This parameter typically is not changed by the user. - It allows to change URL for the Azure feed used by this installer. -.PARAMETER UncachedFeed - This parameter typically is not changed by the user. - It allows to change URL for the Uncached feed used by this installer. -.PARAMETER ProxyAddress - If set, the installer will use the proxy when making web requests -.PARAMETER ProxyUseDefaultCredentials - Default: false - Use default credentials, when using proxy address. -#> -[cmdletbinding()] -param( - [string]$Channel="LTS", - [string]$Version="Latest", - [string]$InstallDir="", - [string]$Architecture="", - [switch]$SharedRuntime, - [switch]$DryRun, - [switch]$NoPath, - [string]$AzureFeed="https://dotnetcli.azureedge.net/dotnet", - [string]$UncachedFeed="https://dotnetcli.blob.core.windows.net/dotnet", - [string]$ProxyAddress, - [switch]$ProxyUseDefaultCredentials -) - -Set-StrictMode -Version Latest -$ErrorActionPreference="Stop" -$ProgressPreference="SilentlyContinue" - -$BinFolderRelativePath="" - -# example path with regex: shared/1.0.0-beta-12345/somepath -$VersionRegEx="/\d+\.\d+[^/]+/" -$OverrideNonVersionedFiles=$true - -function Say($str) { - Write-Output "dotnet-install: $str" -} - -function Say-Verbose($str) { - Write-Verbose "dotnet-install: $str" -} - -function Say-Invocation($Invocation) { - $command = $Invocation.MyCommand; - $args = (($Invocation.BoundParameters.Keys | foreach { "-$_ `"$($Invocation.BoundParameters[$_])`"" }) -join " ") - Say-Verbose "$command $args" -} - -function Invoke-With-Retry([ScriptBlock]$ScriptBlock, [int]$MaxAttempts = 3, [int]$SecondsBetweenAttempts = 1) { - $Attempts = 0 - - while ($true) { - try { - return $ScriptBlock.Invoke() - } - catch { - $Attempts++ - if ($Attempts -lt $MaxAttempts) { - Start-Sleep $SecondsBetweenAttempts - } - else { - throw - } - } - } -} - -function Get-Machine-Architecture() { - Say-Invocation $MyInvocation - - # possible values: AMD64, IA64, x86 - return $ENV:PROCESSOR_ARCHITECTURE -} - -# TODO: Architecture and CLIArchitecture should be unified -function Get-CLIArchitecture-From-Architecture([string]$Architecture) { - Say-Invocation $MyInvocation - - switch ($Architecture.ToLower()) { - { $_ -eq "" } { return Get-CLIArchitecture-From-Architecture $(Get-Machine-Architecture) } - { ($_ -eq "amd64") -or ($_ -eq "x64") } { return "x64" } - { $_ -eq "x86" } { return "x86" } - default { throw "Architecture not supported. If you think this is a bug, please report it at https://github.com/dotnet/cli/issues" } - } -} - -function Get-Version-Info-From-Version-Text([string]$VersionText) { - Say-Invocation $MyInvocation - - $Data = @($VersionText.Split([char[]]@(), [StringSplitOptions]::RemoveEmptyEntries)); - - $VersionInfo = @{} - $VersionInfo.CommitHash = $Data[0].Trim() - $VersionInfo.Version = $Data[1].Trim() - return $VersionInfo -} - -function Load-Assembly([string] $Assembly) { - try { - Add-Type -Assembly $Assembly | Out-Null - } - catch { - # On Nano Server, Powershell Core Edition is used. Add-Type is unable to resolve base class assemblies because they are not GAC'd. - # Loading the base class assemblies is not unnecessary as the types will automatically get resolved. - } -} - -function GetHTTPResponse([Uri] $Uri) -{ - Invoke-With-Retry( - { - - $HttpClient = $null - - try { - # HttpClient is used vs Invoke-WebRequest in order to support Nano Server which doesn't support the Invoke-WebRequest cmdlet. - Load-Assembly -Assembly System.Net.Http - - if(-not $ProxyAddress) - { - # Despite no proxy being explicitly specified, we may still be behind a default proxy - $DefaultProxy = [System.Net.WebRequest]::DefaultWebProxy; - if($DefaultProxy -and (-not $DefaultProxy.IsBypassed($Uri))){ - $ProxyAddress = $DefaultProxy.GetProxy($Uri).OriginalString - $ProxyUseDefaultCredentials = $true - } - } - - if($ProxyAddress){ - $HttpClientHandler = New-Object System.Net.Http.HttpClientHandler - $HttpClientHandler.Proxy = New-Object System.Net.WebProxy -Property @{Address=$ProxyAddress;UseDefaultCredentials=$ProxyUseDefaultCredentials} - $HttpClient = New-Object System.Net.Http.HttpClient -ArgumentList $HttpClientHandler - } - else { - $HttpClient = New-Object System.Net.Http.HttpClient - } - # Default timeout for HttpClient is 100s. For a 50 MB download this assumes 500 KB/s average, any less will time out - # 10 minutes allows it to work over much slower connections. - $HttpClient.Timeout = New-TimeSpan -Minutes 40 - $Response = $HttpClient.GetAsync($Uri).Result - if (($Response -eq $null) -or (-not ($Response.IsSuccessStatusCode))) - { - $ErrorMsg = "Failed to download $Uri." - if ($Response -ne $null) - { - $ErrorMsg += " $Response" - } - - throw $ErrorMsg - } - - return $Response - } - finally { - if ($HttpClient -ne $null) { - $HttpClient.Dispose() - } - } - }) -} - - -function Get-Latest-Version-Info([string]$AzureFeed, [string]$Channel, [bool]$Coherent) { - Say-Invocation $MyInvocation - - $VersionFileUrl = $null - if ($SharedRuntime) { - $VersionFileUrl = "$UncachedFeed/Runtime/$Channel/latest.version" - } - else { - if ($Coherent) { - $VersionFileUrl = "$UncachedFeed/Sdk/$Channel/latest.coherent.version" - } - else { - $VersionFileUrl = "$UncachedFeed/Sdk/$Channel/latest.version" - } - } - - $Response = GetHTTPResponse -Uri $VersionFileUrl - $StringContent = $Response.Content.ReadAsStringAsync().Result - - switch ($Response.Content.Headers.ContentType) { - { ($_ -eq "application/octet-stream") } { $VersionText = [Text.Encoding]::UTF8.GetString($StringContent) } - { ($_ -eq "text/plain") } { $VersionText = $StringContent } - { ($_ -eq "text/plain; charset=UTF-8") } { $VersionText = $StringContent } - default { throw "``$Response.Content.Headers.ContentType`` is an unknown .version file content type." } - } - - $VersionInfo = Get-Version-Info-From-Version-Text $VersionText - - return $VersionInfo -} - - -function Get-Specific-Version-From-Version([string]$AzureFeed, [string]$Channel, [string]$Version) { - Say-Invocation $MyInvocation - - switch ($Version.ToLower()) { - { $_ -eq "latest" } { - $LatestVersionInfo = Get-Latest-Version-Info -AzureFeed $AzureFeed -Channel $Channel -Coherent $False - return $LatestVersionInfo.Version - } - { $_ -eq "coherent" } { - $LatestVersionInfo = Get-Latest-Version-Info -AzureFeed $AzureFeed -Channel $Channel -Coherent $True - return $LatestVersionInfo.Version - } - default { return $Version } - } -} - -function Get-Download-Link([string]$AzureFeed, [string]$Channel, [string]$SpecificVersion, [string]$CLIArchitecture) { - Say-Invocation $MyInvocation - - if ($SharedRuntime) { - $PayloadURL = "$AzureFeed/Runtime/$SpecificVersion/dotnet-runtime-$SpecificVersion-win-$CLIArchitecture.zip" - } - else { - $PayloadURL = "$AzureFeed/Sdk/$SpecificVersion/dotnet-sdk-$SpecificVersion-win-$CLIArchitecture.zip" - } - - Say-Verbose "Constructed primary payload URL: $PayloadURL" - - return $PayloadURL -} - -function Get-LegacyDownload-Link([string]$AzureFeed, [string]$Channel, [string]$SpecificVersion, [string]$CLIArchitecture) { - Say-Invocation $MyInvocation - - if ($SharedRuntime) { - $PayloadURL = "$AzureFeed/Runtime/$SpecificVersion/dotnet-win-$CLIArchitecture.$SpecificVersion.zip" - } - else { - $PayloadURL = "$AzureFeed/Sdk/$SpecificVersion/dotnet-dev-win-$CLIArchitecture.$SpecificVersion.zip" - } - - Say-Verbose "Constructed legacy payload URL: $PayloadURL" - - return $PayloadURL -} - -function Get-User-Share-Path() { - Say-Invocation $MyInvocation - - $InstallRoot = $env:DOTNET_INSTALL_DIR - if (!$InstallRoot) { - $InstallRoot = "$env:LocalAppData\Microsoft\dotnet" - } - return $InstallRoot -} - -function Resolve-Installation-Path([string]$InstallDir) { - Say-Invocation $MyInvocation - - if ($InstallDir -eq "") { - return Get-User-Share-Path - } - return $InstallDir -} - -function Get-Version-Info-From-Version-File([string]$InstallRoot, [string]$RelativePathToVersionFile) { - Say-Invocation $MyInvocation - - $VersionFile = Join-Path -Path $InstallRoot -ChildPath $RelativePathToVersionFile - Say-Verbose "Local version file: $VersionFile" - - if (Test-Path $VersionFile) { - $VersionText = cat $VersionFile - Say-Verbose "Local version file text: $VersionText" - return Get-Version-Info-From-Version-Text $VersionText - } - - Say-Verbose "Local version file not found." - - return $null -} - -function Is-Dotnet-Package-Installed([string]$InstallRoot, [string]$RelativePathToPackage, [string]$SpecificVersion) { - Say-Invocation $MyInvocation - - $DotnetPackagePath = Join-Path -Path $InstallRoot -ChildPath $RelativePathToPackage | Join-Path -ChildPath $SpecificVersion - Say-Verbose "Is-Dotnet-Package-Installed: Path to a package: $DotnetPackagePath" - return Test-Path $DotnetPackagePath -PathType Container -} - -function Get-Absolute-Path([string]$RelativeOrAbsolutePath) { - # Too much spam - # Say-Invocation $MyInvocation - - return $ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath($RelativeOrAbsolutePath) -} - -function Get-Path-Prefix-With-Version($path) { - $match = [regex]::match($path, $VersionRegEx) - if ($match.Success) { - return $entry.FullName.Substring(0, $match.Index + $match.Length) - } - - return $null -} - -function Get-List-Of-Directories-And-Versions-To-Unpack-From-Dotnet-Package([System.IO.Compression.ZipArchive]$Zip, [string]$OutPath) { - Say-Invocation $MyInvocation - - $ret = @() - foreach ($entry in $Zip.Entries) { - $dir = Get-Path-Prefix-With-Version $entry.FullName - if ($dir -ne $null) { - $path = Get-Absolute-Path $(Join-Path -Path $OutPath -ChildPath $dir) - if (-Not (Test-Path $path -PathType Container)) { - $ret += $dir - } - } - } - - $ret = $ret | Sort-Object | Get-Unique - - $values = ($ret | foreach { "$_" }) -join ";" - Say-Verbose "Directories to unpack: $values" - - return $ret -} - -# Example zip content and extraction algorithm: -# Rule: files if extracted are always being extracted to the same relative path locally -# .\ -# a.exe # file does not exist locally, extract -# b.dll # file exists locally, override only if $OverrideFiles set -# aaa\ # same rules as for files -# ... -# abc\1.0.0\ # directory contains version and exists locally -# ... # do not extract content under versioned part -# abc\asd\ # same rules as for files -# ... -# def\ghi\1.0.1\ # directory contains version and does not exist locally -# ... # extract content -function Extract-Dotnet-Package([string]$ZipPath, [string]$OutPath) { - Say-Invocation $MyInvocation - - Load-Assembly -Assembly System.IO.Compression.FileSystem - Set-Variable -Name Zip - try { - $Zip = [System.IO.Compression.ZipFile]::OpenRead($ZipPath) - - $DirectoriesToUnpack = Get-List-Of-Directories-And-Versions-To-Unpack-From-Dotnet-Package -Zip $Zip -OutPath $OutPath - - foreach ($entry in $Zip.Entries) { - $PathWithVersion = Get-Path-Prefix-With-Version $entry.FullName - if (($PathWithVersion -eq $null) -Or ($DirectoriesToUnpack -contains $PathWithVersion)) { - $DestinationPath = Get-Absolute-Path $(Join-Path -Path $OutPath -ChildPath $entry.FullName) - $DestinationDir = Split-Path -Parent $DestinationPath - $OverrideFiles=$OverrideNonVersionedFiles -Or (-Not (Test-Path $DestinationPath)) - if ((-Not $DestinationPath.EndsWith("\")) -And $OverrideFiles) { - New-Item -ItemType Directory -Force -Path $DestinationDir | Out-Null - [System.IO.Compression.ZipFileExtensions]::ExtractToFile($entry, $DestinationPath, $OverrideNonVersionedFiles) - } - } - } - } - finally { - if ($Zip -ne $null) { - $Zip.Dispose() - } - } -} - -function DownloadFile([Uri]$Uri, [string]$OutPath) { - $Stream = $null - - try { - $Response = GetHTTPResponse -Uri $Uri - $Stream = $Response.Content.ReadAsStreamAsync().Result - $File = [System.IO.File]::Create($OutPath) - $Stream.CopyTo($File) - $File.Close() - } - finally { - if ($Stream -ne $null) { - $Stream.Dispose() - } - } -} - -function Prepend-Sdk-InstallRoot-To-Path([string]$InstallRoot, [string]$BinFolderRelativePath) { - $BinPath = Get-Absolute-Path $(Join-Path -Path $InstallRoot -ChildPath $BinFolderRelativePath) - if (-Not $NoPath) { - Say "Adding to current process PATH: `"$BinPath`". Note: This change will not be visible if PowerShell was run as a child process." - $env:path = "$BinPath;" + $env:path - } - else { - Say "Binaries of dotnet can be found in $BinPath" - } -} - -$CLIArchitecture = Get-CLIArchitecture-From-Architecture $Architecture -$SpecificVersion = Get-Specific-Version-From-Version -AzureFeed $AzureFeed -Channel $Channel -Version $Version -$DownloadLink = Get-Download-Link -AzureFeed $AzureFeed -Channel $Channel -SpecificVersion $SpecificVersion -CLIArchitecture $CLIArchitecture -$LegacyDownloadLink = Get-LegacyDownload-Link -AzureFeed $AzureFeed -Channel $Channel -SpecificVersion $SpecificVersion -CLIArchitecture $CLIArchitecture - -if ($DryRun) { - Say "Payload URLs:" - Say "Primary - $DownloadLink" - Say "Legacy - $LegacyDownloadLink" - Say "Repeatable invocation: .\$($MyInvocation.MyCommand) -Version $SpecificVersion -Channel $Channel -Architecture $CLIArchitecture -InstallDir $InstallDir" - exit 0 -} - -$InstallRoot = Resolve-Installation-Path $InstallDir -Say-Verbose "InstallRoot: $InstallRoot" - -$IsSdkInstalled = Is-Dotnet-Package-Installed -InstallRoot $InstallRoot -RelativePathToPackage "sdk" -SpecificVersion $SpecificVersion -Say-Verbose ".NET SDK installed? $IsSdkInstalled" -if ($IsSdkInstalled) { - Say ".NET SDK version $SpecificVersion is already installed." - Prepend-Sdk-InstallRoot-To-Path -InstallRoot $InstallRoot -BinFolderRelativePath $BinFolderRelativePath - exit 0 -} - -New-Item -ItemType Directory -Force -Path $InstallRoot | Out-Null - -$installDrive = $((Get-Item $InstallRoot).PSDrive.Name); -Write-Output "${installDrive}:"; -$free = Get-CimInstance -Class win32_logicaldisk | where Deviceid -eq "${installDrive}:" -if ($free.Freespace / 1MB -le 100 ) { - Say "There is not enough disk space on drive ${installDrive}:" - exit 0 -} - -$ZipPath = [System.IO.Path]::GetTempFileName() -Say-Verbose "Zip path: $ZipPath" -Say "Downloading link: $DownloadLink" -try { - DownloadFile -Uri $DownloadLink -OutPath $ZipPath -} -catch { - Say "Cannot download: $DownloadLink" - $DownloadLink = $LegacyDownloadLink - $ZipPath = [System.IO.Path]::GetTempFileName() - Say-Verbose "Legacy zip path: $ZipPath" - Say "Downloading legacy link: $DownloadLink" - DownloadFile -Uri $DownloadLink -OutPath $ZipPath -} - -Say "Extracting zip from $DownloadLink" -Extract-Dotnet-Package -ZipPath $ZipPath -OutPath $InstallRoot - -Remove-Item $ZipPath - -Prepend-Sdk-InstallRoot-To-Path -InstallRoot $InstallRoot -BinFolderRelativePath $BinFolderRelativePath - -Say "Installation finished" -exit 0 diff --git a/scripts/dotnet-install.sh b/scripts/dotnet-install.sh deleted file mode 100755 index a1ff41cb755..00000000000 --- a/scripts/dotnet-install.sh +++ /dev/null @@ -1,997 +0,0 @@ -#!/usr/bin/env bash -# Copyright (c) .NET Foundation and contributors. All rights reserved. -# Licensed under the MIT license. See LICENSE file in the project root for full license information. -# - -# Stop script on NZEC -set -e -# Stop script if unbound variable found (use ${var:-} if intentional) -set -u -# By default cmd1 | cmd2 returns exit code of cmd2 regardless of cmd1 success -# This is causing it to fail -set -o pipefail - -# Use in the functions: eval $invocation -invocation='say_verbose "Calling: ${yellow:-}${FUNCNAME[0]} ${green:-}$*${normal:-}"' - -# standard output may be used as a return value in the functions -# we need a way to write text on the screen in the functions so that -# it won't interfere with the return value. -# Exposing stream 3 as a pipe to standard output of the script itself -exec 3>&1 - -# Setup some colors to use. These need to work in fairly limited shells, like the Ubuntu Docker container where there are only 8 colors. -# See if stdout is a terminal -if [ -t 1 ] && command -v tput > /dev/null; then - # see if it supports colors - ncolors=$(tput colors) - if [ -n "$ncolors" ] && [ $ncolors -ge 8 ]; then - bold="$(tput bold || echo)" - normal="$(tput sgr0 || echo)" - black="$(tput setaf 0 || echo)" - red="$(tput setaf 1 || echo)" - green="$(tput setaf 2 || echo)" - yellow="$(tput setaf 3 || echo)" - blue="$(tput setaf 4 || echo)" - magenta="$(tput setaf 5 || echo)" - cyan="$(tput setaf 6 || echo)" - white="$(tput setaf 7 || echo)" - fi -fi - -say_warning() { - printf "%b\n" "${yellow:-}dotnet_install: Warning: $1${normal:-}" -} - -say_err() { - printf "%b\n" "${red:-}dotnet_install: Error: $1${normal:-}" >&2 -} - -say() { - # using stream 3 (defined in the beginning) to not interfere with stdout of functions - # which may be used as return value - printf "%b\n" "${cyan:-}dotnet-install:${normal:-} $1" >&3 -} - -say_verbose() { - if [ "$verbose" = true ]; then - say "$1" - fi -} - -# This platform list is finite - if the SDK/Runtime has supported Linux distribution-specific assets, -# then and only then should the Linux distribution appear in this list. -# Adding a Linux distribution to this list does not imply distribution-specific support. -get_legacy_os_name_from_platform() { - eval $invocation - - platform="$1" - case "$platform" in - "centos.7") - echo "centos" - return 0 - ;; - "debian.8") - echo "debian" - return 0 - ;; - "debian.9") - echo "debian.9" - return 0 - ;; - "fedora.23") - echo "fedora.23" - return 0 - ;; - "fedora.24") - echo "fedora.24" - return 0 - ;; - "fedora.27") - echo "fedora.27" - return 0 - ;; - "fedora.28") - echo "fedora.28" - return 0 - ;; - "opensuse.13.2") - echo "opensuse.13.2" - return 0 - ;; - "opensuse.42.1") - echo "opensuse.42.1" - return 0 - ;; - "opensuse.42.3") - echo "opensuse.42.3" - return 0 - ;; - "rhel.7"*) - echo "rhel" - return 0 - ;; - "ubuntu.14.04") - echo "ubuntu" - return 0 - ;; - "ubuntu.16.04") - echo "ubuntu.16.04" - return 0 - ;; - "ubuntu.16.10") - echo "ubuntu.16.10" - return 0 - ;; - "ubuntu.18.04") - echo "ubuntu.18.04" - return 0 - ;; - "alpine.3.4.3") - echo "alpine" - return 0 - ;; - esac - return 1 -} - -get_linux_platform_name() { - eval $invocation - - if [ -n "$runtime_id" ]; then - echo "${runtime_id%-*}" - return 0 - else - if [ -e /etc/os-release ]; then - . /etc/os-release - echo "$ID.$VERSION_ID" - return 0 - elif [ -e /etc/redhat-release ]; then - local redhatRelease=$( /dev/null 2>&1 - return $? -} - - -check_min_reqs() { - local hasMinimum=false - if machine_has "curl"; then - hasMinimum=true - elif machine_has "wget"; then - hasMinimum=true - fi - - if [ "$hasMinimum" = "false" ]; then - say_err "curl (recommended) or wget are required to download dotnet. Install missing prerequisite to proceed." - return 1 - fi - return 0 -} - -check_pre_reqs() { - eval $invocation - - if [ "${DOTNET_INSTALL_SKIP_PREREQS:-}" = "1" ]; then - return 0 - fi - - if [ "$(uname)" = "Linux" ]; then - if [ ! -x "$(command -v ldconfig)" ]; then - echo "ldconfig is not in PATH, trying /sbin/ldconfig." - LDCONFIG_COMMAND="/sbin/ldconfig" - else - LDCONFIG_COMMAND="ldconfig" - fi - - local librarypath=${LD_LIBRARY_PATH:-} - LDCONFIG_COMMAND="$LDCONFIG_COMMAND -NXv ${librarypath//:/ }" - - [ -z "$($LDCONFIG_COMMAND 2>/dev/null | grep libunwind)" ] && say_warning "Unable to locate libunwind. Probable prerequisite missing; please install libunwind." - [ -z "$($LDCONFIG_COMMAND 2>/dev/null | grep libssl)" ] && say_warning "Unable to locate libssl. Probable prerequisite missing; please install libssl." - [ -z "$($LDCONFIG_COMMAND 2>/dev/null | grep libicu)" ] && say_warning "Unable to locate libicu. Probable prerequisite missing; please install libicu." - [ -z "$($LDCONFIG_COMMAND 2>/dev/null | grep -F libcurl.so)" ] && say_warning "Unable to locate libcurl. Probable prerequisite missing; please install libcurl." - fi - - return 0 -} - -# args: -# input - $1 -to_lowercase() { - #eval $invocation - - echo "$1" | tr '[:upper:]' '[:lower:]' - return 0 -} - -# args: -# input - $1 -remove_trailing_slash() { - #eval $invocation - - local input="${1:-}" - echo "${input%/}" - return 0 -} - -# args: -# input - $1 -remove_beginning_slash() { - #eval $invocation - - local input="${1:-}" - echo "${input#/}" - return 0 -} - -# args: -# root_path - $1 -# child_path - $2 - this parameter can be empty -combine_paths() { - eval $invocation - - # TODO: Consider making it work with any number of paths. For now: - if [ ! -z "${3:-}" ]; then - say_err "combine_paths: Function takes two parameters." - return 1 - fi - - local root_path="$(remove_trailing_slash "$1")" - local child_path="$(remove_beginning_slash "${2:-}")" - say_verbose "combine_paths: root_path=$root_path" - say_verbose "combine_paths: child_path=$child_path" - echo "$root_path/$child_path" - return 0 -} - -get_machine_architecture() { - eval $invocation - - if command -v uname > /dev/null; then - CPUName=$(uname -m) - case $CPUName in - armv7l) - echo "arm" - return 0 - ;; - aarch64) - echo "arm64" - return 0 - ;; - esac - fi - - # Always default to 'x64' - echo "x64" - return 0 -} - -# args: -# architecture - $1 -get_normalized_architecture_from_architecture() { - eval $invocation - - local architecture="$(to_lowercase "$1")" - case "$architecture" in - \) - echo "$(get_normalized_architecture_from_architecture "$(get_machine_architecture)")" - return 0 - ;; - amd64|x64) - echo "x64" - return 0 - ;; - arm) - echo "arm" - return 0 - ;; - arm64) - echo "arm64" - return 0 - ;; - esac - - say_err "Architecture \`$architecture\` not supported. If you think this is a bug, please report it at https://github.com/dotnet/cli/issues" - return 1 -} - -# version_info is a conceptual two line string representing commit hash and 4-part version -# format: -# Line 1: # commit_hash -# Line 2: # 4-part version - -# args: -# version_text - stdin -get_version_from_version_info() { - eval $invocation - - cat | tail -n 1 | sed 's/\r$//' - return 0 -} - -# args: -# version_text - stdin -get_commit_hash_from_version_info() { - eval $invocation - - cat | head -n 1 | sed 's/\r$//' - return 0 -} - -# args: -# install_root - $1 -# relative_path_to_package - $2 -# specific_version - $3 -is_dotnet_package_installed() { - eval $invocation - - local install_root="$1" - local relative_path_to_package="$2" - local specific_version="${3//[$'\t\r\n']}" - - local dotnet_package_path="$(combine_paths "$(combine_paths "$install_root" "$relative_path_to_package")" "$specific_version")" - say_verbose "is_dotnet_package_installed: dotnet_package_path=$dotnet_package_path" - - if [ -d "$dotnet_package_path" ]; then - return 0 - else - return 1 - fi -} - -# args: -# azure_feed - $1 -# channel - $2 -# normalized_architecture - $3 -# coherent - $4 -get_latest_version_info() { - eval $invocation - - local azure_feed="$1" - local channel="$2" - local normalized_architecture="$3" - local coherent="$4" - - local version_file_url=null - if [[ "$runtime" == "dotnet" ]]; then - version_file_url="$uncached_feed/Runtime/$channel/latest.version" - elif [[ "$runtime" == "aspnetcore" ]]; then - version_file_url="$uncached_feed/aspnetcore/Runtime/$channel/latest.version" - elif [ -z "$runtime" ]; then - if [ "$coherent" = true ]; then - version_file_url="$uncached_feed/Sdk/$channel/latest.coherent.version" - else - version_file_url="$uncached_feed/Sdk/$channel/latest.version" - fi - else - say_err "Invalid value for \$runtime" - return 1 - fi - say_verbose "get_latest_version_info: latest url: $version_file_url" - - download "$version_file_url" - return $? -} - -# args: -# azure_feed - $1 -# channel - $2 -# normalized_architecture - $3 -# version - $4 -get_specific_version_from_version() { - eval $invocation - - local azure_feed="$1" - local channel="$2" - local normalized_architecture="$3" - local version="$(to_lowercase "$4")" - - case "$version" in - latest) - local version_info - version_info="$(get_latest_version_info "$azure_feed" "$channel" "$normalized_architecture" false)" || return 1 - say_verbose "get_specific_version_from_version: version_info=$version_info" - echo "$version_info" | get_version_from_version_info - return 0 - ;; - coherent) - local version_info - version_info="$(get_latest_version_info "$azure_feed" "$channel" "$normalized_architecture" true)" || return 1 - say_verbose "get_specific_version_from_version: version_info=$version_info" - echo "$version_info" | get_version_from_version_info - return 0 - ;; - *) - echo "$version" - return 0 - ;; - esac -} - -# args: -# azure_feed - $1 -# channel - $2 -# normalized_architecture - $3 -# specific_version - $4 -construct_download_link() { - eval $invocation - - local azure_feed="$1" - local channel="$2" - local normalized_architecture="$3" - local specific_version="${4//[$'\t\r\n']}" - - local osname - osname="$(get_current_os_name)" || return 1 - - local download_link=null - if [[ "$runtime" == "dotnet" ]]; then - download_link="$azure_feed/Runtime/$specific_version/dotnet-runtime-$specific_version-$osname-$normalized_architecture.tar.gz" - elif [[ "$runtime" == "aspnetcore" ]]; then - download_link="$azure_feed/aspnetcore/Runtime/$specific_version/aspnetcore-runtime-$specific_version-$osname-$normalized_architecture.tar.gz" - elif [ -z "$runtime" ]; then - download_link="$azure_feed/Sdk/$specific_version/dotnet-sdk-$specific_version-$osname-$normalized_architecture.tar.gz" - else - return 1 - fi - - echo "$download_link" - return 0 -} - -# args: -# azure_feed - $1 -# channel - $2 -# normalized_architecture - $3 -# specific_version - $4 -construct_legacy_download_link() { - eval $invocation - - local azure_feed="$1" - local channel="$2" - local normalized_architecture="$3" - local specific_version="${4//[$'\t\r\n']}" - - local distro_specific_osname - distro_specific_osname="$(get_legacy_os_name)" || return 1 - - local legacy_download_link=null - if [[ "$runtime" == "dotnet" ]]; then - legacy_download_link="$azure_feed/Runtime/$specific_version/dotnet-$distro_specific_osname-$normalized_architecture.$specific_version.tar.gz" - elif [ -z "$runtime" ]; then - legacy_download_link="$azure_feed/Sdk/$specific_version/dotnet-dev-$distro_specific_osname-$normalized_architecture.$specific_version.tar.gz" - else - return 1 - fi - - echo "$legacy_download_link" - return 0 -} - -get_user_install_path() { - eval $invocation - - if [ ! -z "${DOTNET_INSTALL_DIR:-}" ]; then - echo "$DOTNET_INSTALL_DIR" - else - echo "$HOME/.dotnet" - fi - return 0 -} - -# args: -# install_dir - $1 -resolve_installation_path() { - eval $invocation - - local install_dir=$1 - if [ "$install_dir" = "" ]; then - local user_install_path="$(get_user_install_path)" - say_verbose "resolve_installation_path: user_install_path=$user_install_path" - echo "$user_install_path" - return 0 - fi - - echo "$install_dir" - return 0 -} - -# args: -# install_root - $1 -get_installed_version_info() { - eval $invocation - - local install_root="$1" - local version_file="$(combine_paths "$install_root" "$local_version_file_relative_path")" - say_verbose "Local version file: $version_file" - if [ ! -z "$version_file" ] | [ -r "$version_file" ]; then - local version_info="$(cat "$version_file")" - echo "$version_info" - return 0 - fi - - say_verbose "Local version file not found." - return 0 -} - -# args: -# relative_or_absolute_path - $1 -get_absolute_path() { - eval $invocation - - local relative_or_absolute_path=$1 - echo "$(cd "$(dirname "$1")" && pwd -P)/$(basename "$1")" - return 0 -} - -# args: -# input_files - stdin -# root_path - $1 -# out_path - $2 -# override - $3 -copy_files_or_dirs_from_list() { - eval $invocation - - local root_path="$(remove_trailing_slash "$1")" - local out_path="$(remove_trailing_slash "$2")" - local override="$3" - local osname="$(get_current_os_name)" - local override_switch=$( - if [ "$override" = false ]; then - if [[ "$osname" == "linux-musl" ]]; then - printf -- "-u"; - else - printf -- "-n"; - fi - fi) - - cat | uniq | while read -r file_path; do - local path="$(remove_beginning_slash "${file_path#$root_path}")" - local target="$out_path/$path" - if [ "$override" = true ] || (! ([ -d "$target" ] || [ -e "$target" ])); then - mkdir -p "$out_path/$(dirname "$path")" - cp -R $override_switch "$root_path/$path" "$target" - fi - done -} - -# args: -# zip_path - $1 -# out_path - $2 -extract_dotnet_package() { - eval $invocation - - local zip_path="$1" - local out_path="$2" - - local temp_out_path="$(mktemp -d "$temporary_file_template")" - - local failed=false - tar -xzf "$zip_path" -C "$temp_out_path" > /dev/null || failed=true - - local folders_with_version_regex='^.*/[0-9]+\.[0-9]+[^/]+/' - find "$temp_out_path" -type f | grep -Eo "$folders_with_version_regex" | sort | copy_files_or_dirs_from_list "$temp_out_path" "$out_path" false - find "$temp_out_path" -type f | grep -Ev "$folders_with_version_regex" | copy_files_or_dirs_from_list "$temp_out_path" "$out_path" "$override_non_versioned_files" - - rm -rf "$temp_out_path" - - if [ "$failed" = true ]; then - say_err "Extraction failed" - return 1 - fi -} - -# args: -# remote_path - $1 -# [out_path] - $2 - stdout if not provided -download() { - eval $invocation - - local remote_path="$1" - local out_path="${2:-}" - - if [[ "$remote_path" != "http"* ]]; then - cp "$remote_path" "$out_path" - return $? - fi - - local failed=false - if machine_has "curl"; then - downloadcurl "$remote_path" "$out_path" || failed=true - elif machine_has "wget"; then - downloadwget "$remote_path" "$out_path" || failed=true - else - failed=true - fi - if [ "$failed" = true ]; then - say_verbose "Download failed: $remote_path" - return 1 - fi - return 0 -} - -downloadcurl() { - eval $invocation - local remote_path="$1" - local out_path="${2:-}" - - # Append feed_credential as late as possible before calling curl to avoid logging feed_credential - remote_path="${remote_path}${feed_credential}" - - local failed=false - if [ -z "$out_path" ]; then - curl --retry 10 -sSL -f --create-dirs "$remote_path" || failed=true - else - curl --retry 10 -sSL -f --create-dirs -o "$out_path" "$remote_path" || failed=true - fi - if [ "$failed" = true ]; then - say_verbose "Curl download failed" - return 1 - fi - return 0 -} - -downloadwget() { - eval $invocation - local remote_path="$1" - local out_path="${2:-}" - - # Append feed_credential as late as possible before calling wget to avoid logging feed_credential - remote_path="${remote_path}${feed_credential}" - - local failed=false - if [ -z "$out_path" ]; then - wget -q --tries 10 -O - "$remote_path" || failed=true - else - wget --tries 10 -O "$out_path" "$remote_path" || failed=true - fi - if [ "$failed" = true ]; then - say_verbose "Wget download failed" - return 1 - fi - return 0 -} - -calculate_vars() { - eval $invocation - valid_legacy_download_link=true - - normalized_architecture="$(get_normalized_architecture_from_architecture "$architecture")" - say_verbose "normalized_architecture=$normalized_architecture" - - specific_version="$(get_specific_version_from_version "$azure_feed" "$channel" "$normalized_architecture" "$version")" - say_verbose "specific_version=$specific_version" - if [ -z "$specific_version" ]; then - say_err "Could not get version information." - return 1 - fi - - download_link="$(construct_download_link "$azure_feed" "$channel" "$normalized_architecture" "$specific_version")" - say_verbose "download_link=$download_link" - - legacy_download_link="$(construct_legacy_download_link "$azure_feed" "$channel" "$normalized_architecture" "$specific_version")" || valid_legacy_download_link=false - - if [ "$valid_legacy_download_link" = true ]; then - say_verbose "legacy_download_link=$legacy_download_link" - else - say_verbose "Could not construct a legacy_download_link; omitting..." - fi - - install_root="$(resolve_installation_path "$install_dir")" - say_verbose "install_root=$install_root" -} - -install_dotnet() { - eval $invocation - local download_failed=false - local asset_name='' - local asset_relative_path='' - - if [[ "$runtime" == "dotnet" ]]; then - asset_relative_path="shared/Microsoft.NETCore.App" - asset_name=".NET Core Runtime" - elif [[ "$runtime" == "aspnetcore" ]]; then - asset_relative_path="shared/Microsoft.AspNetCore.App" - asset_name="ASP.NET Core Runtime" - elif [ -z "$runtime" ]; then - asset_relative_path="sdk" - asset_name=".NET Core SDK" - else - say_err "Invalid value for \$runtime" - return 1 - fi - - # Check if the SDK version is already installed. - if is_dotnet_package_installed "$install_root" "$asset_relative_path" "$specific_version"; then - say "$asset_name version $specific_version is already installed." - return 0 - fi - - mkdir -p "$install_root" - zip_path="$(mktemp "$temporary_file_template")" - say_verbose "Zip path: $zip_path" - - say "Downloading link: $download_link" - - # Failures are normal in the non-legacy case for ultimately legacy downloads. - # Do not output to stderr, since output to stderr is considered an error. - download "$download_link" "$zip_path" 2>&1 || download_failed=true - - # if the download fails, download the legacy_download_link - if [ "$download_failed" = true ]; then - say "Cannot download: $download_link" - - if [ "$valid_legacy_download_link" = true ]; then - download_failed=false - download_link="$legacy_download_link" - zip_path="$(mktemp "$temporary_file_template")" - say_verbose "Legacy zip path: $zip_path" - say "Downloading legacy link: $download_link" - download "$download_link" "$zip_path" 2>&1 || download_failed=true - fi - fi - - if [ "$download_failed" = true ]; then - say_err "Could not download $asset_name version $specific_version" - return 1 - fi - - say "Extracting zip from $download_link" - extract_dotnet_package "$zip_path" "$install_root" - - # Check if the SDK version is now installed; if not, fail the installation. - if ! is_dotnet_package_installed "$install_root" "$asset_relative_path" "$specific_version"; then - say_err "$asset_name version $specific_version failed to install with an unknown error." - return 1 - fi - - return 0 -} - -local_version_file_relative_path="/.version" -bin_folder_relative_path="" -temporary_file_template="${TMPDIR:-/tmp}/dotnet.XXXXXXXXX" - -channel="LTS" -version="Latest" -install_dir="" -architecture="" -dry_run=false -no_path=false -no_cdn=false -azure_feed="https://dotnetcli.azureedge.net/dotnet" -uncached_feed="https://dotnetcli.blob.core.windows.net/dotnet" -feed_credential="" -verbose=false -runtime="" -runtime_id="" -override_non_versioned_files=true - -while [ $# -ne 0 ] -do - name="$1" - case "$name" in - -c|--channel|-[Cc]hannel) - shift - channel="$1" - ;; - -v|--version|-[Vv]ersion) - shift - version="$1" - ;; - -i|--install-dir|-[Ii]nstall[Dd]ir) - shift - install_dir="$1" - ;; - --arch|--architecture|-[Aa]rch|-[Aa]rchitecture) - shift - architecture="$1" - ;; - --shared-runtime|-[Ss]hared[Rr]untime) - say_warning "The --shared-runtime flag is obsolete and may be removed in a future version of this script. The recommended usage is to specify '--runtime dotnet'." - if [ -z "$runtime" ]; then - runtime="dotnet" - fi - ;; - --runtime|-[Rr]untime) - shift - runtime="$1" - if [[ "$runtime" != "dotnet" ]] && [[ "$runtime" != "aspnetcore" ]]; then - say_err "Unsupported value for --runtime: '$1'. Valid values are 'dotnet' and 'aspnetcore'." - exit 1 - fi - ;; - --dry-run|-[Dd]ry[Rr]un) - dry_run=true - ;; - --no-path|-[Nn]o[Pp]ath) - no_path=true - ;; - --verbose|-[Vv]erbose) - verbose=true - ;; - --no-cdn|-[Nn]o[Cc]dn) - no_cdn=true - ;; - --azure-feed|-[Aa]zure[Ff]eed) - shift - azure_feed="$1" - ;; - --uncached-feed|-[Uu]ncached[Ff]eed) - shift - uncached_feed="$1" - ;; - --feed-credential|-[Ff]eed[Cc]redential) - shift - feed_credential="$1" - ;; - --runtime-id|-[Rr]untime[Ii]d) - shift - runtime_id="$1" - ;; - --skip-non-versioned-files|-[Ss]kip[Nn]on[Vv]ersioned[Ff]iles) - override_non_versioned_files=false - ;; - -?|--?|-h|--help|-[Hh]elp) - script_name="$(basename "$0")" - echo ".NET Tools Installer" - echo "Usage: $script_name [-c|--channel ] [-v|--version ] [-p|--prefix ]" - echo " $script_name -h|-?|--help" - echo "" - echo "$script_name is a simple command line interface for obtaining dotnet cli." - echo "" - echo "Options:" - echo " -c,--channel Download from the channel specified, Defaults to \`$channel\`." - echo " -Channel" - echo " Possible values:" - echo " - Current - most current release" - echo " - LTS - most current supported release" - echo " - 2-part version in a format A.B - represents a specific release" - echo " examples: 2.0; 1.0" - echo " - Branch name" - echo " examples: release/2.0.0; Master" - echo " -v,--version Use specific VERSION, Defaults to \`$version\`." - echo " -Version" - echo " Possible values:" - echo " - latest - most latest build on specific channel" - echo " - coherent - most latest coherent build on specific channel" - echo " coherent applies only to SDK downloads" - echo " - 3-part version in a format A.B.C - represents specific version of build" - echo " examples: 2.0.0-preview2-006120; 1.1.0" - echo " -i,--install-dir Install under specified location (see Install Location below)" - echo " -InstallDir" - echo " --architecture Architecture of dotnet binaries to be installed, Defaults to \`$architecture\`." - echo " --arch,-Architecture,-Arch" - echo " Possible values: x64, arm, and arm64" - echo " --runtime Installs a shared runtime only, without the SDK." - echo " -Runtime" - echo " Possible values:" - echo " - dotnet - the Microsoft.NETCore.App shared runtime" - echo " - aspnetcore - the Microsoft.AspNetCore.App shared runtime" - echo " --skip-non-versioned-files Skips non-versioned files if they already exist, such as the dotnet executable." - echo " -SkipNonVersionedFiles" - echo " --dry-run,-DryRun Do not perform installation. Display download link." - echo " --no-path, -NoPath Do not set PATH for the current process." - echo " --verbose,-Verbose Display diagnostics information." - echo " --azure-feed,-AzureFeed Azure feed location. Defaults to $azure_feed, This parameter typically is not changed by the user." - echo " --uncached-feed,-UncachedFeed Uncached feed location. This parameter typically is not changed by the user." - echo " --no-cdn,-NoCdn Disable downloading from the Azure CDN, and use the uncached feed directly." - echo " --feed-credential,-FeedCredential Azure feed shared access token. This parameter typically is not specified." - echo " --runtime-id Installs the .NET Tools for the given platform (use linux-x64 for portable linux)." - echo " -RuntimeId" - echo " -?,--?,-h,--help,-Help Shows this help message" - echo "" - echo "Obsolete parameters:" - echo " --shared-runtime The recommended alternative is '--runtime dotnet'." - echo " -SharedRuntime Installs just the shared runtime bits, not the entire SDK." - echo "" - echo "Install Location:" - echo " Location is chosen in following order:" - echo " - --install-dir option" - echo " - Environmental variable DOTNET_INSTALL_DIR" - echo " - $HOME/.dotnet" - exit 0 - ;; - *) - say_err "Unknown argument \`$name\`" - exit 1 - ;; - esac - - shift -done - -if [ "$no_cdn" = true ]; then - azure_feed="$uncached_feed" -fi - -check_min_reqs -calculate_vars - -if [ "$dry_run" = true ]; then - say "Payload URL: $download_link" - if [ "$valid_legacy_download_link" = true ]; then - say "Legacy payload URL: $legacy_download_link" - fi - say "Repeatable invocation: ./$(basename "$0") --version $specific_version --channel $channel --install-dir $install_dir" - exit 0 -fi - -check_pre_reqs -install_dotnet - -bin_path="$(get_absolute_path "$(combine_paths "$install_root" "$bin_folder_relative_path")")" -if [ "$no_path" = false ]; then - say "Adding to current process PATH: \`$bin_path\`. Note: This change will be visible only when sourcing script." - export PATH="$bin_path":"$PATH" -else - say "Binaries of dotnet can be found in $bin_path" -fi - -say "Installation finished successfully." diff --git a/scripts/init-tools.cmd b/scripts/init-tools.cmd deleted file mode 100644 index e075d5ccef5..00000000000 --- a/scripts/init-tools.cmd +++ /dev/null @@ -1,38 +0,0 @@ -@echo off -setlocal enabledelayedexpansion - -set /p DOTNET_TOOLS_VERSION=<"%~dp0..\DotnetCLIToolsVersion.txt" -set DOTNET_TOOLS_PATH=%~dp0..\artifacts\toolset\dotnet -set dotnetexe=%DOTNET_TOOLS_PATH%\dotnet.exe -set sdksentinel=%DOTNET_TOOLS_PATH%\sdk-version.txt - -:: remove an old copy of the SDK -set cleanup_existing= -if exist "%sdksentinel%" ( - set /p INSTALLED_SDK_VERSION=<"%sdksentinel%" - if not "%DOTNET_TOOLS_VERSION%" == "!INSTALLED_SDK_VERSION!" ( - :: wrong version installed, clean it up - set cleanup_existing=1 - - ) else ( - echo Found up-to-date SDK. - ) -) else ( - set cleanup_existing=1 -) - -if "!cleanup_existing!" == "1" ( - echo Removing stale SDK. - rmdir /s /q "%DOTNET_TOOLS_PATH%" -) - -:: download and install SDK -if not exist "%dotnetexe%" ( - echo powershell -ExecutionPolicy unrestricted -NoProfile -Command ".\scripts\dotnet-install.ps1 -InstallDir %DOTNET_TOOLS_PATH% -Architecture x64 -Version %DOTNET_TOOLS_VERSION% -NoPath true; exit $LastExitCode;" - powershell -ExecutionPolicy unrestricted -NoProfile -Command ".\scripts\dotnet-install.ps1 -InstallDir %DOTNET_TOOLS_PATH% -Architecture x64 -Version %DOTNET_TOOLS_VERSION% -NoPath true; exit $LastExitCode;" - if errorlevel 1 ( - echo ERROR: Could not install dotnet cli correctly. - exit /b 1 - ) - echo %DOTNET_TOOLS_VERSION%>"%sdksentinel%" -) diff --git a/scripts/init-tools.sh b/scripts/init-tools.sh deleted file mode 100644 index a8ecd8cab85..00000000000 --- a/scripts/init-tools.sh +++ /dev/null @@ -1,176 +0,0 @@ -#!/usr/bin/env bash - -__scriptpath=$(cd "$(dirname "$0")"; pwd -P) -__init_tools_log=$__scriptpath/init-tools.log -__PACKAGES_DIR=$__scriptpath/packages -__TOOLRUNTIME_DIR=$__scriptpath/Tools - -__DOTNET_PATH=$__TOOLRUNTIME_DIR/dotnetcli -__DOTNET_CMD=$__DOTNET_PATH/dotnet -__DOTNET_VERSION=$(cat $__scriptpath/../DotnetCLIVersion.txt) - -if [ -z "$__BUILDTOOLS_SOURCE" ]; then __BUILDTOOLS_SOURCE=https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json; fi -__BUILD_TOOLS_PACKAGE_VERSION=$(cat $__scriptpath/../BuildToolsVersion.txt) - - -__BUILD_TOOLS_PATH=$__PACKAGES_DIR/microsoft.dotnet.buildtools/$__BUILD_TOOLS_PACKAGE_VERSION/lib -__PROJECT_JSON_PATH=$__TOOLRUNTIME_DIR/$__BUILD_TOOLS_PACKAGE_VERSION -__PROJECT_JSON_FILE=$__PROJECT_JSON_PATH/project.json -__PROJECT_JSON_CONTENTS="{ \"dependencies\": { \"Microsoft.DotNet.BuildTools\": \"$__BUILD_TOOLS_PACKAGE_VERSION\" }, \"frameworks\": { \"netcoreapp1.0\": { } } }" -__INIT_TOOLS_DONE_MARKER=$__PROJECT_JSON_PATH/done - -# Extended version of platform detection logic from dotnet/cli/scripts/obtain/dotnet-install.sh 16692fc -get_current_linux_name() { - # Detect Distro - if [ "$(cat /etc/*-release | grep -cim1 ubuntu)" -eq 1 ]; then - if [ "$(cat /etc/*-release | grep -cim1 16.04)" -eq 1 ]; then - echo "ubuntu.16.04" - return 0 - fi - if [ "$(cat /etc/*-release | grep -cim1 16.10)" -eq 1 ]; then - echo "ubuntu.16.10" - return 0 - fi - - echo "ubuntu" - return 0 - elif [ "$(cat /etc/*-release | grep -cim1 centos)" -eq 1 ]; then - echo "centos" - return 0 - elif [ "$(cat /etc/*-release | grep -cim1 rhel)" -eq 1 ]; then - echo "rhel" - return 0 - elif [ "$(cat /etc/*-release | grep -cim1 debian)" -eq 1 ]; then - echo "debian" - return 0 - elif [ "$(cat /etc/*-release | grep -cim1 alpine)" -eq 1 ]; then - echo "alpine" - return 0 - elif [ "$(cat /etc/*-release | grep -cim1 fedora)" -eq 1 ]; then - if [ "$(cat /etc/*-release | grep -cim1 23)" -eq 1 ]; then - echo "fedora.23" - return 0 - fi - if [ "$(cat /etc/*-release | grep -cim1 24)" -eq 1 ]; then - echo "fedora.24" - return 0 - fi - elif [ "$(cat /etc/*-release | grep -cim1 opensuse)" -eq 1 ]; then - if [ "$(cat /etc/*-release | grep -cim1 13.2)" -eq 1 ]; then - echo "opensuse.13.2" - return 0 - fi - if [ "$(cat /etc/*-release | grep -cim1 42.1)" -eq 1 ]; then - echo "opensuse.42.1" - return 0 - fi - fi - - # Cannot determine Linux distribution, assuming Ubuntu 14.04. - echo "ubuntu" - return 0 -} - -if [ -z "$__DOTNET_PKG" ]; then -OSName=$(uname -s) - case $OSName in - Darwin) - OS=OSX - __DOTNET_PKG=dotnet-dev-osx-x64 - ulimit -n 2048 - ;; - - Linux) - __DOTNET_PKG="dotnet-dev-$(get_current_linux_name)-x64" - OS=Linux - ;; - - *) - echo "Unsupported OS '$OSName' detected. Downloading ubuntu-x64 tools." - OS=Linux - __DOTNET_PKG=dotnet-dev-ubuntu-x64 - ;; - esac -fi - -if [ ! -e $__INIT_TOOLS_DONE_MARKER ]; then - __PATCH_CLI_NUGET_FRAMEWORKS=0 - - if [ -e $__TOOLRUNTIME_DIR ]; then rm -rf -- $__TOOLRUNTIME_DIR; fi - echo "Running: $__scriptpath/init-tools.sh" > $__init_tools_log - - if [ ! -e $__DOTNET_PATH ]; then - - mkdir -p "$__DOTNET_PATH" - - if [ -n "$DOTNET_TOOLSET_DIR" ] && [ -d "$DOTNET_TOOLSET_DIR/$__DOTNET_VERSION" ]; then - echo "Copying $DOTNET_TOOLSET_DIR/$__DOTNET_VERSION to $__DOTNET_PATH" >> $__init_tools_log - cp -r $DOTNET_TOOLSET_DIR/$__DOTNET_VERSION/* $__DOTNET_PATH - elif [ -n "$DOTNET_TOOL_DIR" ] && [ -d "$DOTNET_TOOL_DIR" ]; then - echo "Copying $DOTNET_TOOL_DIR to $__DOTNET_PATH" >> $__init_tools_log - cp -r $DOTNET_TOOL_DIR/* $__DOTNET_PATH - else - echo "Installing dotnet cli..." - echo "The dotnet cli is a large file it may take a few minutes ..." - ./scripts/dotnet-install.sh --install-dir "$__DOTNET_PATH" --architecture "x64" --runtime-id "linux-x64" --version "$__DOTNET_VERSION" - fi - fi - - if [ ! -e $__DOTNET_TOOLS_PATH ]; then - - mkdir -p "$__DOTNET_PATH" - - if [ -n "$DOTNET_TOOLSET_DIR" ] && [ -d "$DOTNET_TOOLSET_DIR/$__DOTNET_TOOLS_VERSION" ]; then - echo "Copying $DOTNET_TOOLSET_DIR/$__DOTNET_TOOLS_VERSION to $__DOTNET_TOOLS_PATH" >> $__init_tools_log - cp -r $DOTNET_TOOLSET_DIR/$__DOTNET_VERSION/* $__DOTNET_PATH - elif [ -n "$DOTNET_TOOL_DIR" ] && [ -d "$DOTNET_TOOL_DIR" ]; then - echo "Copying $DOTNET_TOOL_DIR to $__DOTNET_TOOLS_PATH" >> $__init_tools_log - cp -r $DOTNET_TOOL_DIR/* $__DOTNET_PATH - else - echo "Installing dotnet cli..." - echo "The dotnet cli is a large file it may take a few minutes ..." - ./scripts/dotnet-install.sh --channel "release/2.0.0" --install-dir "$__DOTNET_PATH" --architecture "x64" --runtime-id "linux-x64" --version "$__DOTNET_VERSION" - fi - fi - - if [ -n "$BUILD_TOOLS_TOOLSET_DIR" ] && [ -d "$BUILD_TOOLS_TOOLSET_DIR/$__BUILD_TOOLS_PACKAGE_VERSION" ]; then - echo "Copying $BUILD_TOOLS_TOOLSET_DIR/$__BUILD_TOOLS_PACKAGE_VERSION to $__TOOLRUNTIME_DIR" >> $__init_tools_log - cp -r $BUILD_TOOLS_TOOLSET_DIR/$__BUILD_TOOLS_PACKAGE_VERSION/* $__TOOLRUNTIME_DIR - elif [ -n "$BUILD_TOOLS_TOOL_DIR" ] && [ -d "$BUILD_TOOLS_TOOL_DIR" ]; then - echo "Copying $BUILD_TOOLS_TOOL_DIR to $__TOOLRUNTIME_DIR" >> $__init_tools_log - cp -r $BUILD_TOOLS_TOOL_DIR/* $__TOOLRUNTIME_DIR - else - if [ ! -d "$__PROJECT_JSON_PATH" ]; then mkdir "$__PROJECT_JSON_PATH"; fi - echo $__PROJECT_JSON_CONTENTS > "$__PROJECT_JSON_FILE" - - if [ ! -e $__BUILD_TOOLS_PATH ]; then - echo "Restoring BuildTools version $__BUILD_TOOLS_PACKAGE_VERSION..." - echo "Running: $__DOTNET_CMD restore \"$__PROJECT_JSON_FILE\" --no-cache --packages $__PACKAGES_DIR --source $__BUILDTOOLS_SOURCE" >> $__init_tools_log - $__DOTNET_CMD restore "$__PROJECT_JSON_FILE" --no-cache --packages $__PACKAGES_DIR --source $__BUILDTOOLS_SOURCE >> $__init_tools_log - if [ ! -e "$__BUILD_TOOLS_PATH/init-tools.sh" ]; then echo "ERROR: Could not restore build tools correctly. See '$__init_tools_log' for more details."1>&2; fi - fi - - echo "Initializing BuildTools..." - echo "Running: $__BUILD_TOOLS_PATH/init-tools.sh $__scriptpath $__DOTNET_CMD $__TOOLRUNTIME_DIR" >> $__init_tools_log - $__BUILD_TOOLS_PATH/init-tools.sh $__scriptpath $__DOTNET_CMD $__TOOLRUNTIME_DIR >> $__init_tools_log - if [ "$?" != "0" ]; then - echo "ERROR: An error occurred when trying to initialize the tools. Please check '$__init_tools_log' for more details."1>&2 - exit 1 - fi - fi - - if [ $__PATCH_CLI_NUGET_FRAMEWORKS -eq 1 ]; then - echo "Updating CLI NuGet Frameworks map..." - cp $__TOOLRUNTIME_DIR/NuGet.Frameworks.dll $__TOOLRUNTIME_DIR/dotnetcli/sdk/$__DOTNET_VERSION >> $__init_tools_log - if [ "$?" != "0" ]; then - echo "ERROR: An error occurred when updating Nuget for CLI . Please check '$__init_tools_log' for more details."1>&2 - exit 1 - fi - fi - - touch $__INIT_TOOLS_DONE_MARKER - - echo "Done initializing tools." -else - echo "Tools are already initialized" -fi \ No newline at end of file diff --git a/scripts/install-dotnetcli.ps1 b/scripts/install-dotnetcli.ps1 deleted file mode 100644 index c7fcc897108..00000000000 --- a/scripts/install-dotnetcli.ps1 +++ /dev/null @@ -1,11 +0,0 @@ -<# Copyright (c) Microsoft Corp. All Rights Reserved. See License.txt in the project root for license information. #> - -<# Download and install the dotnet cli #> - -$clipath = $args[0] -$BackUpPath = [System.IO.Path]::Combine($args[1], "dotnet-latest.zip") -$Destination = [System.IO.Path]::Combine($args[1], "dotnet") - -Invoke-WebRequest -UseBasicParsing $clipath -OutFile $BackUpPath -Add-Type -assembly "system.io.compression.filesystem" -[io.compression.zipfile]::ExtractToDirectory($BackUpPath, $destination) diff --git a/scripts/verify-translations.cmd b/scripts/verify-translations.cmd deleted file mode 100644 index b61d9533b07..00000000000 --- a/scripts/verify-translations.cmd +++ /dev/null @@ -1,3 +0,0 @@ -@echo off - -%~dp0..\artifacts\bin\fsi\Release\net472\fsi.exe %~dp0VerifyAllTranslations.fsx -- %~dp0 From fbdb7cb7f000f171a950bfcba6be39ae0cb6f913 Mon Sep 17 00:00:00 2001 From: Jimmy Byrd Date: Mon, 6 Jan 2025 08:27:13 -0600 Subject: [PATCH 18/19] Reduce excess memory usage in TransparentCompiler (#17543) --- .../.FSharp.Compiler.Service/9.0.200.md | 1 + src/Compiler/Service/FSharpProjectSnapshot.fs | 49 ++--- src/Compiler/Service/TransparentCompiler.fs | 170 +++++++++++++----- src/Compiler/Service/TransparentCompiler.fsi | 45 ++++- src/Compiler/Service/service.fs | 12 +- src/Compiler/Service/service.fsi | 5 +- ...ervice.SurfaceArea.netstandard20.debug.bsl | 78 +++++++- ...vice.SurfaceArea.netstandard20.release.bsl | 78 +++++++- ...y_FSharp.Compiler.Service_Debug_net9.0.bsl | 2 +- ....Compiler.Service_Debug_netstandard2.0.bsl | 2 +- ...FSharp.Compiler.Service_Release_net9.0.bsl | 2 +- ...ompiler.Service_Release_netstandard2.0.bsl | 2 +- 12 files changed, 367 insertions(+), 79 deletions(-) diff --git a/docs/release-notes/.FSharp.Compiler.Service/9.0.200.md b/docs/release-notes/.FSharp.Compiler.Service/9.0.200.md index 3faf69c220d..8bfd9d8155b 100644 --- a/docs/release-notes/.FSharp.Compiler.Service/9.0.200.md +++ b/docs/release-notes/.FSharp.Compiler.Service/9.0.200.md @@ -15,6 +15,7 @@ * Fix locals allocating for the special `copyOfStruct` defensive copy ([PR #18025](https://github.com/dotnet/fsharp/pull/18025)) * Fix lowering of computed array expressions when the expression consists of a simple mapping from a `uint64` or `unativeint` array. [PR #18081](https://github.com/dotnet/fsharp/pull/18081) * Add missing nullable-metadata for C# consumers of records,exceptions and DU subtypes generated from F# code. [PR #18079](https://github.com/dotnet/fsharp/pull/18079) +* Reduce excess memory usage in TransparentCompiler. [PR #17543](https://github.com/dotnet/fsharp/pull/17543) * Fix a race condition in file book keeping in the compiler service ([#18008](https://github.com/dotnet/fsharp/pull/18008)) * Fix trimming '%' characters when lowering interpolated string to a concat call [PR #18123](https://github.com/dotnet/fsharp/pull/18123) * Completion: fix qualified completion in sequence expressions [PR #18111](https://github.com/dotnet/fsharp/pull/18111) diff --git a/src/Compiler/Service/FSharpProjectSnapshot.fs b/src/Compiler/Service/FSharpProjectSnapshot.fs index 605e52afe35..030d070a375 100644 --- a/src/Compiler/Service/FSharpProjectSnapshot.fs +++ b/src/Compiler/Service/FSharpProjectSnapshot.fs @@ -747,26 +747,35 @@ and [] FSha FSharpProjectSnapshot.FromOptions(options, getFileSnapshot) -let rec internal snapshotToOptions (projectSnapshot: ProjectSnapshotBase<_>) = - { - ProjectFileName = projectSnapshot.ProjectFileName - ProjectId = projectSnapshot.ProjectId - SourceFiles = projectSnapshot.SourceFiles |> Seq.map (fun x -> x.FileName) |> Seq.toArray - OtherOptions = projectSnapshot.CommandLineOptions |> List.toArray - ReferencedProjects = - projectSnapshot.ReferencedProjects - |> Seq.map (function - | FSharpReference(name, opts) -> FSharpReferencedProject.FSharpReference(name, opts.ProjectSnapshot |> snapshotToOptions) - | PEReference(getStamp, reader) -> FSharpReferencedProject.PEReference(getStamp, reader) - | ILModuleReference(name, getStamp, getReader) -> FSharpReferencedProject.ILModuleReference(name, getStamp, getReader)) - |> Seq.toArray - IsIncompleteTypeCheckEnvironment = projectSnapshot.IsIncompleteTypeCheckEnvironment - UseScriptResolutionRules = projectSnapshot.UseScriptResolutionRules - LoadTime = projectSnapshot.LoadTime - UnresolvedReferences = projectSnapshot.UnresolvedReferences - OriginalLoadReferences = projectSnapshot.OriginalLoadReferences - Stamp = projectSnapshot.Stamp - } +let internal snapshotTable = + ConditionalWeakTable() + +let rec internal snapshotToOptions (projectSnapshot: ProjectSnapshot) = + snapshotTable.GetValue( + projectSnapshot, + fun projectSnapshot -> + { + ProjectFileName = projectSnapshot.ProjectFileName + ProjectId = projectSnapshot.ProjectId + SourceFiles = projectSnapshot.SourceFiles |> Seq.map (fun x -> x.FileName) |> Seq.toArray + OtherOptions = projectSnapshot.CommandLineOptions |> List.toArray + ReferencedProjects = + projectSnapshot.ReferencedProjects + |> Seq.map (function + | FSharpReference(name, opts) -> + FSharpReferencedProject.FSharpReference(name, opts.ProjectSnapshot |> snapshotToOptions) + | PEReference(getStamp, reader) -> FSharpReferencedProject.PEReference(getStamp, reader) + | ILModuleReference(name, getStamp, getReader) -> + FSharpReferencedProject.ILModuleReference(name, getStamp, getReader)) + |> Seq.toArray + IsIncompleteTypeCheckEnvironment = projectSnapshot.IsIncompleteTypeCheckEnvironment + UseScriptResolutionRules = projectSnapshot.UseScriptResolutionRules + LoadTime = projectSnapshot.LoadTime + UnresolvedReferences = projectSnapshot.UnresolvedReferences + OriginalLoadReferences = projectSnapshot.OriginalLoadReferences + Stamp = projectSnapshot.Stamp + } + ) [] type internal Extensions = diff --git a/src/Compiler/Service/TransparentCompiler.fs b/src/Compiler/Service/TransparentCompiler.fs index f5ec26102d3..bc15b6c3b67 100644 --- a/src/Compiler/Service/TransparentCompiler.fs +++ b/src/Compiler/Service/TransparentCompiler.fs @@ -259,44 +259,137 @@ module private TypeCheckingGraphProcessing = return finalFileResults, state } -type internal CompilerCaches(sizeFactor: int) = +type CacheSizes = + { + ParseFileKeepStrongly: int + ParseFileKeepWeakly: int + ParseFileWithoutProjectKeepStrongly: int + ParseFileWithoutProjectKeepWeakly: int + ParseAndCheckFileInProjectKeepStrongly: int + ParseAndCheckFileInProjectKeepWeakly: int + ParseAndCheckAllFilesInProjectKeepStrongly: int + ParseAndCheckAllFilesInProjectKeepWeakly: int + ParseAndCheckProjectKeepStrongly: int + ParseAndCheckProjectKeepWeakly: int + FrameworkImportsKeepStrongly: int + FrameworkImportsKeepWeakly: int + BootstrapInfoStaticKeepStrongly: int + BootstrapInfoStaticKeepWeakly: int + BootstrapInfoKeepStrongly: int + BootstrapInfoKeepWeakly: int + TcLastFileKeepStrongly: int + TcLastFileKeepWeakly: int + TcIntermediateKeepStrongly: int + TcIntermediateKeepWeakly: int + DependencyGraphKeepStrongly: int + DependencyGraphKeepWeakly: int + ProjectExtrasKeepStrongly: int + ProjectExtrasKeepWeakly: int + AssemblyDataKeepStrongly: int + AssemblyDataKeepWeakly: int + SemanticClassificationKeepStrongly: int + SemanticClassificationKeepWeakly: int + ItemKeyStoreKeepStrongly: int + ItemKeyStoreKeepWeakly: int + ScriptClosureKeepStrongly: int + ScriptClosureKeepWeakly: int + } + + static member Create sizeFactor = + + { + ParseFileKeepStrongly = 50 * sizeFactor + ParseFileKeepWeakly = 20 * sizeFactor + ParseFileWithoutProjectKeepStrongly = 5 * sizeFactor + ParseFileWithoutProjectKeepWeakly = 2 * sizeFactor + ParseAndCheckFileInProjectKeepStrongly = sizeFactor + ParseAndCheckFileInProjectKeepWeakly = 2 * sizeFactor + ParseAndCheckAllFilesInProjectKeepStrongly = sizeFactor + ParseAndCheckAllFilesInProjectKeepWeakly = 2 * sizeFactor + ParseAndCheckProjectKeepStrongly = sizeFactor + ParseAndCheckProjectKeepWeakly = 2 * sizeFactor + FrameworkImportsKeepStrongly = sizeFactor + FrameworkImportsKeepWeakly = 2 * sizeFactor + BootstrapInfoStaticKeepStrongly = sizeFactor + BootstrapInfoStaticKeepWeakly = 2 * sizeFactor + BootstrapInfoKeepStrongly = sizeFactor + BootstrapInfoKeepWeakly = 2 * sizeFactor + TcLastFileKeepStrongly = sizeFactor + TcLastFileKeepWeakly = 2 * sizeFactor + TcIntermediateKeepStrongly = 20 * sizeFactor + TcIntermediateKeepWeakly = 20 * sizeFactor + DependencyGraphKeepStrongly = sizeFactor + DependencyGraphKeepWeakly = 2 * sizeFactor + ProjectExtrasKeepStrongly = sizeFactor + ProjectExtrasKeepWeakly = 2 * sizeFactor + AssemblyDataKeepStrongly = sizeFactor + AssemblyDataKeepWeakly = 2 * sizeFactor + SemanticClassificationKeepStrongly = sizeFactor + SemanticClassificationKeepWeakly = 2 * sizeFactor + ItemKeyStoreKeepStrongly = sizeFactor + ItemKeyStoreKeepWeakly = 2 * sizeFactor + ScriptClosureKeepStrongly = sizeFactor + ScriptClosureKeepWeakly = 2 * sizeFactor + } - let sf = sizeFactor + static member Default = + let sizeFactor = 100 + CacheSizes.Create sizeFactor - member _.SizeFactor = sf +type internal CompilerCaches(cacheSizes: CacheSizes) = + let cs = cacheSizes - member val ParseFile = AsyncMemoize(keepStrongly = 50 * sf, keepWeakly = 20 * sf, name = "ParseFile") + member _.CacheSizes = cs + + member val ParseFile = AsyncMemoize(keepStrongly = cs.ParseFileKeepStrongly, keepWeakly = cs.ParseFileKeepWeakly, name = "ParseFile") member val ParseFileWithoutProject = - AsyncMemoize(keepStrongly = 5 * sf, keepWeakly = 2 * sf, name = "ParseFileWithoutProject") + AsyncMemoize( + cs.ParseFileWithoutProjectKeepStrongly, + keepWeakly = cs.ParseFileWithoutProjectKeepWeakly, + name = "ParseFileWithoutProject" + ) - member val ParseAndCheckFileInProject = AsyncMemoize(sf, 2 * sf, name = "ParseAndCheckFileInProject") + member val ParseAndCheckFileInProject = + AsyncMemoize( + cs.ParseAndCheckFileInProjectKeepStrongly, + cs.ParseAndCheckFileInProjectKeepWeakly, + name = "ParseAndCheckFileInProject" + ) - member val ParseAndCheckAllFilesInProject = AsyncMemoizeDisabled(sf, 2 * sf, name = "ParseAndCheckFullProject") + member val ParseAndCheckAllFilesInProject = + AsyncMemoizeDisabled( + cs.ParseAndCheckAllFilesInProjectKeepStrongly, + cs.ParseAndCheckAllFilesInProjectKeepWeakly, + name = "ParseAndCheckFullProject" + ) - member val ParseAndCheckProject = AsyncMemoize(sf, 2 * sf, name = "ParseAndCheckProject") + member val ParseAndCheckProject = + AsyncMemoize(cs.ParseAndCheckProjectKeepStrongly, cs.ParseAndCheckProjectKeepWeakly, name = "ParseAndCheckProject") - member val FrameworkImports = AsyncMemoize(sf, 2 * sf, name = "FrameworkImports") + member val FrameworkImports = AsyncMemoize(cs.FrameworkImportsKeepStrongly, cs.FrameworkImportsKeepWeakly, name = "FrameworkImports") - member val BootstrapInfoStatic = AsyncMemoize(sf, 2 * sf, name = "BootstrapInfoStatic") + member val BootstrapInfoStatic = + AsyncMemoize(cs.BootstrapInfoStaticKeepStrongly, cs.BootstrapInfoStaticKeepWeakly, name = "BootstrapInfoStatic") - member val BootstrapInfo = AsyncMemoize(sf, 2 * sf, name = "BootstrapInfo") + member val BootstrapInfo = AsyncMemoize(cs.BootstrapInfoKeepStrongly, cs.BootstrapInfoKeepWeakly, name = "BootstrapInfo") - member val TcLastFile = AsyncMemoizeDisabled(sf, 2 * sf, name = "TcLastFile") + member val TcLastFile = AsyncMemoizeDisabled(cs.TcLastFileKeepStrongly, cs.TcLastFileKeepWeakly, name = "TcLastFile") - member val TcIntermediate = AsyncMemoize(20 * sf, 20 * sf, name = "TcIntermediate") + member val TcIntermediate = AsyncMemoize(cs.TcIntermediateKeepStrongly, cs.TcIntermediateKeepWeakly, name = "TcIntermediate") - member val DependencyGraph = AsyncMemoize(sf, 2 * sf, name = "DependencyGraph") + member val DependencyGraph = AsyncMemoize(cs.DependencyGraphKeepStrongly, cs.DependencyGraphKeepWeakly, name = "DependencyGraph") - member val ProjectExtras = AsyncMemoizeDisabled(sf, 2 * sf, name = "ProjectExtras") + member val ProjectExtras = AsyncMemoizeDisabled(cs.ProjectExtrasKeepStrongly, cs.ProjectExtrasKeepWeakly, name = "ProjectExtras") - member val AssemblyData = AsyncMemoize(sf, 2 * sf, name = "AssemblyData") + member val AssemblyData = AsyncMemoize(cs.AssemblyDataKeepStrongly, cs.AssemblyDataKeepWeakly, name = "AssemblyData") - member val SemanticClassification = AsyncMemoize(sf, 2 * sf, name = "SemanticClassification") + member val SemanticClassification = + AsyncMemoize(cs.SemanticClassificationKeepStrongly, cs.SemanticClassificationKeepWeakly, name = "SemanticClassification") - member val ItemKeyStore = AsyncMemoize(sf, 2 * sf, name = "ItemKeyStore") + member val ItemKeyStore = AsyncMemoize(cs.ItemKeyStoreKeepStrongly, cs.ItemKeyStoreKeepWeakly, name = "ItemKeyStore") - member val ScriptClosure = AsyncMemoize(sf, 2 * sf, name = "ScriptClosure") + member val ScriptClosure = AsyncMemoize(cs.ScriptClosureKeepStrongly, cs.ScriptClosureKeepWeakly, name = "ScriptClosure") member this.Clear(projects: Set) = let shouldClear project = projects |> Set.contains project @@ -326,7 +419,8 @@ type internal TransparentCompiler parallelReferenceResolution, captureIdentifiersWhenParsing, getSource: (string -> Async) option, - useChangeNotifications + useChangeNotifications, + ?cacheSizes ) as self = let documentSource = @@ -337,8 +431,10 @@ type internal TransparentCompiler // Is having just one of these ok? let lexResourceManager = Lexhelp.LexResourceManager() + let cacheSizes = defaultArg cacheSizes CacheSizes.Default + // Mutable so we can easily clear them by creating a new instance - let mutable caches = CompilerCaches(100) + let mutable caches = CompilerCaches(cacheSizes) // TODO: do we need this? //let maxTypeCheckingParallelism = max 1 (Environment.ProcessorCount / 2) @@ -1371,17 +1467,6 @@ type internal TransparentCompiler node, (fun tcInfo -> - if tcInfo.stateContainsNodes |> Set.contains fileNode then - failwith $"Oops!" - - //if - // tcInfo.stateContainsNodes - // Signature files don't have to be right above the impl file... if we need this check then - // we need to do it differently - // |> Set.contains (NodeToTypeCheck.ArtificialImplFile(index - 1)) - //then - // failwith $"Oops???" - let partialResult, tcState = finisher tcInfo.tcState let tcEnv, topAttribs, _checkImplFileOpt, ccuSigForFile = partialResult @@ -1417,15 +1502,6 @@ type internal TransparentCompiler fileNode, (fun tcInfo -> - if tcInfo.stateContainsNodes |> Set.contains fileNode then - failwith $"Oops!" - - // if - // tcInfo.stateContainsNodes - // |> Set.contains (NodeToTypeCheck.PhysicalFile(index + 1)) - // then - // failwith $"Oops!!!" - let parsedInput = projectSnapshot.SourceFiles[index].ParsedInput let prefixPathOpt = None // Retrieve the type-checked signature information and add it to the TcEnvFromImpls. @@ -2087,9 +2163,13 @@ type internal TransparentCompiler member _.Caches = caches - member _.SetCacheSizeFactor(sizeFactor: int) = - if sizeFactor <> caches.SizeFactor then - caches <- CompilerCaches(sizeFactor) + member _.SetCacheSize(cacheSize: CacheSizes) = + if cacheSize <> caches.CacheSizes then + caches <- CompilerCaches(cacheSize) + + member x.SetCacheSizeFactor(sizeFactor: int) = + let newCacheSize = CacheSizes.Create sizeFactor + x.SetCacheSize newCacheSize interface IBackgroundCompiler with @@ -2151,7 +2231,7 @@ type internal TransparentCompiler member _.ClearCaches() : unit = backgroundCompiler.ClearCaches() - caches <- CompilerCaches(100) // TODO: check + caches <- CompilerCaches(cacheSizes) // TODO: check member _.DownsizeCaches() : unit = backgroundCompiler.DownsizeCaches() diff --git a/src/Compiler/Service/TransparentCompiler.fsi b/src/Compiler/Service/TransparentCompiler.fsi index ed4241f523d..93df10b29e2 100644 --- a/src/Compiler/Service/TransparentCompiler.fsi +++ b/src/Compiler/Service/TransparentCompiler.fsi @@ -98,9 +98,46 @@ type internal Extensions = fileSnapshots: #ProjectSnapshot.IFileSnapshot list * ?extraKeyFlag: DependencyGraphType -> ICacheKey<(DependencyGraphType option * byte array), string> +[] +type CacheSizes = + { ParseFileKeepStrongly: int + ParseFileKeepWeakly: int + ParseFileWithoutProjectKeepStrongly: int + ParseFileWithoutProjectKeepWeakly: int + ParseAndCheckFileInProjectKeepStrongly: int + ParseAndCheckFileInProjectKeepWeakly: int + ParseAndCheckAllFilesInProjectKeepStrongly: int + ParseAndCheckAllFilesInProjectKeepWeakly: int + ParseAndCheckProjectKeepStrongly: int + ParseAndCheckProjectKeepWeakly: int + FrameworkImportsKeepStrongly: int + FrameworkImportsKeepWeakly: int + BootstrapInfoStaticKeepStrongly: int + BootstrapInfoStaticKeepWeakly: int + BootstrapInfoKeepStrongly: int + BootstrapInfoKeepWeakly: int + TcLastFileKeepStrongly: int + TcLastFileKeepWeakly: int + TcIntermediateKeepStrongly: int + TcIntermediateKeepWeakly: int + DependencyGraphKeepStrongly: int + DependencyGraphKeepWeakly: int + ProjectExtrasKeepStrongly: int + ProjectExtrasKeepWeakly: int + AssemblyDataKeepStrongly: int + AssemblyDataKeepWeakly: int + SemanticClassificationKeepStrongly: int + SemanticClassificationKeepWeakly: int + ItemKeyStoreKeepStrongly: int + ItemKeyStoreKeepWeakly: int + ScriptClosureKeepStrongly: int + ScriptClosureKeepWeakly: int } + + static member Create: sizeFactor: int -> CacheSizes + type internal CompilerCaches = - new: sizeFactor: int -> CompilerCaches + new: cacheSizes: CacheSizes -> CompilerCaches member AssemblyData: AsyncMemoize @@ -134,7 +171,7 @@ type internal CompilerCaches = member SemanticClassification: AsyncMemoize<(string * FSharpProjectIdentifier), string, SemanticClassificationView option> - member SizeFactor: int + member CacheSizes: CacheSizes member TcIntermediate: AsyncMemoize<(string * FSharpProjectIdentifier), (string * int), TcIntermediate> @@ -158,7 +195,8 @@ type internal TransparentCompiler = parallelReferenceResolution: ParallelReferenceResolution * captureIdentifiersWhenParsing: bool * getSource: (string -> Async) option * - useChangeNotifications: bool -> + useChangeNotifications: bool * + ?cacheSizes: CacheSizes -> TransparentCompiler member FindReferencesInFile: @@ -177,6 +215,7 @@ type internal TransparentCompiler = fileName: string * projectSnapshot: ProjectSnapshot.ProjectSnapshot * _userOpName: 'a -> Async + member SetCacheSize: cacheSize: CacheSizes -> unit member SetCacheSizeFactor: sizeFactor: int -> unit member Caches: CompilerCaches diff --git a/src/Compiler/Service/service.fs b/src/Compiler/Service/service.fs index 3e42e03223c..4835b784bf8 100644 --- a/src/Compiler/Service/service.fs +++ b/src/Compiler/Service/service.fs @@ -117,7 +117,8 @@ type FSharpChecker captureIdentifiersWhenParsing, getSource, useChangeNotifications, - useTransparentCompiler + useTransparentCompiler, + ?transparentCompilerCacheSizes ) = let backgroundCompiler = @@ -135,7 +136,8 @@ type FSharpChecker parallelReferenceResolution, captureIdentifiersWhenParsing, getSource, - useChangeNotifications + useChangeNotifications, + ?cacheSizes = transparentCompilerCacheSizes ) :> IBackgroundCompiler else @@ -198,7 +200,8 @@ type FSharpChecker ?parallelReferenceResolution: bool, ?captureIdentifiersWhenParsing: bool, ?documentSource: DocumentSource, - ?useTransparentCompiler: bool + ?useTransparentCompiler: bool, + ?transparentCompilerCacheSizes: CacheSizes ) = use _ = Activity.startNoTags "FSharpChecker.Create" @@ -247,7 +250,8 @@ type FSharpChecker | Some(DocumentSource.Custom f) -> Some f | _ -> None), useChangeNotifications, - useTransparentCompiler + useTransparentCompiler, + ?transparentCompilerCacheSizes = transparentCompilerCacheSizes ) member _.UsesTransparentCompiler = useTransparentCompiler = Some true diff --git a/src/Compiler/Service/service.fsi b/src/Compiler/Service/service.fsi index 3e4fde2229c..58c4a8c1dfb 100644 --- a/src/Compiler/Service/service.fsi +++ b/src/Compiler/Service/service.fsi @@ -39,6 +39,7 @@ type public FSharpChecker = /// When set to true we create a set of all identifiers for each parsed file which can be used to speed up finding references. /// Default: FileSystem. You can use Custom source to provide a function that will return the source for a given file path instead of reading it from the file system. Note that with this option the FSharpChecker will also not monitor the file system for file changes. It will expect to be notified of changes via the NotifyFileChanged method. /// Default: false. Indicates whether we use a new experimental background compiler. This does not yet support all features + /// Default: None. The cache sizes for the transparent compiler static member Create: ?projectCacheSize: int * ?keepAssemblyContents: bool * @@ -54,7 +55,9 @@ type public FSharpChecker = [] ?documentSource: DocumentSource * [] ?useTransparentCompiler: - bool -> + bool * + [] ?transparentCompilerCacheSizes: + CacheSizes -> FSharpChecker [] diff --git a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.debug.bsl b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.debug.bsl index db4105530c8..cf5037bc449 100644 --- a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.debug.bsl +++ b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.debug.bsl @@ -2110,7 +2110,7 @@ FSharp.Compiler.CodeAnalysis.FSharpCheckProjectResults: System.String[] Dependen FSharp.Compiler.CodeAnalysis.FSharpCheckProjectResults: System.String[] get_DependencyFiles() FSharp.Compiler.CodeAnalysis.FSharpChecker: Boolean UsesTransparentCompiler FSharp.Compiler.CodeAnalysis.FSharpChecker: Boolean get_UsesTransparentCompiler() -FSharp.Compiler.CodeAnalysis.FSharpChecker: FSharp.Compiler.CodeAnalysis.FSharpChecker Create(Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.CodeAnalysis.LegacyReferenceResolver], Microsoft.FSharp.Core.FSharpOption`1[Microsoft.FSharp.Core.FSharpFunc`2[System.Tuple`2[System.String,System.DateTime],Microsoft.FSharp.Core.FSharpOption`1[System.Tuple`3[System.Object,System.IntPtr,System.Int32]]]], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.CodeAnalysis.DocumentSource], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean]) +FSharp.Compiler.CodeAnalysis.FSharpChecker: FSharp.Compiler.CodeAnalysis.FSharpChecker Create(Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.CodeAnalysis.LegacyReferenceResolver], Microsoft.FSharp.Core.FSharpOption`1[Microsoft.FSharp.Core.FSharpFunc`2[System.Tuple`2[System.String,System.DateTime],Microsoft.FSharp.Core.FSharpOption`1[System.Tuple`3[System.Object,System.IntPtr,System.Int32]]]], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.CodeAnalysis.DocumentSource], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes]) FSharp.Compiler.CodeAnalysis.FSharpChecker: FSharp.Compiler.CodeAnalysis.FSharpChecker Instance FSharp.Compiler.CodeAnalysis.FSharpChecker: FSharp.Compiler.CodeAnalysis.FSharpChecker get_Instance() FSharp.Compiler.CodeAnalysis.FSharpChecker: FSharp.Compiler.CodeAnalysis.FSharpProjectOptions GetProjectOptionsFromCommandLineArgs(System.String, System.String[], Microsoft.FSharp.Core.FSharpOption`1[System.DateTime], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean]) @@ -2547,6 +2547,82 @@ FSharp.Compiler.CodeAnalysis.ProjectSnapshot: FSharp.Compiler.CodeAnalysis.Proje FSharp.Compiler.CodeAnalysis.ProjectSnapshot: FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpReferencedProjectSnapshot FSharp.Compiler.CodeAnalysis.ProjectSnapshot: FSharp.Compiler.CodeAnalysis.ProjectSnapshot+ProjectConfig FSharp.Compiler.CodeAnalysis.ProjectSnapshot: FSharp.Compiler.CodeAnalysis.ProjectSnapshot+ReferenceOnDisk +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Boolean Equals(FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes) +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Boolean Equals(FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes, System.Collections.IEqualityComparer) +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Boolean Equals(System.Object) +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Boolean Equals(System.Object, System.Collections.IEqualityComparer) +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes Create(Int32) +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 AssemblyDataKeepStrongly +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 AssemblyDataKeepWeakly +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 BootstrapInfoKeepStrongly +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 BootstrapInfoKeepWeakly +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 BootstrapInfoStaticKeepStrongly +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 BootstrapInfoStaticKeepWeakly +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 CompareTo(FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes) +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 CompareTo(System.Object) +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 CompareTo(System.Object, System.Collections.IComparer) +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 DependencyGraphKeepStrongly +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 DependencyGraphKeepWeakly +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 FrameworkImportsKeepStrongly +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 FrameworkImportsKeepWeakly +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 GetHashCode() +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 GetHashCode(System.Collections.IEqualityComparer) +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 ItemKeyStoreKeepStrongly +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 ItemKeyStoreKeepWeakly +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 ParseAndCheckAllFilesInProjectKeepStrongly +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 ParseAndCheckAllFilesInProjectKeepWeakly +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 ParseAndCheckFileInProjectKeepStrongly +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 ParseAndCheckFileInProjectKeepWeakly +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 ParseAndCheckProjectKeepStrongly +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 ParseAndCheckProjectKeepWeakly +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 ParseFileKeepStrongly +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 ParseFileKeepWeakly +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 ParseFileWithoutProjectKeepStrongly +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 ParseFileWithoutProjectKeepWeakly +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 ProjectExtrasKeepStrongly +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 ProjectExtrasKeepWeakly +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 ScriptClosureKeepStrongly +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 ScriptClosureKeepWeakly +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 SemanticClassificationKeepStrongly +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 SemanticClassificationKeepWeakly +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 TcIntermediateKeepStrongly +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 TcIntermediateKeepWeakly +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 TcLastFileKeepStrongly +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 TcLastFileKeepWeakly +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 get_AssemblyDataKeepStrongly() +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 get_AssemblyDataKeepWeakly() +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 get_BootstrapInfoKeepStrongly() +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 get_BootstrapInfoKeepWeakly() +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 get_BootstrapInfoStaticKeepStrongly() +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 get_BootstrapInfoStaticKeepWeakly() +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 get_DependencyGraphKeepStrongly() +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 get_DependencyGraphKeepWeakly() +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 get_FrameworkImportsKeepStrongly() +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 get_FrameworkImportsKeepWeakly() +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 get_ItemKeyStoreKeepStrongly() +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 get_ItemKeyStoreKeepWeakly() +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 get_ParseAndCheckAllFilesInProjectKeepStrongly() +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 get_ParseAndCheckAllFilesInProjectKeepWeakly() +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 get_ParseAndCheckFileInProjectKeepStrongly() +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 get_ParseAndCheckFileInProjectKeepWeakly() +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 get_ParseAndCheckProjectKeepStrongly() +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 get_ParseAndCheckProjectKeepWeakly() +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 get_ParseFileKeepStrongly() +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 get_ParseFileKeepWeakly() +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 get_ParseFileWithoutProjectKeepStrongly() +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 get_ParseFileWithoutProjectKeepWeakly() +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 get_ProjectExtrasKeepStrongly() +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 get_ProjectExtrasKeepWeakly() +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 get_ScriptClosureKeepStrongly() +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 get_ScriptClosureKeepWeakly() +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 get_SemanticClassificationKeepStrongly() +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 get_SemanticClassificationKeepWeakly() +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 get_TcIntermediateKeepStrongly() +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 get_TcIntermediateKeepWeakly() +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 get_TcLastFileKeepStrongly() +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 get_TcLastFileKeepWeakly() +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: System.String ToString() +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Void .ctor(Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32) FSharp.Compiler.CodeAnalysis.Workspace.FSharpWorkspace: FSharp.Compiler.CodeAnalysis.FSharpChecker Checker FSharp.Compiler.CodeAnalysis.Workspace.FSharpWorkspace: FSharp.Compiler.CodeAnalysis.FSharpChecker get_Checker() FSharp.Compiler.CodeAnalysis.Workspace.FSharpWorkspace: FSharpWorkspaceFiles Files diff --git a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.release.bsl b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.release.bsl index db4105530c8..cf5037bc449 100644 --- a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.release.bsl +++ b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.release.bsl @@ -2110,7 +2110,7 @@ FSharp.Compiler.CodeAnalysis.FSharpCheckProjectResults: System.String[] Dependen FSharp.Compiler.CodeAnalysis.FSharpCheckProjectResults: System.String[] get_DependencyFiles() FSharp.Compiler.CodeAnalysis.FSharpChecker: Boolean UsesTransparentCompiler FSharp.Compiler.CodeAnalysis.FSharpChecker: Boolean get_UsesTransparentCompiler() -FSharp.Compiler.CodeAnalysis.FSharpChecker: FSharp.Compiler.CodeAnalysis.FSharpChecker Create(Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.CodeAnalysis.LegacyReferenceResolver], Microsoft.FSharp.Core.FSharpOption`1[Microsoft.FSharp.Core.FSharpFunc`2[System.Tuple`2[System.String,System.DateTime],Microsoft.FSharp.Core.FSharpOption`1[System.Tuple`3[System.Object,System.IntPtr,System.Int32]]]], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.CodeAnalysis.DocumentSource], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean]) +FSharp.Compiler.CodeAnalysis.FSharpChecker: FSharp.Compiler.CodeAnalysis.FSharpChecker Create(Microsoft.FSharp.Core.FSharpOption`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.CodeAnalysis.LegacyReferenceResolver], Microsoft.FSharp.Core.FSharpOption`1[Microsoft.FSharp.Core.FSharpFunc`2[System.Tuple`2[System.String,System.DateTime],Microsoft.FSharp.Core.FSharpOption`1[System.Tuple`3[System.Object,System.IntPtr,System.Int32]]]], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.CodeAnalysis.DocumentSource], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes]) FSharp.Compiler.CodeAnalysis.FSharpChecker: FSharp.Compiler.CodeAnalysis.FSharpChecker Instance FSharp.Compiler.CodeAnalysis.FSharpChecker: FSharp.Compiler.CodeAnalysis.FSharpChecker get_Instance() FSharp.Compiler.CodeAnalysis.FSharpChecker: FSharp.Compiler.CodeAnalysis.FSharpProjectOptions GetProjectOptionsFromCommandLineArgs(System.String, System.String[], Microsoft.FSharp.Core.FSharpOption`1[System.DateTime], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean]) @@ -2547,6 +2547,82 @@ FSharp.Compiler.CodeAnalysis.ProjectSnapshot: FSharp.Compiler.CodeAnalysis.Proje FSharp.Compiler.CodeAnalysis.ProjectSnapshot: FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpReferencedProjectSnapshot FSharp.Compiler.CodeAnalysis.ProjectSnapshot: FSharp.Compiler.CodeAnalysis.ProjectSnapshot+ProjectConfig FSharp.Compiler.CodeAnalysis.ProjectSnapshot: FSharp.Compiler.CodeAnalysis.ProjectSnapshot+ReferenceOnDisk +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Boolean Equals(FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes) +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Boolean Equals(FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes, System.Collections.IEqualityComparer) +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Boolean Equals(System.Object) +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Boolean Equals(System.Object, System.Collections.IEqualityComparer) +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes Create(Int32) +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 AssemblyDataKeepStrongly +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 AssemblyDataKeepWeakly +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 BootstrapInfoKeepStrongly +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 BootstrapInfoKeepWeakly +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 BootstrapInfoStaticKeepStrongly +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 BootstrapInfoStaticKeepWeakly +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 CompareTo(FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes) +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 CompareTo(System.Object) +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 CompareTo(System.Object, System.Collections.IComparer) +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 DependencyGraphKeepStrongly +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 DependencyGraphKeepWeakly +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 FrameworkImportsKeepStrongly +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 FrameworkImportsKeepWeakly +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 GetHashCode() +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 GetHashCode(System.Collections.IEqualityComparer) +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 ItemKeyStoreKeepStrongly +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 ItemKeyStoreKeepWeakly +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 ParseAndCheckAllFilesInProjectKeepStrongly +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 ParseAndCheckAllFilesInProjectKeepWeakly +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 ParseAndCheckFileInProjectKeepStrongly +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 ParseAndCheckFileInProjectKeepWeakly +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 ParseAndCheckProjectKeepStrongly +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 ParseAndCheckProjectKeepWeakly +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 ParseFileKeepStrongly +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 ParseFileKeepWeakly +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 ParseFileWithoutProjectKeepStrongly +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 ParseFileWithoutProjectKeepWeakly +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 ProjectExtrasKeepStrongly +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 ProjectExtrasKeepWeakly +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 ScriptClosureKeepStrongly +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 ScriptClosureKeepWeakly +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 SemanticClassificationKeepStrongly +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 SemanticClassificationKeepWeakly +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 TcIntermediateKeepStrongly +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 TcIntermediateKeepWeakly +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 TcLastFileKeepStrongly +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 TcLastFileKeepWeakly +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 get_AssemblyDataKeepStrongly() +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 get_AssemblyDataKeepWeakly() +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 get_BootstrapInfoKeepStrongly() +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 get_BootstrapInfoKeepWeakly() +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 get_BootstrapInfoStaticKeepStrongly() +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 get_BootstrapInfoStaticKeepWeakly() +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 get_DependencyGraphKeepStrongly() +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 get_DependencyGraphKeepWeakly() +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 get_FrameworkImportsKeepStrongly() +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 get_FrameworkImportsKeepWeakly() +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 get_ItemKeyStoreKeepStrongly() +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 get_ItemKeyStoreKeepWeakly() +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 get_ParseAndCheckAllFilesInProjectKeepStrongly() +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 get_ParseAndCheckAllFilesInProjectKeepWeakly() +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 get_ParseAndCheckFileInProjectKeepStrongly() +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 get_ParseAndCheckFileInProjectKeepWeakly() +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 get_ParseAndCheckProjectKeepStrongly() +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 get_ParseAndCheckProjectKeepWeakly() +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 get_ParseFileKeepStrongly() +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 get_ParseFileKeepWeakly() +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 get_ParseFileWithoutProjectKeepStrongly() +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 get_ParseFileWithoutProjectKeepWeakly() +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 get_ProjectExtrasKeepStrongly() +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 get_ProjectExtrasKeepWeakly() +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 get_ScriptClosureKeepStrongly() +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 get_ScriptClosureKeepWeakly() +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 get_SemanticClassificationKeepStrongly() +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 get_SemanticClassificationKeepWeakly() +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 get_TcIntermediateKeepStrongly() +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 get_TcIntermediateKeepWeakly() +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 get_TcLastFileKeepStrongly() +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Int32 get_TcLastFileKeepWeakly() +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: System.String ToString() +FSharp.Compiler.CodeAnalysis.TransparentCompiler.CacheSizes: Void .ctor(Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32) FSharp.Compiler.CodeAnalysis.Workspace.FSharpWorkspace: FSharp.Compiler.CodeAnalysis.FSharpChecker Checker FSharp.Compiler.CodeAnalysis.Workspace.FSharpWorkspace: FSharp.Compiler.CodeAnalysis.FSharpChecker get_Checker() FSharp.Compiler.CodeAnalysis.Workspace.FSharpWorkspace: FSharpWorkspaceFiles Files diff --git a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_net9.0.bsl b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_net9.0.bsl index 901f7434dfd..1f0b8002279 100644 --- a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_net9.0.bsl +++ b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_net9.0.bsl @@ -15,7 +15,7 @@ [IL]: Error [ReturnPtrToStack]: : FSharp.Compiler.CodeAnalysis.ItemKeyStore::ReadFirstKeyString()][offset 0x00000070] Return type is ByRef, TypedReference, ArgHandle, or ArgIterator. [IL]: Error [StackUnexpected]: : FSharp.Compiler.CodeAnalysis.ItemKeyStoreBuilder::writeRange([FSharp.Compiler.Service]FSharp.Compiler.Text.Range)][offset 0x00000011][found address of '[FSharp.Compiler.Service]FSharp.Compiler.Text.Range'][expected Native Int] Unexpected type on the stack. [IL]: Error [ExpectedNumericType]: : FSharp.Compiler.EditorServices.SemanticClassificationKeyStoreBuilder::WriteAll([FSharp.Compiler.Service]FSharp.Compiler.EditorServices.SemanticClassificationItem[])][offset 0x0000001D][found address of '[FSharp.Compiler.Service]FSharp.Compiler.EditorServices.SemanticClassificationItem'] Expected numeric type on the stack. -[IL]: Error [StackUnexpected]: : FSharp.Compiler.CodeAnalysis.FSharpChecker::.ctor([FSharp.Compiler.Service]FSharp.Compiler.CodeAnalysis.LegacyReferenceResolver, int32, bool, bool, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.FSharpOption`1>>, bool, bool, bool, bool, [FSharp.Compiler.Service]FSharp.Compiler.CompilerConfig+ParallelReferenceResolution, bool, [FSharp.Core]Microsoft.FSharp.Core.FSharpOption`1>>>, bool, [FSharp.Core]Microsoft.FSharp.Core.FSharpOption`1)][offset 0x000000A2][found ref 'object'][expected ref '[FSharp.Compiler.Service]FSharp.Compiler.CodeAnalysis.IBackgroundCompiler'] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : FSharp.Compiler.CodeAnalysis.FSharpChecker::.ctor([FSharp.Compiler.Service]FSharp.Compiler.CodeAnalysis.LegacyReferenceResolver, int32, bool, bool, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.FSharpOption`1>>, bool, bool, bool, bool, [FSharp.Compiler.Service]FSharp.Compiler.CompilerConfig+ParallelReferenceResolution, bool, [FSharp.Core]Microsoft.FSharp.Core.FSharpOption`1>>>, bool, [FSharp.Core]Microsoft.FSharp.Core.FSharpOption`1, [FSharp.Core]Microsoft.FSharp.Core.FSharpOption`1)][offset 0x000000A4][found ref 'object'][expected ref '[FSharp.Compiler.Service]FSharp.Compiler.CodeAnalysis.IBackgroundCompiler'] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.CodeAnalysis.Hosted.CompilerHelpers::fscCompile([FSharp.Compiler.Service]FSharp.Compiler.CodeAnalysis.LegacyReferenceResolver, string, string[])][offset 0x0000005C][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.CodeAnalysis.Hosted.CompilerHelpers::fscCompile([FSharp.Compiler.Service]FSharp.Compiler.CodeAnalysis.LegacyReferenceResolver, string, string[])][offset 0x00000065][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.CodeAnalysis.Hosted.CompilerHelpers::fscCompile([FSharp.Compiler.Service]FSharp.Compiler.CodeAnalysis.LegacyReferenceResolver, string, string[])][offset 0x00000082][found Char] Unexpected type on the stack. diff --git a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl index 7ae4f3e43ca..2013e914ed5 100644 --- a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl +++ b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl @@ -20,7 +20,7 @@ [IL]: Error [StackUnexpected]: : FSharp.Compiler.CodeAnalysis.ItemKeyStoreBuilder::writeRange([FSharp.Compiler.Service]FSharp.Compiler.Text.Range)][offset 0x00000011][found address of '[FSharp.Compiler.Service]FSharp.Compiler.Text.Range'][expected Native Int] Unexpected type on the stack. [IL]: Error [ExpectedNumericType]: : FSharp.Compiler.EditorServices.SemanticClassificationKeyStoreBuilder::WriteAll([FSharp.Compiler.Service]FSharp.Compiler.EditorServices.SemanticClassificationItem[])][offset 0x0000001D][found address of '[FSharp.Compiler.Service]FSharp.Compiler.EditorServices.SemanticClassificationItem'] Expected numeric type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.EditorServices.Parent::FormatEntityFullName([FSharp.Compiler.Service]FSharp.Compiler.Symbols.FSharpEntity)][offset 0x00000069][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : FSharp.Compiler.CodeAnalysis.FSharpChecker::.ctor([FSharp.Compiler.Service]FSharp.Compiler.CodeAnalysis.LegacyReferenceResolver, int32, bool, bool, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.FSharpOption`1>>, bool, bool, bool, bool, [FSharp.Compiler.Service]FSharp.Compiler.CompilerConfig+ParallelReferenceResolution, bool, [FSharp.Core]Microsoft.FSharp.Core.FSharpOption`1>>>, bool, [FSharp.Core]Microsoft.FSharp.Core.FSharpOption`1)][offset 0x000000A2][found ref 'object'][expected ref '[FSharp.Compiler.Service]FSharp.Compiler.CodeAnalysis.IBackgroundCompiler'] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : FSharp.Compiler.CodeAnalysis.FSharpChecker::.ctor([FSharp.Compiler.Service]FSharp.Compiler.CodeAnalysis.LegacyReferenceResolver, int32, bool, bool, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.FSharpOption`1>>, bool, bool, bool, bool, [FSharp.Compiler.Service]FSharp.Compiler.CompilerConfig+ParallelReferenceResolution, bool, [FSharp.Core]Microsoft.FSharp.Core.FSharpOption`1>>>, bool, [FSharp.Core]Microsoft.FSharp.Core.FSharpOption`1, [FSharp.Core]Microsoft.FSharp.Core.FSharpOption`1)][offset 0x000000A4][found ref 'object'][expected ref '[FSharp.Compiler.Service]FSharp.Compiler.CodeAnalysis.IBackgroundCompiler'] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.CodeAnalysis.FSharpChecker::TokenizeFile(string)][offset 0x0000000D][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.CodeAnalysis.Hosted.CompilerHelpers::fscCompile([FSharp.Compiler.Service]FSharp.Compiler.CodeAnalysis.LegacyReferenceResolver, string, string[])][offset 0x0000005C][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.CodeAnalysis.Hosted.CompilerHelpers::fscCompile([FSharp.Compiler.Service]FSharp.Compiler.CodeAnalysis.LegacyReferenceResolver, string, string[])][offset 0x00000065][found Char] Unexpected type on the stack. diff --git a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_net9.0.bsl b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_net9.0.bsl index 99af17bef5a..af810c63892 100644 --- a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_net9.0.bsl +++ b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_net9.0.bsl @@ -15,7 +15,7 @@ [IL]: Error [ReturnPtrToStack]: : FSharp.Compiler.CodeAnalysis.ItemKeyStore::ReadFirstKeyString()][offset 0x00000064] Return type is ByRef, TypedReference, ArgHandle, or ArgIterator. [IL]: Error [StackUnexpected]: : FSharp.Compiler.CodeAnalysis.ItemKeyStoreBuilder::writeRange([FSharp.Compiler.Service]FSharp.Compiler.Text.Range)][offset 0x00000017][found address of '[FSharp.Compiler.Service]FSharp.Compiler.Text.Range'][expected Native Int] Unexpected type on the stack. [IL]: Error [ExpectedNumericType]: : FSharp.Compiler.EditorServices.SemanticClassificationKeyStoreBuilder::WriteAll([FSharp.Compiler.Service]FSharp.Compiler.EditorServices.SemanticClassificationItem[])][offset 0x0000001C][found address of '[FSharp.Compiler.Service]FSharp.Compiler.EditorServices.SemanticClassificationItem'] Expected numeric type on the stack. -[IL]: Error [StackUnexpected]: : FSharp.Compiler.CodeAnalysis.FSharpChecker::.ctor([FSharp.Compiler.Service]FSharp.Compiler.CodeAnalysis.LegacyReferenceResolver, int32, bool, bool, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.FSharpOption`1>>, bool, bool, bool, bool, [FSharp.Compiler.Service]FSharp.Compiler.CompilerConfig+ParallelReferenceResolution, bool, [FSharp.Core]Microsoft.FSharp.Core.FSharpOption`1>>>, bool, [FSharp.Core]Microsoft.FSharp.Core.FSharpOption`1)][offset 0x000000A2][found ref 'object'][expected ref '[FSharp.Compiler.Service]FSharp.Compiler.CodeAnalysis.IBackgroundCompiler'] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : FSharp.Compiler.CodeAnalysis.FSharpChecker::.ctor([FSharp.Compiler.Service]FSharp.Compiler.CodeAnalysis.LegacyReferenceResolver, int32, bool, bool, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.FSharpOption`1>>, bool, bool, bool, bool, [FSharp.Compiler.Service]FSharp.Compiler.CompilerConfig+ParallelReferenceResolution, bool, [FSharp.Core]Microsoft.FSharp.Core.FSharpOption`1>>>, bool, [FSharp.Core]Microsoft.FSharp.Core.FSharpOption`1, [FSharp.Core]Microsoft.FSharp.Core.FSharpOption`1)][offset 0x000000A4][found ref 'object'][expected ref '[FSharp.Compiler.Service]FSharp.Compiler.CodeAnalysis.IBackgroundCompiler'] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.CodeAnalysis.Hosted.CompilerHelpers::fscCompile([FSharp.Compiler.Service]FSharp.Compiler.CodeAnalysis.LegacyReferenceResolver, string, string[])][offset 0x0000005C][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.CodeAnalysis.Hosted.CompilerHelpers::fscCompile([FSharp.Compiler.Service]FSharp.Compiler.CodeAnalysis.LegacyReferenceResolver, string, string[])][offset 0x00000065][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.CodeAnalysis.Hosted.CompilerHelpers::fscCompile([FSharp.Compiler.Service]FSharp.Compiler.CodeAnalysis.LegacyReferenceResolver, string, string[])][offset 0x00000082][found Char] Unexpected type on the stack. diff --git a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl index 3ef589fcd21..5b4d38b154b 100644 --- a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl +++ b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl @@ -20,7 +20,7 @@ [IL]: Error [StackUnexpected]: : FSharp.Compiler.CodeAnalysis.ItemKeyStoreBuilder::writeRange([FSharp.Compiler.Service]FSharp.Compiler.Text.Range)][offset 0x00000017][found address of '[FSharp.Compiler.Service]FSharp.Compiler.Text.Range'][expected Native Int] Unexpected type on the stack. [IL]: Error [ExpectedNumericType]: : FSharp.Compiler.EditorServices.SemanticClassificationKeyStoreBuilder::WriteAll([FSharp.Compiler.Service]FSharp.Compiler.EditorServices.SemanticClassificationItem[])][offset 0x0000001C][found address of '[FSharp.Compiler.Service]FSharp.Compiler.EditorServices.SemanticClassificationItem'] Expected numeric type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.EditorServices.Parent::FormatEntityFullName([FSharp.Compiler.Service]FSharp.Compiler.Symbols.FSharpEntity)][offset 0x0000003F][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : FSharp.Compiler.CodeAnalysis.FSharpChecker::.ctor([FSharp.Compiler.Service]FSharp.Compiler.CodeAnalysis.LegacyReferenceResolver, int32, bool, bool, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.FSharpOption`1>>, bool, bool, bool, bool, [FSharp.Compiler.Service]FSharp.Compiler.CompilerConfig+ParallelReferenceResolution, bool, [FSharp.Core]Microsoft.FSharp.Core.FSharpOption`1>>>, bool, [FSharp.Core]Microsoft.FSharp.Core.FSharpOption`1)][offset 0x000000A2][found ref 'object'][expected ref '[FSharp.Compiler.Service]FSharp.Compiler.CodeAnalysis.IBackgroundCompiler'] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : FSharp.Compiler.CodeAnalysis.FSharpChecker::.ctor([FSharp.Compiler.Service]FSharp.Compiler.CodeAnalysis.LegacyReferenceResolver, int32, bool, bool, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.FSharpOption`1>>, bool, bool, bool, bool, [FSharp.Compiler.Service]FSharp.Compiler.CompilerConfig+ParallelReferenceResolution, bool, [FSharp.Core]Microsoft.FSharp.Core.FSharpOption`1>>>, bool, [FSharp.Core]Microsoft.FSharp.Core.FSharpOption`1, [FSharp.Core]Microsoft.FSharp.Core.FSharpOption`1)][offset 0x000000A4][found ref 'object'][expected ref '[FSharp.Compiler.Service]FSharp.Compiler.CodeAnalysis.IBackgroundCompiler'] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.CodeAnalysis.FSharpChecker::TokenizeFile(string)][offset 0x0000000B][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.CodeAnalysis.Hosted.CompilerHelpers::fscCompile([FSharp.Compiler.Service]FSharp.Compiler.CodeAnalysis.LegacyReferenceResolver, string, string[])][offset 0x0000005C][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.CodeAnalysis.Hosted.CompilerHelpers::fscCompile([FSharp.Compiler.Service]FSharp.Compiler.CodeAnalysis.LegacyReferenceResolver, string, string[])][offset 0x00000065][found Char] Unexpected type on the stack. From d6393f2b0d9ea11ce7e00cf523aa2e07e17317bd Mon Sep 17 00:00:00 2001 From: progressive-galib <125106402+progressive-galib@users.noreply.github.com> Date: Mon, 6 Jan 2025 22:36:10 +0600 Subject: [PATCH 19/19] MaybeNull wrapper round nullness syntax removed and refactored for src/fsi/console.fs (#18201) --- src/fsi/console.fs | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/src/fsi/console.fs b/src/fsi/console.fs index 6be943317ec..d644180d384 100644 --- a/src/fsi/console.fs +++ b/src/fsi/console.fs @@ -8,18 +8,6 @@ open System.Collections.Generic open System.Runtime.InteropServices open FSharp.Compiler.DiagnosticsLogger -[] -module internal ConsoleHelpers = - -#if NO_CHECKNULLS - type MaybeNull<'T when 'T : null> = 'T - - // Shim to match nullness checking library support in preview - let inline (|Null|NonNull|) (x: 'T) : Choice = match x with null -> Null | v -> NonNull v -#else - type MaybeNull<'T when 'T : not null> = 'T | null -#endif - type internal Style = | Prompt | Out @@ -42,17 +30,17 @@ type internal History() = list.Clear() current <- -1 - member _.Add (line: string MaybeNull) = + member _.Add (line: string | null) = match line with - | Null + | null | "" -> () - | NonNull line -> list.Add(line) + | _ -> list.Add(line) - member _.AddLast (line: string MaybeNull) = + member _.AddLast (line: string | null) = match line with - | Null + | null | "" -> () - | NonNull line -> + | _ -> list.Add(line) current <- list.Count