-
Notifications
You must be signed in to change notification settings - Fork 0
Makefile updates to get dotnet/fsharp building on mono #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 5 commits
7453406
54364b8
541ba7c
c4f93b0
d906c81
129e9dc
4838d8f
ebc63f3
033a425
a55d861
f37ef5e
6f1bde0
a656980
9c3c48d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,46 +1,55 @@ | ||
| Configuration ?= release | ||
| DotNetVersion = `cat DotnetCLIToolsVersion.txt` | ||
| DotNetToolPath = $(CURDIR)/artifacts/toolset/dotnet | ||
| DotNetExe = "$(DotNetToolPath)/dotnet" | ||
| Configuration ?= Release | ||
| ConfigurationProperty = /p:Configuration=$(Configuration) | ||
|
|
||
| all: proto restore build test | ||
| Verbosity ?= normal | ||
| VerbosityProperty = /Verbosity:$(Verbosity) | ||
|
|
||
| MSBuild = /Library/Frameworks/Mono.framework/Versions/Current/Commands/msbuild | ||
| RestoreCommand = $(MSBuild) /t:Restore | ||
| BuildCommand = $(MSBuild) /t:Build | ||
| TestCommand = $(MSBuild) /t:VSTest | ||
| ProtoConfiguration = /p:Configuration=Proto | ||
|
|
||
| tools: | ||
| $(CURDIR)/scripts/dotnet-install.sh --version $(DotNetVersion) --install-dir "$(DotNetToolPath)" | ||
| NF45 = /p:TargetFramework=net45 | ||
| NF472 = /p:TargetFramework=net472 | ||
| NS16 = /p:TargetFramework=netstandard1.6 | ||
| NS20 = /p:TargetFramework=netstandard2.0 | ||
| NCA20 = /p:TargetFramework=netcoreapp2.0 | ||
| NCA21 = /p:TargetFramework=netcoreapp2.1 | ||
|
|
||
| all: proto restore build test | ||
|
|
||
| proto: tools | ||
| $(DotNetExe) build-server shutdown | ||
| $(DotNetExe) restore src/buildtools/buildtools.proj | ||
| $(DotNetExe) restore src/fsharp/FSharp.Build/FSharp.Build.fsproj | ||
| $(DotNetExe) restore src/fsharp/fsc/fsc.fsproj | ||
| $(DotNetExe) build src/buildtools/buildtools.proj -c Proto | ||
| $(DotNetExe) build src/fsharp/FSharp.Build/FSharp.Build.fsproj -f netstandard2.0 -c Proto | ||
| $(DotNetExe) build src/fsharp/fsc/fsc.fsproj -f netcoreapp2.1 -c Proto | ||
| proto: | ||
| $(RestoreCommand) $(NF472) src/buildtools/buildtools.proj | ||
|
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. virtually all changes to this file revolve around using pure |
||
| $(RestoreCommand) $(NF472) src/fsharp/FSharp.Build/FSharp.Build.fsproj | ||
| $(RestoreCommand) $(NF472) src/fsharp/fsc/fsc.fsproj | ||
| $(BuildCommand) $(NF472) $(ConfigurationProperty) src/buildtools/buildtools.proj | ||
| $(BuildCommand) $(NF472) $(ProtoConfiguration) src/fsharp/FSharp.Build/FSharp.Build.fsproj | ||
| $(BuildCommand) $(NF472) $(ProtoConfiguration) $(VerbosityProperty) src/fsharp/fsc/fsc.fsproj | ||
|
|
||
| restore: | ||
| $(DotNetExe) restore src/fsharp/FSharp.Core/FSharp.Core.fsproj | ||
| $(DotNetExe) restore src/fsharp/FSharp.Build/FSharp.Build.fsproj | ||
| $(DotNetExe) restore src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj | ||
| $(DotNetExe) restore src/fsharp/fsc/fsc.fsproj | ||
| $(DotNetExe) restore src/fsharp/FSharp.Compiler.Interactive.Settings/FSharp.Compiler.Interactive.Settings.fsproj | ||
| $(DotNetExe) restore src/fsharp/fsi/fsi.fsproj | ||
| $(DotNetExe) restore tests/FSharp.Core.UnitTests/FSharp.Core.UnitTests.fsproj | ||
| $(DotNetExe) restore tests/FSharp.Build.UnitTests/FSharp.Build.UnitTests.fsproj | ||
| $(RestoreCommand) src/fsharp/FSharp.Core/FSharp.Core.fsproj | ||
| $(RestoreCommand) src/fsharp/FSharp.Build/FSharp.Build.fsproj | ||
| $(RestoreCommand) src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj | ||
| $(RestoreCommand) src/fsharp/fsc/fsc.fsproj | ||
| $(RestoreCommand) src/fsharp/FSharp.Compiler.Interactive.Settings/FSharp.Compiler.Interactive.Settings.fsproj | ||
| $(RestoreCommand) src/fsharp/fsi/fsi.fsproj | ||
| $(RestoreCommand) tests/FSharp.Core.UnitTests/FSharp.Core.UnitTests.fsproj | ||
| $(RestoreCommand) tests/FSharp.Build.UnitTests/FSharp.Build.UnitTests.fsproj | ||
|
|
||
| build: proto restore | ||
| $(DotNetExe) build-server shutdown | ||
| $(DotNetExe) build -c $(Configuration) -f netstandard1.6 src/fsharp/FSharp.Core/FSharp.Core.fsproj | ||
| $(DotNetExe) build -c $(Configuration) -f netstandard2.0 src/fsharp/FSharp.Build/FSharp.Build.fsproj | ||
| $(DotNetExe) build -c $(Configuration) -f netstandard2.0 src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj | ||
| $(DotNetExe) build -c $(Configuration) -f netcoreapp2.1 src/fsharp/fsc/fsc.fsproj | ||
| $(DotNetExe) build -c $(Configuration) -f netstandard2.0 src/fsharp/FSharp.Compiler.Interactive.Settings/FSharp.Compiler.Interactive.Settings.fsproj | ||
| $(DotNetExe) build -c $(Configuration) -f netcoreapp2.1 src/fsharp/fsi/fsi.fsproj | ||
| $(DotNetExe) build -c $(Configuration) -f netcoreapp2.0 tests/FSharp.Core.UnitTests/FSharp.Core.UnitTests.fsproj | ||
| $(DotNetExe) build -c $(Configuration) -f netcoreapp2.0 tests/FSharp.Build.UnitTests/FSharp.Build.UnitTests.fsproj | ||
| $(BuildCommand) $(ConfigurationProperty) $(NF45) src/fsharp/FSharp.Core/FSharp.Core.fsproj | ||
| $(BuildCommand) $(ConfigurationProperty) $(NF472) src/fsharp/FSharp.Build/FSharp.Build.fsproj | ||
| $(BuildCommand) $(ConfigurationProperty) $(NF472) src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj | ||
| $(BuildCommand) $(ConfigurationProperty) $(NF472) src/fsharp/fsc/fsc.fsproj | ||
| $(BuildCommand) $(ConfigurationProperty) $(NF472) src/fsharp/FSharp.Compiler.Interactive.Settings/FSharp.Compiler.Interactive.Settings.fsproj | ||
| $(BuildCommand) $(ConfigurationProperty) $(NF472) src/fsharp/fsi/fsi.fsproj | ||
| $(BuildCommand) $(ConfigurationProperty) $(NF472) tests/FSharp.Core.UnitTests/FSharp.Core.UnitTests.fsproj | ||
| $(BuildCommand) $(ConfigurationProperty) $(NF472) tests/FSharp.Build.UnitTests/FSharp.Build.UnitTests.fsproj | ||
|
|
||
| test: build | ||
| $(DotNetExe) test -f netcoreapp2.0 -c $(Configuration) --no-restore --no-build tests/FSharp.Core.UnitTests/FSharp.Core.UnitTests.fsproj -l "trx;LogFileName=$(CURDIR)/tests/TestResults/FSharp.Core.UnitTests.coreclr.trx" | ||
| $(DotNetExe) test -f netcoreapp2.0 -c $(Configuration) --no-restore --no-build tests/FSharp.Build.UnitTests/FSharp.Build.UnitTests.fsproj -l "trx;LogFileName=$(CURDIR)/tests/TestResults/FSharp.Build.UnitTests.coreclr.trx" | ||
| $(TestCommand) $(NF472) $(ConfigurationProperty) tests/FSharp.Core.UnitTests/FSharp.Core.UnitTests.fsproj /p:VSTestNoBuild=true /p:VSTestLogger="trx;LogFileName=$(CURDIR)/tests/TestResults/FSharp.Core.UnitTests.coreclr.trx" | ||
| $(TestCommand) $(NF472) $(ConfigurationProperty) tests/FSharp.Build.UnitTests/FSharp.Build.UnitTests.fsproj /p:VSTestNoBuild=true /p:VSTestLogger="trx;LogFileName=$(CURDIR)/tests/TestResults/FSharp.Build.UnitTests.coreclr.trx" | ||
|
|
||
| clean: | ||
| rm -rf $(CURDIR)/artifacts | ||
| rm -rf $(CURDIR)/Artifacts | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -76,6 +76,7 @@ | |
| <!-- version numbers from files --> | ||
| <RoslynVersion>$([System.IO.File]::ReadAllText('$(MSBuildThisFileDirectory)..\RoslynPackageVersion.txt').Trim())</RoslynVersion> | ||
| <!-- System.* packages --> | ||
| <SystemCollectionsVersion>4.3.0</SystemCollectionsVersion> | ||
|
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. initially I thought that adding a version here and flowing through a packagereference would be what we needed to get some projects to build on net472 for mono, but in the end plain |
||
| <SystemCollectionsImmutableVersion>1.5.0</SystemCollectionsImmutableVersion> | ||
| <SystemConsoleVersion>4.3.0</SystemConsoleVersion> | ||
| <SystemDesignVersion>4.0.0</SystemDesignVersion> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,7 @@ | ||
| #!/bin/bash | ||
|
|
||
| # note: expects to run from top directory | ||
| #./mono/latest-mono-stable.sh | ||
| ./mono/latest-mono-stable.sh | ||
| make Configuration=$@ | ||
| #sudo make install Configuration=$@ | ||
| #./mono/test-mono.sh |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,14 +20,16 @@ | |
| BeforeTargets="CoreCompile"> | ||
|
|
||
| <PropertyGroup> | ||
| <FsLexPath Condition="'$(FsLexPath)' == ''">$(ArtifactsDir)\Bootstrap\fslex.dll</FsLexPath> | ||
| <FsLexPath Condition="'$(FsLexPath)' == '' And '$(MonoPackaging)' == 'false' ">$(ArtifactsDir)\Bootstrap\netcoreapp2.1\fslex.dll</FsLexPath> | ||
|
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. changes to this file are around making fxlex/fsyacc invoke correctly on mono/unix. Directories have changed too and need to be validated (ie building by the makefile we don't get the |
||
| <FsLexPath Condition="'$(FsLexPath)' == '' And '$(MonoPackaging)' == 'true' ">$(ArtifactsDir)\bin\fslex\Release\net472\fslex.exe</FsLexPath> | ||
| </PropertyGroup> | ||
|
|
||
| <!-- Create the output directory --> | ||
| <MakeDir Directories="$(FsLexOutputFolder)"/> | ||
|
|
||
| <!-- Run the tool --> | ||
| <Exec Command=""$(DotNetTool)" "$(FsLexPath)" -o "$(FsLexOutputFolder)%(FsLex.Filename).fs" %(FsLex.OtherFlags) %(FsLex.Identity)" /> | ||
| <Exec Condition="'$(MonoPackaging)' == 'false'" Command=""$(DotNetTool)" "$(FsLexPath)" -o "$(FsLexOutputFolder)%(FsLex.Filename).fs" %(FsLex.OtherFlags) %(FsLex.Identity)" /> | ||
| <Exec Condition="'$(MonoPackaging)' == 'true'" Command=""mono" "$(FsLexPath)" -o "$(FsLexOutputFolder)%(FsLex.Filename).fs" %(FsLex.OtherFlags) %(FsLex.Identity)" /> | ||
|
|
||
| <!-- Make sure it will get cleaned --> | ||
| <CreateItem Include="$(FsLexOutputFolder)%(FsLex.Filename).fs"> | ||
|
|
@@ -43,14 +45,16 @@ | |
| BeforeTargets="CoreCompile"> | ||
|
|
||
| <PropertyGroup> | ||
| <FsYaccPath Condition="'$(FsYaccPath)' == ''">$(ArtifactsDir)\Bootstrap\fsyacc.dll</FsYaccPath> | ||
| <FsYaccPath Condition="'$(FsYaccPath)' == '' And '$(MonoPackaging)' == 'false'">$(ArtifactsDir)\Bootstrap\netcoreapp2.1\fsyacc.dll</FsYaccPath> | ||
| <FsYaccPath Condition="'$(FsYaccPath)' == '' And '$(MonoPackaging)' == 'true'">$(ArtifactsDir)\bin\fsyacc\Release\net472\fsyacc.exe</FsYaccPath> | ||
| </PropertyGroup> | ||
|
|
||
| <!-- Create the output directory --> | ||
| <MakeDir Directories="$(FsYaccOutputFolder)" /> | ||
|
|
||
| <!-- Run the tool --> | ||
| <Exec Command=""$(DotNetTool)" "$(FsYaccPath)" -o "$(FsYaccOutputFolder)%(FsYacc.Filename).fs" %(FsYacc.OtherFlags) %(FsYacc.Identity)" /> | ||
| <Exec Condition="'$(MonoPackaging)' == 'false'" Command=""$(DotNetTool)" "$(FsYaccPath)" -o "$(FsYaccOutputFolder)%(FsYacc.Filename).fs" %(FsYacc.OtherFlags) %(FsYacc.Identity)" /> | ||
| <Exec Condition="'$(MonoPackaging)' == 'true'" Command=""mono" "$(FsYaccPath)" -o "$(FsYaccOutputFolder)%(FsYacc.Filename).fs" %(FsYacc.OtherFlags) %(FsYacc.Identity)" /> | ||
|
|
||
| <!-- Make sure it will get cleaned --> | ||
| <CreateItem Include="$(FsYaccOutputFolder)%(FsYacc.Filename).fs"> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,7 +2,7 @@ | |
|
|
||
| <PropertyGroup> | ||
| <OutputType>Exe</OutputType> | ||
| <TargetFramework>netcoreapp2.1</TargetFramework> | ||
| <TargetFrameworks>net472;netcoreapp2.1</TargetFrameworks> | ||
|
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. need to be able to invoke these tools on mono, so they build for net472 now. |
||
| <DefineConstants>INTERNALIZED_FSLEXYACC_RUNTIME;$(DefineConstant)</DefineConstants> | ||
| </PropertyGroup> | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,7 +5,6 @@ | |
| <PropertyGroup> | ||
| <OutputType>Library</OutputType> | ||
| <TargetFrameworks>net472;netcoreapp2.1</TargetFrameworks> | ||
| <TargetFrameworks Condition="'$(OS)' == 'Unix'">netcoreapp2.1</TargetFrameworks> | ||
|
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was removed for several projects in order to enable mono builds |
||
| <AssemblyName>FSharp.Build</AssemblyName> | ||
| <NoWarn>$(NoWarn);45;55;62;75;1204</NoWarn> | ||
| <AllowCrossTargeting>true</AllowCrossTargeting> | ||
|
|
@@ -38,6 +37,7 @@ | |
|
|
||
| <ItemGroup Condition="'$(TargetFramework)' == 'net472'"> | ||
| <PackageReference Include="Microsoft.VisualFSharp.Type.Providers.Redist" Version="$(MicrosoftVisualFSharpTypeProvidersRedistVersion)" /> | ||
| <Reference Include="System.Collections" /> | ||
|
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should this be strongly-versioned? (same question for the other instances) |
||
| </ItemGroup> | ||
|
|
||
| <ItemGroup> | ||
|
|
@@ -46,6 +46,7 @@ | |
| <PackageReference Include="Microsoft.Build.Tasks.Core" Version="$(MicrosoftBuildTasksCoreVersion)" /> | ||
| <PackageReference Include="Microsoft.Build.Utilities.Core" Version="$(MicrosoftBuildUtilitiesCoreVersion)" /> | ||
| <PackageReference Include="Microsoft.Win32.Registry" Version="$(MicrosoftWin32RegistryVersion)" /> | ||
| <PackageReference Include="System.Collections" Version="4.3.0" /> | ||
|
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Initially I wanted to use a packagereference for System.Collections like other assemblies do, but this didn't work for two reasons: I couldn't use the version from |
||
| </ItemGroup> | ||
|
|
||
| </Project> | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,7 +5,6 @@ | |
| <PropertyGroup> | ||
| <OutputType>Library</OutputType> | ||
| <TargetFrameworks>net472;netstandard2.0</TargetFrameworks> | ||
| <TargetFrameworks Condition="'$(OS)' == 'Unix'">netstandard2.0</TargetFrameworks> | ||
| <AssemblyName>FSharp.Compiler.Private</AssemblyName> | ||
| <NoWarn>$(NoWarn);45;55;62;75;1204</NoWarn> | ||
| <AllowCrossTargeting>true</AllowCrossTargeting> | ||
|
|
@@ -696,6 +695,11 @@ | |
|
|
||
| <ItemGroup Condition="'$(TargetFramework)' == 'net472'"> | ||
| <Reference Include="ISymWrapper, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> | ||
| <Reference Include="System.Collections" /> | ||
|
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same story here for these |
||
| <Reference Include="System.Globalization" /> | ||
| <Reference Include="System.Threading" /> | ||
| <Reference Include="System.Threading.Tasks" /> | ||
| <Reference Include="netstandard" /> | ||
| <PackageReference Include="Microsoft.Build" Version="$(MicrosoftBuildVersion)" /> | ||
| <PackageReference Include="Microsoft.Build.Framework" Version="$(MicrosoftBuildVersion)" /> | ||
| <PackageReference Include="Microsoft.Build.Tasks.Core" Version="$(MicrosoftBuildVersion)" /> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,11 +5,11 @@ | |
| <PropertyGroup> | ||
| <OutputType>Library</OutputType> | ||
| <TargetFrameworks>net45;netstandard1.6</TargetFrameworks> | ||
| <TargetFrameworks Condition="'$(OS)' == 'Unix'">netstandard1.6</TargetFrameworks> | ||
| <NoWarn>$(NoWarn);45;55;62;75;1204</NoWarn> | ||
| <AllowCrossTargeting>true</AllowCrossTargeting> | ||
| <DefineConstants>$(DefineConstants);FSHARP_CORE</DefineConstants> | ||
| <DefineConstants Condition="'$(Configuration)' == 'Proto'">BUILDING_WITH_LKG;$(DefineConstants)</DefineConstants> | ||
| <DefineConstants Condition="'$(MonoPackaging)' == 'true'">BUILD_FROM_SOURCE;$(DefineConstants)</DefineConstants> | ||
|
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How is |
||
| <OtherFlags>$(OtherFlags) --warnon:1182 --compiling-fslib --compiling-fslib-40 --maxerrors:20 --extraoptimizationloops:1</OtherFlags> | ||
| <Tailcalls>true</Tailcalls> <!-- .tail annotations always emitted for this binary, even in debug mode --> | ||
| <NGenBinary>true</NGenBinary> | ||
|
|
@@ -218,6 +218,7 @@ | |
| </ItemGroup> | ||
|
|
||
| <ItemGroup> | ||
|
|
||
| <PackageReference Include="System.Linq.Queryable" Version="$(SystemLinqQueryableVersion)" /> | ||
| <PackageReference Include="System.Net.Requests" Version="$(SystemNetRequestsVersion)" /> | ||
| <PackageReference Include="System.Threading.Tasks.Parallel" Version="$(SystemThreadingTasksParallelVersion)" /> | ||
|
|
@@ -228,6 +229,10 @@ | |
| <PackageReference Include="System.Threading.ThreadPool" Version="$(SystemThreadingThreadPoolVersion)" /> | ||
| </ItemGroup> | ||
|
|
||
| <ItemGroup Condition="'$(TargetFramework)' == 'net45'"> | ||
| <PackageReference Include="System.Collections" Version="4.3.0" /> | ||
| </ItemGroup> | ||
|
|
||
| <!-- Hook compilation phase to do custom work --> | ||
| <!-- NOTE: The optdata and sigdata files are no longer needed by the F# compiler (the information is --> | ||
| <!-- integrated as resources into more recent FSharp.Core.dll's. However they are still produced to --> | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this can be reverted I believe. the stable msbuild targets for mono handle setting facades from what I can see now, and this property just ends up being reverted if you look at a detailed log.