Disable a flaky test.
[mono-project.git] / README.md
blob33d7ae950204272b9a5f7664d24b14c761c9c88f
1 Mono is a software platform designed to allow developers to easily
2 create cross platform applications.  It is an open source
3 implementation of Microsoft's .NET Framework based on the ECMA
4 standards for C# and the Common Language Runtime.
6 The Mono project is part of the [.NET Foundation](http://www.dotnetfoundation.org/)
8 [![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/mono/mono?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
10 1. [Compilation and Installation](#compilation-and-installation)
11 2. [Using Mono](#using-mono)
12 3. [Directory Roadmap](#directory-roadmap)
13 4. [Contributing to Mono](#contributing-to-mono)
14 5. [Reporting bugs](#reporting-bugs)
15 6. [Configuration Options](#configuration-options)
16 7. [Working with Submodules](#working-with-submodules)
18 ### Build Status
20 | OS           | Architecture       | Status                       |
21 |--------------|--------------------|------------------------------|
22 | Debian 9     | amd64              | [![debian-9-amd64][1]][2]    |
23 | Debian 9     | i386               | [![debian-9-i386][3]][4]     |
24 | Debian 9     | armel              | [![debian-9-armel][5]][6]    |
25 | Debian 9     | armhf              | [![debian-9-armhf][7]][8]    |
26 | Debian 9     | arm64              | [![debian-9-arm64][9]][10]   |
27 | OS X         | amd64              | [![osx-amd64][11]][12]       |
28 | OS X         | i386               | [![osx-i386][13]][14]        |
29 | Windows      | amd64              | [![windows-amd64][15]][16]   |
30 | Windows      | i386               | [![windows-i386][17]][18]    |
31 | CentOS       | s390x (cs)         | [![centos-s390x][19]][20]    |
32 | Debian 9     | ppc64el (cs)       | [![debian-9-ppc64el][21]][22]|
34 _(cs) = community supported architecture_
36 [1]: https://jenkins.mono-project.com/job/test-mono-mainline-linux/label=debian-9-amd64/badge/icon
37 [2]: https://jenkins.mono-project.com/job/test-mono-mainline-linux/label=debian-9-amd64
38 [3]: https://jenkins.mono-project.com/job/test-mono-mainline-linux/label=debian-9-i386/badge/icon
39 [4]: https://jenkins.mono-project.com/job/test-mono-mainline-linux/label=debian-9-i386/
40 [5]: https://jenkins.mono-project.com/job/test-mono-mainline-linux/label=debian-9-armel/badge/icon
41 [6]: https://jenkins.mono-project.com/job/test-mono-mainline-linux/label=debian-9-armel/
42 [7]: https://jenkins.mono-project.com/job/test-mono-mainline-linux/label=debian-9-armhf/badge/icon
43 [8]: https://jenkins.mono-project.com/job/test-mono-mainline-linux/label=debian-9-armhf/
44 [9]: https://jenkins.mono-project.com/job/test-mono-mainline-linux/label=debian-9-arm64/badge/icon
45 [10]: https://jenkins.mono-project.com/job/test-mono-mainline-linux/label=debian-9-arm64/
46 [11]: https://jenkins.mono-project.com/job/test-mono-mainline/label=osx-amd64/badge/icon
47 [12]: https://jenkins.mono-project.com/job/test-mono-mainline/label=osx-amd64/
48 [13]: https://jenkins.mono-project.com/job/test-mono-mainline/label=osx-i386/badge/icon
49 [14]: https://jenkins.mono-project.com/job/test-mono-mainline/label=osx-i386/
50 [15]: https://jenkins.mono-project.com/job/z/label=w64/badge/icon
51 [16]: https://jenkins.mono-project.com/job/z/label=w64/
52 [17]: https://jenkins.mono-project.com/job/z/label=w32/badge/icon
53 [18]: https://jenkins.mono-project.com/job/z/label=w32/
54 [19]: https://jenkins.mono-project.com/job/test-mono-mainline-community/label=centos-s390x/badge/icon
55 [20]: https://jenkins.mono-project.com/job/test-mono-mainline-community/label=centos-s390x
56 [21]: https://jenkins.mono-project.com/job/test-mono-mainline-community-chroot/label=debian-9-ppc64el/badge/icon
57 [22]: https://jenkins.mono-project.com/job/test-mono-mainline-community-chroot/label=debian-9-ppc64el
59 Compilation and Installation
60 ============================
62 Building the Software
63 ---------------------
65 Please see our guides for building Mono on
66 [Mac OS X](http://www.mono-project.com/docs/compiling-mono/mac/),
67 [Linux](http://www.mono-project.com/docs/compiling-mono/linux/) and 
68 [Windows](http://www.mono-project.com/docs/compiling-mono/windows/).
70 Note that building from Git assumes that you already have Mono installed,
71 so please download and [install the latest Mono release](http://www.mono-project.com/download/)
72 before trying to build from Git. This is required because the Mono build
73 relies on a working Mono C# compiler to compile itself
74 (also known as [bootstrapping](http://en.wikipedia.org/wiki/Bootstrapping_(compilers))).
76 If you don't have a working Mono installation
77 ---------------------------------------------
79 If you don't have a working Mono installation, you can try a slightly
80 more risky approach: getting the latest version of the 'monolite' distribution,
81 which contains just enough to run the 'mcs' compiler. You do this with:
83     # Run the following line after ./autogen.sh
84     make get-monolite-latest
86 This will download and place the files appropriately so that you can then
87 just run:
89     make
91 The build will then use the files downloaded by `make get-monolite-latest`.
93 Testing and Installation
94 ------------------------
96 You can run the mono and mcs test suites with the command: `make check`.
98 Expect to find a few test suite failures. As a sanity check, you
99 can compare the failures you got with [https://jenkins.mono-project.com/](https://jenkins.mono-project.com/).
101 You can now install mono with: `make install`
103 You can verify your installation by using the mono-test-install
104 script, it can diagnose some common problems with Mono's install.
105 Failure to follow these steps may result in a broken installation. 
107 Using Mono
108 ==========
110 Once you have installed the software, you can run a few programs:
112 * `mono program.exe` runtime engine
114 * `mcs program.cs` C# compiler
116 * `monodis program.exe` CIL Disassembler
118 See the man pages for mono(1), mcs(1) and monodis(1) for further details.
120 Directory Roadmap
121 =================
123 * `acceptance-tests/` - Optional third party test suites used to validate Mono against a wider range of test cases.
125 * `data/` - Configuration files installed as part of the Mono runtime.
127 * `docs/` - Technical documents about the Mono runtime.
129 * `external/` - Git submodules for external libraries (Newtonsoft.Json, ikvm, etc).
131 * `ikvm-native/` - Glue code for ikvm.
133 * `libgc/` - The (deprecated) Boehm GC implementation.
135 * `llvm/` - Utility Makefiles for integrating the Mono LLVM fork.
137 * `m4/` - General utility Makefiles.
139 * `man/` - Manual pages for the various Mono commands and programs.
141 * `mcs/` - The class libraries, compiler and tools
143   * `class/` - The class libraries (like System.*, Microsoft.Build, etc.)
145   * `mcs/` - The Mono C# compiler written in C#
147   * `tools/` - Tools like gacutil, ikdasm, mdoc, etc.
149 * `mono/` - The core of the Mono Runtime.
151   * `arch/` - Architecture specific portions.
153   * `benchmark/` - A collection of benchmarks.
155   * `btls/` - Build files for the BTLS library which incorporates BoringSSL.
157   * `cil/` - Common Intermediate Representation, XML
158 definition of the CIL bytecodes.
160   * `dis/` - CIL executable Disassembler.
162   * `eglib/` - Independent implementation of the glib API.
164   * `metadata/` - The object system and metadata reader.
166   * `mini/` - The Just in Time Compiler.
168   * `profiler/` - The profiler implementation.
170   * `sgen/` - The SGen Garbage Collector implementation.
172   * `tests/` - The main runtime tests.
174   * `unit-tests/` - Additional runtime unit tests.
176   * `utils/` - Utility functions used across the runtime codebase.
178 * `msvc/` - Logic for the MSVC / Visual Studio based runtime and BCL build system.
179 The latter is experimental at the moment.
181 * `packaging/` - Packaging logic for the OS X and Windows Mono packages.
183 * `po/` - Translation files.
185 * `runtime/` - A directory that contains the Makefiles that link the
186 mono/ and mcs/ build systems.
188 * `samples/` - Some simple sample programs on uses of the Mono
189 runtime as an embedded library.
191 * `scripts/` - Scripts used to invoke Mono and the corresponding program.
193 * `sdks/` - A new way of embedding Mono into Xamarin.iOS, Xamarin.Android and other products.
195 * `support/` - Various support libraries.
197 * `tools/` - A collection of tools, mostly used during Mono development.
199 Contributing to Mono
200 ====================
202 Before submitting changes to Mono, please review the [contribution
203 guidelines](http://www.mono-project.com/community/contributing/).
204 Please pay particular attention to the [Important
205 Rules](http://www.mono-project.com/community/contributing/#important-rules)
206 section.
208 Reporting bugs
209 ==============
211 To submit bug reports, please [open an issue on the mono GitHub repo](https://github.com/mono/mono/issues/new).
213 Please use the search facility to ensure the same bug hasn't already
214 been submitted and follow our
215 [guidelines](http://www.mono-project.com/community/bugs/make-a-good-bug-report/)
216 on how to make a good bug report.
218 Configuration Options
219 =====================
221 The following are the configuration options that someone building Mono
222 might want to use:
224 * `--with-sgen=yes,no` - Generational GC support: Used to enable or
225 disable the compilation of a Mono runtime with the SGen garbage
226 collector.
228   * On platforms that support it, after building Mono, you will have
229 both a `mono-boehm` binary and a `mono-sgen` binary. `mono-boehm` uses Boehm,
230 while `mono-sgen` uses the Simple Generational GC.
232 * `--with-libgc=[included, none]` - Selects the default Boehm
233 garbage collector engine to use.
235   * *included*: (*slightly modified Boehm GC*) This is the default
236 value for the Boehm GC, and it's the most feature complete, it will
237 allow Mono to use typed allocations and support the debugger.
239   * *none*:
240 Disables the inclusion of a Boehm garbage collector.
242   * This defaults to `included`.
244 * `--with-cooperative-gc`
246   * If you pass this flag the Mono runtime is configured to only use
247   the cooperative mode of the garbage collector.  If you do not pass
248   this flag, then you can control at runtime the use of the
249   cooperative GC mode by setting the `MONO_ENABLE_COOP` flag.
250   
251 * `--with-tls=__thread,pthread`
253   * Controls how Mono should access thread local storage,
254 pthread forces Mono to use the pthread APIs, while
255 __thread uses compiler-optimized access to it.
257   * Although __thread is faster, it requires support from
258 the compiler, kernel and libc. Old Linux systems do
259 not support with __thread.
261   * This value is typically pre-configured and there is no
262 need to set it, unless you are trying to debug a problem.
264 * `--with-sigaltstack=yes,no`
266   * **Experimental**: Use at your own risk, it is known to
267 cause problems with garbage collection and is hard to
268 reproduce those bugs.
270   * This controls whether Mono will install a special
271 signal handler to handle stack overflows. If set to
272 `yes`, it will turn stack overflows into the
273 StackOverflowException. Otherwise when a stack
274 overflow happens, your program will receive a
275 segmentation fault.
277   * The configure script will try to detect if your
278 operating system supports this. Some older Linux
279 systems do not support this feature, or you might want
280 to override the auto-detection.
282 * `--with-static_mono=yes,no`
284   * This controls whether `mono` should link against a
285 static library (libmono.a) or a shared library
286 (libmono.so). 
288   * This defaults to `yes`, and will improve the performance
289 of the `mono` program. 
291   * This only affects the `mono' binary, the shared
292 library libmono.so will always be produced for
293 developers that want to embed the runtime in their
294 application.
296 * `--with-xen-opt=yes,no` - Optimize code for Xen virtualization.
298   * It makes Mono generate code which might be slightly
299 slower on average systems, but the resulting executable will run
300 faster under the Xen virtualization system.
302   * This defaults to `yes`.
304 * `--with-large-heap=yes,no` - Enable support for GC heaps larger than 3GB.
306   * This defaults to `no`.
308 * `--enable-small-config=yes,no` - Enable some tweaks to reduce memory usage
309 and disk footprint at the expense of some capabilities.
311   * Typically this means that the number of threads that can be created
312 is limited (256), that the maximum heap size is also reduced (256 MB)
313 and other such limitations that still make mono useful, but more suitable
314 to embedded devices (like mobile phones).
316   * This defaults to `no`.
318 * `--with-ikvm-native=yes,no` - Controls whether the IKVM JNI interface library is
319 built or not.
321   * This is used if you are planning on
322 using the IKVM Java Virtual machine with Mono.
324   * This defaults to `yes`.
326 * `--with-profile4=yes,no` - Whether you want to build the 4.x profile libraries
327 and runtime.
329   * This defaults to `yes`.
331 * `--with-libgdiplus=installed,sibling,<path>` - Configure where Mono
332 searches for libgdiplus when running System.Drawing tests.
334   * It defaults to `installed`, which means that the
335 library is available to Mono through the regular
336 system setup.
338   * `sibling` can be used to specify that a libgdiplus
339 that resides as a sibling of this directory (mono)
340 should be used.
342  * Or you can specify a path to a libgdiplus.
344 * `--enable-minimal=LIST`
346   * Use this feature to specify optional runtime
347 components that you might not want to include.  This
348 is only useful for developers embedding Mono that
349 require a subset of Mono functionality.
350   * The list is a comma-separated list of components that
351 should be removed, these are:
353     * `aot`:
354 Disables support for the Ahead of Time compilation.
356     * `attach`:
357 Support for the Mono.Management assembly and the
358 VMAttach API (allowing code to be injected into
359 a target VM)
361     * `com`:
362 Disables COM support.
364     * `debug`:
365 Drop debugging support.
367     * `decimal`:
368 Disables support for System.Decimal.
370     * `full_messages`:
371 By default Mono comes with a full table
372 of messages for error codes. This feature
373 turns off uncommon error messages and reduces
374 the runtime size.
376     * `generics`:
377 Generics support.  Disabling this will not
378 allow Mono to run any 2.0 libraries or
379 code that contains generics.
381     * `jit`:
382 Removes the JIT engine from the build, this reduces
383 the executable size, and requires that all code
384 executed by the virtual machine be compiled with
385 Full AOT before execution.
387     * `large_code`:
388 Disables support for large assemblies.
390     * `logging`:
391 Disables support for debug logging.
393     * `pinvoke`:
394 Support for Platform Invocation services,
395 disabling this will drop support for any
396 libraries using DllImport.
398     * `portability`:
399 Removes support for MONO_IOMAP, the environment
400 variables for simplifying porting applications that 
401 are case-insensitive and that mix the Unix and Windows path separators.
403     * `profiler`:
404 Disables support for the default profiler.
406     * `reflection_emit`:
407 Drop System.Reflection.Emit support
409     * `reflection_emit_save`:
410 Drop support for saving dynamically created
411 assemblies (AssemblyBuilderAccess.Save) in
412 System.Reflection.Emit.
414     * `shadow_copy`:
415 Disables support for AppDomain's shadow copies
416 (you can disable this if you do not plan on 
417 using appdomains).
419     * `simd`:
420 Disables support for the Mono.SIMD intrinsics
421 library.
423     * `ssa`:
424 Disables compilation for the SSA optimization
425 framework, and the various SSA-based optimizations.
427 * `--enable-llvm`
428 * `--enable-loadedllvm`
430   * This enables the use of LLVM as a code generation engine
431 for Mono.  The LLVM code generator and optimizer will be 
432 used instead of Mono's built-in code generator for both
433 Just in Time and Ahead of Time compilations.
435   * See http://www.mono-project.com/docs/advanced/mono-llvm/ for the 
436 full details and up-to-date information on this feature.
438   * You will need to have an LLVM built that Mono can link
439 against.
441   * The `--enable-loadedllvm` variant will make the LLVM backend
442 into a runtime-loadable module instead of linking it directly
443 into the main mono binary.
445 * `--enable-big-arrays` - Enable use of arrays with indexes larger
446 than Int32.MaxValue.
448   * By default Mono has the same limitation as .NET on
449 Win32 and Win64 and limits array indexes to 32-bit
450 values (even on 64-bit systems).
452   * In certain scenarios where large arrays are required,
453 you can pass this flag and Mono will be built to
454 support 64-bit arrays.
456   * This is not the default as it breaks the C embedding
457 ABI that we have exposed through the Mono development
458 cycle.
460 * `--enable-parallel-mark`
462   * Use this option to enable the garbage collector to use
463 multiple CPUs to do its work.  This helps performance
464 on multi-CPU machines as the work is divided across CPUS.
466   * This option is not currently the default on OSX
467 as it runs into issues there.
469   * This option only applies to the Boehm GC.
471 * `--enable-dtrace`
473   * On Solaris and MacOS X builds a version of the Mono
474 runtime that contains DTrace probes and can
475 participate in the system profiling using DTrace.
477 * `--disable-dev-random`
479   * Mono uses /dev/random to obtain good random data for
480 any source that requires random numbers.   If your
481 system does not support this, you might want to
482 disable it.
484   * There are a number of runtime options to control this
485 also, see the man page.
487 * `--with-csc=roslyn,mcs,default`
489   * Use this option to configure which C# compiler to use.  By default
490     the configure script will pick Roslyn, except on platforms where
491     Roslyn does not work (Big Endian systems) where it will pick mcs.
493     If you specify "mcs", then Mono's C# compiler will be used.  This
494     also allows for a complete bootstrap of Mono's core compiler and
495     core libraries from source.
497     If you specify "roslyn", then Roslyn's C# compiler will be used.
498     This currently uses Roslyn binaries.
499   
500 * `--enable-nacl`
502   * This configures the Mono compiler to generate code
503 suitable to be used by Google's Native Client:
504 http://code.google.com/p/nativeclient/
506   * Currently this is used with Mono's AOT engine as
507 Native Client does not support JIT engines yet.
509 * `--enable-wasm`
511   * Use this option to configure mono to run on WebAssembly. It will
512     set both host and target to the WebAssembly triplet. This overrides
513     the values passed to `--host` or `--target` and ignored what config.sub guesses.
515     This is a workaround to enable usage of old automake versions that don't
516     recognize the wasm triplet.
519 Working With Submodules
520 =======================
522 Mono references several external git submodules, for example
523 a fork of Microsoft's reference source code that has been altered
524 to be suitable for use with the Mono runtime.
526 This section describes how to use it.
528 An initial clone should be done recursively so all submodules will also be
529 cloned in a single pass:
531         $ git clone --recursive git@github.com:mono/mono
533 Once cloned, submodules can be updated to pull down the latest changes.
534 This can also be done after an initial non-recursive clone:
536         $ git submodule update --init --recursive
538 To pull external changes into a submodule:
540         $ cd <submodule>
541         $ git pull origin <branch>
542         $ cd <top-level>
543         $ git add <submodule>
544         $ git commit
546 By default, submodules are detached because they point to a specific commit.
547 Use `git checkout` to move back to a branch before making changes:
549         $ cd <submodule>
550         $ git checkout <branch>
551         # work as normal; the submodule is a normal repo
552         $ git commit/push new changes to the repo (submodule)
554         $ cd <top-level>
555         $ git add <submodule> # this will record the new commits to the submodule
556         $ git commit
558 To switch the repo of a submodule (this should not be a common or normal thing
559 to do at all), first edit `.gitmodules` to point to the new location, then:
561         $ git submodule sync -- <path of the submodule>
562         $ git submodule update --recursive
563         $ git checkout <desired new hash or branch>
565 The desired output diff is a change in `.gitmodules` to reflect the
566 change in the remote URL, and a change in /<submodule> where you see
567 the desired change in the commit hash.
569 License
570 =======
572 See the LICENSE file for licensing information, and the PATENTS.TXT
573 file for information about Microsoft's patent grant.
575 Mono Trademark Use Policy
576 =========================
578 The use of trademarks and logos for Mono can be found [here](http://www.dotnetfoundation.org/legal/mono-tm). 
580 Maintaining the Class Library Solution Files
581 ============================================
583 Mono now ships with a solution file that can be used to build the
584 assemblies from an IDE.  Either by opening the topmost `net_4_x.sln`
585 file, or to by loading one of the individual `csproj` files located in
586 each directory.
588 These are maintained by extracting the configuration information from
589 our Makefiles, which as of May 2016 remain the canonical location for
590 configuration information.
592 When changes are made to the Makefiles, a user would need to run the
593 following command to re-generate the solution files at the top level:
595         $ make update-solution-files