-
Notifications
You must be signed in to change notification settings - Fork 18
/
Cargo.toml
210 lines (178 loc) · 6.9 KB
/
Cargo.toml
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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
cargo-features = [
# Allows setting a different target triple on a per-crate level. This is
# required to include platform crates (which require specific target
# triples) in the main workspace.
#
# See: https://doc.rust-lang.org/cargo/reference/unstable.html#per-package-target
"per-package-target",
# Some platform implementations require specific RUSTFLAGS environment
# variables to configure the compiler's behavior, such as setting linker
# arguments. This unstable feature allows us to configure these RUSTFLAGS in
# the Cargo.toml on a per-crate basis, rather than requiring a separate
# `.cargo/config.toml` in each platform crate (and necessitating `cd`ing
# into those crates' directories in order to build the crate).
#
# See: https://doc.rust-lang.org/cargo/reference/unstable.html#profile-rustflags-option
"profile-rustflags",
]
[workspace]
resolver = "2"
members = [
# mnemOS source
"source/*",
# tools
"tools/*",
# platforms
"platforms/allwinner-d1",
"platforms/allwinner-d1/d1-config",
"platforms/allwinner-d1/d1-core",
"platforms/beepy",
"platforms/esp32c3-buddy",
"platforms/melpomene",
"platforms/melpomene/melpo-config",
"platforms/x86_64/*",
"platforms/pomelo",
]
# By default, run cargo commands without a specific package against everything
# that can build cross-platform. This avoids incompatible feature unification
# while running `cargo check`/`cargo fmt`/etc for most workspace crates.
#
# Incompatible crates are checked/built/formatted/documented individually by the
# `just check`, `just clippy`, `just docs`, and `just fmt` Just recipes.
default-members = [
# mnemOS source
"source/*",
# tools
# note that this skips `manganese` by default, so that we don't build its
# dependency features when running `cargo check --all-features` and similar.
#
# also, crowtty is excluded by default, as it depends on `libudev` on Linux,
# and we would like to be able to build documentation without having to
# install libudev on CI.
"tools/libcrowtty",
"tools/dumbloader",
"tools/f3repl",
"tools/x86_64-bootimager",
# platforms
"platforms/melpomene",
"platforms/melpomene/melpo-config",
"platforms/allwinner-d1/d1-config",
"platforms/allwinner-d1/d1-core",
]
# this isn't actually a crate
exclude = ["source/notes"]
### workspace dependencies ###
[workspace.package]
edition = "2021"
repository = "https://github.com/tosc-rs/mnemos"
homepage = "https://mnemos.dev"
license = "MIT OR Apache-2.0"
[workspace.dependencies]
cordyceps = { version = "0.3", default-features = false }
hal-core = { version = "0.1.0" }
maitake = { version = "0.1.0", default-features = false }
miette = "7.2"
mycelium-alloc = { version = "0.1.0", features = ["buddy", "bump"] }
mycelium-bitfield = { version = "0.1.5" }
mycelium-util = { version = "0.1.0" }
### profile settings ###
[profile.release]
lto = 'thin' # better optimizations at a lower cost
# symbols are nice and they don't increase the size on Flash
debug = true
## profile settings for D1 ##
[profile.release.package.mnemos-d1]
codegen-units = 1 # better optimizations
# faster optimizations --- we don't need opt-level='s'/'z' on D1, since we have
# a whopping 1GB of RAM!
opt-level = 3
[profile.dev.package.mnemos-d1]
# faster optimizations --- we don't need opt-level='s'/'z' on D1, since we have
# a whopping 1GB of RAM!
opt-level = 3
## profile settings for esp32c3-buddy ##
[profile.release.package.mnemos-esp32c3-buddy]
codegen-units = 1 # better optimizations
# opt-level='z' is broken on esp32c3.
#
# See: https://github.com/esp-rs/esp-hal/pull/198
opt-level = "s"
rustflags = [
"-C", "link-arg=-Tlinkall.x",
# Required to obtain backtraces (e.g. when using the "esp-backtrace" crate.)
# NOTE: May negatively impact performance of produced code
"-C", "force-frame-pointers",
]
[profile.dev.package.mnemos-esp32c3-buddy]
codegen-units = 1 # better optimizations
# opt-level='z' is broken on esp32c3.
#
# See: https://github.com/esp-rs/esp-hal/pull/198
opt-level = "s"
# symbols are nice and they don't increase the size on Flash
rustflags = [
"-C", "link-arg=-Tlinkall.x",
# Required to obtain backtraces (e.g. when using the "esp-backtrace" crate.)
# NOTE: May negatively impact performance of produced code
"-C", "force-frame-pointers",
]
## profile settings for x86_64 ##
[profile.release.package.mnemos-x86_64]
codegen-units = 1 # better optimizations
# faster optimizations --- we don't need to optimize for size on x86
opt-level = 3
[profile.dev.package.mnemos-x86_64]
# faster optimizations --- we don't need to optimize for size on x86
opt-level = 3
## profile settings for host tools ##
[profile.release.package.crowtty]
# only generate the debuginfo needed for backtraces, speeding
# up the build a bit.
debug = "line-tables-only"
[profile.release.package.melpomene]
# only generate the debuginfo needed for backtraces, speeding
# up the build a bit.
debug = "line-tables-only"
### patches ###
[patch.crates-io.maitake]
git = "https://github.com/hawkw/mycelium"
rev = "ba56bb4d02f46fb59754b7b88bddc2e8ca99c1f5"
[patch.crates-io.mycelium-alloc]
git = "https://github.com/hawkw/mycelium"
rev = "ba56bb4d02f46fb59754b7b88bddc2e8ca99c1f5"
# Use the `mycelium-bitfield` crate from the Mycelium monorepo rather than
# crates.io.
# NOTE: this patch, unlike the patches for `maitake` and `mycelium-util`, (which
# are unpublished), is not *strictly* necessary, as `mycelium-bitfield` *is*
# published to crates.io. However, we may as well depend on the git version,
# since it's already in our dependency tree as a transitive dep of `maitake` ---
# having both a Git dep and a crates.io dep seems unfortunate.
[patch.crates-io.mycelium-bitfield]
git = "https://github.com/hawkw/mycelium"
rev = "ba56bb4d02f46fb59754b7b88bddc2e8ca99c1f5"
[patch.crates-io.mycelium-util]
git = "https://github.com/hawkw/mycelium"
rev = "ba56bb4d02f46fb59754b7b88bddc2e8ca99c1f5"
[patch.crates-io.cordyceps]
git = "https://github.com/hawkw/mycelium"
rev = "ba56bb4d02f46fb59754b7b88bddc2e8ca99c1f5"
[patch.crates-io.hal-core]
git = "https://github.com/hawkw/mycelium"
rev = "ba56bb4d02f46fb59754b7b88bddc2e8ca99c1f5"
[patch.crates-io.hal-x86_64]
git = "https://github.com/hawkw/mycelium"
rev = "ba56bb4d02f46fb59754b7b88bddc2e8ca99c1f5"
[patch.crates-io.bbq10kbd]
git = "https://github.com/hawkw/bbq10kbd"
branch = "eliza/async"
# necessary to avoid `esp32c3-hal` depending on `log` with version `=0.4.18`,
# which clashes with the `nextest` dependency of `log` `^0.4.19`. lol. lmao.
[patch.crates-io.esp32c3-hal]
git = "https://github.com/esp-rs/esp-hal"
rev = "5a8be302b4049a6ebc17bd712d97c85a9fd83f76"
[patch.crates-io.esp-hal-common]
git = "https://github.com/esp-rs/esp-hal"
rev = "5a8be302b4049a6ebc17bd712d97c85a9fd83f76"
[patch.crates-io.esp-hal-procmacros]
git = "https://github.com/esp-rs/esp-hal"
rev = "5a8be302b4049a6ebc17bd712d97c85a9fd83f76"