1
0
Fork 0
mirror of https://github.com/VSadov/Satori.git synced 2025-06-10 01:50:53 +09:00
Satori/docs/workflow
Jeremy Koritzinsky 8c6a049cdb
Enable using the Ninja generator instead of Visual Studio on Windows builds. (#41897)
* Move DacTableGen out of the CMake build and into tools-local.

* Attempt: usenmakefiles means ninja.

* Make changes to Windows build to support non-VS generators like ninja.

* Use CMake 3.16 PCHs.

* Remove explicit process count.

* Build and run DacTableGen via the .NET CLI we pull down for the build instead of via CMake.

* Update configurecompiler.cmake to specify language (needed for Ninja).

Signed-off-by: Jeremy Koritzinsky <jekoritz@microsoft.com>

* Get Ninja build working again.

* Pass configuration to cmake configure step for Ninja build.

* Rename flag

* Fix configure step for cross-arch native build

Signed-off-by: Jeremy Koritzinsky <jekoritz@microsoft.com>

* Support building via Ninja for coreclr via an MSBuild property

Signed-off-by: Jeremy Koritzinsky <jekoritz@microsoft.com>

* Implement support for opening the CoreCLR solution in VS via the -vs flag.

* Fix setting generator to Ninja.

* Merge libraries gen-buildsys-win.bat with runtime gen-buildsys.cmd to share windows cmake configure infra.

* Enable building libraries native build with ninja.

* Centralize setting CMAKE_SYSTEM_VERSION for windows builds.

Signed-off-by: Jeremy Koritzinsky <jekoritz@microsoft.com>

* Update host build to use shared gen-buildsys.cmd

* Fix multi-config generator detection.

Signed-off-by: Jeremy Koritzinsky <jekoritz@microsoft.com>

* Exit with success when we build successfully.

Signed-off-by: Jeremy Koritzinsky <jekoritz@microsoft.com>

* Enable and fix up Ninja build for hosts.

Signed-off-by: Jeremy Koritzinsky <jekoritz@microsoft.com>

* Only link delayimp.lib on Windows

Signed-off-by: Jeremy Koritzinsky <jekoritz@microsoft.com>

* Remove "overriding /W3 with /W1" warning in Ninja build of hosts by turning on /W3 and disabling any new warnings we hit.

* Reduce command line override warnings by adopting the MSVC_RUNTIME_LIBRARY abstraction feature in CMake 3.14+ (below the minimum requirement on Windows).

* Use the delayed expansion syntax to correctly pass in the config to cmake.

* Move all usages of MSVC runtime library selection to the CMake abstraction to reduce console spew about overridden flags.

Signed-off-by: Jeremy Koritzinsky <jekoritz@microsoft.com>

* Condition the rest of the compiler options correctly so they don't show up as invalid parameter warnings for assembly builds.

* Correctly build DIALib and DacTableGen as AnyCPU

* Fix WRITE_BARRIER_CHECK define

Signed-off-by: Jeremy Koritzinsky <jekoritz@microsoft.com>

* Fix passing arch for MSBuild build.

Signed-off-by: Jeremy Koritzinsky <jekoritz@microsoft.com>

* Configure ASM compiler command line format in configurecompiler.cmake and use CMake's assembly compilation step to build ASM files for ARM/ARM64 instead of manually building them and adding the generated files as additional sources.

* Cleanup after fixing ARM/ARM64 support.

* Rename variable

* Condition PCH's for C++-only as needed to fix using them on non-Windows (where we compile C as C instead of as C++).

* Fix CoreCLR native test build on windows to point to new gen-buildsys location.

* Add missing compilation options in Ninja build that are implicitly defined in the MSBuild build.

* Disable analyzers for DacTableGen. Remove /MAP linker flag (that's for local testing).

* Upgrade to CMake 3.16.4

* Don't warn on unused variables in CMake (these usually vary on platform/config)

Signed-off-by: Jeremy Koritzinsky <jekoritz@microsoft.com>

* Manually compile ARM and ARM64 asm files when using the VS generator since it doesn't support emitting MARMASM item types in projects (and as a result cannot compile ARM or ARM64 asm without assistance).

* Enable CMake policy in test build to use CMAKE_MSVC_RUNTIME_LIBRARY variable.

* Update initially disabled warnings in host.

* Add -ninja arg to root scripts to enable using Ninja.

* Enable using Ninja in CoreCLR CI.

* Try to fix passing the -ninja arg in yaml.

Signed-off-by: Jeremy Koritzinsky <jekoritz@microsoft.com>

* Add ninja to the Windows invocation

* Fix 2-phase cross targeting to do one phase at a time and initialize the VC++ environment for the correct build tools each time instead of interleaving them and relying on Visual Studio to handle the differing targets.

* Restore old /Ox optimization setting for Release.

* Fix typos, don't pass exception flags to C files.

* Remove unneeded pragma.

* Fix .pgd file installation.

Signed-off-by: Jeremy Koritzinsky <jekoritz@microsoft.com>

* Add mention of the `-ninja` flag in the Building CoreCLR documentation.

Signed-off-by: Jeremy Koritzinsky <jekoritz@microsoft.com>

* Mention installation locations for Ninja and warn while building if CMake is older than 3.16.0.

* Update docs/workflow/requirements/windows-requirements.md
2020-11-02 07:50:01 -08:00
..
building Enable using the Ninja generator instead of Visual Studio on Windows builds. (#41897) 2020-11-02 07:50:01 -08:00
ci Fix various typos (#43073) 2020-10-10 01:54:53 -04:00
debugging Update steps in debugging instruction of CLR (#43557) 2020-10-21 18:08:53 +02:00
requirements Enable using the Ninja generator instead of Visual Studio on Windows builds. (#41897) 2020-11-02 07:50:01 -08:00
testing Fix various typos (#43073) 2020-10-10 01:54:53 -04:00
trimming Trim more Http DiagnosticsHandler code (#39525) 2020-07-21 08:59:52 -05:00
editing-and-debugging.md Add docs link to editing-and-debugging (#41636) 2020-08-31 15:42:51 -07:00
README.md Add docs link to editing-and-debugging (#41636) 2020-08-31 15:42:51 -07:00
using-dotnet-cli.md Update using-dotnet-cli.md (#40580) 2020-08-10 17:55:00 -05:00

Workflow Guide

The repo can be built for the following platforms, using the provided setup and the following instructions. Before attempting to clone or build, please check these requirements.

Build Requirements

Chip Windows Linux macOS FreeBSD
x64
x86
ARM
ARM64
Requirements Requirements Requirements Requirements

Before proceeding further, please click on the link above that matches your machine and ensure you have installed all the prerequisites for the build to work.

Concepts

The runtime repo can be built from a regular, non-administrator command prompt, from the root of the repo, as follows:

For Linux and macOS

./build.sh

For Windows:

build.cmd

This builds the product (in the default debug configuration), but not the tests.

For information about the different options available, supply the argument --help|-h when invoking the build script:

build -h

On Unix like systems, arguments can be passed in with a single - or double hyphen --.

The repository currently consists of different major parts: the runtimes, the libraries, and the installer. To build just one part you use the root build script (build.cmd/sh), and you add the -subset flag.

Editing and Debugging

For instructions on how to edit code and debug your changes, see Editing and Debugging.

Configurations

You may need to build the tree in a combination of configurations. This section explains why.

A quick reminder of some concepts -- see the glossary for more on these:

  • Debug Configuration -- Non-optimized code. Asserts are enabled.
  • Checked Configuration -- Optimized code. Asserts are enabled. Only relevant to CoreCLR runtime.
  • Release Configuration -- Optimized code. Asserts are disabled. Runs at the best speed, and suitable for performance profiling. You will have limited debugging experience.

When we talk about mixing configurations, we're discussing the following sub-components:

  • Runtime is the execution engine for managed code and there are two different implementations available. Both are written in C/C++, therefore, easier to debug when built in a Debug configuration.
    • CoreCLR is the comprehensive execution engine which if build in Debug Configuration it executes managed code very slowly. For example, it will take a long time to run the managed code unit tests. The code lives under src/coreclr.
    • Mono is portable and also slimmer runtime and it's not that sensitive to Debug Configuration for running managed code. You will still need to build it without optimizations to have good runtime debugging experience though. The code lives under src/mono.
  • CoreLib (also known as System.Private.CoreLib) is the lowest level managed library. It has a special relationship to the runtimes and therefore it must be built in the matching configuration, e.g., if the runtime you are using was built in a Debug configuration, this must be in a Debug configuration. The runtime agnostic code for this library can be found at src/libraries/System.Private.CoreLib/src.
  • Libraries is the bulk of the dlls that are oblivious to the configuration that runtimes and CoreLib were built in. They are most debuggable when built in a Debug configuration, and, happily, they still run sufficiently fast in that configuration that it's acceptable for development work. The code lives under src/libraries.

What does this mean for me?

At this point you probably know what you are planning to work on primarily: the runtimes or libraries.

  • if you're working in runtimes, you may want to build everything in the Debug configuration, depending on how comfortable you are debugging optimized native code.
  • if you're working in libraries, you will want to use debug libraries with a release version of runtime and CoreLib, because the tests will run faster.
  • if you're working in CoreLib - you probably want to try to get the job done with release runtime and CoreLib, and fall back to debug if you need to. The Building Libraries document explains how you'll do this.

Now you know about configurations and how we use them, you will want to read how to build what you plan to work on. Pick one of these:

After that, here's information about how to run tests:

And how to measure performance: