Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions DEVGUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ and Visual F# Tools then building the solution will be enough.
The compiler is compiled as a set of .NET 4.0 components using a bootstrap process.
This uses a Last Known Good (LKG) compiler checked into this repository to build.

msbuild src\fsharp-proto-build.proj
msbuild src/fsharp-proto-build.proj

### 2. Building an F# (Debug) library and compiler

Expand Down Expand Up @@ -184,7 +184,7 @@ For **Release**:

1. Run ``vsintegration\update-vsintegration.cmd release`` (clobbers the installed F# SDK)

### Notes on the build
### Notes on the .NET Framework build

1. The `update.cmd` script adds required strong name validation skips, and NGens the compiler and libraries. This requires admin privileges.
1. The compiler binaries produced are "private" and strong-named signed with a test key.
Expand All @@ -195,6 +195,9 @@ For **Release**:
- We use the proto compiler to compile the source for `FSharp.Core.dll` in this distribution.
- We use the proto compiler to compile the source for `FSharp.Compiler.dll`, `fsc.exe`, `fsi.exe`, and other binaries found in this distribution.




## Resources

The primary technical guide to the core compiler code is [The F# Compiler Technical Guide](http://fsharp.github.io/2015/09/29/fsharp-compiler-guide.html). Please read and contribute to that guide.
Expand Down
2 changes: 1 addition & 1 deletion src/fsharp-library-build.proj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<!-- Core library: all frameworks -->
<ItemGroup>
<ProjectFiles Include="fsharp\FSharp.Core\FSharp.Core.fsproj" />
<ProjectFiles Include="fsharp\fsharp.core.netcore.nuget\FSharp.Core.netcore.nuget.proj" Condition="'$(TargetFramework)' == 'coreclr'" />
<ProjectFiles Include="fsharp\FSharp.Core.netcore.nuget\FSharp.Core.netcore.nuget.proj" Condition="'$(TargetFramework)' == 'coreclr'" />
</ItemGroup>

<Import Project="root.traversal.targets"/>
Expand Down
4 changes: 2 additions & 2 deletions src/fsharp/CompileOps.fs
Original file line number Diff line number Diff line change
Expand Up @@ -1605,7 +1605,7 @@ let GetFSharpCoreReferenceUsedByCompiler(useSimpleResolution) =
let fsCoreName = GetFSharpCoreLibraryName()
#if FX_RESHAPED_REFLECTION
// RESHAPED_REFLECTION does not have Assembly.GetReferencedAssemblies()
// So use the fsharp.core.dll from alongside the fsc compiler.
// So use the FSharp.Core.dll from alongside the fsc compiler.
// This can also be used for the out of gac work on DEV15
let fscCoreLocation =
let fscLocation = typeof<TypeInThisAssembly>.Assembly.Location
Expand Down Expand Up @@ -2553,7 +2553,7 @@ type TcConfig private (data : TcConfigBuilder,validate:bool) =
| _ -> res
let primaryAssemblyCcuInitializer = getSystemRuntimeInitializer data.primaryAssembly (computeKnownDllReference >> fst)

// If either mscorlib.dll/System.Runtime.dll or fsharp.core.dll are explicitly specified then we require the --noframework flag.
// If either mscorlib.dll/System.Runtime.dll or FSharp.Core.dll are explicitly specified then we require the --noframework flag.
// The reason is that some non-default frameworks may not have the default dlls. For example, Client profile does
// not have System.Web.dll.
do if ((primaryAssemblyExplicitFilenameOpt.IsSome || fslibExplicitFilenameOpt.IsSome) && data.framework) then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<Tailcalls>false</Tailcalls>
<TargetProfile Condition=" '$(TargetFramework)' == 'portable7' or '$(TargetFramework)' == 'portable78' or '$(TargetFramework)' == 'portable259' or '$(TargetFramework)' == 'coreclr' ">netcore</TargetProfile>
<NoWarn>$(NoWarn);217</NoWarn>
<OutputPath Condition="'$(TargetFramework)' == 'coreclr'">$(FSharpSourcesRoot)\..\tests\testbin\$(Configuration)\coreclr\fsharp.core.unittests</OutputPath>
<OutputPath Condition="'$(TargetFramework)' == 'coreclr'">$(FSharpSourcesRoot)\..\tests\testbin\$(Configuration)\coreclr\FSharp.Core.unittests</OutputPath>
<CustomOutputPath Condition="'$(TargetFramework)' == 'coreclr'">true</CustomOutputPath>
</PropertyGroup>
<PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/fsharp/FSharp.Core.Unittests/LibraryTestFx.fs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ module SurfaceArea =
// gets string form of public surface area for the currently-loaded FSharp.Core
let private getActual () =

// get current fsharp.core
// get current FSharp.Core
let asm =
#if portable7 || portable78 || portable259 || coreclr
typeof<int list>.GetTypeInfo().Assembly
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<metadata>
<id>Microsoft.FSharp.Core.netcore</id>
<description>
.NET Core compatible version of the fsharp core library fsharp.core.dll
.NET Core compatible version of the fsharp core library FSharp.Core.dll
Supported Platforms: - .NET Core (netstandard1.6)
</description>
<language>en-US</language>
Expand Down
2 changes: 1 addition & 1 deletion src/fsharp/fsc.fs
Original file line number Diff line number Diff line change
Expand Up @@ -2045,7 +2045,7 @@ let main4 (Args (tcConfig, errorLogger: ErrorLogger, ilGlobals, ilxMainModule, o

AbortOnError(errorLogger, tcConfig, exiter)

// Don't copy referenced fharp.core.dll if we are building fsharp.core.dll
// Don't copy referenced FSharp.core.dll if we are building FSharp.Core.dll
if tcConfig.copyFSharpCore && not tcConfig.compilingFslib && not tcConfig.standalone then
copyFSharpCore(outfile, tcConfig.referencedDLLs)

Expand Down
16 changes: 8 additions & 8 deletions tests/BuildTestTools.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -81,20 +81,20 @@ if '%BUILD_CORECLR%' == '1' (
)

rem deploy x86 version of compiler and dependencies
%_fsiexe% --exec %~dp0fsharpqa\testenv\src\DeployProj\DeployProj.fsx --targetPlatformName:.NETStandard,Version=v1.6/win7-x86 --projectJson:%~dp0fsharp\project.json --projectJsonLock:%~dp0fsharp\project.lock.json --packagesDir:%~dp0..\packages --fsharpCore:%~dp0..\%1\coreclr\bin\fsharp.core.dll --output:%~dp0testbin\%1\coreclr\fsc\win7-x86 --nugetPath:%~dp0..\.nuget\nuget.exe --nugetConfig:%~dp0..\.nuget\nuget.config --copyCompiler:yes --v:quiet
%_fsiexe% --exec %~dp0fsharpqa\testenv\src\DeployProj\DeployProj.fsx --targetPlatformName:.NETStandard,Version=v1.6/win7-x86 --projectJson:%~dp0fsharp\project.json --projectJsonLock:%~dp0fsharp\project.lock.json --packagesDir:%~dp0..\packages --fsharpCore:%~dp0..\%1\coreclr\bin\fsharp.core.dll --output:%~dp0testbin\%1\coreclr\win7-x86 --nugetPath:%~dp0..\.nuget\nuget.exe --nugetConfig:%~dp0..\.nuget\nuget.config --copyCompiler:no --v:quiet
%_fsiexe% --exec %~dp0fsharpqa\testenv\src\DeployProj\DeployProj.fsx --targetPlatformName:.NETStandard,Version=v1.6/win7-x86 --projectJson:%~dp0fsharp\project.json --projectJsonLock:%~dp0fsharp\project.lock.json --packagesDir:%~dp0..\packages --fsharpCore:%~dp0..\%1\coreclr\bin\FSharp.Core.dll --output:%~dp0testbin\%1\coreclr\fsc\win7-x86 --nugetPath:%~dp0..\.nuget\nuget.exe --nugetConfig:%~dp0..\.nuget\nuget.config --copyCompiler:yes --v:quiet
%_fsiexe% --exec %~dp0fsharpqa\testenv\src\DeployProj\DeployProj.fsx --targetPlatformName:.NETStandard,Version=v1.6/win7-x86 --projectJson:%~dp0fsharp\project.json --projectJsonLock:%~dp0fsharp\project.lock.json --packagesDir:%~dp0..\packages --fsharpCore:%~dp0..\%1\coreclr\bin\FSharp.Core.dll --output:%~dp0testbin\%1\coreclr\win7-x86 --nugetPath:%~dp0..\.nuget\nuget.exe --nugetConfig:%~dp0..\.nuget\nuget.config --copyCompiler:no --v:quiet

rem deploy x64 version of compiler
%_fsiexe% --exec %~dp0fsharpqa\testenv\src\DeployProj\DeployProj.fsx --targetPlatformName:.NETStandard,Version=v1.6/win7-x64 --projectJson:%~dp0fsharp\project.json --projectJsonLock:%~dp0fsharp\project.lock.json --packagesDir:%~dp0..\packages --fsharpCore:%~dp0..\%1\coreclr\bin\fsharp.core.dll --output:%~dp0testbin\%1\coreclr\fsc\win7-x64 --nugetPath:%~dp0..\.nuget\nuget.exe --nugetConfig:%~dp0..\.nuget\nuget.config --copyCompiler:yes --v:quiet
%_fsiexe% --exec %~dp0fsharpqa\testenv\src\DeployProj\DeployProj.fsx --targetPlatformName:.NETStandard,Version=v1.6/win7-x64 --projectJson:%~dp0fsharp\project.json --projectJsonLock:%~dp0fsharp\project.lock.json --packagesDir:%~dp0..\packages --fsharpCore:%~dp0..\%1\coreclr\bin\fsharp.core.dll --output:%~dp0testbin\%1\coreclr\win7-x64 --nugetPath:%~dp0..\.nuget\nuget.exe --nugetConfig:%~dp0..\.nuget\nuget.config --copyCompiler:no --v:quiet
%_fsiexe% --exec %~dp0fsharpqa\testenv\src\DeployProj\DeployProj.fsx --targetPlatformName:.NETStandard,Version=v1.6/win7-x64 --projectJson:%~dp0fsharp\project.json --projectJsonLock:%~dp0fsharp\project.lock.json --packagesDir:%~dp0..\packages --fsharpCore:%~dp0..\%1\coreclr\bin\FSharp.Core.dll --output:%~dp0testbin\%1\coreclr\fsc\win7-x64 --nugetPath:%~dp0..\.nuget\nuget.exe --nugetConfig:%~dp0..\.nuget\nuget.config --copyCompiler:yes --v:quiet
%_fsiexe% --exec %~dp0fsharpqa\testenv\src\DeployProj\DeployProj.fsx --targetPlatformName:.NETStandard,Version=v1.6/win7-x64 --projectJson:%~dp0fsharp\project.json --projectJsonLock:%~dp0fsharp\project.lock.json --packagesDir:%~dp0..\packages --fsharpCore:%~dp0..\%1\coreclr\bin\FSharp.Core.dll --output:%~dp0testbin\%1\coreclr\win7-x64 --nugetPath:%~dp0..\.nuget\nuget.exe --nugetConfig:%~dp0..\.nuget\nuget.config --copyCompiler:no --v:quiet

rem deploy linux version of built compiler
%_fsiexe% --exec %~dp0fsharpqa\testenv\src\DeployProj\DeployProj.fsx --targetPlatformName:.NETStandard,Version=v1.6/ubuntu.14.04-x64 --projectJson:%~dp0fsharp\project.json --projectJsonLock:%~dp0fsharp\project.lock.json --packagesDir:%~dp0..\packages --fsharpCore:%~dp0..\%1\coreclr\bin\fsharp.core.dll --output:%~dp0testbin\%1\coreclr\fsc\ubuntu.14.04-x64 --nugetPath:%~dp0..\.nuget\nuget.exe --nugetConfig:%~dp0..\.nuget\nuget.config --copyCompiler:yes --v:quiet
%_fsiexe% --exec %~dp0fsharpqa\testenv\src\DeployProj\DeployProj.fsx --targetPlatformName:.NETStandard,Version=v1.6/ubuntu.14.04-x64 --projectJson:%~dp0fsharp\project.json --projectJsonLock:%~dp0fsharp\project.lock.json --packagesDir:%~dp0..\packages --fsharpCore:%~dp0..\%1\coreclr\bin\fsharp.core.dll --output:%~dp0testbin\%1\coreclr\ubuntu.14.04-x64 --nugetPath:%~dp0..\.nuget\nuget.exe --nugetConfig:%~dp0..\.nuget\nuget.config --copyCompiler:no --v:quiet
%_fsiexe% --exec %~dp0fsharpqa\testenv\src\DeployProj\DeployProj.fsx --targetPlatformName:.NETStandard,Version=v1.6/ubuntu.14.04-x64 --projectJson:%~dp0fsharp\project.json --projectJsonLock:%~dp0fsharp\project.lock.json --packagesDir:%~dp0..\packages --fsharpCore:%~dp0..\%1\coreclr\bin\FSharp.Core.dll --output:%~dp0testbin\%1\coreclr\fsc\ubuntu.14.04-x64 --nugetPath:%~dp0..\.nuget\nuget.exe --nugetConfig:%~dp0..\.nuget\nuget.config --copyCompiler:yes --v:quiet
%_fsiexe% --exec %~dp0fsharpqa\testenv\src\DeployProj\DeployProj.fsx --targetPlatformName:.NETStandard,Version=v1.6/ubuntu.14.04-x64 --projectJson:%~dp0fsharp\project.json --projectJsonLock:%~dp0fsharp\project.lock.json --packagesDir:%~dp0..\packages --fsharpCore:%~dp0..\%1\coreclr\bin\FSharp.Core.dll --output:%~dp0testbin\%1\coreclr\ubuntu.14.04-x64 --nugetPath:%~dp0..\.nuget\nuget.exe --nugetConfig:%~dp0..\.nuget\nuget.config --copyCompiler:no --v:quiet

rem deploy osx version of built compiler
%_fsiexe% --exec %~dp0fsharpqa\testenv\src\DeployProj\DeployProj.fsx --targetPlatformName:.NETStandard,Version=v1.6/osx.10.10-x64 --projectJson:%~dp0fsharp\project.json --projectJsonLock:%~dp0fsharp\project.lock.json --packagesDir:%~dp0..\packages --fsharpCore:%~dp0..\%1\coreclr\bin\fsharp.core.dll --output:%~dp0testbin\%1\coreclr\fsc\osx.10.10-x64 --nugetPath:%~dp0..\.nuget\nuget.exe --nugetConfig:%~dp0..\.nuget\nuget.config --copyCompiler:yes --v:quiet
%_fsiexe% --exec %~dp0fsharpqa\testenv\src\DeployProj\DeployProj.fsx --targetPlatformName:.NETStandard,Version=v1.6/osx.10.10-x64 --projectJson:%~dp0fsharp\project.json --projectJsonLock:%~dp0fsharp\project.lock.json --packagesDir:%~dp0..\packages --fsharpCore:%~dp0..\%1\coreclr\bin\fsharp.core.dll --output:%~dp0testbin\%1\coreclr\osx.10.10-x64 --nugetPath:%~dp0..\.nuget\nuget.exe --nugetConfig:%~dp0..\.nuget\nuget.config --copyCompiler:no --v:quiet
%_fsiexe% --exec %~dp0fsharpqa\testenv\src\DeployProj\DeployProj.fsx --targetPlatformName:.NETStandard,Version=v1.6/osx.10.10-x64 --projectJson:%~dp0fsharp\project.json --projectJsonLock:%~dp0fsharp\project.lock.json --packagesDir:%~dp0..\packages --fsharpCore:%~dp0..\%1\coreclr\bin\FSharp.Core.dll --output:%~dp0testbin\%1\coreclr\fsc\osx.10.10-x64 --nugetPath:%~dp0..\.nuget\nuget.exe --nugetConfig:%~dp0..\.nuget\nuget.config --copyCompiler:yes --v:quiet
%_fsiexe% --exec %~dp0fsharpqa\testenv\src\DeployProj\DeployProj.fsx --targetPlatformName:.NETStandard,Version=v1.6/osx.10.10-x64 --projectJson:%~dp0fsharp\project.json --projectJsonLock:%~dp0fsharp\project.lock.json --packagesDir:%~dp0..\packages --fsharpCore:%~dp0..\%1\coreclr\bin\FSharp.Core.dll --output:%~dp0testbin\%1\coreclr\osx.10.10-x64 --nugetPath:%~dp0..\.nuget\nuget.exe --nugetConfig:%~dp0..\.nuget\nuget.config --copyCompiler:no --v:quiet

echo "%NUNITPATH%*.*" "%~dp0fsharpqa\testenv\bin\nunit\*.*" /S /Q /Y
xcopy "%NUNITPATH%*.*" "%~dp0fsharpqa\testenv\bin\nunit\*.*" /S /Q /Y
Expand Down
2 changes: 1 addition & 1 deletion tests/fsharp/single-test-build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ set command_line_args=%command_line_args% --targetPlatformName:.NETStandard,Vers
set command_line_args=%command_line_args% --source:"%~d0%~p0coreclr_utilities.fs" --source:"%sources%"
set command_line_args=%command_line_args% --packagesDir:%~d0%~p0..\..\packages
set command_line_args=%command_line_args% --projectJsonLock:%~d0%~p0project.lock.json
set command_line_args=%command_line_args% --fsharpCore:%~d0%~p0..\testbin\%flavor%\coreclr\fsc\%platform%\fsharp.core.dll
set command_line_args=%command_line_args% --fsharpCore:%~d0%~p0..\testbin\%flavor%\coreclr\fsc\%platform%\FSharp.Core.dll
set command_line_args=%command_line_args% --define:CoreClr --define:NetCore
set command_line_args=%command_line_args% --compilerPath:%~d0%~p0..\testbin\%flavor%\coreclr\fsc\%platform%
set command_line_args=%command_line_args% --copyCompiler:yes
Expand Down
2 changes: 1 addition & 1 deletion tests/fsharp/single-test-build.fs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ let singleTestBuild cfg testDir =
let buildOkPath = testDir / "build.ok"
do if fileExists "build.ok" then del "build.ok"

//remove FSharp.Core.dll from the target directory to ensure that compiler uses the correct fsharp.core.dll
//remove FSharp.Core.dll from the target directory to ensure that compiler uses the correct FSharp.Core.dll
do if fileExists "FSharp.Core.dll" then del "FSharp.Core.dll"


Expand Down
1 change: 1 addition & 0 deletions tests/fsharp/single-test-run.bat
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ goto :EOF
set platform=win7-x64
set packagesDir=%~d0%~p0..\..\packages
For %%A in ("%cd%") do ( Set TestCaseName=%%~nxA)
echo %~d0%~p0..\testbin\%flavor%\coreclr\%platform%\corerun.exe %~d0%~p0..\testbin\%flavor%\coreclr\fsharp\core\%TestCaseName%\output\test.exe > coreclr.run.cmd
%CLIX% %~d0%~p0..\testbin\%flavor%\coreclr\%platform%\corerun.exe %~d0%~p0..\testbin\%flavor%\coreclr\fsharp\core\%TestCaseName%\output\test.exe
dir test.ok > NUL 2>&1 ) || (
@echo :FSC_CORECLR failed
Expand Down
7 changes: 4 additions & 3 deletions tests/fsharpqa/testenv/src/deployProj/CompileProj.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ let GetArgumentFromCommandLine switchName defaultValue =
let ProjectJsonLock = GetArgumentFromCommandLine "--projectJsonLock:" @"tests\fsharp\project.lock.json"
let PackagesDir = GetArgumentFromCommandLine "--packagesDir:" @"packages"
let TargetPlatformName = GetArgumentFromCommandLine "--targetPlatformName:" @"DNXCore,Version=v5.0/win7-x64"
let FSharpCore = GetArgumentFromCommandLine "--fsharpCore:" @"Release\coreclr\bin\fsharp.core.dll"
let FSharpCore = GetArgumentFromCommandLine "--fsharpCore:" @"Release\coreclr\bin\FSharp.Core.dll"
let Output = GetArgumentFromCommandLine "--output:" @"."
let Verbosity = GetArgumentFromCommandLine "--v:" @"quiet"
let CompilerPath = GetArgumentFromCommandLine "--compilerPath:" @"."
Expand All @@ -49,8 +49,8 @@ let FSharpCompilerFiles =
seq {
yield Path.Combine(FSharpCoreDir, "fsc.exe")
yield Path.Combine(FSharpCoreDir, "FSharp.Compiler.dll")
yield Path.Combine(FSharpCoreDir, "fsharp.core.sigdata")
yield Path.Combine(FSharpCoreDir, "fsharp.core.optdata")
yield Path.Combine(FSharpCoreDir, "FSharp.Core.sigdata")
yield Path.Combine(FSharpCoreDir, "FSharp.Core.optdata")
yield Win32Manifest
yield Path.Combine(FSharpCoreDir, "fsi.exe")
yield Path.Combine(FSharpCoreDir, "FSharp.Compiler.Interactive.Settings.dll")
Expand Down Expand Up @@ -106,6 +106,7 @@ let executeCompiler sources references =
(GetPublicSignOption)
(ExtraDefines)
(listToSpaceSeperatedString sources)
File.WriteAllText(@"coreclr.fsc.cmd",(CompilerPath + @"\CoreRun.exe" + arguments))
executeProcess (CompilerPath + @"\CoreRun.exe") arguments

let setPathSeperators (path:string) = path.Replace('/', '\\')
Expand Down
6 changes: 3 additions & 3 deletions tests/fsharpqa/testenv/src/deployProj/DeployProj.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ let configFile = GetArgumentFromCommandLine "--nugetConfig:" @".n
let ProjectJsonLock = GetArgumentFromCommandLine "--projectJsonLock:" @"tests\fsharp\project.lock.json"
let PackagesDir = GetArgumentFromCommandLine "--packagesDir:" @"packages"
let TargetPlatformName = GetArgumentFromCommandLine "--targetPlatformName:" @"DNXCore,Version=v5.0/win7-x64"
let FSharpCore = GetArgumentFromCommandLine "--fsharpCore:" @"Release\coreclr\bin\fsharp.core.dll"
let FSharpCore = GetArgumentFromCommandLine "--fsharpCore:" @"Release\coreclr\bin\FSharp.Core.dll"
let Output = GetArgumentFromCommandLine "--output:" @"."
let NugetPath = GetArgumentFromCommandLine "--nugetPath:" @".nuget\nuget.exe"
let Verbosity = GetArgumentFromCommandLine "--v:" @"quiet"
Expand All @@ -41,8 +41,8 @@ let FSharpCompilerFiles =
seq {
yield Path.Combine(FSharpCoreDir, "fsc.exe")
yield Path.Combine(FSharpCoreDir, "FSharp.Compiler.dll")
yield Path.Combine(FSharpCoreDir, "fsharp.core.sigdata")
yield Path.Combine(FSharpCoreDir, "fsharp.core.optdata")
yield Path.Combine(FSharpCoreDir, "FSharp.Core.sigdata")
yield Path.Combine(FSharpCoreDir, "FSharp.Core.optdata")
yield Path.Combine(FSharpCoreDir, "default.win32manifest")
yield Path.Combine(FSharpCoreDir, "fsi.exe")
yield Path.Combine(FSharpCoreDir, "FSharp.Compiler.Interactive.Settings.dll")
Expand Down