summaryrefslogtreecommitdiff
path: root/site_scons/mongo/build_profiles.py
blob: e32163a61b4df3516e7fdaa26bf75428e04fb9c9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
"""Dictionary to store available build profiles."""
from dataclasses import dataclass
from typing import Any, List, Optional
import mongo.generators as mongo_generators


@dataclass
class BuildProfile:
    ninja: str
    variables_files: List
    allocator: str
    sanitize: Optional[str]
    link_model: str
    dbg: str
    opt: str
    ICECC: Optional[str]
    CCACHE: Optional[str]
    NINJA_PREFIX: str
    VARIANT_DIR: Any


BUILD_PROFILES = {
    # These options were the default settings before implementing build profiles.
    "default":
        BuildProfile(
            ninja="disabled",
            variables_files=[],
            allocator="auto",
            sanitize=None,
            link_model="auto",
            dbg="off",
            opt="auto",
            ICECC=None,
            CCACHE=None,
            NINJA_PREFIX="build",
            VARIANT_DIR=mongo_generators.default_variant_dir_generator,
        ),
    # This build has fast runtime speed & fast build time at the cost of debuggability.
    "fast":
        BuildProfile(
            ninja="enabled",
            variables_files=[
                './etc/scons/mongodbtoolchain_stable_clang.vars',
                './etc/scons/developer_versions.vars',
            ],
            allocator="auto",
            sanitize=None,
            link_model="dynamic",
            dbg="off",
            opt="off",
            ICECC="icecc",
            CCACHE="ccache",
            NINJA_PREFIX="fast",
            VARIANT_DIR="fast",
        ),
    # This build has fast runtime speed & debuggability at the cost of build time.
    "opt":
        BuildProfile(
            ninja="enabled",
            variables_files=[
                './etc/scons/mongodbtoolchain_stable_clang.vars',
                './etc/scons/developer_versions.vars',
            ],
            allocator="auto",
            sanitize=None,
            link_model="dynamic",
            dbg="off",
            opt="on",
            ICECC="icecc",
            CCACHE="ccache",
            NINJA_PREFIX="opt",
            VARIANT_DIR="opt",
        ),
    # This build leverages santizers & is the suggested build profile to use for development.
    "san":
        BuildProfile(
            ninja="enabled",
            variables_files=[
                './etc/scons/mongodbtoolchain_stable_clang.vars',
                './etc/scons/developer_versions.vars',
            ],
            allocator="system",
            sanitize="undefined,address",
            link_model="dynamic",
            dbg="on",
            opt="debug",
            ICECC="icecc",
            CCACHE="ccache",
            NINJA_PREFIX="san",
            VARIANT_DIR="san",
        ),
}