Skip to content

Commit e7ce9cd

Browse files
authored
Re-enable FCS build on Jenkins Ubuntu (#4391)
* re-enable mono build on CI * do it right * simplify fcs samples * build nugets and test on mono * fix proto build * remove mono workarounds using msbuild, use dotnet instead * add comment * set IsPackable=false explicitly in samples * missing file * add docs * fix minor things
1 parent 44ef814 commit e7ce9cd

30 files changed

+156
-518
lines changed

fcs/FSharp.Compiler.Service.MSBuild.v12/FSharp.Compiler.Service.MSBuild.v12.fsproj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<FSharpSourcesRoot>$(MSBuildProjectDirectory)\..\..\src</FSharpSourcesRoot>
44
</PropertyGroup>
55
<Import Project="..\fcs.props" />
6+
<Import Project="..\netfx.props" />
67
<PropertyGroup>
78
<TargetFrameworks>net45</TargetFrameworks>
89
<OutputPath>..\..\$(Configuration.ToLower())\fcs</OutputPath>
@@ -23,10 +24,10 @@
2324
<Compile Include="..\..\src\fsharp\MSBuildReferenceResolver.fs">
2425
<Link>Service/MSBuildReferenceResolver.fs</Link>
2526
</Compile>
26-
<Reference Include="FSharp.Core">
27-
<HintPath>$(FSharpSourcesRoot)\..\packages\Microsoft.Portable.FSharp.Core.4.1.20\lib\profiles\net40\FSharp.Core.dll</HintPath>
28-
<Private>false</Private>
29-
</Reference>
27+
</ItemGroup>
28+
<ItemGroup>
29+
<PackageReference Include="FSharp.Core" Version="4.1.*" />
30+
<ProjectReference Include="..\FSharp.Compiler.Service\FSharp.Compiler.Service.fsproj" />
3031
<Reference Include="Microsoft.Build.Framework, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
3132
<HintPath>$(FSharpSourcesRoot)\..\fcs\dependencies\MSBuild.v12.0\Microsoft.Build.Framework.dll</HintPath>
3233
<Private>false</Private>
@@ -47,6 +48,5 @@
4748
<HintPath>$(FSharpSourcesRoot)\..\fcs\dependencies\MSBuild.v12.0\Microsoft.Build.Tasks.v12.0.dll</HintPath>
4849
<Private>false</Private>
4950
</Reference>
50-
<ProjectReference Include="..\FSharp.Compiler.Service\FSharp.Compiler.Service.fsproj" />
5151
</ItemGroup>
5252
</Project>

fcs/FSharp.Compiler.Service.ProjectCracker/FSharp.Compiler.Service.ProjectCracker.fsproj

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<FSharpSourcesRoot>$(MSBuildProjectDirectory)\..\..\src</FSharpSourcesRoot>
44
</PropertyGroup>
55
<Import Project="..\fcs.props" />
6+
<Import Project="..\netfx.props" />
67
<PropertyGroup>
78
<TargetFrameworks>net45</TargetFrameworks>
89
<OutputPath>..\..\$(Configuration.ToLower())\fcs</OutputPath>
@@ -26,11 +27,8 @@
2627
<Content Include="..\..\release\fcs\net45\FSharp.Compiler.Service.ProjectCrackerTool.exe" PackagePath="utilities\net45" />
2728
<Content Include="..\..\release\fcs\net45\FSharp.Compiler.Service.ProjectCrackerTool.exe.config" PackagePath="utilities\net45" />
2829
</ItemGroup>
29-
<ItemGroup Condition="'$(TargetFramework)' == 'net45'">
30-
<Reference Include="FSharp.Core">
31-
<HintPath>$(FSharpSourcesRoot)\..\packages\Microsoft.Portable.FSharp.Core.4.1.20\lib\profiles\net40\FSharp.Core.dll</HintPath>
32-
<Private>false</Private>
33-
</Reference>
30+
<ItemGroup>
31+
<PackageReference Include="FSharp.Core" Version="4.1.*" />
3432
<ProjectReference Include="..\FSharp.Compiler.Service\FSharp.Compiler.Service.fsproj" />
3533
</ItemGroup>
3634
</Project>

fcs/FSharp.Compiler.Service.ProjectCrackerTool/FSharp.Compiler.Service.ProjectCrackerTool.fsproj

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<FSharpSourcesRoot>$(MSBuildProjectDirectory)\..\..\src</FSharpSourcesRoot>
44
</PropertyGroup>
55
<Import Project="..\fcs.props" />
6+
<Import Project="..\netfx.props" />
67
<PropertyGroup>
78
<OutputType>Exe</OutputType>
89
<TargetFrameworks>net45</TargetFrameworks>
@@ -19,11 +20,7 @@
1920
<Compile Include="Program.fs" />
2021
<None Include="App.config" />
2122
<None Include="FSharp.Compiler.Service.ProjectCracker.targets" />
22-
<None Include="paket.references" />
23-
<Reference Include="FSharp.Core">
24-
<HintPath>$(FSharpSourcesRoot)\..\packages\Microsoft.Portable.FSharp.Core.4.1.20\lib\profiles\net40\FSharp.Core.dll</HintPath>
25-
<Private>false</Private>
26-
</Reference>
23+
<PackageReference Include="FSharp.Core" Version="4.1.*" />
2724
<Reference Include="Microsoft.Build.Framework, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
2825
<HintPath>$(FSharpSourcesRoot)\..\fcs\dependencies\MSBuild.v12.0\Microsoft.Build.Framework.dll</HintPath>
2926
<Private>false</Private>

fcs/FSharp.Compiler.Service.ProjectCrackerTool/paket.references

Lines changed: 0 additions & 4 deletions
This file was deleted.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
<Import Project="..\..\netfx.props" />
3+
<PropertyGroup>
4+
<TargetFrameworks>net45;netstandard2.0</TargetFrameworks>
5+
<IsPackable>false</IsPackable>
6+
</PropertyGroup>
7+
<ItemGroup>
8+
<Compile Include="../../../tests/service/data/CSharp_Analysis/CSharpClass.cs" />
9+
</ItemGroup>
10+
</Project>

fcs/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
<FSharpSourcesRoot>$(MSBuildProjectDirectory)\..\..\src</FSharpSourcesRoot>
44
</PropertyGroup>
55
<Import Project="..\fcs.props" />
6+
<Import Project="..\netfx.props" />
67
<PropertyGroup>
78
<TargetFrameworks>net46;netcoreapp2.0</TargetFrameworks>
8-
<!-- <DefineConstants>$(DefineConstants);NETCOREAPP2_0</DefineConstants> -->
99
<NoWarn>$(NoWarn);44;</NoWarn>
1010
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
11-
<DelaySign>true</DelaySign>
1211
<GenerateDocumentationFile>true</GenerateDocumentationFile>
13-
<OutputPath>..\..\$(Configuration.ToLower())\fcs</OutputPath>
12+
<IsPackable>false</IsPackable>
13+
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies> <!-- Tests won't run without this, at least on OSX, see https://github.com/NuGet/Home/issues/4837#issuecomment-354536302 -->
1414
</PropertyGroup>
1515
<PropertyGroup Condition="'$(TargetFramework)' == 'netcoreapp2.0'">
1616
<DefineConstants>$(DefineConstants);FX_NO_RUNTIMEENVIRONMENT</DefineConstants>
@@ -68,14 +68,12 @@
6868
<None Include="App.config" />
6969
</ItemGroup>
7070
<ItemGroup>
71-
<ProjectReference Include="..\FSharp.Compiler.Service\FSharp.Compiler.Service.fsproj" />
72-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.5.0" />
71+
<PackageReference Include="FSharp.Core" Version="4.2.*" />
72+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.6.0" />
7373
<PackageReference Include="NUnit" Version="3.9.0" />
7474
<PackageReference Include="NUnit3TestAdapter" Version="3.9.0" />
7575
<PackageReference Include="Dotnet.ProjInfo" Version="0.9.0" />
76-
</ItemGroup>
77-
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp2.0'">
78-
<PackageReference Include="FSharp.Core" Version="4.2.3" />
76+
<ProjectReference Include="..\FSharp.Compiler.Service\FSharp.Compiler.Service.fsproj" />
7977
</ItemGroup>
8078
<ItemGroup Condition="'$(TargetFramework)' == 'net46'">
8179
<Reference Include="mscorlib" />
@@ -91,7 +89,7 @@
9189
<Reference Include="System.Xaml" />
9290
<Reference Include="WindowsBase" />
9391
<Reference Include="UIAutomationTypes" />
94-
<ProjectReference Include="$(FSharpSourcesRoot)\..\tests\service\data\CSharp_Analysis\CSharp_Analysis.csproj" />
95-
<ProjectReference Include="$(FSharpSourcesRoot)\..\fcs\FSharp.Compiler.Service.ProjectCracker\FSharp.Compiler.Service.ProjectCracker.fsproj" />
92+
<ProjectReference Include="CSharp_Analysis\CSharp_Analysis.csproj" />
93+
<ProjectReference Include="..\FSharp.Compiler.Service.ProjectCracker\FSharp.Compiler.Service.ProjectCracker.fsproj" />
9694
</ItemGroup>
9795
</Project>

fcs/FSharp.Compiler.Service.sln

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "UntypedTree", "samples\Unty
5151
EndProject
5252
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FscExe", "samples\FscExe\FscExe.fsproj", "{C94C257C-3C0A-4858-B5D8-D746498D1F08}"
5353
EndProject
54-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CSharp_Analysis", "..\tests\service\data\CSharp_Analysis\CSharp_Analysis.csproj", "{887630A3-4B1D-40EA-B8B3-2D842E9C40DB}"
54+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CSharp_Analysis", "FSharp.Compiler.Service.Tests\CSharp_Analysis\CSharp_Analysis.csproj", "{887630A3-4B1D-40EA-B8B3-2D842E9C40DB}"
5555
EndProject
5656
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FsiExe", "samples\FsiExe\FsiExe.fsproj", "{F9540CA8-1CE0-4546-A23A-A461E416E95B}"
5757
EndProject

fcs/FSharp.Compiler.Service/FSharp.Compiler.Service.fsproj

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<FSharpSourcesRoot>$(MSBuildProjectDirectory)\..\..\src</FSharpSourcesRoot>
44
</PropertyGroup>
55
<Import Project="..\fcs.props" />
6+
<Import Project="..\netfx.props" />
67
<PropertyGroup>
78
<TargetFrameworks>net45;netstandard2.0</TargetFrameworks>
89
<DefineConstants>$(DefineConstants);COMPILER_SERVICE_AS_DLL</DefineConstants>
@@ -30,7 +31,6 @@
3031
<PackageTags>F#, fsharp, interactive, compiler, editor</PackageTags>
3132
</PropertyGroup>
3233
<PropertyGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
33-
<!-- <DefineConstants >$(DefineConstants);NETSTANDARD2_0</DefineConstants> -->
3434
<DefineConstants>$(DefineConstants);FX_NO_PDB_READER</DefineConstants>
3535
<DefineConstants>$(DefineConstants);FX_NO_PDB_WRITER</DefineConstants>
3636
<DefineConstants>$(DefineConstants);FX_NO_SYMBOLSTORE</DefineConstants>
@@ -631,31 +631,25 @@
631631
<Link>Service/fsi.fs</Link>
632632
</Compile>
633633
</ItemGroup>
634-
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
634+
<ItemGroup>
635+
<PackageReference Include="FSharp.Core" Version="4.1.*" />
635636
<PackageReference Include="System.Collections.Immutable" Version="1.3.1" />
637+
<PackageReference Include="System.Reflection.Metadata" Version="1.4.2" />
638+
<PackageReference Include="Microsoft.DiaSymReader.PortablePdb" Version="1.2.0" />
639+
<PackageReference Include="Microsoft.DiaSymReader" Version="1.1.0" />
640+
</ItemGroup>
641+
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
636642
<PackageReference Include="System.Diagnostics.Process" Version="4.1.0" />
637643
<PackageReference Include="System.Diagnostics.TraceSource" Version="4.0.0" />
638644
<PackageReference Include="System.Reflection.Emit" Version="4.3.0" />
639-
<PackageReference Include="System.Reflection.Metadata" Version="1.4.1" />
640645
<PackageReference Include="System.Reflection.TypeExtensions" Version="4.3.0" />
641646
<PackageReference Include="System.Runtime.Loader" Version="4.0.0" />
642647
<PackageReference Include="System.Security.Cryptography.Algorithms" Version="4.3.0" />
643-
<PackageReference Include="FSharp.Core" Version="4.1.*" />
644648
</ItemGroup>
645649
<ItemGroup Condition="'$(TargetFramework)' == 'net45'">
650+
<Reference Include="System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
651+
<Reference Include="System.IO, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
646652
<Reference Include="ISymWrapper, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
647-
<Reference Include="Microsoft.DiaSymReader.PortablePdb">
648-
<HintPath>$(FSharpSourcesRoot)\..\packages\Microsoft.DiaSymReader.PortablePdb.1.2.0\lib\portable-net45+win8\Microsoft.DiaSymReader.PortablePdb.dll</HintPath>
649-
</Reference>
650-
<Reference Include="Microsoft.DiaSymReader">
651-
<HintPath>$(FSharpSourcesRoot)\..\packages\Microsoft.DiaSymReader.1.1.0\lib\portable-net45+win8\Microsoft.DiaSymReader.dll</HintPath>
652-
</Reference>
653-
<Reference Include="System.Reflection.Metadata">
654-
<HintPath>$(FSharpSourcesRoot)\..\packages\System.Reflection.Metadata.1.4.2\lib\portable-net45+win8\System.Reflection.Metadata.dll</HintPath>
655-
</Reference>
656-
<Reference Include="System.Collections.Immutable">
657-
<HintPath>$(FSharpSourcesRoot)\..\packages\System.Collections.Immutable.1.3.1\lib\portable-net45+win8+wp8+wpa81\System.Collections.Immutable.dll</HintPath>
658-
</Reference>
659653
<Reference Include="System.ValueTuple">
660654
<HintPath>$(FSharpSourcesRoot)\..\packages\System.ValueTuple.4.3.1\lib\netstandard1.0\System.ValueTuple.dll</HintPath>
661655
</Reference>

fcs/build.fsx

Lines changed: 16 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -63,78 +63,57 @@ let isJenkinsBuild = buildServer = BuildServer.Jenkins
6363
let isVersionTag tag = Version.TryParse tag |> fst
6464
let hasRepoVersionTag = isAppVeyorBuild && AppVeyorEnvironment.RepoTag && isVersionTag AppVeyorEnvironment.RepoTagName
6565
let assemblyVersion = if hasRepoVersionTag then AppVeyorEnvironment.RepoTagName else release.NugetVersion
66-
let nugetVersion = release.NugetVersion
67-
open SemVerHelper
6866

6967
let buildVersion =
7068
if hasRepoVersionTag then assemblyVersion
7169
else if isAppVeyorBuild then sprintf "%s-b%s" assemblyVersion AppVeyorEnvironment.BuildNumber
7270
else assemblyVersion
7371

74-
// Skipping build of FCS on Jenkins Mono for now until we knoow how to get an updated version of Mono installed
75-
let skipBuild = isJenkinsBuild && isMono
76-
7772
Target "Clean" (fun _ ->
78-
if not skipBuild then
7973
CleanDir releaseDir
8074
)
8175

8276
Target "Restore" (fun _ ->
83-
if not skipBuild then
84-
runDotnet __SOURCE_DIRECTORY__ "restore FSharp.Compiler.Service/FSharp.Compiler.Service.fsproj -v n"
85-
runDotnet __SOURCE_DIRECTORY__ "restore FSharp.Compiler.Service.ProjectCrackerTool/FSharp.Compiler.Service.ProjectCrackerTool.fsproj -v n"
86-
runDotnet __SOURCE_DIRECTORY__ "restore FSharp.Compiler.Service.ProjectCracker/FSharp.Compiler.Service.ProjectCracker.fsproj -v n"
87-
runDotnet __SOURCE_DIRECTORY__ "restore FSharp.Compiler.Service.MSBuild.v12/FSharp.Compiler.Service.MSBuild.v12.fsproj -v n"
88-
for p in (!! "./../**/packages.config") do
89-
let result =
90-
ExecProcess (fun info ->
91-
info.FileName <- FullName @"./../.nuget/NuGet.exe"
92-
info.WorkingDirectory <- FullName @"./.."
93-
info.Arguments <- sprintf "restore %s -PackagesDirectory \"%s\" -ConfigFile \"%s\"" (FullName p) (FullName "./../packages") (FullName "./../NuGet.Config")) TimeSpan.MaxValue
94-
if result <> 0 then failwithf "nuget restore %s failed" p
77+
// We assume a paket restore has already been run
78+
runDotnet __SOURCE_DIRECTORY__ "restore FSharp.Compiler.Service.sln -v n"
79+
for p in [ "../packages.config" ] do
80+
ExecProcess (fun info ->
81+
info.FileName <- FullName @"./../.nuget/NuGet.exe"
82+
info.WorkingDirectory <- FullName @"./.."
83+
info.Arguments <- sprintf "restore %s -PackagesDirectory \"%s\" -ConfigFile \"%s\"" (FullName p) (FullName "./../packages") (FullName "./../NuGet.Config")) TimeSpan.MaxValue
84+
|> assertExitCodeZero
9585
)
9686

9787
Target "BuildVersion" (fun _ ->
98-
if not skipBuild then
9988
Shell.Exec("appveyor", sprintf "UpdateBuild -Version \"%s\"" buildVersion) |> ignore
10089
)
10190

10291
Target "Build" (fun _ ->
103-
if skipBuild then
104-
try Directory.CreateDirectory("../Release/") |> ignore with _ -> ()
105-
File.WriteAllText("../Release/nichts.txt", "nothing to see here, build was skipped until we knoow how to get an updated version of Mono installed on Jenkins")
106-
else
107-
runDotnet __SOURCE_DIRECTORY__ "build FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj -v n -c Release /maxcpucount:1"
92+
runDotnet __SOURCE_DIRECTORY__ "build FSharp.Compiler.Service.sln -v n -c Release"
10893
)
10994

11095
Target "Test" (fun _ ->
111-
if not skipBuild then
96+
// This project file is used for the netcoreapp2.0 tests to work out reference sets
11297
runDotnet __SOURCE_DIRECTORY__ "restore ../tests/projects/Sample_NETCoreSDK_FSharp_Library_netstandard2_0/Sample_NETCoreSDK_FSharp_Library_netstandard2_0.fsproj -v n"
11398
runDotnet __SOURCE_DIRECTORY__ "build ../tests/projects/Sample_NETCoreSDK_FSharp_Library_netstandard2_0/Sample_NETCoreSDK_FSharp_Library_netstandard2_0.fsproj -v n"
114-
runDotnet __SOURCE_DIRECTORY__ "test FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj -v n -c Release /maxcpucount:1"
115-
)
11699

100+
// Now run the tests
101+
runDotnet __SOURCE_DIRECTORY__ "test FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj -v n -c Release"
102+
)
117103

118104
Target "NuGet" (fun _ ->
119-
if not skipBuild then
120-
runDotnet __SOURCE_DIRECTORY__ "build FSharp.Compiler.Service.ProjectCrackerTool/FSharp.Compiler.Service.ProjectCrackerTool.fsproj -v n -c Release /maxcpucount:1"
121-
runDotnet __SOURCE_DIRECTORY__ "pack FSharp.Compiler.Service/FSharp.Compiler.Service.fsproj -v n -c Release /maxcpucount:1"
122-
runDotnet __SOURCE_DIRECTORY__ "pack FSharp.Compiler.Service.ProjectCracker/FSharp.Compiler.Service.ProjectCracker.fsproj -v n -c Release /maxcpucount:1"
123-
runDotnet __SOURCE_DIRECTORY__ "pack FSharp.Compiler.Service.MSBuild.v12/FSharp.Compiler.Service.MSBuild.v12.fsproj -v n -c Release /maxcpucount:1"
105+
runDotnet __SOURCE_DIRECTORY__ "pack FSharp.Compiler.Service.sln -v n -c Release"
124106
)
125107

126108
Target "GenerateDocsEn" (fun _ ->
127-
if not skipBuild then
128109
executeFSIWithArgs "docsrc/tools" "generate.fsx" [] [] |> ignore
129110
)
130111

131112
Target "GenerateDocsJa" (fun _ ->
132-
if not skipBuild then
133113
executeFSIWithArgs "docsrc/tools" "generate.ja.fsx" [] [] |> ignore
134114
)
135115

136116
Target "PublishNuGet" (fun _ ->
137-
if not skipBuild then
138117
Paket.Push (fun p ->
139118
let apikey =
140119
match getBuildParam "nuget-apikey" with
@@ -148,11 +127,12 @@ Target "PublishNuGet" (fun _ ->
148127
// --------------------------------------------------------------------------------------
149128
// Run all targets by default. Invoke 'build <Target>' to override
150129

130+
Target "Start" DoNothing
151131
Target "Release" DoNothing
152132
Target "GenerateDocs" DoNothing
153133
Target "TestAndNuGet" DoNothing
154134

155-
"Clean"
135+
"Start"
156136
=?> ("BuildVersion", isAppVeyorBuild)
157137
==> "Restore"
158138
==> "Build"

fcs/cibuild.sh

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

33
# note: expects to run from top directory
44
./mono/latest-mono-stable.sh
5-
./build.sh NuGet
5+
./fcs/build.sh NuGet

0 commit comments

Comments
 (0)