You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: DEVGUIDE.md
+82-55Lines changed: 82 additions & 55 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,43 +1,19 @@
1
-
#F# Compiler, Core Library and Visual F# Tools Open Contribution Repository
1
+
#Development Guide
2
2
3
-
This repo is where you can contribute to the F# compiler, core library and the Visual F# Tools.
4
-
To learn what F# is and why it's interesting, go to[fsharp.org](http://fsharp.org). To get a free F# environment, go to[fsharp.org](http://fsharp.org/use/windows).
3
+
Follow the instructions below to build and develop the F# Compiler, Core Library and tools on Windows, macOS and Linux.
5
4
6
-
**Compiler Technical Documentation**
5
+
*[Developing the F# Compiler (Windows)](#developing-the-f-compiler-windows)
6
+
*[Developing the F# Compiler (Linux)](#developing-the-f-compiler-linux)
7
+
*[Developing the F# Compiler (macOS)](#developing-the-f-compiler-macos)
8
+
*[Developing the Visual F# IDE Tools (Windows Only)](#developing-the-visual-f-ide-tools-windows-only)
9
+
*[Notes and Resources](#notes)
7
10
8
-
The primary technical documents forthe F#compiler code are
11
+
###Developingthe F#Compiler (Windows)
9
12
10
-
*[The F# Language and Core Library RFC Process](http://fsharp.github.io/2016/09/26/fsharp-rfc-process.html)
13
+
Install
11
14
12
-
*[The F# Language Specification](http://fsharp.org/specs/language-spec/)
maintained by contributors to this repository. Please read
16
-
and contribute to that guide.
17
-
18
-
**License**
19
-
>Contributions made to this repo are subject to terms and conditions of the Apache License, Version 2.0. A copy of the license can be found in the[License.txt](License.txt) file at the root of this distribution.
20
-
>By using this source code in any fashion, you are agreeing to be bound by the terms of the Apache License, Version 2.0. You must not remove this notice, or any other, from this software.
21
-
22
-
**Questions?** If you have questions about the source code, please ask in the issues.
23
-
24
-
##Quick Start: Build, Test, Develop
25
-
26
-
###F# Compiler (Linux)
27
-
28
-
Currently you can do on Linux a bootstrap of the Mono version of the compiler. Full testing is not enabled,
On Windows you can build the F# compiler for .NET Framework as follows:
43
19
@@ -82,37 +58,51 @@ Building ``FSharp.sln`` builds nearly everything. However building portable prof
82
58
FSharp.Core.dll is not included. If you are just developing the core compiler and library
83
59
then building the solution will be enough.
84
60
85
-
###Notes on the.NET Framework build
61
+
###Developing theF# Compiler (Linux)
86
62
87
-
1. The`update.cmd` script adds required strong name validation skips, and NGens the compiler and libraries. This requires admin privileges.
88
-
1. The compiler binaries produced are "private" and strong-named signed with a test key.
89
-
1. Some additional tools are required to build the compiler, notably`fslex.exe`,`fsyacc.exe`,`FSharp.PowerPack.Build.Tasks.dll`,`FsSrGen.exe`,`FSharp.SRGen.Build.Tasks.dll`, and the other tools found in the`lkg` directory.
90
-
1. The overall bootstrapping process executes as follows
91
-
- We first need an existing F# compiler. We use the one in the`lkg` directory. Let's assume this compiler has an`FSharp.Core.dll` with version X.
92
-
- We use this compiler to compile the source in this distribution, to produce a "proto" compiler, dropped to the`proto` directory. When run, this compiler still relies on`FSharp.Core.dll` with version X.
93
-
- We use the proto compiler to compile the source for`FSharp.Core.dll` in this distribution.
94
-
- We use the proto compiler to compile the source for`FSharp.Compiler.dll`,`fsc.exe`,`fsi.exe`, and other binaries found in this distribution.
63
+
For Linux/Mono, follow[these instructions](http://www.mono-project.com/docs/getting-started/install/linux/). Also you may need:
95
64
96
-
###Configuring proxy server
65
+
sudo apt-get install mono-complete autoconf libtool pkg-config make git automake
97
66
98
-
If you are behind a proxy server, NuGet client tool must be configured to use it:
Full testing is not yet enabled on Linux, nor is a .NET Core build of the compiler.
103
74
104
-
Where you should set proper proxy address, user name and password.
75
+
You can alternatively use
76
+
77
+
./build.sh
105
78
106
-
#The VisualF#IDE Tools (Windows Only)
79
+
###Developing theF#Compiler (macOS)
107
80
108
-
To build and test Visual F# IDE Tools, you must use the latest version of[Visual Studio 2017](https://www.visualstudio.com/downloads/). See the section titled "Development tools" in the[readme](README.md).
build.cmd vs -- build the Visual F# IDE Tools in Release configuration (see below)
111
100
build.cmd vs debug -- build the Visual F# IDE Tools in Debug configuration (see below)
112
101
build.cmd vs test -- build Visual F# IDE Tools, run all tests (see below)
113
102
114
103
Use``VisualFSharp.sln`` if you're building the Visual F# IDE Tools.
115
104
105
+
116
106
Note on Debug vs Release:``Release`` Configuration has a degraded debugging experience, so if you want to test a change locally, it is recommended to do it in the``Debug`` configuration. For more information seehttps://github.com/Microsoft/visualfsharp/issues/2771 andhttps://github.com/Microsoft/visualfsharp/pull/2773.
117
107
118
108
Note: if you face this error[#2351](https://github.com/Microsoft/visualfsharp/issues/2351):
@@ -124,7 +114,7 @@ Or hard crash on launch ("Unknown Error"), delete these folders:
124
114
*`%localappdata%\Microsoft\VisualStudio\15.0_(some number here)FSharpDev`
125
115
*`%localappdata%\Microsoft\VisualStudio\15.0_(some number here)`
126
116
127
-
##[Optional] Install the Visual F# IDE Tools (Windows Only)
117
+
####[Optional] Install the Visual F# IDE Tools (Windows Only)
128
118
129
119
At time of writing, the Visual F# IDE Tools can only be installed into the latest Visual Studio 2017 RC releases.
130
120
The new builds of the Visual F# IDE Tools can no longer be installed into Visual Studio 2015.
@@ -146,7 +136,7 @@ For **Release**, uninstall then reinstall:
146
136
147
137
Restart Visual Studio, it should now be running your freshly-built Visual F# IDE Tools with updated F# Interactive.
148
138
149
-
###[Optional] F5 testing of local changes
139
+
####[Optional] F5 testing of local changes
150
140
151
141
To test your changes locally_without_ overwriting your default installed F# tools, set the`VisualFSharp\Vsix\VisualFSharpOpenSource`
152
142
project as the startup project. When you hit F5 a new instance of Visual Studio will be started in the`FSharpDev` hive with your
@@ -160,7 +150,7 @@ For the brave, you can rapidly deploy incrementally updated versions of Visual F
160
150
161
151
This gives a much tighter inner development loop than uninstalling/reinstalling the VSIX, as you do not have to restart VIsual Studio. Caveat emptor.
162
152
163
-
###[Optional] Clobber the F# SDK on the machine
153
+
####[Optional] Clobber the F# SDK on the machine
164
154
165
155
**Note:** The step below will try to clobber the machine-wide installed F# SDK on your machine. This replaces the``fsc.exe`` used by the standard innstall location or``Microsoft.FSharp.targets``.**Repairing Visual Studio 15 is currently the only way to revert this step.**
1. The`update.cmd` script adds required strong name validation skips, and NGens the compiler and libraries. This requires admin privileges.
185
+
1. The compiler binaries produced are "private" and strong-named signed with a test key.
186
+
1. Some additional tools are required to build the compiler, notably`fslex.exe`,`fsyacc.exe`,`FSharp.PowerPack.Build.Tasks.dll`,`FsSrGen.exe`,`FSharp.SRGen.Build.Tasks.dll`, and the other tools found in the`lkg` directory.
187
+
1. The overall bootstrapping process executes as follows
188
+
- We first need an existing F# compiler. We use the one in the`lkg` directory. Let's assume this compiler has an`FSharp.Core.dll` with version X.
189
+
- We use this compiler to compile the source in this distribution, to produce a "proto" compiler, dropped to the`proto` directory. When run, this compiler still relies on`FSharp.Core.dll` with version X.
190
+
- We use the proto compiler to compile the source for`FSharp.Core.dll` in this distribution.
191
+
- We use the proto compiler to compile the source for`FSharp.Compiler.dll`,`fsc.exe`,`fsi.exe`, and other binaries found in this distribution.
192
+
193
+
###Configuring proxy server
194
+
195
+
If you are behind a proxy server, NuGet client tool must be configured to use it:
Where you should set proper proxy address, user name and password.
202
+
176
203
##Resources
177
204
178
205
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.