Skip to content

Commit 09ca9a7

Browse files
authored
Merge pull request #16772 from dotnet/merges/main-to-lsp
Merge main to lsp
2 parents 057d349 + bc3dd9f commit 09ca9a7

File tree

110 files changed

+1749
-307
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

110 files changed

+1749
-307
lines changed

DEVGUIDE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ Install the latest released [Visual Studio](https://visualstudio.microsoft.com/v
4949
* .NET desktop development (also check F# desktop support, as this will install some legacy templates)
5050
* Visual Studio extension development
5151

52-
You will also need the latest .NET 7 SDK installed from [here](https://dotnet.microsoft.com/download/dotnet/7.0).
52+
You will also need .NET SDK installed from [here](https://dotnet.microsoft.com/download/dotnet), exact version can be found in the global.json file in the root of the repository.
5353

5454
Building is simple:
5555

@@ -76,7 +76,7 @@ If you are just developing the core compiler and library then building ``FSharp.
7676
We recommend installing the latest Visual Studio preview and using that if you are on Windows. However, if you prefer not to do that, you will need to install the following:
7777

7878
* [.NET Framework 4.7.2](https://dotnet.microsoft.com/download/dotnet-framework/net472)
79-
* [.NET 7](https://dotnet.microsoft.com/download/dotnet/7.0)
79+
* [.NET SDK](https://dotnet.microsoft.com/download/dotnet) (see exact version in global.json file in the repository root).
8080

8181
You'll need to pass an additional flag to the build script:
8282

Directory.Build.props

Lines changed: 35 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
<LangVersion Condition="'$(FSharpLangVersion)' != ''">$(FSharpLangVersion)</LangVersion>
55
<RepoRoot Condition="'$(RepoRoot)' == ''">$(MSBuildThisFileDirectory)</RepoRoot>
66
<AccelerateBuildsInVisualStudio>true</AccelerateBuildsInVisualStudio>
7+
<FSharpNetCoreProductDefaultTargetFramework>net8.0</FSharpNetCoreProductDefaultTargetFramework>
78
</PropertyGroup>
89
<!--
910
When developers load the FSharp.Compiler.Service solution we set FSHARPCORE_USE_PACKAGE to true if it hasn't already been set to a value.
10-
This option ensures that building and testing uses the specified FSharp.Core nuget package instead of the local
11-
FSharp.Core project.
12-
We also disable arcade and reset certain artifacts and compiler paths to use default ones
11+
This option ensures that building and testing uses the specified FSharp.Core nuget package instead of the local FSharp.Core project.
12+
We also disable arcade and reset certain artifacts and compiler paths to use default ones.
1313
All settings below can be overriden via CLI switches if needed. -->
1414

1515
<PropertyGroup Condition="'$(SolutionName)' == 'FSharp.Compiler.Service' and '$(BUILDING_USING_DOTNET)' != 'false'">
@@ -21,25 +21,49 @@
2121
<BUILDING_USING_DOTNET>true</BUILDING_USING_DOTNET>
2222
</PropertyGroup>
2323

24-
<Import Project="$(RepoRoot)/Directory.Build.props.user" Condition = "Exists('$(RepoRoot)/Directory.Build.props.user')" />
24+
<Import Project="$(RepoRoot)/Directory.Build.props.user" Condition="Exists('$(RepoRoot)/Directory.Build.props.user')" />
2525

2626
<PropertyGroup Condition="'$(BUILDING_USING_DOTNET)' == 'true'">
27-
<BUILDING_WITH_LKG>true</BUILDING_WITH_LKG>
28-
<BUILD_FROM_SOURCE>true</BUILD_FROM_SOURCE>
2927
<DisableAutoSetFscCompilerPath>false</DisableAutoSetFscCompilerPath>
3028
<FSHARPCORE_USE_PACKAGE Condition="'$(FSHARPCORE_USE_PACKAGE)' == ''">true</FSHARPCORE_USE_PACKAGE>
3129
<DISABLE_ARCADE Condition="'$(DISABLE_ARCADE)' == ''">true</DISABLE_ARCADE>
3230
<ArtifactsDir>$(MSBuildThisFileDirectory)artifacts/</ArtifactsDir>
3331
<OutputPath>$(ArtifactsDir)/bin/$(MSBuildProjectName)/$(Configuration)/</OutputPath>
3432
<IntermediateOutputPath>$(ArtifactsDir)obj/$(MSBuildProjectName)/$(Configuration)/</IntermediateOutputPath>
35-
<FsLexPath>$(ArtifactsDir)/bin/fslex/$(Configuration)/net8.0/fslex.dll</FsLexPath>
36-
<FsYaccPath>$(ArtifactsDir)/bin/fsyacc/$(Configuration)/net8.0/fsyacc.dll</FsYaccPath>
33+
<!-- Note, that default framework is used here (the one we use for development in the current cycle),
34+
since it's a non-arcade and non-sourcebuild scenario -->
35+
<FsLexPath>$(ArtifactsDir)/bin/fslex/$(Configuration)/$(FSharpNetCoreProductDefaultTargetFramework)/fslex.dll</FsLexPath>
36+
<FsYaccPath>$(ArtifactsDir)/bin/fsyacc/$(Configuration)/$(FSharpNetCoreProductDefaultTargetFramework)/fsyacc.dll</FsYaccPath>
37+
<DefineConstants>NO_CHECKNULLS;BUILDING_WITH_LKG;NO_NULLCHECKING_LIB_SUPPORT;$(DefineConstants)</DefineConstants>
3738
</PropertyGroup>
39+
<Import Project="$(MSBuildThisFileDirectory)/eng/Versions.props" Condition="'$(DISABLE_ARCADE)' == 'true'" />
3840

39-
<Import Project="$(MSBuildThisFileDirectory)/eng/Versions.props" Condition="'$(DISABLE_ARCADE)' == 'true'"/>
41+
<Import Project="FSharpBuild.Directory.Build.props" Condition=" '$(FSharpTestCompilerVersion)' == '' " />
42+
<!-- To support source-build for the "next" version of .NET without forcing this repo to use it,
43+
we can utilize arcade's $(NetCurrent) property, and set it ourselves in the arcade-less scenarios.
44+
For FCS solution, we set it to one for current dev cycle.
45+
When used with arcade, and inserting/building for net8 branches, it will set it to net8.0, for net9 branches to net9.0 and so on. -->
46+
<Choose>
47+
<!-- Once we move to OOP in VS, and major dependants of FCS will move to netcore (not netstandard),
48+
we should also support $(NetPrevious) for all releases.
49+
This will likely include FCS and FSharp.Core as well as shipped products.
50+
Right now, it only covers products we ship (FSC and FSI), not NuGet packages. -->
51+
<When Condition="'$(DotNetBuildFromSource)' == 'true' AND '$(DotNetBuildFromSourceFlavor)' == 'Product'">
52+
<PropertyGroup>
53+
<FSharpNetCoreProductTargetFramework>$(NetCurrent)</FSharpNetCoreProductTargetFramework>
54+
</PropertyGroup>
55+
</When>
56+
<Otherwise>
57+
<PropertyGroup>
58+
<FSharpNetCoreProductTargetFramework>$(FSharpNetCoreProductDefaultTargetFramework)</FSharpNetCoreProductTargetFramework>
59+
</PropertyGroup>
60+
</Otherwise>
61+
</Choose>
4062

41-
<Import Project="FSharpBuild.Directory.Build.props" Condition = " '$(FSharpTestCompilerVersion)' == '' "/>
42-
<Import Project="FSharpTests.Directory.Build.props" Condition = " '$(FSharpTestCompilerVersion)' != '' "/>
63+
<!-- It's important we set TFM before this, since FSharpTests.Directory.Build.props uses it.
64+
TODO(vlza): this build props looks outdated, since we only use $(FSharpTestCompilerVersion) in TP tests or cambridge suite (which we slowly want to migrate to xUnit).
65+
We probably should remove or revisit it. -->
66+
<Import Project="FSharpTests.Directory.Build.props" Condition=" '$(FSharpTestCompilerVersion)' != '' " />
4367

4468
<ItemGroup>
4569
<!-- If there is a README.md next to a project file, include it (for easier access in the IDE) -->

FSharp.Compiler.Service.sln

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Benchmarks", "Benchmarks",
2929
tests\benchmarks\FCSBenchmarks\SmokeTestAllBenchmarks.ps1 = tests\benchmarks\FCSBenchmarks\SmokeTestAllBenchmarks.ps1
3030
EndProjectSection
3131
EndProject
32-
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "HistoricalBenchmark", "tests\benchmarks\FCSBenchmarks\BenchmarkComparison\HistoricalBenchmark.fsproj", "{35F5F1C5-AE4F-4B5A-8D94-1AF708724FD5}"
33-
EndProject
34-
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharp.Compiler.Benchmarks", "tests\benchmarks\FCSBenchmarks\CompilerServiceBenchmarks\FSharp.Compiler.Benchmarks.fsproj", "{C1950E28-1CB7-4DEC-BB3A-8A0443A17282}"
35-
EndProject
36-
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "HistoricalBenchmark.Runner", "tests\benchmarks\FCSBenchmarks\BenchmarkComparison\HistoricalBenchmark.Runner\HistoricalBenchmark.Runner.fsproj", "{07CD957A-3C31-4F75-A735-16CE72E1BD71}"
37-
EndProject
3832
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{DD4D4A7E-D519-4409-89DA-16DCA3EF80AA}"
3933
ProjectSection(SolutionItems) = preProject
4034
src\Compiler\FSComp.txt = src\Compiler\FSComp.txt
@@ -61,8 +55,6 @@ Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FSharp.Compiler.Interactive
6155
EndProject
6256
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharp.Compiler.UnitTests", "tests\FSharp.Compiler.UnitTests\FSharp.Compiler.UnitTests.fsproj", "{0C0BDAF4-7D47-4BDA-9992-077F63D6B494}"
6357
EndProject
64-
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharp.Benchmarks.Common", "tests\benchmarks\FSharp.Benchmarks.Common\FSharp.Benchmarks.Common.fsproj", "{A7ACFD1F-D1B8-483A-A210-200BB6B4BD7E}"
65-
EndProject
6658
Global
6759
GlobalSection(SolutionConfigurationPlatforms) = preSolution
6860
Debug|Any CPU = Debug|Any CPU
@@ -97,18 +89,6 @@ Global
9789
{2A182B7D-EDA3-4BF2-84B8-C7553BB7A5A7}.Debug|Any CPU.Build.0 = Debug|Any CPU
9890
{2A182B7D-EDA3-4BF2-84B8-C7553BB7A5A7}.Release|Any CPU.ActiveCfg = Release|Any CPU
9991
{2A182B7D-EDA3-4BF2-84B8-C7553BB7A5A7}.Release|Any CPU.Build.0 = Release|Any CPU
100-
{35F5F1C5-AE4F-4B5A-8D94-1AF708724FD5}.Debug|Any CPU.ActiveCfg = Release|Any CPU
101-
{35F5F1C5-AE4F-4B5A-8D94-1AF708724FD5}.Debug|Any CPU.Build.0 = Release|Any CPU
102-
{35F5F1C5-AE4F-4B5A-8D94-1AF708724FD5}.Release|Any CPU.ActiveCfg = Release|Any CPU
103-
{35F5F1C5-AE4F-4B5A-8D94-1AF708724FD5}.Release|Any CPU.Build.0 = Release|Any CPU
104-
{C1950E28-1CB7-4DEC-BB3A-8A0443A17282}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
105-
{C1950E28-1CB7-4DEC-BB3A-8A0443A17282}.Debug|Any CPU.Build.0 = Debug|Any CPU
106-
{C1950E28-1CB7-4DEC-BB3A-8A0443A17282}.Release|Any CPU.ActiveCfg = Release|Any CPU
107-
{C1950E28-1CB7-4DEC-BB3A-8A0443A17282}.Release|Any CPU.Build.0 = Release|Any CPU
108-
{07CD957A-3C31-4F75-A735-16CE72E1BD71}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
109-
{07CD957A-3C31-4F75-A735-16CE72E1BD71}.Debug|Any CPU.Build.0 = Debug|Any CPU
110-
{07CD957A-3C31-4F75-A735-16CE72E1BD71}.Release|Any CPU.ActiveCfg = Release|Any CPU
111-
{07CD957A-3C31-4F75-A735-16CE72E1BD71}.Release|Any CPU.Build.0 = Release|Any CPU
11292
{A6995088-3C1D-42BC-B3DD-72B1EEAB23F4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
11393
{A6995088-3C1D-42BC-B3DD-72B1EEAB23F4}.Debug|Any CPU.Build.0 = Debug|Any CPU
11494
{A6995088-3C1D-42BC-B3DD-72B1EEAB23F4}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -145,10 +125,6 @@ Global
145125
{0C0BDAF4-7D47-4BDA-9992-077F63D6B494}.Debug|Any CPU.Build.0 = Debug|Any CPU
146126
{0C0BDAF4-7D47-4BDA-9992-077F63D6B494}.Release|Any CPU.ActiveCfg = Release|Any CPU
147127
{0C0BDAF4-7D47-4BDA-9992-077F63D6B494}.Release|Any CPU.Build.0 = Release|Any CPU
148-
{A7ACFD1F-D1B8-483A-A210-200BB6B4BD7E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
149-
{A7ACFD1F-D1B8-483A-A210-200BB6B4BD7E}.Debug|Any CPU.Build.0 = Debug|Any CPU
150-
{A7ACFD1F-D1B8-483A-A210-200BB6B4BD7E}.Release|Any CPU.ActiveCfg = Release|Any CPU
151-
{A7ACFD1F-D1B8-483A-A210-200BB6B4BD7E}.Release|Any CPU.Build.0 = Release|Any CPU
152128
EndGlobalSection
153129
GlobalSection(SolutionProperties) = preSolution
154130
HideSolutionNode = FALSE
@@ -157,10 +133,6 @@ Global
157133
{BFE6E6F1-1B73-404F-A3A5-30B57E5E0731} = {875D91AC-BA4C-4191-AB11-AE461DB9B8DB}
158134
{2EF674B9-8B56-4796-9933-42B2629E52C3} = {875D91AC-BA4C-4191-AB11-AE461DB9B8DB}
159135
{38A23D53-E2BF-4B76-907F-49F41D60C88E} = {875D91AC-BA4C-4191-AB11-AE461DB9B8DB}
160-
{35F5F1C5-AE4F-4B5A-8D94-1AF708724FD5} = {AF321816-B4A0-41DD-9A1D-484E8A20C6F6}
161-
{C1950E28-1CB7-4DEC-BB3A-8A0443A17282} = {AF321816-B4A0-41DD-9A1D-484E8A20C6F6}
162-
{07CD957A-3C31-4F75-A735-16CE72E1BD71} = {AF321816-B4A0-41DD-9A1D-484E8A20C6F6}
163-
{A7ACFD1F-D1B8-483A-A210-200BB6B4BD7E} = {AF321816-B4A0-41DD-9A1D-484E8A20C6F6}
164136
EndGlobalSection
165137
GlobalSection(ExtensibilityGlobals) = postSolution
166138
SolutionGuid = {F9A60F3B-D894-4C8E-BA0F-C51115B25A5A}

FSharpTests.Directory.Build.props

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,18 @@
2222
<FscToolPath>$([System.IO.Path]::GetDirectoryName('$(DOTNET_HOST_PATH)'))</FscToolPath>
2323
<FscToolExe Condition="'$(OS)' != 'Unix'">dotnet.exe</FscToolExe>
2424
<FscToolExe Condition="'$(OS)' == 'Unix'">dotnet</FscToolExe>
25-
<DotnetFscCompilerPath>$(MSBuildThisFileDirectory)artifacts\bin\fsc\$(Configuration)\net8.0\fsc.dll</DotnetFscCompilerPath>
25+
<DotnetFscCompilerPath>$(MSBuildThisFileDirectory)artifacts\bin\fsc\$(Configuration)\$(FSharpNetCoreProductTargetFramework)\fsc.dll</DotnetFscCompilerPath>
2626

2727
<FsiToolPath>$([System.IO.Path]::GetDirectoryName('$(DOTNET_HOST_PATH)'))</FsiToolPath>
2828
<FsiToolExe Condition="'$(OS)' != 'Unix'">dotnet.exe</FsiToolExe>
2929
<FsiToolExe Condition="'$(OS)' == 'Unix'">dotnet</FsiToolExe>
30-
<DotnetFsiCompilerPath>$(MSBuildThisFileDirectory)artifacts\bin\fsi\$(Configuration)\net8.0\fsi.dll</DotnetFsiCompilerPath>
30+
<DotnetFsiCompilerPath>$(MSBuildThisFileDirectory)artifacts\bin\fsi\$(Configuration)\$(FSharpNetCoreProductTargetFramework)\fsi.dll</DotnetFsiCompilerPath>
3131
</PropertyGroup>
3232

3333
<!-- SDK targets override -->
3434
<PropertyGroup>
3535
<_FSharpBuildTargetFramework Condition="'$(MSBuildRuntimeType)'!='Core'">net472</_FSharpBuildTargetFramework>
36-
<_FSharpBuildTargetFramework Condition="'$(MSBuildRuntimeType)'=='Core'">net8.0</_FSharpBuildTargetFramework>
36+
<_FSharpBuildTargetFramework Condition="'$(MSBuildRuntimeType)'=='Core'">$(FSharpNetCoreProductTargetFramework)</_FSharpBuildTargetFramework>
3737
<_FSharpBuildBinPath>$(MSBuildThisFileDirectory)artifacts\bin\fsc\$(Configuration)\$(_FSharpBuildTargetFramework)</_FSharpBuildBinPath>
3838

3939
<FSharpBuildAssemblyFile>$(_FSharpBuildBinPath)\FSharp.Build.dll</FSharpBuildAssemblyFile>

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
You're invited to contribute to future releases of the F# compiler, core library, and tools. Development of this repository can be done on any OS supported by [.NET](https://dotnet.microsoft.com/).
77

8-
You will also need the latest .NET 7 SDK installed from [here](https://dotnet.microsoft.com/download/dotnet/7.0).
8+
You will also need .NET SDK installed from [here](https://dotnet.microsoft.com/download/dotnet), exact version can be found in the global.json file in the root of the repository.
99

1010
## Contributing
1111

buildtools/AssemblyCheck/AssemblyCheck.fsproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>net8.0</TargetFramework>
5+
<TargetFramework>$(FSharpNetCoreProductTargetFramework)</TargetFramework>
66
<DisableImplicitFSharpCoreReference>true</DisableImplicitFSharpCoreReference>
77
<UseAppHost Condition="'$(DotNetBuildFromSource)' == 'true'">false</UseAppHost>
88
</PropertyGroup>

buildtools/checkpackages/FSharp.Compiler.Service_notshipped.fsproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<Import Project="$(MSBuildProjectDirectory)\..\..\eng\Versions.props" />
4-
4+
55
<PropertyGroup>
6-
<TargetFramework>net8.0</TargetFramework>
6+
<TargetFramework>$(FSharpNetCoreProductTargetFramework)</TargetFramework>
77
<DisableImplicitFSharpCoreReference>true</DisableImplicitFSharpCoreReference>
88
<CachePath>$(MSBuildProjectDirectory)\..\..\artifacts\tmp\$([System.Guid]::NewGuid())</CachePath>
99
<OutputPath>$(CachePath)\bin</OutputPath>

buildtools/fslex/fslex.fsproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>net8.0</TargetFramework>
5+
<TargetFramework>$(FSharpNetCoreProductTargetFramework)</TargetFramework>
66
<DisableImplicitFSharpCoreReference>true</DisableImplicitFSharpCoreReference>
77
<UseAppHost Condition="'$(DotNetBuildFromSource)' == 'true'">false</UseAppHost>
88
<RollForward Condition="'$(BUILDING_USING_DOTNET)' == 'true'">LatestMajor</RollForward>

buildtools/fsyacc/fsyacc.fsproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>net8.0</TargetFramework>
5+
<TargetFramework>$(FSharpNetCoreProductTargetFramework)</TargetFramework>
66
<DisableImplicitFSharpCoreReference>true</DisableImplicitFSharpCoreReference>
77
<UseAppHost Condition="'$(DotNetBuildFromSource)' == 'true'">false</UseAppHost>
88
<RollForward Condition="'$(BUILDING_USING_DOTNET)' == 'true'">LatestMajor</RollForward>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
### Fixed
2+
3+
`nameof Module` expressions and patterns are processed to link files in `--test:GraphBasedChecking`. ([PR #16570](https://github.com/dotnet/fsharp/pull/16570), [PR #16747](https://github.com/dotnet/fsharp/pull/16747))

0 commit comments

Comments
 (0)