Skip to content

Commit 55c49ef

Browse files
authored
64 bit fcs (dotnet#11998)
* 64 bit desktop compiler * Add tests
1 parent 6271eb0 commit 55c49ef

36 files changed

+412
-52
lines changed

FSharp.sln

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CSharp_Analysis", "tests\se
7676
EndProject
7777
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "TestTP", "tests\service\data\TestTP\TestTP.fsproj", "{7BFA159A-BF9D-4489-BF46-1B83ACCEEE0F}"
7878
EndProject
79+
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "fscAnyCpu", "src\fsharp\fscAnyCpu\fscAnyCpu.fsproj", "{8ACA60C2-7266-425A-B641-A2946396B7D1}"
80+
EndProject
7981
Global
8082
GlobalSection(SolutionConfigurationPlatforms) = preSolution
8183
Debug|Any CPU = Debug|Any CPU
@@ -386,6 +388,18 @@ Global
386388
{7BFA159A-BF9D-4489-BF46-1B83ACCEEE0F}.Release|Any CPU.Build.0 = Release|Any CPU
387389
{7BFA159A-BF9D-4489-BF46-1B83ACCEEE0F}.Release|x86.ActiveCfg = Release|Any CPU
388390
{7BFA159A-BF9D-4489-BF46-1B83ACCEEE0F}.Release|x86.Build.0 = Release|Any CPU
391+
{8ACA60C2-7266-425A-B641-A2946396B7D1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
392+
{8ACA60C2-7266-425A-B641-A2946396B7D1}.Debug|Any CPU.Build.0 = Debug|Any CPU
393+
{8ACA60C2-7266-425A-B641-A2946396B7D1}.Debug|x86.ActiveCfg = Debug|Any CPU
394+
{8ACA60C2-7266-425A-B641-A2946396B7D1}.Debug|x86.Build.0 = Debug|Any CPU
395+
{8ACA60C2-7266-425A-B641-A2946396B7D1}.Proto|Any CPU.ActiveCfg = Debug|Any CPU
396+
{8ACA60C2-7266-425A-B641-A2946396B7D1}.Proto|Any CPU.Build.0 = Debug|Any CPU
397+
{8ACA60C2-7266-425A-B641-A2946396B7D1}.Proto|x86.ActiveCfg = Debug|Any CPU
398+
{8ACA60C2-7266-425A-B641-A2946396B7D1}.Proto|x86.Build.0 = Debug|Any CPU
399+
{8ACA60C2-7266-425A-B641-A2946396B7D1}.Release|Any CPU.ActiveCfg = Release|Any CPU
400+
{8ACA60C2-7266-425A-B641-A2946396B7D1}.Release|Any CPU.Build.0 = Release|Any CPU
401+
{8ACA60C2-7266-425A-B641-A2946396B7D1}.Release|x86.ActiveCfg = Release|Any CPU
402+
{8ACA60C2-7266-425A-B641-A2946396B7D1}.Release|x86.Build.0 = Release|Any CPU
389403
EndGlobalSection
390404
GlobalSection(SolutionProperties) = preSolution
391405
HideSolutionNode = FALSE
@@ -394,7 +408,7 @@ Global
394408
{D5870CF0-ED51-4CBC-B3D7-6F56DA84AC06} = {B8DDA694-7939-42E3-95E5-265C2217C142}
395409
{DED3BBD7-53F4-428A-8C9F-27968E768605} = {3058BC79-8E79-4645-B05D-48CC182FA8A6}
396410
{702A7979-BCF9-4C41-853E-3ADFC9897890} = {B8DDA694-7939-42E3-95E5-265C2217C142}
397-
{C94C257C-3C0A-4858-B5D8-D746498D1F08} = {3881429D-A97A-49EB-B7AE-A82BA5FE9C77}
411+
{C94C257C-3C0A-4858-B5D8-D746498D1F08} = {B8DDA694-7939-42E3-95E5-265C2217C142}
398412
{649FA588-F02E-457C-9FCF-87E46407481E} = {B8DDA694-7939-42E3-95E5-265C2217C142}
399413
{D0E98C0D-490B-4C61-9329-0862F6E87645} = {B8DDA694-7939-42E3-95E5-265C2217C142}
400414
{8B3E283D-B5FE-4055-9D80-7E3A32F3967B} = {B8DDA694-7939-42E3-95E5-265C2217C142}
@@ -420,6 +434,7 @@ Global
420434
{452EED3C-AA87-471F-B9AC-0F4479C5820C} = {CFE3259A-2D30-4EB0-80D5-E8B5F3D01449}
421435
{F8743670-C8D4-41B3-86BE-BBB1226C352F} = {452EED3C-AA87-471F-B9AC-0F4479C5820C}
422436
{7BFA159A-BF9D-4489-BF46-1B83ACCEEE0F} = {452EED3C-AA87-471F-B9AC-0F4479C5820C}
437+
{8ACA60C2-7266-425A-B641-A2946396B7D1} = {B8DDA694-7939-42E3-95E5-265C2217C142}
423438
EndGlobalSection
424439
GlobalSection(ExtensibilityGlobals) = postSolution
425440
SolutionGuid = {BD5177C7-1380-40E7-94D2-7768E1A8B1B8}

VisualFSharp.sln

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,8 @@ Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "MicroPerf", "tests\benchmar
178178
EndProject
179179
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "MicroPerf", "MicroPerf", "{47112E07-9FF1-43E7-8021-F2A21D6A19A0}"
180180
EndProject
181+
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "fscAnyCpu", "src\fsharp\fscAnyCpu\fscAnyCpu.fsproj", "{52DCA91F-3843-43E3-8FE1-FB2B66658CBD}"
182+
EndProject
181183
Global
182184
GlobalSection(SolutionConfigurationPlatforms) = preSolution
183185
Debug|Any CPU = Debug|Any CPU
@@ -1016,6 +1018,18 @@ Global
10161018
{EE08E954-AE91-4EFA-8595-10931D29E628}.Release|Any CPU.Build.0 = Release|Any CPU
10171019
{EE08E954-AE91-4EFA-8595-10931D29E628}.Release|x86.ActiveCfg = Release|Any CPU
10181020
{EE08E954-AE91-4EFA-8595-10931D29E628}.Release|x86.Build.0 = Release|Any CPU
1021+
{52DCA91F-3843-43E3-8FE1-FB2B66658CBD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
1022+
{52DCA91F-3843-43E3-8FE1-FB2B66658CBD}.Debug|Any CPU.Build.0 = Debug|Any CPU
1023+
{52DCA91F-3843-43E3-8FE1-FB2B66658CBD}.Debug|x86.ActiveCfg = Debug|Any CPU
1024+
{52DCA91F-3843-43E3-8FE1-FB2B66658CBD}.Debug|x86.Build.0 = Debug|Any CPU
1025+
{52DCA91F-3843-43E3-8FE1-FB2B66658CBD}.Proto|Any CPU.ActiveCfg = Debug|Any CPU
1026+
{52DCA91F-3843-43E3-8FE1-FB2B66658CBD}.Proto|Any CPU.Build.0 = Debug|Any CPU
1027+
{52DCA91F-3843-43E3-8FE1-FB2B66658CBD}.Proto|x86.ActiveCfg = Debug|Any CPU
1028+
{52DCA91F-3843-43E3-8FE1-FB2B66658CBD}.Proto|x86.Build.0 = Debug|Any CPU
1029+
{52DCA91F-3843-43E3-8FE1-FB2B66658CBD}.Release|Any CPU.ActiveCfg = Release|Any CPU
1030+
{52DCA91F-3843-43E3-8FE1-FB2B66658CBD}.Release|Any CPU.Build.0 = Release|Any CPU
1031+
{52DCA91F-3843-43E3-8FE1-FB2B66658CBD}.Release|x86.ActiveCfg = Release|Any CPU
1032+
{52DCA91F-3843-43E3-8FE1-FB2B66658CBD}.Release|x86.Build.0 = Release|Any CPU
10191033
EndGlobalSection
10201034
GlobalSection(SolutionProperties) = preSolution
10211035
HideSolutionNode = FALSE
@@ -1051,7 +1065,7 @@ Global
10511065
{AC85EE6D-033C-45F9-B8BA-884BC22EC6D9} = {3F044931-FB83-4433-B934-AE66AB27B278}
10521066
{956BBE41-ABD1-4DBA-9F3B-BA1C9821C98C} = {3F044931-FB83-4433-B934-AE66AB27B278}
10531067
{702A7979-BCF9-4C41-853E-3ADFC9897890} = {B8DDA694-7939-42E3-95E5-265C2217C142}
1054-
{C94C257C-3C0A-4858-B5D8-D746498D1F08} = {3881429D-A97A-49EB-B7AE-A82BA5FE9C77}
1068+
{C94C257C-3C0A-4858-B5D8-D746498D1F08} = {B8DDA694-7939-42E3-95E5-265C2217C142}
10551069
{649FA588-F02E-457C-9FCF-87E46407481E} = {B8DDA694-7939-42E3-95E5-265C2217C142}
10561070
{8B3E283D-B5FE-4055-9D80-7E3A32F3967B} = {B8DDA694-7939-42E3-95E5-265C2217C142}
10571071
{D0E98C0D-490B-4C61-9329-0862F6E87645} = {B8DDA694-7939-42E3-95E5-265C2217C142}
@@ -1097,6 +1111,7 @@ Global
10971111
{208E36EE-665C-42D2-B767-C6DB03C4FEB2} = {47112E07-9FF1-43E7-8021-F2A21D6A19A0}
10981112
{EE08E954-AE91-4EFA-8595-10931D29E628} = {47112E07-9FF1-43E7-8021-F2A21D6A19A0}
10991113
{47112E07-9FF1-43E7-8021-F2A21D6A19A0} = {DFB6ADD7-3149-43D9-AFA0-FC4A818B472B}
1114+
{52DCA91F-3843-43E3-8FE1-FB2B66658CBD} = {B8DDA694-7939-42E3-95E5-265C2217C142}
11001115
EndGlobalSection
11011116
GlobalSection(ExtensibilityGlobals) = postSolution
11021117
SolutionGuid = {48EDBBBE-C8EE-4E3C-8B19-97184A487B37}

eng/tests/UpToDate.ps1

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,11 @@ try {
2424
$ArtifactsBinDir = Join-Path $RepoRoot "artifacts" | Join-Path -ChildPath "bin" -Resolve
2525
$FSharpAssemblyDirs = Get-ChildItem -Path $ArtifactsBinDir -Filter "FSharp.*"
2626
$FscAssemblyDir = Get-ChildItem -Path $ArtifactsBinDir -Filter "fsc"
27+
$FscAnyCpuAssemblyDir = Get-ChildItem -Path $ArtifactsBinDir -Filter "fscAnyCpu"
2728
$FsiAssemblyDir = Get-ChildItem -Path $ArtifactsBinDir -Filter "fsi"
2829
$FsiAnyCpuAssemblyDir = Get-ChildItem -Path $ArtifactsBinDir -Filter "fsiAnyCpu"
2930
$ProjectSystemAssemblyDirs = Get-ChildItem -Path $ArtifactsBinDir -Filter "ProjectSystem*"
30-
$FSharpDirs = @($FSharpAssemblyDirs) + @($FscAssemblyDir) + @($FsiAssemblyDir) + @($FsiAnyCpuAssemblyDir) + @($ProjectSystemAssemblyDirs)
31+
$FSharpDirs = @($FSharpAssemblyDirs) + @($FscAssemblyDir) + @($FscAnyCpuAssemblyDir) + @($FsiAssemblyDir) + @($FsiAnyCpuAssemblyDir) + @($ProjectSystemAssemblyDirs)
3132
$FSharpDllPaths = $FSharpDirs | ForEach-Object { Get-ChildItem -Path (Join-Path $ArtifactsBinDir $_) -Recurse -Filter "*.dll" } | ForEach-Object { $_.FullName }
3233
$FSharpExePaths = $FSharpDirs | ForEach-Object { Get-ChildItem -Path (Join-Path $ArtifactsBinDir $_) -Recurse -Filter "*.exe" } | ForEach-Object { $_.FullName }
3334
$FSharpAssemblyPaths = @($FSharpDllPaths) + @($FSharpExePaths)

setup/Swix/Microsoft.FSharp.Compiler.MSBuild/Microsoft.FSharp.Compiler.MSBuild.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
<ItemGroup>
88
<ProjectReference Include="$(FSharpSourcesRoot)\fsharp\fsc\fsc.fsproj" />
9+
<ProjectReference Include="$(FSharpSourcesRoot)\fsharp\fscAnyCpu\fscAnyCpu.fsproj" />
910
<ProjectReference Include="$(FSharpSourcesRoot)\fsharp\fsi\fsi.fsproj" />
1011
<ProjectReference Include="$(FSharpSourcesRoot)\fsharp\fsiAnyCpu\fsiAnyCpu.fsproj" />
1112
<ProjectReference Include="$(FSharpSourcesRoot)\fsharp\FSharp.Build\FSharp.Build.fsproj" />
@@ -80,6 +81,8 @@ vs.dependencies
8081
folder "InstallDir:Common7\IDE\CommonExtensions\Microsoft\FSharp\Tools"
8182
file source="$(BinariesFolder)fsc\$(Configuration)\$(TargetFramework)\fsc.exe" vs.file.ngen=yes vs.file.ngenArchitecture=x86 vs.file.ngenPriority=2 vs.file.ngenApplication="[installDir]\Common7\IDE\CommonExtensions\Microsoft\FSharp\Tools\fsc.exe"
8283
file source="$(BinariesFolder)fsc\$(Configuration)\$(TargetFramework)\fsc.exe.config"
84+
file source="$(BinariesFolder)fscAnyCpu\$(Configuration)\$(TargetFramework)\fscAnyCpu.exe" vs.file.ngen=yes vs.file.ngenArchitecture=X64 vs.file.ngenPriority=2 vs.file.ngenApplication="[installDir]\Common7\IDE\CommonExtensions\Microsoft\FSharp\Tools\fscAnyCpu.exe"
85+
file source="$(BinariesFolder)fscAnyCpu\$(Configuration)\$(TargetFramework)\fscAnyCpu.exe.config"
8386
file source="$(BinariesFolder)fsi\$(Configuration)\$(TargetFramework)\fsi.exe" vs.file.ngen=yes vs.file.ngenArchitecture=X86 vs.file.ngenPriority=2 vs.file.ngenApplication="[installDir]\Common7\IDE\CommonExtensions\Microsoft\FSharp\Tools\fsi.exe"
8487
file source="$(BinariesFolder)fsi\$(Configuration)\$(TargetFramework)\fsi.exe.config"
8588
file source="$(BinariesFolder)fsiAnyCpu\$(Configuration)\$(TargetFramework)\fsiAnyCpu.exe" vs.file.ngen=yes vs.file.ngenArchitecture=X64 vs.file.ngenPriority=2 vs.file.ngenApplication="[installDir]\Common7\IDE\CommonExtensions\Microsoft\FSharp\Tools\fsiAnyCpu.exe"

setup/shims/Microsoft.FSharp.ShimHelpers.props

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,26 @@
55
</PropertyGroup>
66

77
<!--
8-
If the Directory.Build.props file in the project directory specifies 'FSharpUseNETSdkCompiler' then Visual Studio / msbuild.exe will use the NETSDK compiler.
9-
Otherwise stick with desktop compiler.
8+
If FSharpCompilerPath is set, we have nothing else to do, someone has already expressed a preference.
109
-->
11-
<PropertyGroup Condition="'$(FSharpUseNETSdkCompiler)' == 'true'">
10+
<PropertyGroup Condition="'$(FSharpCompilerPath)' == '' and '$(DisableAutoSetFscCompilerPath)' != 'true'">
11+
<!--
12+
Precompute paths to compiler for both netsdk and netframework compilers. Settings in the project file will allow
13+
Microsoft.FSharp.Targets to select which compiler to use.
14+
-->
15+
<FSharp_Shim_Present>true</FSharp_Shim_Present>
1216

13-
<!-- We are in the msbuild/VS build path only, we want to forward to the installed net sdk always -->
14-
<FSharpCompilerPath Condition="'$(FSharpCompilerPath)' == ''">$(NetCoreRoot)sdk/$(NETCoreSdkVersion)/FSharp/</FSharpCompilerPath>
17+
<Fsc_NetFramework_X86_ToolExe>fsc.exe</Fsc_NetFramework_X86_ToolExe>
18+
<Fsc_NetFramework_AnyCpu_ToolExe>fscAnyCpu.exe</Fsc_NetFramework_AnyCpu_ToolExe>
1519

16-
<FscToolPath>$(NetCoreRoot)</FscToolPath>
17-
<FscToolExe>$(NetCoreRoot)dotnet.exe</FscToolExe>
18-
<DotnetFscCompilerPath>"$(FSharpCompilerPath)fsc.dll"</DotnetFscCompilerPath>
20+
<Fsc_DotNet_CompilerPath>$(NetCoreRoot)sdk/$(NETCoreSdkVersion)/FSharp/</Fsc_DotNet_CompilerPath>
21+
<Fsc_NetFramework_ToolPath>$(VsInstallRoot)/Common7/IDE/CommonExtensions/Microsoft/FSharp/Tools/</Fsc_NetFramework_ToolPath>
1922

20-
<FsiToolPath>$(NetCoreRoot)</FsiToolPath>
21-
<FsiToolExe>$(NetCoreRoot)dotnet.exe</FsiToolExe>
22-
<DotnetFsiCompilerPath>"$(FSharpCompilerPath)fsi.dll"</DotnetFsiCompilerPath>
23+
<Fsc_DotNET_ToolPath>$(NetCoreRoot)</Fsc_DotNET_ToolPath>
24+
<Fsc_DotNET_ToolExe>dotnet.exe</Fsc_DotNET_ToolExe>
25+
<Fsc_DotNET_DotnetFscCompilerPath>$(Fsc_DotNet_CompilerPath)fsc.dll</Fsc_DotNET_DotnetFscCompilerPath>
2326

27+
<FSharpCompilerPath>$(Fsc_NetFramework_ToolPath)</FSharpCompilerPath>
2428
</PropertyGroup>
2529

2630
</Project>

src/fsharp/FSharp.Build/Microsoft.FSharp.Targets

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,30 @@ this file.
5050
<Actual32Bit Condition="!('$(TargetFrameworkVersion)'=='v2.0' or '$(TargetFrameworkVersion)'=='v3.0' or '$(TargetFrameworkVersion)'=='v3.5' or '$(TargetFrameworkVersion)'=='v4.0')">$(Prefer32Bit)</Actual32Bit>
5151
</PropertyGroup>
5252

53+
<!--
54+
Project file properties that control compiler selection:
55+
========================================================
56+
Suggest that the compiler used be the desktop framework version. On computers without Visual Studio these properties is ignored.
57+
<FSharpPreferNetFrameworkTools> boolean: true or false === default value true
58+
59+
Suggest that the compiler used be the 64 Bit compiler. On computers without Visual Studio this property is ignored.
60+
<FSharpPrefer64BitFSCTools> boolean: true or false === default value true
61+
62+
If Shim helpers are present then the values are valid and set by the Microsoft.FSharp.Helpers.props
63+
-->
64+
<PropertyGroup Condition="'$(FSharp_Shim_Present)' == 'true' and '$(FSharpPreferNetFrameworkTools)' == 'true'">
65+
<FscToolPath>$(Fsc_NetFramework_ToolPath)</FscToolPath>
66+
<FscToolExe Condition="'$(FSharpPrefer64BitTools)' != 'false'">$(Fsc_NetFramework_AnyCpu_ToolExe)</FscToolExe>
67+
<FscToolExe Condition="'$(FSharpPrefer64BitTools)' == 'false'">$(Fsc_NetFramework_X86_ToolExe)</FscToolExe>
68+
<DotnetFscCompilerPath></DotnetFscCompilerPath>
69+
</PropertyGroup>
70+
71+
<PropertyGroup Condition="'$(FSharp_Shim_Present)' == 'true' and '$(FSharpPreferNetFrameworkTools)' != 'true'">
72+
<FscToolPath>$(Fsc_Dotnet_ToolPath)</FscToolPath>
73+
<FscToolExe>$(Fsc_Dotnet_ToolExe)</FscToolExe>
74+
<DotnetFscCompilerPath>"$(Fsc_Dotnet_DotnetFscCompilerPath)"</DotnetFscCompilerPath>
75+
</PropertyGroup>
76+
5377
<!--
5478
The CreateManifestResourceNames target create the manifest resource names from the .RESX
5579
files.

src/fsharp/FSharp.Compiler.Service/FSharp.Compiler.Service.fsproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464

6565
<ItemGroup>
6666
<InternalsVisibleTo Include="fsc" />
67+
<InternalsVisibleTo Include="fscAnyCpu" />
6768
<InternalsVisibleTo Include="fsi" />
6869
<InternalsVisibleTo Include="fsiAnyCpu" />
6970
<InternalsVisibleTo Include="FSharp.Compiler.Server.Shared" />

src/fsharp/fsc/InternalsVisibleTo.fs

Lines changed: 0 additions & 8 deletions
This file was deleted.

src/fsharp/fscAnyCpu/App.config

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<runtime>
4+
<gcAllowVeryLargeObjects enabled="true" />
5+
<legacyUnhandledExceptionPolicy enabled="true" />
6+
<gcServer enabled="true"/>
7+
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
8+
<dependentAssembly>
9+
<assemblyIdentity name="FSharp.Core" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
10+
<bindingRedirect oldVersion="2.0.0.0-{{FSCoreVersion}}" newVersion="{{FSCoreVersion}}"/>
11+
</dependentAssembly>
12+
</assemblyBinding>
13+
</runtime>
14+
</configuration>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<Project>
2+
3+
<PropertyGroup>
4+
<UseFSharpProductVersion>true</UseFSharpProductVersion>
5+
</PropertyGroup>
6+
7+
<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)../'))" />
8+
9+
</Project>

0 commit comments

Comments
 (0)