-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgnrt_config.toml
More file actions
138 lines (121 loc) · 5.2 KB
/
gnrt_config.toml
File metadata and controls
138 lines (121 loc) · 5.2 KB
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
# 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.
# This file configures how to generate GN rules for third-party Rust crates.
#
# `[crate.foo]` sections below can configure generation of `BUILD.gn` and/or
# `README.chromium` by specifying the following options:
#
# allow_first_party_usage: If false, the crate should not be visible to first
# party code even though it is present in the Cargo.toml file. It defaults to
# true. Use this if you need to control features for a crate that is only
# meant for use as a transitive dependency of third-party crates.
# e.g. allow_first_party_usage = false
#
# ban_features: A list of crate features that are disallowed in Chromium.
# Typically `ban_features` is used when a crate-feature-gated code failed or
# hasn't gone through a security audit.
#
# build_script_outputs: A list of file paths, rooted from where the BUILD.gn
# file is located, of files generated by the crate's build script.
# e.g. build_script_outputs = [ "crate/src/gen/gen_stuff.rs" ]
#
# extra_input_roots: A list of additional arbitrary files and/or directories
# that are part of the crate (these need to be listed as `inputs` in the
# generated `BUILD.gn`). An example scenario that needs `extra_input_roots`
# is when a crate uses `include_str!` to include `README.md` as a doc
# comment.
#
# extra_src_roots: A list of additional Rust sources that come from outside of
# the crate's `src` directory (these need to be added to `sources` in the
# generated `BUILD.gn`). An example scenario that needs `extra_src_roots` is
# when a crate uses generated code via `include!("../generated/foo.rs")`.
#
# group: One of 'safe', 'sandbox', or 'test. This indicates where the library
# is allowed to be used and where its GN rules will be written.
#
# The group of least privilege is inherited by a crate C from all crates that
# depend on C transitively. For crates listed in Cargo.toml, and not depended
# on by other crates, the default is 'safe'.
# TODO(danakj): The default should probably be 'sandbox'?
#
# 'safe': The library satisfies the rule-of-2 and can be used in any process.
# 'sandbox': The library does not satisfy the rule-of-2 and must be used in
# a sandboxed process such as the renderer or a utility process.
# 'test': The library is only used in tests.
#
# license: The name of the license. This should normally be populated from the
# crate's Cargo.toml, but it can be specified to override it.
#
# license_files: A list of license files, relative to the crate's root.
# This is normally found automatically based on convention, but it can be
# specified to override it. A license file is expected for all shipped
# libraries.
#
# security_critical: A boolean that overrides if the crate is marked security-
# critical in the README.chromium. It defaults to true if the crate is not in
# the 'test' group/.
#
# shipped: A boolean that overrides if the crate is marked shipped in the
# README.chromium. It defaults to true if the crate is not in the 'test'
# group.
#
# bin_targets: A list of binary target names to cover. This list is empty by
# default, which means that the default generated `BUILD.gn` will only cover
# the library target (if any) of the package.
#
# Additional, less commonly needed options can also be discovered by reading
# the doc comments in `//tools/crates/gnrt/lib/config.rs` (e.g. `CrateConfig`'s
# fields correspond to per-crate options like `extra_input_roots`).
[gn]
build_file_template = "BLUE_BUILD.gn.hbs"
readme_file_template = "README.blueos.hbs"
removed_cargo_template = "removed_Cargo.toml.hbs"
removed_librs_template = "removed_lib.rs.hbs"
[vet]
config_template = "vet_config.toml.hbs"
[resolve]
root = "bluekernel_crates_io"
# These crates are dependencies in some configurations, but we don't use them.
remove_crates = [
# C/C++ dependencies must be explicitly writting in GN rules somehow.
'cc',
'link-cplusplus',
'shlex',
# minimal-lexical is unsound see https://crrev.com/c/4977110 for more info.
# It is a dependency of nom, but not actually used.
'minimal-lexical',
# Windows targets that we do not ever target.
'windows_aarch64_gnullvm',
'windows_i686_gnu',
'windows_i686_gnullvm',
'windows_x86_64_gnu',
'windows_x86_64_gnullvm',
# Behind a feature that we do not enable.
'wasi'
]
[crate.defmt]
license_files = ["LICENSE-APACHE", "LICENSE-MIT"]
[crate.defmt-parser]
license_files = ["LICENSE-APACHE", "LICENSE-MIT"]
[crate.defmt-macros]
license_files = ["LICENSE-APACHE", "LICENSE-MIT"]
[crate.delegate]
license_files = ["LICENSE-APACHE", "LICENSE-MIT"]
[crate.siphasher]
license_files = ["README.md"]
[crate.tock-registers]
license_files = ["LICENSE-APACHE", "LICENSE-MIT"]
[crate.void]
license_files = ["LICENSE-APACHE", "LICENSE-MIT"]
[crate.managed]
license_files = ["LICENSE-APACHE", "LICENSE-MIT"]
[crate.gd32e5]
license_files = ["LICENSE-APACHE", "LICENSE-MIT"]
[crate.bare-metal]
license_files = ["LICENSE-APACHE", "LICENSE-MIT"]
[crate.smoltcp]
license_files = ["LICENSE-0BSD.txt"]
build_script_outputs = [ "config.rs" ]
[crate.thiserror]
build_script_outputs = [ "private.rs" ]