Skip to content

Commit 379f46f

Browse files
committed
fix build for mono packaging
1 parent dd0e119 commit 379f46f

File tree

26 files changed

+191
-99
lines changed

26 files changed

+191
-99
lines changed

FSharp.sln

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FSharp.Tests.FSharpSuite",
3131
EndProject
3232
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FSharp.Compiler.UnitTests", "tests\FSharp.Compiler.UnitTests\FSharp.Compiler.UnitTests.fsproj", "{A8D9641A-9170-4CF4-8FE0-6DB8C134E1B5}"
3333
EndProject
34-
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FSharp.Core.UnitTests", "tests\FSharp.Core.UnitTests\FSharp.Core.UnitTests.fsproj", "{88E2D422-6852-46E3-A740-83E391DC7973}"
34+
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FSharp.Core.UnitTests", "tests\FSharp.Core.UnitTests\FSharp.Core.Unittests.fsproj", "{88E2D422-6852-46E3-A740-83E391DC7973}"
3535
EndProject
3636
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Compiler", "Compiler", "{3881429D-A97A-49EB-B7AE-A82BA5FE9C77}"
3737
EndProject

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
include $(topsrcdir)mono/config.make
22

3-
.PHONY: restore
3+
.PHONY: restore build
44

55
restore:
66
MONO_ENV_OPTIONS=$(monoopts) mono .nuget/NuGet.exe restore packages.config -PackagesDirectory packages -ConfigFile .nuget/NuGet.Config
@@ -27,7 +27,7 @@ build:
2727
MONO_ENV_OPTIONS=$(monoopts) $(MSBUILD) /p:Configuration=$(Configuration) /p:TargetDotnetProfile=net40 src/fsharp/FSharp.Compiler.Server.Shared/FSharp.Compiler.Server.Shared.fsproj
2828
MONO_ENV_OPTIONS=$(monoopts) $(MSBUILD) /p:Configuration=$(Configuration) /p:TargetDotnetProfile=net40 src/fsharp/fsi/Fsi.fsproj
2929
MONO_ENV_OPTIONS=$(monoopts) $(MSBUILD) /p:Configuration=$(Configuration) /p:TargetDotnetProfile=net40 src/fsharp/fsiAnyCpu/FsiAnyCPU.fsproj
30-
MONO_ENV_OPTIONS=$(monoopts) $(MSBUILD) /p:Configuration=$(Configuration) /p:TargetDotnetProfile=net40 tests/FSharp.Core.UnitTests/FSharp.Core.UnitTests.fsproj
30+
MONO_ENV_OPTIONS=$(monoopts) $(MSBUILD) /p:Configuration=$(Configuration) /p:TargetDotnetProfile=net40 tests/FSharp.Core.UnitTests/FSharp.Core.Unittests.fsproj
3131
mkdir -p $(Configuration)/fsharp30/net40/bin
3232
mkdir -p $(Configuration)/fsharp31/net40/bin
3333
mkdir -p $(Configuration)/fsharp40/net40/bin

build-everything.proj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,12 @@
5454
<!-- +++++++++++++++++++++++ Project selection for testing +++++++++++++++++++++++++++++++ -->
5555

5656
<ItemGroup Condition="'$(TEST_NET40_COREUNIT_SUITE)'=='1'" >
57-
<ProjectsWithNet40 Include="tests/FSharp.Core.UnitTests/FSharp.Core.UnitTests.fsproj"/>
57+
<ProjectsWithNet40 Include="tests/FSharp.Core.UnitTests/FSharp.Core.Unittests.fsproj"/>
5858
<ProjectsWithNet40 Include="tests/FSharp.Build.UnitTests/FSharp.Build.UnitTests.fsproj"/>
5959
</ItemGroup>
6060

6161
<ItemGroup Condition="'$(TEST_CORECLR_COREUNIT_SUITE)'=='1'">
62-
<ProjectsWithCoreClr Include="tests/FSharp.Core.UnitTests/FSharp.Core.UnitTests.fsproj"/>
62+
<ProjectsWithCoreClr Include="tests/FSharp.Core.UnitTests/FSharp.Core.Unittests.fsproj"/>
6363
<ProjectsWithCoreClr Include="tests/FSharp.Build.UnitTests/FSharp.Build.UnitTests.fsproj"/>
6464
</ItemGroup>
6565

build.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -361,15 +361,15 @@ if [ "$BUILD_PROTO" = "1" ]; then
361361
# { printeval "$_ngenexe install Proto/net40/bin/fsc-proto.exe /nologo"; } || failwith "NGen of proto failed"
362362
else
363363
# Build proto-compiler and libs
364-
{ printeval "$_msbuildexe $msbuildflags src/fsharp-proto-build.proj /p:UseMonoPackaging=true /p:Configuration=Proto /p:DisableLocalization=true"; } || failwith "compiler proto build failed"
364+
{ printeval "$_msbuildexe $msbuildflags src/fsharp-proto-build.proj /p:MonoPackaging=true /p:Configuration=Proto /p:DisableLocalization=true"; } || failwith "compiler proto build failed"
365365
fi
366366
fi
367367

368368

369369
build_status "Done with proto, starting build"
370370

371371
if [ "$BUILD_PHASE" = "1" ]; then
372-
cmd="$_msbuildexe $msbuildflags build-everything.proj /p:UseMonoPackaging=true /p:Configuration=$BUILD_CONFIG $BUILD_DIAG /p:BUILD_PUBLICSIGN=$BUILD_PUBLICSIGN"
372+
cmd="$_msbuildexe $msbuildflags build-everything.proj /p:MonoPackaging=true /p:Configuration=$BUILD_CONFIG $BUILD_DIAG /p:BUILD_PUBLICSIGN=$BUILD_PUBLICSIGN"
373373
{ printeval "$cmd"; } || failwith "'$cmd' failed"
374374
fi
375375

build/targets/GitHash.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
Copied from RepoToolset. Might be slightly modified to adjust for the current F# build system specifics if necessary.
66
-->
77

8-
<Project>
8+
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
99
<!--
1010
1111
Defines the following properties:

mono/appveyor.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
# the version under development, update after a release
3-
$version = '4.1.28'
3+
$version = '4.1.31'
44

55
function isVersionTag($tag){
66
$v = New-Object Version

packages.config

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@
2020
<package id="Microsoft.DiaSymReader.PortablePdb" version="1.2.0" />
2121
<package id="Microsoft.DiaSymReader" version="1.1.0" />
2222
<package id="System.ValueTuple" version="4.3.1" />
23-
<package id="Microsoft.VisualFSharp.Msbuild.15.0" version="1.0.1" />
23+
<package id="Microsoft.Build" version="14.3.0" />
24+
<package id="Microsoft.Build.Framework" version="14.3.0" />
25+
<package id="Microsoft.Build.Utilities.Core" version="14.3.0" />
26+
<package id="Microsoft.Build.Tasks.Core" version="14.3.0" />
2427

2528
<!-- Testing -->
2629
<package id="FsCheck" version="2.6.2" />

src/FSharpSource.Profiles.targets

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
44

55
<PropertyGroup Condition="'$(TargetDotnetProfile)'=='net40'">
6+
<DefineConstants Condition="'$(MonoPackaging)' == 'true'">$(DefineConstants);CROSS_PLATFORM_COMPILER</DefineConstants>
67
<DefineConstants>$(DefineConstants);PREFERRED_UI_LANG</DefineConstants>
78
<DefineConstants>$(DefineConstants);ENABLE_MONO_SUPPORT</DefineConstants>
89
<DefineConstants>$(DefineConstants);BE_SECURITY_TRANSPARENT</DefineConstants>

src/FSharpSource.Settings.targets

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,14 +103,18 @@
103103
<XliffTasksVersion>0.2.0-beta-000076</XliffTasksVersion>
104104
</PropertyGroup>
105105

106+
<!-- Default setting. Some get modified later in FSharpSource.targets -->
106107
<PropertyGroup>
108+
<SkipSigning>false</SkipSigning>
109+
<UseOpenSourceSign>true</UseOpenSourceSign>
107110
<SignAssembly>true</SignAssembly>
108111
<AssemblyOriginatorKeyFile>$(FSharpSourcesRoot)\fsharp\msft.pubkey</AssemblyOriginatorKeyFile>
109112
<StrongNames>true</StrongNames>
110113
<DelaySign>true</DelaySign>
111114
</PropertyGroup>
112115

113-
<PropertyGroup Condition="'$(OS)' != 'Unix'">
116+
<!-- On windows, VS packaging -->
117+
<PropertyGroup Condition="'$(MonoPackaging)' != 'true' AND '$(OS)' != 'Unix'">
114118
<UseMicroBuild>true</UseMicroBuild>
115119
<UseSourceLink Condition = " '$(UseSourceLink)' == '' AND '$(Configuration)'=='Release' ">false</UseSourceLink>
116120
<UseGatherBinaries>true</UseGatherBinaries>
@@ -130,6 +134,7 @@
130134
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
131135
<!-- Settings for Debug mode -->
132136
<DebugType>full</DebugType>
137+
<DebugType Condition="'$(OS)' == 'Unix'">portable</DebugType> <!-- no longer use MDB on Mono -->
133138

134139
<Optimize Condition=" '$(Optimize)' == '' ">false</Optimize>
135140
<ErrorReport Condition=" '$(ErrorReport)' == '' ">prompt</ErrorReport>
@@ -142,6 +147,7 @@
142147
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
143148
<!-- Flags used for Release mode. -->
144149
<DebugType>pdbonly</DebugType>
150+
<DebugType Condition="'$(OS)' == 'Unix'">portable</DebugType> <!-- no longer use MDB on Mono -->
145151

146152
<Optimize Condition=" '$(Optimize)' == '' ">true</Optimize>
147153
<EmbedAllSource>false</EmbedAllSource>
@@ -153,6 +159,7 @@
153159
<PropertyGroup Condition="'$(Configuration)'=='Proto'">
154160
<!-- Flags used when running the Proto compiler. -->
155161
<DebugType Condition=" '$(DebugType)' == '' ">full</DebugType>
162+
<DebugType Condition="'$(OS)' == 'Unix'">portable</DebugType> <!-- no longer use MDB on Mono -->
156163
<Optimize>true</Optimize>
157164
<DefineConstants>DEBUG;NO_STRONG_NAMES;$(DefineConstants)</DefineConstants>
158165
</PropertyGroup>
@@ -196,17 +203,23 @@
196203
<!-- FSharp.Compiler.Tools is currently only used to get a working FSI.EXE to execute some scripts during the build -->
197204
<!-- The LKG FSI.EXE requires MSBuild 15 to be installed, which is painful -->
198205
<FsiToolPath>$(FSharpSourcesRoot)\..\packages\FSharp.Compiler.Tools.4.1.27\tools</FsiToolPath>
206+
207+
208+
<!-- The version of MSBuild assumed byt the F# compiler in the Mono packaging of F# -->
209+
<MonoPackagingMSBuildVersionFull>14.0.0.0</MonoPackagingMSBuildVersionFull>
210+
199211
</PropertyGroup>
200212

213+
<!--
201214
<Import Project="$(MSBuildThisFileDirectory)..\packages\XliffTasks.$(XliffTasksVersion)\build\XliffTasks.props" Condition="'$(DisableLocalization)' != 'true'" />
202215
203216
<PropertyGroup>
204-
<!-- in addition to the standard xlf languages, also provide a baseline en->en file -->
205217
<XlfLanguages>en;$(XlfLanguages)</XlfLanguages>
206218
</PropertyGroup>
207219
208220
<Import Project="$(RestorePackagesPath)\XliffTasks.$(XliffTasksVersion)\build\XliffTasks.targets" Condition="'$(DisableLocalization)' != 'true'" />
209221
<Import Project="../Tools/Build.Common.props" Condition="'$(TargetDotnetProfile)'=='coreclr'"/>
210222
<Import Project="$(BuildVersionFilePath)" Condition="Exists('$(BuildVersionFilePath)')" />
223+
-->
211224

212225
</Project>

src/FSharpSource.targets

Lines changed: 26 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -8,74 +8,43 @@
88

99
<Import Project="..\build\targets\GitHash.props" />
1010

11-
<Choose>
12-
<When Condition="'$(Configuration)' == 'Debug' or '$(Configuration)' == 'Release' ">
13-
<PropertyGroup>
14-
<SkipSigning>false</SkipSigning><!-- Skip using the ,net toolset to generate signing . -->
15-
<UseOpenSourceSign>true</UseOpenSourceSign>
16-
</PropertyGroup>
17-
<Choose>
18-
<When Condition="'$(ProjectLanguage)' == 'FSharp'">
19-
<Choose>
20-
<!-- Some unit test assemblies must not have strong names since they reference other assemblies that don't have strong names -->
21-
<!-- These unit test assemblies can't use InternalsVisibleTo into assemblies with strong names. -->
22-
<When Condition="'$(StrongNames)' == 'false'" >
23-
<PropertyGroup>
24-
<SkipSigning>true</SkipSigning>
25-
<UseOpenSourceSign>false</UseOpenSourceSign>
26-
<MicroBuildAssemblyFileLanguage>fs</MicroBuildAssemblyFileLanguage>
27-
</PropertyGroup>
28-
</When>
29-
<!-- In the Microsoft build we just delay-sign everything with the MSFT key -->
30-
<!-- We have to do unit test DLLs well because they can see the internals of other strong-named DLLs -->
31-
<Otherwise>
32-
<PropertyGroup>
33-
<DelaySign>true</DelaySign>
34-
<StrongNames>true</StrongNames>
35-
<MicroBuildAssemblyFileLanguage>fs</MicroBuildAssemblyFileLanguage>
36-
</PropertyGroup>
37-
</Otherwise>
38-
</Choose>
39-
</When>
40-
<Otherwise>
41-
<!-- Not F# code -->
42-
<PropertyGroup>
43-
<SignAssembly>true</SignAssembly>
44-
<AssemblyOriginatorKeyFile>$(FSharpSourcesRoot)\fsharp\msft.pubkey</AssemblyOriginatorKeyFile>
45-
<StrongNames>true</StrongNames>
46-
<DelaySign>true</DelaySign>
47-
<MicroBuildAssemblyFileLanguage>fs</MicroBuildAssemblyFileLanguage>
48-
</PropertyGroup>
49-
</Otherwise>
50-
</Choose>
51-
</When>
52-
<Otherwise>
53-
<PropertyGroup Condition="'$(StrongNames)' != 'true'">
54-
<!-- For the proto build we don't use strong names. -->
55-
<DefineConstants>NO_STRONG_NAMES;$(DefineConstants)</DefineConstants>
56-
<MicroBuildAssemblyFileLanguage>fs</MicroBuildAssemblyFileLanguage>
57-
</PropertyGroup>
58-
</Otherwise>
59-
</Choose>
11+
<PropertyGroup>
12+
<MicroBuildAssemblyFileLanguage>fs</MicroBuildAssemblyFileLanguage>
13+
</PropertyGroup>
6014

15+
<!-- Some unit test assemblies must not have strong names since they reference other assemblies that don't have strong names -->
16+
<!-- These unit test assemblies can't use InternalsVisibleTo into assemblies with strong names. -->
17+
<PropertyGroup Condition="'$(StrongNames)' == 'false'">
18+
<SkipSigning>true</SkipSigning>
19+
<UseOpenSourceSign>false</UseOpenSourceSign>
20+
<SignAssembly>false</SignAssembly>
21+
<DefineConstants>NO_STRONG_NAMES;$(DefineConstants)</DefineConstants>
22+
</PropertyGroup>
23+
24+
<!-- On mono, use test.snk to sign private compiler binaries -->
25+
<PropertyGroup Condition="'$(StrongNames)' != 'false' AND '$(MonoPackaging)' == 'true' AND '$(AssemblyName)' != 'FSharp.Core' AND '$(AssemblyName)' != 'FSharp.Compiler.Interactive.Settings'" >
26+
<AssemblyOriginatorKeyFile>$(FSharpSourcesRoot)\fsharp\test.snk</AssemblyOriginatorKeyFile>
27+
<DelaySign>false</DelaySign>
28+
<DefineConstants>STRONG_NAME_FSHARP_COMPILER_WITH_TEST_KEY;$(DefineConstants)</DefineConstants>
29+
</PropertyGroup>
30+
31+
<!-- On proto, use he FSharp.Core assembly version for everything (it only matters we get it right for FSharp.Core), and pass the version flag explicitly if not using MicroBuild -->
6132
<PropertyGroup Condition="'$(Configuration)' == 'Proto'">
62-
<OtherFlags >$(OtherFlags) --version:"$(MicroBuildAssemblyVersion)"</OtherFlags>
33+
<MicroBuildAssemblyVersion>$(FSCoreVersion)</MicroBuildAssemblyVersion>
34+
<OtherFlags>$(OtherFlags) --version:"$(MicroBuildAssemblyVersion)"</OtherFlags>
6335
</PropertyGroup>
6436

6537
<PropertyGroup Condition="'$(UseSourceLink)' == 'true'">
6638
<SourceLink>$(IntermediateOutputPath)source_link.json</SourceLink>
6739
</PropertyGroup>
6840

69-
<PropertyGroup Condition="'$(StrongNames)' != 'true'">
70-
<DefineConstants>NO_STRONG_NAMES;$(DefineConstants)</DefineConstants>
71-
</PropertyGroup>
72-
41+
<!-- We assume MSBuild 15.0 or greater. Note the Mono packaging doesn't actually rely on any specific version of MSBuild any longer except to build the MSBuild task-->
7342
<PropertyGroup>
7443
<DefineConstants>MSBUILD_AT_LEAST_14;$(DefineConstants)</DefineConstants>
7544
</PropertyGroup>
7645

46+
<!-- Disable uwa toolchain nuget package resolve logic. -->
7747
<PropertyGroup>
78-
<!-- Disable uwa toolchain nuget package resolve logic. -->
7948
<NuGetTargets Condition="'$(NuGetTargets)' == ''">false</NuGetTargets>
8049
</PropertyGroup>
8150

@@ -126,7 +95,8 @@
12695
<TargetFrameworkOutputDirectory Condition="'$(FSharpCoreBackVersion)' == '3.0'">fsharp30\$(TargetDotnetProfile)</TargetFrameworkOutputDirectory>
12796
<TargetFrameworkOutputDirectory Condition="'$(FSharpCoreBackVersion)' == '3.1'">fsharp31\$(TargetDotnetProfile)</TargetFrameworkOutputDirectory>
12897
<TargetFrameworkOutputDirectory Condition="'$(FSharpCoreBackVersion)' == '4.0'">fsharp40\$(TargetDotnetProfile)</TargetFrameworkOutputDirectory>
129-
<IntermediateOutputPath>obj\$(TargetFrameworkOutputDirectory)\</IntermediateOutputPath>
98+
<TargetFrameworkOutputDirectory>$(TargetDotnetProfile)</TargetFrameworkOutputDirectory>
99+
<IntermediateOutputPath>obj\$(Configuration)\$(TargetFrameworkOutputDirectory)\</IntermediateOutputPath>
130100
</PropertyGroup>
131101

132102
<Choose>

0 commit comments

Comments
 (0)