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
<b>Questions?</b> If you have questions about the source code, please ask in the issues and discussion forums.
324
324
</p>
325
325
326
-
<h3>Compilation Instructions</h3>
327
326
327
+
<h3>1. Building a Proto Compiler</h3>
328
328
329
329
<p>
330
330
The compiler is compiled as a set of .NET 4.0 components using a bootstrap process.
331
-
When you build the compiler using the standard instructions below, you get<code>fsc.exe</code>,<code>fsi.exe</code>,<code>FSharp.Core.dll</code>,<code>FSharp.Compiler.dll</code> and some related DLLs.
332
331
</p>
333
332
334
-
335
-
<h3>1. Building a Proto Compiler</h3>
336
-
337
333
<p>This uses the lkg compiler to build. Note that you need the .NET framework 3.5 installed on your machine in order to complete this step.</p>
Use this script to add the built FSharp.Core to the
358
-
GAC,<b>add required strong name validation skips</b>, and NGen the compiler and libraries.
359
-
This requires admin privileges.
360
-
</p>
361
-
<pre>
362
-
update.cmd debug -ngen
363
-
</pre>
364
-
365
-
<h3>3. Running Tests</h3>
346
+
<p>You can now use the updated commpiler in<code>Debug\net40\bin\fsc.exe</code> to develop and test basic language and tool features.</p>
366
347
367
-
<p>There are language tests under the<code>tests</code> directory. The test apparatus uses batch files, assuming<ahref="http://www.perl.org/get.html">Perl</a> (ActiveState Perl 5.16.3 is known to work fine) is installed. You can run these on Windows using:</p>
368
-
<pre>
369
-
cd ..\tests
370
-
BuildTestTools.cmd debug
371
-
Runtests.cmd debug fsharp
372
-
Runtests.cmd debug fsharpqa
373
-
Runtests.cmd debug coreunit
374
-
</pre>
375
-
<p>
376
-
For more details on how to run, debug, and write tests, see<ahref="tests\TESTGUIDE.html">tests\TESTGUIDE.html</a>.
377
-
</p>
378
348
349
+
<h3>3. Full Steps Before Running Tests</h3>
379
350
380
-
<p>You can also use the F# compiler and F# interactive as follows:</p>
381
-
382
-
<pre>
383
-
..\Debug\net40\bin\fsc.exe /help
384
-
..\Debug\net40\bin\fsi.exe /help
385
-
..\Debug\net40\bin\fsi.exe
386
-
1 + 1;;
387
-
#q;;
388
-
</pre>
389
-
<p>Compile hello world.</p>
390
-
<pre>
391
-
echo printfn "hello world"> hello.fs
392
-
..\Debug\net40\bin\fsc.exe hello.fs
393
-
copy ..\Debug\net40\bin\FSharp.Core.dll .
394
-
hello.exe
395
-
del /q hello.fs
396
-
del /q FSharp.Core.dll
397
-
</pre>
398
-
399
-
<h3>4. [Optional] Building and testing the "release" compiler</h3>
400
-
401
-
<p>This uses the proto compiler to build the FSharp.Compiler.dll and fsc.exe to run on for Mono/.NET 4.0.</p>
351
+
<p>See<ahref="tests\TESTGUIDE.html">tests\TESTGUIDE.html</a> to run tests.</p>
352
+
353
+
<p>Prior to a<b>Debug</b> test run, you need to complete<b>all<b> of these steps:</p>
<h3>5. [Optional] Open a solution with Visual Studio</h3>
417
-
418
-
<p>
419
-
You can use "fsharp.sln" to browse source code using Visual Studio.
420
-
However, you need to complete step 1) and 2) in order to properly
421
-
open this solution. In addition, FSharp.Core.Unittests project requires NUnit installed.
422
-
</p>
423
-
<h3>6. [Optional] Build Visual Studio components</h3>
401
+
<h3>4. [Optional] Build and Install Visual Studio components</h3>
424
402
<p>
425
403
To build the VS components:
426
404
</p>
427
405
<pre>
428
406
cd ..\vsintegration
429
407
msbuild fsharp-vsintegration-build.proj
430
408
</pre>
431
-
432
-
<h3>6. [Optional] Build and install Visual Studio components</h3>
433
409
<p>
434
410
To install the VS components:
435
411
</p>
436
-
<p>
437
-
Ensure that the VSIX package is uninstalled, in VS select Tools/Extensions and Updates,
438
-
If the packages VisualStudio.FSharp.EnableOpenSource is installed, select Uninstall
439
-
</p>
412
+
<ul>
413
+
<li>
414
+
First ensure that the VSIX package is uninstalled, in VS select Tools/Extensions and Updates,
415
+
If the packages VisualStudio.FSharp.EnableOpenSource is installed, select Uninstall
416
+
</li>
417
+
<li>Then:</li>
418
+
</ul>
440
419
<pre>
441
420
..\Debug\net40\bin\EnableOpenSource.vsix
442
421
</pre>
443
422
<p>
444
-
RestartVisual Studio, now it should be runningthe open source FSharp.VS.FSI.
423
+
Now restartVisual Studio, now it should be runningyour freshly built components.
445
424
</p>
446
-
<pre>
447
-
</pre>
448
425
449
426
<h3>Notes on the build</h3>
450
427
451
-
<p>
452
-
The compiler binaries produced are "private" and
453
-
strong-named signed with a test key (src\fsharp\test.snk). They use CLI assembly version nunmber 2.9.9.999. You can place these components in the GAC but they will not replace
454
-
the components used by Visual Studio or other normal F# programs.
455
-
</p>
456
-
457
-
<p>
458
-
The prerequisites and build command line for compiling the source (on Windows) are shown
459
-
later in this README. Here's the logic of the build:
460
-
</p>
461
428
<ul>
429
+
<li>
430
+
The<code>update.cmd</code> script add the built FSharp.Core to the
431
+
GAC, adds required strong name validation skips, and NGens the compiler and libraries.
432
+
This requires admin privileges.
433
+
</li>
434
+
<li>
435
+
The compiler binaries produced are "private" and strong-named signed with a test key (src\fsharp\test.snk).
436
+
</li>
462
437
<li>We first need an existing F# compiler, using the one in the 'lkg' directory. Let's assume this compiler has an FSharp.Core.dll with version X.</li>
463
438
<li>
464
439
We use this compiler to compile the source in this distribution, to produce a "proto" compiler, in the Proto
465
440
directory. When run, this compiler still relies on the FSharp.Core.dll with version X.
466
441
</li>
467
442
<li>
468
-
We use the proto compiler to compile the source for FSharp.Core.dll in this distribution, producing
469
-
an FSharp.Core.dll with the version identified in src\source-build-version, usually 1.9.999.
443
+
We use the proto compiler to compile the source for FSharp.Core.dll in this distribution.
470
444
</li>
471
445
<li>
472
446
We use the proto compiler to compile the source for FSharp.Compiler.dll, fsc.exe, fsi.exe and other
473
-
binaries found in this distribution. When run, these binaries will rely on the FSharp.Core.dll with version
474
-
1.9.999. This is good, since it means the 1.9.999 binaries now form a consistent, bootstrapped compiler. If
475
-
you like you should now be able to throw away the compiler with version X.
447
+
binaries found in this distribution.
448
+
</li>
449
+
<li>
450
+
Some additional tools are required to build the compiler, notably fslex.exe, fsyacc.exe,
451
+
FSharp.PowerPack.Build.Tasks.dll, FsSrGen.exe, FSharp.SRGen.Build.Tasks.dll and the other
452
+
tools found in the lkg directory.
476
453
</li>
477
454
</ul>
478
-
<p>
479
-
Some additional tools are required to build the compiler, notably fslex.exe, fsyacc.exe,
480
-
FSharp.PowerPack.Build.Tasks.dll, FsSrGen.exe, FSharp.SRGen.Build.Tasks.dll and the other
481
-
tools found in the lkg directory. These are "Last Known Good" binaries created from a version of the F# Power Pack
482
-
on CodePlex. If you like you can throw away these binaries and use your own compiled versions of these tools.