Skip to content

Commit 1632f46

Browse files
authored
Update build for arm64 (#13200)
* Update build for arm64 * temp * fsiarm64 * Add ticks * namespace
1 parent 1950309 commit 1632f46

Some content is hidden

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

46 files changed

+460
-406
lines changed

FSharp.sln

Lines changed: 91 additions & 70 deletions
Large diffs are not rendered by default.

VisualFSharp.sln

Lines changed: 90 additions & 65 deletions
Large diffs are not rendered by default.

eng/targets/NGenBinaries.targets

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,25 +29,36 @@
2929
<PropertyGroup>
3030
<PathToNGen32>$(windir)\Microsoft.NET\Framework\v4.0.30319\ngen.exe</PathToNGen32>
3131
<PathToNGen64>$(windir)\Microsoft.NET\Framework64\v4.0.30319\ngen.exe</PathToNGen64>
32+
<PathToNGenArm>$(windir)\Microsoft.NET\FrameworkArm64\v4.0.30319\ngen.exe</PathToNGenArm>
3233
</PropertyGroup>
3334

3435
<Exec Command='"$(PathToNGen32)" install "$(TargetPath)" /nologo /silent /ExeConfig:"$(TargetPath)"'
35-
Condition = "Exists('$(PathToNGen32)') AND '$(PlatformTarget)' != 'x64' AND Exists('$(TargetPath).config') AND '$(OutputType)' == 'Exe' AND '$(IsAdministrator)' == 'true'"
36+
Condition = "Exists('$(PathToNGen32)') AND '$(PlatformTarget)' != 'x64' AND '$(PlatformTarget)' != 'arm64' AND Exists('$(TargetPath).config') AND '$(OutputType)' == 'Exe' AND '$(IsAdministrator)' == 'true'"
3637
ConsoleToMSBuild="true"
3738
IgnoreStandardErrorWarningFormat="true" />
3839

3940
<Exec Command='"$(PathToNGen32)" install "$(TargetPath)" /nologo /silent'
40-
Condition = " Exists('$(PathToNGen32)') AND '$(PlatformTarget)' != 'x64' AND (!Exists('$(TargetPath).config') OR '$(OutputType)' != 'Exe') AND '$(IsAdministrator)' == 'true' "
41+
Condition = " Exists('$(PathToNGen32)') AND '$(PlatformTarget)' != 'x64' AND '$(PlatformTarget)' != 'arm64' AND (!Exists('$(TargetPath).config') OR '$(OutputType)' != 'Exe') AND '$(IsAdministrator)' == 'true' "
4142
ConsoleToMSBuild="true"
4243
IgnoreStandardErrorWarningFormat="true"/>
4344

4445
<Exec Command='"$(PathToNGen64)" install "$(TargetPath)" /nologo /silent /ExeConfig:"$(TargetPath)"'
45-
Condition = "Exists('$(PathToNGen64)') AND '$(PlatformTarget)' != 'x86' AND Exists('$(TargetPath).config') AND '$(OutputType)' == 'Exe' AND '$(IsAdministrator)' == 'true'"
46+
Condition = "Exists('$(PathToNGen64)') AND '$(PlatformTarget)' != 'x86' AND '$(PlatformTarget)' != 'arm64' AND Exists('$(TargetPath).config') AND '$(OutputType)' == 'Exe' AND '$(IsAdministrator)' == 'true'"
4647
ConsoleToMSBuild="true"
4748
IgnoreStandardErrorWarningFormat="true" />
4849

4950
<Exec Command='"$(PathToNGen64)" install "$(TargetPath)" /nologo /silent'
50-
Condition = " Exists('$(PathToNGen64)') AND '$(PlatformTarget)' != 'x86' AND (!Exists('$(TargetPath).config') OR '$(OutputType)' != 'Exe') AND '$(IsAdministrator)' == 'true' "
51+
Condition = " Exists('$(PathToNGen64)') AND '$(PlatformTarget)' != 'x86' AND '$(PlatformTarget)' != 'arm64' AND (!Exists('$(TargetPath).config') OR '$(OutputType)' != 'Exe') AND '$(IsAdministrator)' == 'true' "
52+
ConsoleToMSBuild="true"
53+
IgnoreStandardErrorWarningFormat="true"/>
54+
55+
<Exec Command='"$(PathToNGenArm64)" install "$(TargetPath)" /nologo /silent /ExeConfig:"$(TargetPath)"'
56+
Condition = "Exists('$(PathToNGenArm64)') AND '$(PlatformTarget)' == 'arm64' AND Exists('$(TargetPath).config') AND '$(OutputType)' == 'Exe' AND '$(IsAdministrator)' == 'true'"
57+
ConsoleToMSBuild="true"
58+
IgnoreStandardErrorWarningFormat="true" />
59+
60+
<Exec Command='"$(PathToNGenArm64)" install "$(TargetPath)" /nologo /silent'
61+
Condition = " Exists('$(PathToNGenArm64)') AND '$(PlatformTarget)' == 'arm64' AND (!Exists('$(TargetPath).config') OR '$(OutputType)' != 'Exe') AND '$(IsAdministrator)' == 'true' "
5162
ConsoleToMSBuild="true"
5263
IgnoreStandardErrorWarningFormat="true"/>
5364

@@ -61,10 +72,12 @@
6172
<PropertyGroup>
6273
<PathToSN32>$(WindowsSDK_ExecutablePath_x86)\sn.exe</PathToSN32>
6374
<PathToSN64>$(WindowsSDK_ExecutablePath_x64)\sn.exe</PathToSN64>
75+
<PathToSNArm64>$(WindowsSDK_ExecutablePath_Arm64)\sn.exe</PathToSNArm64>
6476
</PropertyGroup>
6577

6678
<Exec Command='"$(PathToSN32)" /q /Vr "$(TargetPath)"' Condition = "Exists('$(PathToSN32)') AND '$(DelaySign)' == 'true' AND Exists('$(TargetPath)') AND '$(IsAdministrator)' == 'true'" ConsoleToMsBuild='true' />
6779
<Exec Command='"$(PathToSN64)" /q /Vr "$(TargetPath)"' Condition = "Exists('$(PathToSN64)') AND '$(DelaySign)' == 'true' AND Exists('$(TargetPath)') AND '$(IsAdministrator)' == 'true'" ConsoleToMsBuild='true' />
80+
<Exec Command='"$(PathToSNArm64)" /q /Vr "$(TargetPath)"' Condition = "Exists('$(PathToSNArm64)') AND '$(DelaySign)' == 'true' AND Exists('$(TargetPath)') AND '$(IsAdministrator)' == 'true'" ConsoleToMsBuild='true' />
6881
</Target>
6982

7083
</Project>

proto.proj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
<Projects Include="src\FSharp.Build\FSharp.Build.fsproj">
1010
<AdditionalProperties>TargetFramework=netstandard2.0</AdditionalProperties>
1111
</Projects>
12-
<Projects Include="src\fsc\fsc.fsproj">
12+
<Projects Include="src\fsc\fscProject\fsc.fsproj">
1313
<AdditionalProperties Condition="'$(OS)' == 'Unix'">TargetFramework=net6.0</AdditionalProperties>
1414
</Projects>
15-
<Projects Include="src\fsi\fsi.fsproj">
15+
<Projects Include="src\fsi\fsiProject\fsi.fsproj">
1616
<AdditionalProperties Condition="'$(OS)' == 'Unix'">TargetFramework=net6.0</AdditionalProperties>
1717
</Projects>
1818
</ItemGroup>

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

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@
55
</PropertyGroup>
66

77
<ItemGroup>
8-
<ProjectReference Include="$(FSharpSourcesRoot)\fsc\fsc.fsproj" />
9-
<ProjectReference Include="$(FSharpSourcesRoot)\fscAnyCpu\fscAnyCpu.fsproj" />
10-
<ProjectReference Include="$(FSharpSourcesRoot)\fsi\fsi.fsproj" />
11-
<ProjectReference Include="$(FSharpSourcesRoot)\fsiAnyCpu\fsiAnyCpu.fsproj" />
8+
<ProjectReference Include="$(FSharpSourcesRoot)\fsc\fscProject\fsc.fsproj" />
9+
<ProjectReference Include="$(FSharpSourcesRoot)\fsc\fscAnyCpuProject\fscAnyCpu.fsproj" />
10+
<ProjectReference Include="$(FSharpSourcesRoot)\fsc\fscArm64Project\fscArm64.fsproj" />
11+
<ProjectReference Include="$(FSharpSourcesRoot)\fsi\fsiProject\fsi.fsproj" />
12+
<ProjectReference Include="$(FSharpSourcesRoot)\fsi\fsiAnyCpuProject\fsiAnyCpu.fsproj" />
13+
<ProjectReference Include="$(FSharpSourcesRoot)\fsi\fsiArm64Project\fsiArm64.fsproj" />
1214
<ProjectReference Include="$(FSharpSourcesRoot)\FSharp.Build\FSharp.Build.fsproj" />
1315
<ProjectReference Include="$(FSharpSourcesRoot)\FSharp.Compiler.Interactive.Settings\FSharp.Compiler.Interactive.Settings.fsproj" />
1416
<ProjectReference Include="$(FSharpSourcesRoot)\FSharp.Compiler.Server.Shared\FSharp.Compiler.Server.Shared.fsproj" />
@@ -83,10 +85,14 @@ folder "InstallDir:Common7\IDE\CommonExtensions\Microsoft\FSharp\Tools"
8385
file source="$(BinariesFolder)fsc\$(Configuration)\$(TargetFramework)\fsc.exe.config"
8486
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"
8587
file source="$(BinariesFolder)fscAnyCpu\$(Configuration)\$(TargetFramework)\fscAnyCpu.exe.config"
88+
file source="$(BinariesFolder)fscArm64\$(Configuration)\$(TargetFramework)\fscArm64.exe" vs.file.ngen=no vs.file.ngenArchitecture=all vs.file.ngenPriority=2 vs.file.ngenApplication="[installDir]\Common7\IDE\CommonExtensions\Microsoft\FSharp\Tools\fscArm64.exe"
89+
file source="$(BinariesFolder)fscArm64\$(Configuration)\$(TargetFramework)\fscArm64.exe.config"
8690
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"
8791
file source="$(BinariesFolder)fsi\$(Configuration)\$(TargetFramework)\fsi.exe.config"
8892
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"
8993
file source="$(BinariesFolder)fsiAnyCpu\$(Configuration)\$(TargetFramework)\fsiAnyCpu.exe.config"
94+
file source="$(BinariesFolder)fsiArm64\$(Configuration)\$(TargetFramework)\fsiArm64.exe" vs.file.ngen=no vs.file.ngenArchitecture=all vs.file.ngenPriority=2 vs.file.ngenApplication="[installDir]\Common7\IDE\CommonExtensions\Microsoft\FSharp\Tools\fsiAnyCpu.exe"
95+
file source="$(BinariesFolder)fsiArm64\$(Configuration)\$(TargetFramework)\fsiArm64.exe.config"
9096
file source="$(BinariesFolder)FSharp.Compiler.Interactive.Settings\$(Configuration)\netstandard2.0\FSharp.Compiler.Interactive.Settings.dll" vs.file.ngen=yes vs.file.ngenArchitecture=All vs.file.ngenPriority=2
9197
file source="$(BinariesFolder)FSharp.Compiler.Interactive.Settings\$(Configuration)\netstandard2.0\FSharp.Compiler.Interactive.Settings.xml"
9298
file source="$(BinariesFolder)fsc\$(Configuration)\$(TargetFramework)\FSharp.Compiler.Service.dll" vs.file.ngen=yes vs.file.ngenArchitecture=All vs.file.ngenPriority=2

src/Compiler/FSharp.Compiler.Service.fsproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,10 @@
7777
<ItemGroup>
7878
<InternalsVisibleTo Include="fsc" />
7979
<InternalsVisibleTo Include="fscAnyCpu" />
80+
<InternalsVisibleTo Include="fscArm64" />
8081
<InternalsVisibleTo Include="fsi" />
8182
<InternalsVisibleTo Include="fsiAnyCpu" />
83+
<InternalsVisibleTo Include="fsiArm64" />
8284
<InternalsVisibleTo Include="FSharp.Compiler.Server.Shared" />
8385
<InternalsVisibleTo Include="VisualFSharp.Salsa" />
8486
<InternalsVisibleTo Include="VisualFSharp.UnitTests" />

src/FSharp.Build/Microsoft.FSharp.Targets

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ this file.
6969
<PropertyGroup Condition="'$(FSharp_Shim_Present)' == 'true' and '$(FSharpPreferNetFrameworkTools)' == 'true'">
7070
<FscToolPath>$(Fsc_NetFramework_ToolPath)</FscToolPath>
7171
<FscToolExe Condition="'$(FSharpPrefer64BitTools)' != 'false'">$(Fsc_NetFramework_AnyCpu_ToolExe)</FscToolExe>
72-
<FscToolExe Condition="'$(FSharpPrefer64BitTools)' == 'false'">$(Fsc_NetFramework_X86_ToolExe)</FscToolExe>
72+
<FscToolExe Condition="'$(FSharpPrefer64BitTools)' == 'false'">$(Fsc_NetFramework_PlatformSpecific_ToolExe)</FscToolExe>
7373
<DotnetFscCompilerPath></DotnetFscCompilerPath>
7474
</PropertyGroup>
7575

src/FSharp.Compiler.Interactive.Settings/FSharp.Compiler.Interactive.Settings.fsproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
<ItemGroup>
1313
<InternalsVisibleTo Include="fsi" />
1414
<InternalsVisibleTo Include="fsiAnyCpu" />
15+
<InternalsVisibleTo Include="fsiArm64" />
1516
<InternalsVisibleTo Include="FSharp.Compiler" />
1617
</ItemGroup>
1718

src/FSharp.Compiler.Server.Shared/FSharp.Compiler.Server.Shared.fsproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
<ItemGroup>
1212
<InternalsVisibleTo Include="fsi" />
1313
<InternalsVisibleTo Include="fsiAnyCpu" />
14+
<InternalsVisibleTo Include="fsiArm64" />
1415
<InternalsVisibleTo Include="FSharp.VS.FSI" />
1516
</ItemGroup>
1617

src/fsc/App.config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<configuration>
33
<runtime>
4+
<gcAllowVeryLargeObjects enabled="true" />
45
<legacyUnhandledExceptionPolicy enabled="true" />
56
<gcServer enabled="true"/>
67
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">

src/fsc/fsc.fsproj

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

src/fscAnyCpu/fscAnyCpu.fsproj renamed to src/fsc/fsc.targets

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,30 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!-- Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. -->
3-
<Project Sdk="Microsoft.NET.Sdk">
3+
<Project>
44

55
<PropertyGroup>
66
<OutputType>Exe</OutputType>
7-
<TargetFrameworks>net472</TargetFrameworks>
8-
<PlatformTarget>AnyCPU</PlatformTarget>
9-
<TargetExt>.exe</TargetExt>
10-
<NoWarn>$(NoWarn);44;45;55;62;75;1204</NoWarn>
7+
<NoWarn>$(NoWarn);44</NoWarn> <!-- Obsolete -->
8+
<NoWarn>$(NoWarn);75</NoWarn> <!-- InternalCommandLineOption -->
119
<AllowCrossTargeting>true</AllowCrossTargeting>
1210
<NGenBinary>true</NGenBinary>
13-
<ExcludeFromSourceBuild>true</ExcludeFromSourceBuild>
11+
<UseAppHost>true</UseAppHost>
12+
<UseAppHost Condition="'$(DotNetBuildFromSource)' == 'true'">false</UseAppHost>
1413
</PropertyGroup>
1514

1615
<ItemGroup>
17-
<Compile Include="..\fsc\fscmain.fs">
18-
<Link>fscmain.fs</Link>
19-
</Compile>
20-
<NoneSubstituteText Include="App.config">
16+
<Compile Include="$(MSBuildThisFileDirectory)fscmain.fs" />
17+
<NoneSubstituteText Include="$(MSBuildThisFileDirectory)App.config">
2118
<Pattern1>{{FSCoreVersion}}</Pattern1>
2219
<Replacement1>$(FSCoreVersion)</Replacement1>
2320
</NoneSubstituteText>
2421
</ItemGroup>
2522

2623
<ItemGroup>
27-
<ProjectReference Include="$(MSBuildThisFileDirectory)..\FSharp.Core\FSharp.Core.fsproj" />
28-
<ProjectReference Include="$(MSBuildThisFileDirectory)..\FSharp.Build\FSharp.Build.fsproj" />
29-
<ProjectReference Include="$(MSBuildThisFileDirectory)..\Compiler\FSharp.Compiler.Service.fsproj" />
30-
<ProjectReference Include="$(MSBuildThisFileDirectory)..\FSharp.DependencyManager.Nuget\FSharp.DependencyManager.Nuget.fsproj" />
24+
<ProjectReference Include="$(MSBuildThisFileDirectory)../FSharp.Core/FSharp.Core.fsproj" />
25+
<ProjectReference Include="$(MSBuildThisFileDirectory)../FSharp.Build/FSharp.Build.fsproj" />
26+
<ProjectReference Include="$(MSBuildThisFileDirectory)../Compiler/FSharp.Compiler.Service.fsproj" />
27+
<ProjectReference Include="$(MSBuildThisFileDirectory)../FSharp.DependencyManager.Nuget/FSharp.DependencyManager.Nuget.fsproj" />
3128
</ItemGroup>
3229

3330
<ItemGroup>
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+
<!-- Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. -->
3+
<Project Sdk="Microsoft.NET.Sdk">
4+
5+
<PropertyGroup>
6+
<TargetFrameworks>net472</TargetFrameworks>
7+
<PlatformTarget>anycpu</PlatformTarget>
8+
<TargetExt>.exe</TargetExt>
9+
<ExcludeFromSourceBuild>true</ExcludeFromSourceBuild>
10+
</PropertyGroup>
11+
12+
<Import Project="$([MSBuild]::GetPathOfFileAbove('fsc.targets', '$(MSBuildThisFileDirectory)../'))" />
13+
14+
</Project>
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+
<!-- Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. -->
3+
<Project Sdk="Microsoft.NET.Sdk">
4+
5+
<PropertyGroup>
6+
<TargetFramework>net472</TargetFramework>
7+
<PlatformTarget>arm64</PlatformTarget>
8+
<TargetExt>.exe</TargetExt>
9+
<ExcludeFromSourceBuild>true</ExcludeFromSourceBuild>
10+
</PropertyGroup>
11+
12+
<Import Project="$([MSBuild]::GetPathOfFileAbove('fsc.targets', '$(MSBuildThisFileDirectory)../'))" />
13+
14+
</Project>

src/fsc/fscProject/fsc.fsproj

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+
<!-- Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. -->
3+
<Project Sdk="Microsoft.NET.Sdk">
4+
5+
<PropertyGroup >
6+
<TargetFrameworks Condition="'$(ProtoTargetFramework)' != ''">$(ProtoTargetFramework)</TargetFrameworks>
7+
<TargetFrameworks Condition="'$(ProtoTargetFramework)' == ''">net472;net6.0</TargetFrameworks>
8+
<TargetFrameworks Condition="'$(OS)' == 'Unix'">net6.0</TargetFrameworks>
9+
<PlatformTarget Condition="'$(TargetFramework)' == 'net472'">x86</PlatformTarget>
10+
</PropertyGroup>
11+
12+
<Import Project="$([MSBuild]::GetPathOfFileAbove('fsc.targets', '$(MSBuildThisFileDirectory)../'))" />
13+
14+
</Project>

src/fscAnyCpu/App.config

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

src/fscAnyCpu/Directory.Build.props

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

src/fsi/App.config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<configuration>
33
<runtime>
4+
<gcAllowVeryLargeObjects enabled="true" />
45
<legacyUnhandledExceptionPolicy enabled="true" />
56
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
67
<dependentAssembly>

0 commit comments

Comments
 (0)