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)
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 a67c88e5284..4029c80e146 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)
+* Shim/file system: fix leaks of the shim [PR #18144](https://github.com/dotnet/fsharp/pull/18144)
### Added
@@ -27,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/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..43016b9b621 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=2"
"$DOTNET_INSTALL_DIR/dotnet" $args || exit $?
}
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/Driver/fsc.fs b/src/Compiler/Driver/fsc.fs
index 1d17950a9ac..696761f43da 100644
--- a/src/Compiler/Driver/fsc.fs
+++ b/src/Compiler/Driver/fsc.fs
@@ -1129,7 +1129,10 @@ let main6
DoesNotRequireCompilerThreadTokenAndCouldPossiblyBeMadeConcurrent ctok
let pdbfile =
- pdbfile |> Option.map (tcConfig.MakePathAbsolute >> FileSystem.GetFullPathShim)
+ pdbfile
+ |> Option.map (fun s ->
+ let absolutePath = tcConfig.MakePathAbsolute s
+ FileSystem.GetFullPathShim(absolutePath))
let normalizeAssemblyRefs (aref: ILAssemblyRef) =
match tcImports.TryFindDllInfo(ctok, rangeStartup, aref.Name, lookupOnly = false) with
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 @@
-
- Vygenerovat více sestavení (ve výchozím nastavení zapnuto)
+
+ Emit multiple assemblies ({0} by default)
@@ -113,8 +113,8 @@
-
- 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)
@@ -123,13 +123,13 @@
-
- Podpora dokončování pomocí tabulátorů v konzole (ve výchozím nastavení zapnuté)
+
+ Support TAB completion in console ({0} by default)
-
- Generovat ladicí informace v uvozovkách
+
+ Emit debug information in quotations ({0} by default)
@@ -298,8 +298,8 @@
-
- Znemožňuje zamknutí referencí procesem F# Interactive.
+
+ Prevents references from being locked by the F# Interactive process ({0} by default)