1
- [build ]
2
- # - On systems that do not use lld as the system linker (such as Solus) using
3
- # lld directly saves about a second of build time for incremental compiles
4
- # for building boulder (from 2.191s to 1.198s on Reilly's machine).
5
- # - The new symbol mangling format[1] improves the backtrace shown by
6
- # RUST_BACKTRACE=1 and other debug utilities. It should also be helpful once
7
- # we have ABI reports. Upstream hasn't switched to it yet by default due to
8
- # stable distros not having new enough tools, but that doesn't matter for us
9
- # [1]: https://doc.rust-lang.org/rustc/symbol-mangling/v0.html
10
- rustflags = [
11
- " -Clink-arg=-fuse-ld=lld" ,
12
- " -Csymbol-mangling-version=v0" ,
13
- ]
14
-
15
1
[profile .release ]
16
2
lto = " thin"
17
3
@@ -20,7 +6,7 @@ lto = "thin"
20
6
# and full backtraces. Hyperfine tests shows opt-level = 1 to be a good
21
7
# compromise between compile speed and runtime speed.
22
8
# During testing, opt-level = 2 caused a non-trivial slowdown in compilation
23
- # iteration speed, but also sped up execution times commensurably.
9
+ # iteration speed, but also sped up execution times commensurably. /ermo
24
10
[profile .onboarding ]
25
11
inherits = " dev"
26
12
opt-level = 1
@@ -37,29 +23,49 @@ opt-level = 3
37
23
strip = " none"
38
24
debug = true
39
25
40
- # This build profile is for packaging on Serpent, where we control the toolchain.
41
- # Hence, we can get away with adding rustflags here that we know are present
42
- # in the Serpent toolchain builds.
26
+ # Having a way to detect on which system we are compiled means we can get
27
+ # away with adding rustflags here that we know are present in the Serpent
28
+ # toolchain builds.
43
29
#
44
30
# We can set these extra flags via matching on a target cfg() expression.
45
31
#
46
- # This requires that we set a custom cfg value for the Serpent rustc at compile time,
47
- # which the cfg() expression can then match against, so that this target is _only_
48
- # selected for Serpent-native builds
32
+ # This requires that we set a custom cfg value for the Serpent rustc at
33
+ # compile time, which the cfg() expression can then match against, so that
34
+ # this target is _only_ selected for Serpent-native builds
49
35
#
50
- # Note that target rustflags take precedence over the build.rustflags specified above.
36
+ # - On systems that do not use lld as the system linker (such as Solus) using
37
+ # lld directly saves about a second of build time for incremental compiles
38
+ # for building boulder (from 2.191s to 1.198s on Reilly's machine).
51
39
#
52
- # So in addition to the above [build] settings:
53
- # - Add compression of debug symbols with zstd, which shrinks the dev profile
40
+ # - In testing, compression of debug symbols with zstd shrinks the dev profile
54
41
# boulder binary from 206.03MB to 81.44MB, a 124.59MB or ~60% savings.
55
42
# It doesn't affect the binary size for packaging builds since we strip those,
56
43
# but the debug symbols are reduced in size from 113.16MB to 34.63MB.
57
44
# It adds about ~152ms to the build times which is less than we gained by
58
- # switching to lld.
45
+ # switching to lld. This feature requires a compiler compiled with support
46
+ # for zstd debug symbols.
59
47
#
60
- # [target.'cfg(all(custom_value = "serpent"))']
61
- # rustflags = [
62
- # "-Clink-arg=-fuse-ld=lld",
63
- # "-Csymbol-mangling-version=v0",
64
- # "-Clink-arg=-Wl,--compress-debug-sections=zstd",
65
- # ]
48
+ # - The new symbol mangling format[1] improves the backtrace shown by
49
+ # RUST_BACKTRACE=1 and other debug utilities. It should also be helpful once
50
+ # we have ABI reports. Upstream hasn't switched to it yet by default due to
51
+ # stable distros not having new enough tools, but that doesn't matter for us
52
+ # [1]: https://doc.rust-lang.org/rustc/symbol-mangling/v0.html
53
+ #
54
+
55
+ # NB: os_release patterns need to be added to both target configs for this to
56
+ # work...
57
+ #
58
+ # The Solus toolchain supports zstd debug sections currently (Serpent doesn't)
59
+ [target .'cfg(any(os_release_id = "solus"))' ]
60
+ rustflags = [
61
+ " -Clink-arg=-fuse-ld=lld" ,
62
+ " -Clink-arg=-Wl,--compress-debug-sections=zstd" ,
63
+ " -Csymbol-mangling-version=v0" ,
64
+ ]
65
+
66
+ # Default flags
67
+ [target .'cfg(not(any(os_release_id = "solus")))' ]
68
+ rustflags = [
69
+ " -Clink-arg=-fuse-ld=lld" ,
70
+ " -Csymbol-mangling-version=v0" ,
71
+ ]
0 commit comments