Backed out changeset f9ccd9f31b9c (bug 1917901) for causing networking crashes. a...
[gecko.git] / Cargo.toml
blobc8e483f79341e3b571a10f3640ee2eba9909a160
1 [workspace]
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   "browser/app/nmhproxy/",
9   "js/src/frontend/smoosh",
10   "js/src/rust",
11   "netwerk/base/idna_glue",
12   "netwerk/test/http3server",
13   "security/manager/ssl/builtins",
14   "security/manager/ssl/tests/unit/test_builtins",
15   "security/manager/ssl/ipcclientcerts",
16   "security/manager/ssl/osclientcerts",
17   "testing/geckodriver",
18   "toolkit/components/uniffi-bindgen-gecko-js",
19   "toolkit/crashreporter/client/app",
20   "toolkit/crashreporter/minidump-analyzer/android/export",
21   "toolkit/crashreporter/mozwer-rust",
22   "toolkit/crashreporter/rust_minidump_writer_linux",
23   "toolkit/library/gtest/rust",
24   "toolkit/library/rust/",
27 # Excluded crates may be built as dependencies, but won't be considered members
28 # of the workspace and their dev-dependencies won't be included.
29 exclude = [
30   # Exclude third-party code vendored into mozilla-central.
31   "servo",
32   "third_party/rust",
34   # Excluded because these crates have their own Cargo workspaces so they can't
35   # be included in the top-level one.
36   "gfx/wr",
38   # Excluded because they are used only as dependencies, not top-level targets,
39   # so we don't need to vendor their dev-dependencies.
40   "gfx/webrender_bindings",
41   "media/mp4parse-rust/mp4parse",
42   "media/mp4parse-rust/mp4parse_capi",
43   "xpcom/rust/gkrust_utils",
44   "toolkit/crashreporter/minidump-analyzer",
45   "tools/lint/test/files/clippy",
46   "tools/fuzzing/rust",
47   "dom/base/rust",
48   "dom/origin-trials/ffi",
49   "ipc/rust/ipdl_utils",
51   # Excluded because we don't want to vendor their dependencies.
52   "intl/l10n/rust/l10nregistry-tests",
55 # Use the new dependency resolver to reduce some of the platform-specific dependencies.
56 # This is required for 'third_party/rust/wgpu-hal'
57 resolver = "2"
59 [workspace.dependencies]
60 # Shared across multiple UniFFI consumers.
61 uniffi = "0.28.2"
62 uniffi_bindgen = "0.28.2"
63 # Shared across multiple application-services consumers.
64 rusqlite = "0.31.0"
65 # Shared across multiple glean consumers.
66 glean = "=62.0.0"
68 # Explicitly specify what our profiles use.  The opt-level setting here is
69 # a total fiction; see the setup of MOZ_RUST_DEFAULT_FLAGS for what the
70 # opt-level setting will be as a result of various other configure flags.
71 [profile.dev]
72 opt-level = 1
73 rpath = false
74 lto = false
75 debug-assertions = true
76 panic = "abort"
78 [profile.release]
79 opt-level = 2
80 rpath = false
81 debug-assertions = false
82 panic = "abort"
84 # Optimize build dependencies, because bindgen and proc macros / style
85 # compilation take more to run than to build otherwise.
86 [profile.dev.build-override]
87 opt-level = 1
89 [profile.release.build-override]
90 opt-level = 1
92 # optimizing glsl more makes a big difference in swgl build times
93 [profile.dev.package.glsl]
94 opt-level = 2
96 [profile.release.package.glsl]
97 opt-level = 2
99 [patch.crates-io]
100 # The build system doesn't want those to be used, but they are pulled anyways (because
101 # dependencies can't be disabled based on features), but remain unused. We ensure they
102 # stay unused by overriding them with crates that contain enough to build the current
103 # code and will fail the build in unwanted cases.
104 cmake = { path = "build/rust/cmake" }
105 vcpkg = { path = "build/rust/vcpkg" }
107 # Helper crate for integration in the gecko build system.
108 mozbuild = { path = "build/rust/mozbuild" }
110 # Workspace hack
111 mozilla-central-workspace-hack = { path = "build/workspace-hack" }
113 # windows-targets replacement. It avoids the large dependencies of the original
114 # crate, which we don't really need as we require MSVC anyways.
115 windows-targets = { path = "build/rust/windows-targets" }
117 # Patch windows to use a non-vendored local copy of the crate.
118 windows = { path = "build/rust/windows" }
120 # Dummy oslog replacement. It's only used by glean in code that is not actually used.
121 oslog = { path = "build/rust/oslog" }
123 # Override terminal_size with a dummy crate that returns a fixed 80x25 terminal size.
124 terminal_size = { path = "build/rust/terminal_size" }
126 # Patch bitflags 1.0 to 2.0
127 bitflags = { path = "build/rust/bitflags" }
129 # Patch redox_users to an empty crate
130 redox_users = { path = "build/rust/redox_users" }
132 # Patch redox_syscall to an empty crate
133 redox_syscall = { path = "build/rust/redox_syscall" }
135 # Patch hermit-abi to an empty crate
136 hermit-abi = { path = "build/rust/hermit-abi" }
138 # Patch base64 0.13 to 0.21
139 base64 = { path = "build/rust/base64" }
141 # Patch wasi 0.10 to 0.11
142 wasi = { path = "build/rust/wasi" }
144 # tokio 0.29.0 includes an experimental "tracing" feature which requires
145 # backtrace ^0.3.58 and the `tokio_unstable` flag. We don't use it, and nothing
146 # else we do use requires backtrace, so dummy it out for now.
147 backtrace = { path = "build/rust/backtrace" }
149 # Patch bindgen 0.63 to 0.69
150 bindgen_0_63 = { package = "bindgen", path = "build/rust/bindgen-0.63" }
151 # Locally patch bindgen for https://github.com/rust-lang/rust-bindgen/pull/2824
152 bindgen = { path = "third_party/rust/bindgen" }
154 # Patch nix 0.26 to 0.29
155 nix = { path = "build/rust/nix" }
157 # Patch cfg_aliases 0.1 to 0.2
158 cfg_aliases = { path = "build/rust/cfg_aliases" }
160 # Patch indexmap 2.0 to 1.0
161 indexmap = { path = "build/rust/indexmap" }
163 # Patch derive_more 0.99 to 1.0.0-beta
164 derive_more = { path = "build/rust/derive_more" }
166 # Patch autocfg to hide rustc output. Workaround for https://github.com/cuviper/autocfg/issues/30
167 autocfg = { path = "third_party/rust/autocfg" }
169 # Patch goblin 0.7.0 to 0.8
170 goblin = { path = "build/rust/goblin" }
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" }
175 # Patch `hashbrown` 0.12.* to depend on 0.14.*
176 hashbrown = { path = "build/rust/hashbrown" }
178 # Patch `socket2` 0.4 to 0.5
179 socket2 = { path = "build/rust/socket2" }
181 # The following overrides point to dummy projects, as a temporary measure until this is resolved:
182 # https://github.com/rust-lang/cargo/issues/6179
183 js-sys = { path = "build/rust/dummy-web/js-sys" }
184 wasm-bindgen = { path = "build/rust/dummy-web/wasm-bindgen" }
185 web-sys = { path = "build/rust/dummy-web/web-sys" }
187 # Overrides to allow easier use of common internal crates.
188 moz_asserts = { path = "mozglue/static/rust/moz_asserts" }
190 # Patch `rure` to disable building the cdylib and staticlib targets
191 # Cargo has no way to disable building targets your dependencies provide which
192 # you don't depend on, and linking the cdylib breaks during instrumentation
193 # builds.
194 # Workaround for https://github.com/rust-lang/cargo/issues/11232
195 rure = { path = "third_party/rust/rure" }
197 # Patch `plist` to work with `indexmap` 2.*
198 plist = { path = "third_party/rust/plist" }
200 # To-be-published changes.
201 unicode-bidi = { git = "https://github.com/servo/unicode-bidi", rev = "ca612daf1c08c53abe07327cb3e6ef6e0a760f0c" }
203 # Other overrides
204 any_all_workaround = { git = "https://github.com/hsivonen/any_all_workaround", rev = "7fb1b7034c9f172aade21ee1c8554e8d8a48af80" }
205 chardetng = { git = "https://github.com/hsivonen/chardetng", rev = "3484d3e3ebdc8931493aa5df4d7ee9360a90e76b" }
206 chardetng_c = { git = "https://github.com/hsivonen/chardetng_c", rev = "ed8a4c6f900a90d4dbc1d64b856e61490a1c3570" }
207 coremidi = { git = "https://github.com/chris-zen/coremidi.git", rev = "fc68464b5445caf111e41f643a2e69ccce0b4f83" }
208 cose = { git = "https://github.com/franziskuskiefer/cose-rust", rev = "43c22248d136c8b38fe42ea709d08da6355cf04b" }
209 firefox-on-glean = { path = "toolkit/components/glean/api" }
210 icu_capi = { path = "intl/icu_capi" }
211 icu_segmenter_data = { path = "intl/icu_segmenter_data" }
212 libudev-sys = { path = "dom/webauthn/libudev-sys" }
213 midir = { git = "https://github.com/mozilla/midir.git", rev = "85156e360a37d851734118104619f86bd18e94c6" }
214 # Allow webrender to have a versioned dependency on the older crate on crates.io
215 # in order to build standalone.
216 malloc_size_of_derive = { path = "xpcom/rust/malloc_size_of_derive" }
218 # application-services overrides to make updating them all simpler.
219 interrupt-support = { git = "https://github.com/mozilla/application-services", rev = "3303de12a04710164f7c80fb5e466fbf2560a20f" }
220 relevancy = { git = "https://github.com/mozilla/application-services", rev = "3303de12a04710164f7c80fb5e466fbf2560a20f" }
221 sql-support = { git = "https://github.com/mozilla/application-services", rev = "3303de12a04710164f7c80fb5e466fbf2560a20f" }
222 suggest = { git = "https://github.com/mozilla/application-services", rev = "3303de12a04710164f7c80fb5e466fbf2560a20f" }
223 sync15 = { git = "https://github.com/mozilla/application-services", rev = "3303de12a04710164f7c80fb5e466fbf2560a20f" }
224 tabs = { git = "https://github.com/mozilla/application-services", rev = "3303de12a04710164f7c80fb5e466fbf2560a20f" }
225 viaduct = { git = "https://github.com/mozilla/application-services", rev = "3303de12a04710164f7c80fb5e466fbf2560a20f" }
226 webext-storage = { git = "https://github.com/mozilla/application-services", rev = "3303de12a04710164f7c80fb5e466fbf2560a20f" }
228 allocator-api2 = { path = "third_party/rust/allocator-api2" }