| 1 |
[workspace] |
| 2 |
|
| 3 |
# These are the "root" crates, which we build and test as top-level targets. |
| 4 |
# Their transitive dependencies and dev-dependencies are included automatically |
| 5 |
# and do not need to be listed here. Their external dependencies are vendored |
| 6 |
# into `third_party/rust` by `mach vendor rust`. |
| 7 |
members = [ |
| 8 |
"js/src/rust", |
| 9 |
] |
| 10 |
|
| 11 |
# Excluded crates may be built as dependencies, but won't be considered members |
| 12 |
# of the workspace and their dev-dependencies won't be included. |
| 13 |
exclude = [ |
| 14 |
# Exclude third-party code vendored into mozilla-central. |
| 15 |
"servo", |
| 16 |
"third_party/rust", |
| 17 |
|
| 18 |
# Excluded because these crates have their own Cargo workspaces so they can't |
| 19 |
# be included in the top-level one. |
| 20 |
"gfx/wr", |
| 21 |
|
| 22 |
# Excluded because they are used only as dependencies, not top-level targets, |
| 23 |
# so we don't need to vendor their dev-dependencies. |
| 24 |
"gfx/webrender_bindings", |
| 25 |
"media/mp4parse-rust/mp4parse", |
| 26 |
"media/mp4parse-rust/mp4parse_capi", |
| 27 |
"xpcom/rust/gkrust_utils", |
| 28 |
"toolkit/crashreporter/minidump-analyzer", |
| 29 |
"tools/lint/test/files/clippy", |
| 30 |
"tools/fuzzing/rust", |
| 31 |
"dom/base/rust", |
| 32 |
"dom/origin-trials/ffi", |
| 33 |
"ipc/rust/ipdl_utils", |
| 34 |
|
| 35 |
# Excluded because we don't want to vendor their dependencies. |
| 36 |
"intl/l10n/rust/l10nregistry-tests", |
| 37 |
] |
| 38 |
|
| 39 |
# Use the new dependency resolver to reduce some of the platform-specific dependencies. |
| 40 |
# This is required for 'third_party/rust/wgpu-hal' |
| 41 |
resolver = "2" |
| 42 |
|
| 43 |
[workspace.package] |
| 44 |
rust-version = "1.82.0" |
| 45 |
|
| 46 |
[workspace.dependencies] |
| 47 |
# Shared across multiple UniFFI consumers. |
| 48 |
uniffi = "0.29.2" |
| 49 |
uniffi_bindgen = "0.29.2" |
| 50 |
# Shared across multiple application-services consumers. |
| 51 |
rusqlite = "0.33.0" |
| 52 |
# Shared across multiple glean consumers. |
| 53 |
glean = "=64.3.1" |
| 54 |
|
| 55 |
# Explicitly specify what our profiles use. The opt-level setting here is |
| 56 |
# a total fiction; see the setup of MOZ_RUST_DEFAULT_FLAGS for what the |
| 57 |
# opt-level setting will be as a result of various other configure flags. |
| 58 |
[profile.dev] |
| 59 |
opt-level = 1 |
| 60 |
rpath = false |
| 61 |
lto = false |
| 62 |
debug-assertions = true |
| 63 |
panic = "abort" |
| 64 |
|
| 65 |
[profile.release] |
| 66 |
opt-level = 2 |
| 67 |
rpath = false |
| 68 |
debug-assertions = false |
| 69 |
panic = "abort" |
| 70 |
|
| 71 |
# Optimize build dependencies, because bindgen and proc macros / style |
| 72 |
# compilation take more to run than to build otherwise. |
| 73 |
[profile.dev.build-override] |
| 74 |
opt-level = 1 |
| 75 |
|
| 76 |
[profile.release.build-override] |
| 77 |
opt-level = 1 |
| 78 |
|
| 79 |
# optimizing glsl more makes a big difference in swgl build times |
| 80 |
[profile.dev.package.glsl] |
| 81 |
opt-level = 2 |
| 82 |
|
| 83 |
[profile.release.package.glsl] |
| 84 |
opt-level = 2 |
| 85 |
|
| 86 |
[patch.crates-io] |
| 87 |
# The build system doesn't want those to be used, but they are pulled anyways (because |
| 88 |
# dependencies can't be disabled based on features), but remain unused. We ensure they |
| 89 |
# stay unused by overriding them with crates that contain enough to build the current |
| 90 |
# code and will fail the build in unwanted cases. |
| 91 |
cmake = { path = "build/rust/cmake" } |
| 92 |
vcpkg = { path = "build/rust/vcpkg" } |
| 93 |
|
| 94 |
# Helper crate for integration in the gecko build system. |
| 95 |
mozbuild = { path = "build/rust/mozbuild" } |
| 96 |
|
| 97 |
# Workspace hack |
| 98 |
mozilla-central-workspace-hack = { path = "build/workspace-hack" } |
| 99 |
|
| 100 |
# windows-targets replacement. It avoids the large dependencies of the original |
| 101 |
# crate, which we don't really need as we require MSVC anyways. |
| 102 |
windows-targets = { path = "build/rust/windows-targets" } |
| 103 |
|
| 104 |
# Patch windows to use a non-vendored local copy of the crate. |
| 105 |
windows = { path = "build/rust/windows" } |
| 106 |
|
| 107 |
# Dummy oslog replacement. It's only used by glean in code that is not actually used. |
| 108 |
oslog = { path = "build/rust/oslog" } |
| 109 |
|
| 110 |
# Override terminal_size with a dummy crate that returns a fixed 80x25 terminal size. |
| 111 |
terminal_size = { path = "build/rust/terminal_size" } |
| 112 |
|
| 113 |
# Patch bitflags 1.0 to 2.0 |
| 114 |
bitflags = { path = "build/rust/bitflags" } |
| 115 |
|
| 116 |
# Patch r-efi to an empty crate |
| 117 |
r-efi = { path = "build/rust/r-efi" } |
| 118 |
|
| 119 |
# Patch redox_users to an empty crate |
| 120 |
redox_users = { path = "build/rust/redox_users" } |
| 121 |
|
| 122 |
# Patch redox_syscall to an empty crate |
| 123 |
redox_syscall = { path = "build/rust/redox_syscall" } |
| 124 |
|
| 125 |
# Patch hermit-abi to an empty crate |
| 126 |
hermit-abi = { path = "build/rust/hermit-abi" } |
| 127 |
|
| 128 |
# Patch base64 0.13 to 0.22 |
| 129 |
base64_13 = { package = "base64", path = "build/rust/base64_13" } |
| 130 |
|
| 131 |
# Patch base64 0.21 to 0.22 |
| 132 |
base64_21 = { package = "base64", path = "build/rust/base64" } |
| 133 |
|
| 134 |
# Patch wasi 0.10 to 0.14 |
| 135 |
wasi_0_10 = { package = "wasi", path = "build/rust/wasi-0.10" } |
| 136 |
|
| 137 |
# Patch wasi 0.11 to 0.14 |
| 138 |
wasi_0_11 = { package = "wasi", path = "build/rust/wasi" } |
| 139 |
|
| 140 |
# tokio 0.29.0 includes an experimental "tracing" feature which requires |
| 141 |
# backtrace ^0.3.58 and the `tokio_unstable` flag. We don't use it, and nothing |
| 142 |
# else we do use requires backtrace, so dummy it out for now. |
| 143 |
backtrace = { path = "build/rust/backtrace" } |
| 144 |
|
| 145 |
# Patch bindgen 0.63 to 0.69 |
| 146 |
bindgen_0_63 = { package = "bindgen", path = "build/rust/bindgen-0.63" } |
| 147 |
# Locally patch bindgen for https://github.com/rust-lang/rust-bindgen/pull/2824 |
| 148 |
# and for bug 1945218 |
| 149 |
bindgen = { path = "third_party/rust/bindgen" } |
| 150 |
|
| 151 |
# Patch nix 0.26 to 0.30+ |
| 152 |
nix_0_26 = { package = "nix", path = "build/rust/nix" } |
| 153 |
|
| 154 |
# Patch nix 0.29 to 0.30+ |
| 155 |
nix_0_30 = { package = "nix", path = "build/rust/nix-0.29" } |
| 156 |
|
| 157 |
# Patch derive_more 0.99 to 1.0.0-beta |
| 158 |
derive_more = { path = "build/rust/derive_more" } |
| 159 |
|
| 160 |
# Patch autocfg to hide rustc output. Workaround for https://github.com/cuviper/autocfg/issues/30 |
| 161 |
autocfg = { path = "third_party/rust/autocfg" } |
| 162 |
|
| 163 |
# Patch goblin 0.7.0 to 0.8 |
| 164 |
goblin = { path = "build/rust/goblin" } |
| 165 |
|
| 166 |
# Implement getrandom 0.2 in terms of 0.3 |
| 167 |
getrandom = { path = "build/rust/getrandom" } |
| 168 |
|
| 169 |
# Patch rustc-hash 1.1.0 to 2.1.1 |
| 170 |
rustc-hash = { path = "build/rust/rustc-hash" } |
| 171 |
|
| 172 |
# Patch memoffset from 0.8.0 to 0.9.0 since it's compatible and it avoids duplication |
| 173 |
memoffset = { path = "build/rust/memoffset" } |
| 174 |
|
| 175 |
# Patch `hashbrown` 0.13.* to depend on 0.15.* |
| 176 |
hashbrown_0_13 = { package = "hashbrown", path = "build/rust/hashbrown-0.13" } |
| 177 |
|
| 178 |
# Patch `hashbrown` 0.14.* to depend on 0.15.* |
| 179 |
hashbrown_0_14 = { package = "hashbrown", path = "build/rust/hashbrown" } |
| 180 |
|
| 181 |
# Patch `socket2` 0.4 to 0.5 |
| 182 |
socket2 = { path = "build/rust/socket2" } |
| 183 |
|
| 184 |
# Patch `thiserror` 1 to 2. |
| 185 |
thiserror = { path = "build/rust/thiserror" } |
| 186 |
|
| 187 |
# The following overrides point to dummy projects, as a temporary measure until this is resolved: |
| 188 |
# https://github.com/rust-lang/cargo/issues/6179 |
| 189 |
js-sys = { path = "build/rust/dummy-web/js-sys" } |
| 190 |
wasm-bindgen = { path = "build/rust/dummy-web/wasm-bindgen" } |
| 191 |
web-sys = { path = "build/rust/dummy-web/web-sys" } |
| 192 |
|
| 193 |
|
| 194 |
# Upgrade `core-foundation` 0.9.* to 0.10. |
| 195 |
core-foundation = { path = "build/rust/core-foundation" } |
| 196 |
# Patch `core-graphics-types` 0.1.* to 0.2. |
| 197 |
core-graphics-types = { path = "build/rust/core-graphics-types" } |
| 198 |
|
| 199 |
# Patch `half` 1.* to 2. |
| 200 |
half = { path = "build/rust/half" } |
| 201 |
|
| 202 |
# Upgrade `rusqlite` 0.31 to 0.33. |
| 203 |
rusqlite = { path = "build/rust/rusqlite" } |
| 204 |
|
| 205 |
# Patch `itertools` 0.10.* to 0.14. |
| 206 |
itertools = { path = "build/rust/itertools" } |
| 207 |
|
| 208 |
# Overrides to allow easier use of common internal crates. |
| 209 |
|
| 210 |
# Patch `rure` to disable building the cdylib and staticlib targets |
| 211 |
# Cargo has no way to disable building targets your dependencies provide which |
| 212 |
# you don't depend on, and linking the cdylib breaks during instrumentation |
| 213 |
# builds. |
| 214 |
# Workaround for https://github.com/rust-lang/cargo/issues/11232 |
| 215 |
rure = { path = "third_party/rust/rure" } |
| 216 |
|
| 217 |
# Patch `plist` to work with `indexmap` 2.* |
| 218 |
plist = { path = "third_party/rust/plist" } |
| 219 |
|
| 220 |
# Patch `unicode-width` 0.1.* to 0.2. |
| 221 |
unicode-width = { path = "build/rust/unicode-width" } |
| 222 |
|
| 223 |
# To-be-published changes. |
| 224 |
unicode-bidi = { git = "https://github.com/servo/unicode-bidi", rev = "ca612daf1c08c53abe07327cb3e6ef6e0a760f0c" } |
| 225 |
nss-gk-api = { git = "https://github.com/beurdouche/nss-gk-api", rev = "e48a946811ffd64abc78de3ee284957d8d1c0d63" } |
| 226 |
cssparser = { git = "https://github.com/servo/rust-cssparser", rev = "958a3f098acb92ddacdce18a7ef2c4a87ac3326f" } |
| 227 |
|
| 228 |
# Other overrides |
| 229 |
any_all_workaround = { git = "https://github.com/hsivonen/any_all_workaround", rev = "7fb1b7034c9f172aade21ee1c8554e8d8a48af80" } |
| 230 |
chardetng = { git = "https://github.com/hsivonen/chardetng", rev = "3484d3e3ebdc8931493aa5df4d7ee9360a90e76b" } |
| 231 |
chardetng_c = { git = "https://github.com/hsivonen/chardetng_c", rev = "ed8a4c6f900a90d4dbc1d64b856e61490a1c3570" } |
| 232 |
coremidi = { git = "https://github.com/chris-zen/coremidi.git", rev = "fc68464b5445caf111e41f643a2e69ccce0b4f83" } |
| 233 |
cose = { git = "https://github.com/franziskuskiefer/cose-rust", rev = "43c22248d136c8b38fe42ea709d08da6355cf04b" } |
| 234 |
icu_capi = { path = "intl/icu_capi" } |
| 235 |
icu_segmenter_data = { path = "intl/icu_segmenter_data" } |
| 236 |
midir = { git = "https://github.com/mozilla/midir.git", rev = "85156e360a37d851734118104619f86bd18e94c6" } |
| 237 |
# Allow webrender to have a versioned dependency on the older crate on crates.io |
| 238 |
# in order to build standalone. |
| 239 |
# Use the in-tree code instead of pulling it in. It matches the crates.io version |
| 240 |
# Make --enable-rust-simd compatible with Rust 1.95 |
| 241 |
encoding_rs = { git = "https://github.com/hsivonen/encoding_rs", rev = "1236d1bc423e6ba35a06485f74a6304db2d703b5" } |
| 242 |
|
| 243 |
# objc 0.2.7 + fa7ca43b862861dd1cd000d7ad01e6e0266cda13 |
| 244 |
objc = { git = "https://github.com/glandium/rust-objc", rev = "4de89f5aa9851ceca4d40e7ac1e2759410c04324" } |
| 245 |
|
| 246 |
# allocator-api2 + f95e3419ce41883904fcb2279b52aa35b5f04d76 + fdd92751afa7ce34408b677004b429d597e72c90 |
| 247 |
allocator-api2 = { git = "https://github.com/glandium/allocator-api2", rev = "ad5f3d56a5a4519eff52af4ff85293431466ef5c" } |
| 248 |
|
| 249 |
# application-services overrides to make updating them all simpler. |
| 250 |
context_id = { git = "https://github.com/mozilla/application-services", rev = "f5907a411e52a3985d0369d71c486eb507c2c4e6" } |
| 251 |
interrupt-support = { git = "https://github.com/mozilla/application-services", rev = "f5907a411e52a3985d0369d71c486eb507c2c4e6" } |
| 252 |
relevancy = { git = "https://github.com/mozilla/application-services", rev = "f5907a411e52a3985d0369d71c486eb507c2c4e6" } |
| 253 |
search = { git = "https://github.com/mozilla/application-services", rev = "f5907a411e52a3985d0369d71c486eb507c2c4e6" } |
| 254 |
sql-support = { git = "https://github.com/mozilla/application-services", rev = "f5907a411e52a3985d0369d71c486eb507c2c4e6" } |
| 255 |
suggest = { git = "https://github.com/mozilla/application-services", rev = "f5907a411e52a3985d0369d71c486eb507c2c4e6" } |
| 256 |
sync15 = { git = "https://github.com/mozilla/application-services", rev = "f5907a411e52a3985d0369d71c486eb507c2c4e6" } |
| 257 |
tabs = { git = "https://github.com/mozilla/application-services", rev = "f5907a411e52a3985d0369d71c486eb507c2c4e6" } |
| 258 |
viaduct = { git = "https://github.com/mozilla/application-services", rev = "f5907a411e52a3985d0369d71c486eb507c2c4e6" } |
| 259 |
webext-storage = { git = "https://github.com/mozilla/application-services", rev = "f5907a411e52a3985d0369d71c486eb507c2c4e6" } |