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
1. It is recommended to run the build.cmd and the qualifiers below on a command prompt with path set to have the location of MSBuild. If you have Visual Studio, we can also run using`Developer Command Prompt for Visual Studio 20xx` (depends on Visual Studio version). This developer command prompt is easier to use than normal command prompt, because it already has the correct path of Visual Studio and .NET's tooling set for us to use (including MSBuild).
19
-
2. The running command prompt must be run under Administrator right (`Run as Administrator`).
18
+
19
+
1. It is recommended to run`build.cmd` in a command prompt with path set to have the location of MSBuild. If you have Visual Studio, we can run using`Developer Command Prompt for Visual Studio 20xx` (depends on Visual Studio version). This developer command prompt is easier to use than normal command prompt, because it already has the correct path of Visual Studio and .NET's tooling set for us to use (including MSBuild).
20
+
21
+
2. The command prompt must have Administrator rights (`Run as Administrator`).
20
22
21
23
Before running the build scripts, ensure that you have cleaned up the visualfsharp repo by running this git command:
22
24
@@ -59,18 +61,18 @@ After you build the first time you can open and use this solution:
59
61
60
62
or just build it directly:
61
63
62
-
msbuild FSharp.sln
64
+
msbuild FSharp.sln
63
65
64
66
If you are just developing the core compiler and library then building``FSharp.sln`` will be enough.
65
67
66
-
###Developing the F# Compiler (Linux)
68
+
###Developing the F# Compiler (Linux)
67
69
68
70
For Linux/Mono, follow[these instructions](http://www.mono-project.com/docs/getting-started/install/linux/). Also you may need:
69
71
70
72
sudo apt-get install mono-complete make git
71
73
72
74
Then:
73
-
75
+
74
76
make
75
77
76
78
Then to replace your machine-wide installation:
@@ -79,7 +81,7 @@ Then to replace your machine-wide installation:
79
81
80
82
Full testing is not yet enabled on Linux.
81
83
82
-
###Developing the F# Compiler (macOS)
84
+
###Developing the F# Compiler (macOS)
83
85
84
86
Install XCode command line tools (or homebrew equivalents) and Mono or Visual Studio for Mac.
85
87
@@ -99,25 +101,25 @@ You can specify a custom installation path using the DESTDIR shell variable
99
101
100
102
DESTDIR=/my/path/to/fsharp make install
101
103
102
-
###Developing the F# Compiler (Linux or macOS - .NET Core)
104
+
###Developing the F# Compiler (Linux or macOS - .NET Core)
103
105
104
106
Install[the latest .NET SDK](https://www.microsoft.com/net/download/). Then use
105
107
106
-
src/buildfromsource.sh
108
+
src/buildfromsource.sh
107
109
108
-
Outputs are placed in
110
+
Outputs are placed in
109
111
110
112
BuildFromSource/Debug/...
111
113
BuildFromSource/Release/...
112
114
113
-
This uses an installed .NET SDK 2.0 to build the various duplicated project
114
-
115
-
Testing the .NET Core version of the F# compiler on macOS and Linux is TBD.
115
+
This uses an installed .NET SDK 2.0 to build the various duplicated project
116
116
117
+
Testing the .NET Core version of the F# compiler on macOS and Linux is TBD.
117
118
118
119
###Developing the Visual F# IDE Tools (Windows Only)
119
120
120
121
To build and test Visual F# IDE Tools, install these requirements:
122
+
121
123
-[Visual Studio 2017](https://www.visualstudio.com/downloads/)
122
124
- Under the "Windows" workloads, select ".NET desktop development"
123
125
- Select "F# desktop language support" under the optional components
@@ -131,16 +133,16 @@ Steps to build:
131
133
132
134
Use``VisualFSharp.sln`` if you're building the Visual F# IDE Tools.
133
135
134
-
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.
136
+
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 seeissues[#2771](https://github.com/Microsoft/visualfsharp/issues/2771) and[#2773](https://github.com/Microsoft/visualfsharp/pull/2773).
135
137
136
-
Note: if you face this error[#2351](https://github.com/Microsoft/visualfsharp/issues/2351):
138
+
Note ([#2351](https://github.com/Microsoft/visualfsharp/issues/2351)): if you face this error:
137
139
138
-
>error VSSDK1077: Unable to locate the extensions directory. "ExternalSettingsManager::GetScopePaths failed to initialize PkgDefManager for C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\devenv.exe".
140
+
>error VSSDK1077: Unable to locate the extensions directory. "ExternalSettingsManager::GetScopePaths failed to initialize PkgDefManager for C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\devenv.exe".
139
141
140
142
Or hard crash on launch ("Unknown Error"), delete these folders:
141
143
142
-
*`%localappdata%\Microsoft\VisualStudio\15.0_(some number here)RoslynDev`
143
-
*`%localappdata%\Microsoft\VisualStudio\15.0_(some number here)`
144
+
-`%localappdata%\Microsoft\VisualStudio\15.0_(some number here)RoslynDev`
145
+
-`%localappdata%\Microsoft\VisualStudio\15.0_(some number here)`
144
146
145
147
####[Optional] Install the Visual F# IDE Tools (Windows Only)
146
148
@@ -154,18 +156,18 @@ components installed in that VS installation. You can revert this step by disab
Restart Visual Studio, it should now be running your freshly-built Visual F# IDE Tools with updated F# Interactive.
165
167
166
168
####[Optional] F5 testing of local changes
167
169
168
-
To test your changes locally_without_ overwriting your default installed Visual F# tools, set the`VisualFSharp\Vsix\VisualFSharpOpenSource`
170
+
To test your changes locally_without_ overwriting your default installed Visual F# tools, set the`VisualFSharp\Vsix\VisualFSharpFull`
169
171
project as the startup project. When you hit F5 a new instance of Visual Studio will be started in the`RoslynDev` hive with your
170
172
changes, but the root (default) hive will remain untouched. You can also start this hive automatically using
171
173
@@ -213,6 +215,13 @@ For **Release**:
213
215
- We use the proto compiler to compile the source for`FSharp.Core.dll` in this distribution.
214
216
- We use the proto compiler to compile the source for`FSharp.Compiler.dll`,`fsc.exe`,`fsi.exe`, and other binaries found in this distribution.
215
217
218
+
####Updating FSComp.fs
219
+
220
+
If you change error messages you may need to update FSComp.fs in`src\buildfromsource\FSharp.Compiler.Private`.
221
+
222
+
To do this, build the non-buildfromsource version of FSharp.Compiler.Private (src\fsharp\FSharp.Compiler.Private) then check its obj\ directory for`FSComp.fs` and manually copy that into the buildfromsource directory.
223
+
224
+
216
225
####Configuring proxy server
217
226
218
227
If you are behind a proxy server, NuGet client tool must be configured to use it:
@@ -223,6 +232,12 @@ If you are behind a proxy server, NuGet client tool must be configured to use it
223
232
224
233
Where you should set proper proxy address, user name and password.
225
234
235
+
####When modifying, adding, or removing keywords or compiler messages
236
+
237
+
If your changes involve modifying the list of language keywords in any way, (e.g. when implementing a new keyword), the XLF localization files need to be synced with the corresponding resx files. This can be done automatically by running`msbuild FSharp.Compiler.Private.fsproj /t:UpdateXlf` (located in[src\fsharp\FSharp.Compiler.Private](https://github.com/Microsoft/visualfsharp/tree/master/src/fsharp/FSharp.Compiler.Private)). This only works on Windows/.NETStandard framework, so changing this from any other platform requires editing and syncing all of the XLF files manually.
238
+
239
+
After this, you must copy any differing`resx` files from the output directory into the corresponding subdirectory in[src\buildfromsource](https://github.com/Microsoft/visualfsharp/tree/master/src/fsharp/FSharp.Compiler.Private). This step will soon be eliminated (see issue[#3905](https://github.com/Microsoft/visualfsharp/issues/3905)).
240
+
226
241
####Resources
227
242
228
243
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.