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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
# Copyright 2023 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# Provides per-crate and overall configuration options to gnrt.
#
# Most commonly needed configuration options can be found in the top-level doc
# comment in //third_party/rust/chromium_crates_io/gnrt_config.toml. As a
# fallback, one may also read the doc comments in
# `//tools/crates/gnrt/lib/config.rs` (e.g. `CrateConfig`'s fields correspond
# to per-crate options).
[]
# `/build/rust/std/fake_root` is an artificial crate that depends on a
# `sysroot` crate from `//third_party/rust-src/library/sysroot` while also
# turning on all the required crate features of `sysroot`. `sysroot` includes
# all sysroot libraries as dependencies.
= "fake_root"
# Workaround for Cargo issue: hashbrown's Cargo.toml uses an unstable Cargo
# feature that leads to incorrect `cargo metadata` output.
#
# TODO(https://github.com/rust-lang/cargo/issues/10801): remove workaround once
# issue is fixed.
= ['allocator-api2', 'shlex']
[]
= "BUILD.gn.hbs"
[]
# std crates should have metadata applied to them. This would avoid any symbol
# conflicts between std dependencies and third_party/rust crates.
#
# However, we can't apply it yet. GN can't automatically clean old artifacts,
# nor can we delete and rebuild the sysroot on every build.
#
# TODO(crbug.com/40196262): set up GN rules to rebuilt the sysroot only when
# needed. Then set this metadata.
#
# rustc_metadata = "libstd"
= { = true }
[]
= { = [ "core" ] }
[]
# Dependencies of profiler_builtins must have instrumentation disabled.
#
# compiler_builtins should build with one codegen unit per builtin. See
# https://github.com/rust-lang/rust/blob/1.93.0/library/Cargo.toml#L19-L23
# TODO(crbug.com/507831026): Remove use_libm_configure when we next roll rust.
= { = false, = true, = true }
= [
# TODO(crbug.com/507831026): Change this to `../../libm/configure.rs` when we next roll rust
'../configure.rs',
]
= [
'../../libm/src',
]
[]
= [
'**/*.md',
'../../portable-simd/crates/core_simd/src/core_simd_docs.md',
'../../portable-simd/crates/core_simd/src/**/*.rs',
'../../stdarch/crates/core_arch/src/core_arch_docs.md',
'../../stdarch/crates/core_arch/src/**/*.rs',
]
[]
# Dependencies of profiler_builtins must have instrumentation disabled
= false
= true
= { = [] }
[]
# Workaround for Cargo issue: hashbrown's Cargo.toml uses an unstable Cargo
# feature that leads to incorrect `cargo metadata` output.
#
# TODO(https://github.com/rust-lang/cargo/issues/10801): remove workaround once
# issue is fixed.
= ['allocator-api2']
[]
# This target is #[no_core] when included by std, which is incompatible with
# profiling.
= { = false }
[]
# The build script is used to compile a profiler-rt library, but we get
# the profiler rt library from clang, so we skip this.
#
# profiler_builtins cannot depend on itself, which it would if build with
# instrumentation.
= { = false, = true }
[]
# This target is #[no_core] which is incompatible with profiling.
= { = false }
[]
# Dependencies of profiler_builtins must have instrumentation disabled
= { = false }
[]
= [
'../../backtrace/src',
'../../core/**/*.md',
'../../core/src/primitive_docs.rs',
'../../portable-simd/crates/core_simd/src/core_simd_docs.md',
'../../portable-simd/crates/std_float/src',
'../../stdarch/crates/core_arch/src/core_arch_docs.md',
]
# Remove this from std. It will be depended on directly when needed.
= ['profiler_builtins']
[]
= true
= { = [ "alloc", "core" ] }
[]
# test only depends on proc_macro as an internal detail of the Rust build, so
# it's implicitly included with std/test. However, we list the std crates and
# construct the sysroot explicitly. We don't need this, and we don't even want
# it during cross-compiles (since we will only build host proc_macro crates).
= ['proc_macro']
[]
# The build script is used to set up the link directives which we skip below.
# It uses `cc` to run a compiler to do so, which we don't support in build
# scripts.
#
# Suppress link directives since we specify the deps in GN configs.
= { = true, = true }
[]
# This target is #[no_core] which is incompatible with profiling.
= { = false }