Backed out changeset d4cbab5a690c (bug 1885173) for causing xpc failures @ toolkit...
[gecko.git] / Cargo.toml
blobdd0ed4f7c2db64df0e4f0b0d7a1c89d7ebfa948b
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/test/http3server",
12   "security/manager/ssl/builtins",
13   "security/manager/ssl/ipcclientcerts",
14   "security/manager/ssl/osclientcerts",
15   "testing/geckodriver",
16   "toolkit/components/uniffi-bindgen-gecko-js",
17   "toolkit/crashreporter/mozwer-rust",
18   "toolkit/crashreporter/rust_minidump_writer_linux",
19   "toolkit/library/gtest/rust",
20   "toolkit/library/rust/",
23 # Excluded crates may be built as dependencies, but won't be considered members
24 # of the workspace and their dev-dependencies won't be included.
25 exclude = [
26   # Exclude third-party code vendored into mozilla-central.
27   "servo",
28   "third_party/rust",
30   # Excluded because these crates have their own Cargo workspaces so they can't
31   # be included in the top-level one.
32   "gfx/wr",
34   # Excluded because they are used only as dependencies, not top-level targets,
35   # so we don't need to vendor their dev-dependencies.
36   "gfx/webrender_bindings",
37   "media/mp4parse-rust/mp4parse",
38   "media/mp4parse-rust/mp4parse_capi",
39   "xpcom/rust/gkrust_utils",
40   "tools/lint/test/files/clippy",
41   "tools/fuzzing/rust",
42   "dom/base/rust",
43   "dom/origin-trials/ffi",
45   # Excluded because we don't want to vendor their dependencies.
46   "intl/l10n/rust/l10nregistry-tests",
49 # Use the new dependency resolver to reduce some of the platform-specific dependencies.
50 # This is required for 'third_party/rust/wgpu-hal'
51 resolver = "2"
53 [workspace.dependencies]
54 # Shared across multiple UniFFI consumers.
55 uniffi = "0.25.3"
56 # Shared across multiple application-services consumers.
57 rusqlite = "0.30.0"
59 # Explicitly specify what our profiles use.  The opt-level setting here is
60 # a total fiction; see the setup of MOZ_RUST_DEFAULT_FLAGS for what the
61 # opt-level setting will be as a result of various other configure flags.
62 [profile.dev]
63 opt-level = 1
64 rpath = false
65 lto = false
66 debug-assertions = true
67 panic = "abort"
69 [profile.release]
70 opt-level = 2
71 rpath = false
72 debug-assertions = false
73 panic = "abort"
75 # Optimize build dependencies, because bindgen and proc macros / style
76 # compilation take more to run than to build otherwise.
77 [profile.dev.build-override]
78 opt-level = 1
80 [profile.release.build-override]
81 opt-level = 1
83 # optimizing glsl more makes a big difference in swgl build times
84 [profile.dev.package.glsl]
85 opt-level = 2
87 [profile.release.package.glsl]
88 opt-level = 2
90 [patch.crates-io]
91 # The build system doesn't want those to be used, but they are pulled anyways (because
92 # dependencies can't be disabled based on features), but remain unused. We ensure they
93 # stay unused by overriding them with crates that contain enough to build the current
94 # code and will fail the build in unwanted cases.
95 cmake = { path = "build/rust/cmake" }
96 vcpkg = { path = "build/rust/vcpkg" }
98 # Helper crate for integration in the gecko build system.
99 mozbuild = { path = "build/rust/mozbuild" }
101 # Workspace hack
102 mozilla-central-workspace-hack = { path = "build/workspace-hack" }
104 # windows-targets replacement. It avoids the large dependencies of the original
105 # crate, which we don't really need as we require MSVC anyways.
106 windows-targets = { path = "build/rust/windows-targets" }
107 windows-targets_0_48 = { package = "windows-targets", path = "build/rust/windows-targets-0.48" }
109 # Patch windows-sys from 0.48.0 to 0.52.0
110 windows-sys = { path = "build/rust/windows-sys" }
112 # Patch windows to use a non-vendored local copy of the crate.
113 windows = { path = "build/rust/windows" }
115 # Dummy oslog replacement. It's only used by glean in code that is not actually used.
116 oslog = { path = "build/rust/oslog" }
118 # Override terminal_size with a dummy crate that returns a fixed 80x25 terminal size.
119 terminal_size = { path = "build/rust/terminal_size" }
121 # Patch bitflags 1.0 to 2.0
122 bitflags = { path = "build/rust/bitflags" }
124 # Patch memmap2 0.5.x and 0.8 to 0.9
125 memmap2_0_5 = { package = "memmap2", path = "build/rust/memmap2-0.5" }
126 memmap2 = { path = "build/rust/memmap2" }
128 # Patch cfg-if 0.1 to 1.0
129 cfg-if = { path = "build/rust/cfg-if" }
131 # Patch redox_users to an empty crate
132 redox_users = { path = "build/rust/redox_users" }
134 # Patch redox_syscall to an empty crate
135 redox_syscall = { path = "build/rust/redox_syscall" }
137 # Override tinyvec with smallvec
138 tinyvec = { path = "build/rust/tinyvec" }
140 # Patch base64 0.13 to 0.21
141 base64 = { path = "build/rust/base64" }
143 # Patch wasi 0.10 to 0.11
144 wasi = { path = "build/rust/wasi" }
146 # tokio 0.29.0 includes an experimental "tracing" feature which requires
147 # backtrace ^0.3.58 and the `tokio_unstable` flag. We don't use it, and nothing
148 # else we do use requires backtrace, so dummy it out for now.
149 backtrace = { path = "build/rust/backtrace" }
151 # Patch bindgen 0.63 to 0.69
152 bindgen_0_63 = { package = "bindgen", path = "build/rust/bindgen-0.63" }
154 # Patch nix 0.26 to 0.27
155 nix = { path = "build/rust/nix" }
157 # Patch indexmap 2.0 to 1.0
158 indexmap = { path = "build/rust/indexmap" }
160 # Patch derive_more 0.99 to 1.0.0-beta
161 derive_more = { path = "build/rust/derive_more" }
163 # Patch autocfg to hide rustc output. Workaround for https://github.com/cuviper/autocfg/issues/30
164 autocfg = { path = "third_party/rust/autocfg" }
166 # Patch goblin 0.6.0 to 0.7.0 because uniffi crates still use the older version
167 # and we want to avoid duplications
168 goblin = { path = "build/rust/goblin" }
170 # Patch memoffset from 0.8.0 to 0.9.0 since it's compatible and it avoids duplication
171 memoffset = { path = "build/rust/memoffset" }
173 # The following overrides point to dummy projects, as a temporary measure until this is resolved:
174 # https://github.com/rust-lang/cargo/issues/6179
175 js-sys = { path = "build/rust/dummy-web/js-sys" }
176 wasm-bindgen = { path = "build/rust/dummy-web/wasm-bindgen" }
177 web-sys = { path = "build/rust/dummy-web/web-sys" }
179 # Overrides to allow easier use of common internal crates.
180 moz_asserts = { path = "mozglue/static/rust/moz_asserts" }
182 # Patch `rure` to disable building the cdylib and staticlib targets
183 # Cargo has no way to disable building targets your dependencies provide which
184 # you don't depend on, and linking the cdylib breaks during instrumentation
185 # builds.
186 # Workaround for https://github.com/rust-lang/cargo/issues/11232
187 rure = { path = "third_party/rust/rure" }
189 # To-be-published changes.
190 cssparser = { git = "https://github.com/servo/rust-cssparser", rev = "aaa966d9d6ae70c4b8a62bb5e3a14c068bb7dff0" }
191 cssparser-macros = { git = "https://github.com/servo/rust-cssparser", rev = "aaa966d9d6ae70c4b8a62bb5e3a14c068bb7dff0" }
192 unicode-bidi = { git = "https://github.com/servo/unicode-bidi", rev = "ca612daf1c08c53abe07327cb3e6ef6e0a760f0c" }
194 # Other overrides
195 chardetng = { git = "https://github.com/hsivonen/chardetng", rev = "3484d3e3ebdc8931493aa5df4d7ee9360a90e76b" }
196 chardetng_c = { git = "https://github.com/hsivonen/chardetng_c", rev = "ed8a4c6f900a90d4dbc1d64b856e61490a1c3570" }
197 coremidi = { git = "https://github.com/chris-zen/coremidi.git", rev = "fc68464b5445caf111e41f643a2e69ccce0b4f83" }
198 cose = { git = "https://github.com/franziskuskiefer/cose-rust", rev = "43c22248d136c8b38fe42ea709d08da6355cf04b" }
199 firefox-on-glean = { path = "toolkit/components/glean/api" }
200 icu_capi = { path = "intl/icu_capi" }
201 icu_segmenter_data = { path = "intl/icu_segmenter_data" }
202 libudev-sys = { path = "dom/webauthn/libudev-sys" }
203 midir = { git = "https://github.com/mozilla/midir.git", rev = "85156e360a37d851734118104619f86bd18e94c6" }
204 # warp 0.3.6 + https://github.com/seanmonstar/warp/pull/1069
205 warp = { git = "https://github.com/seanmonstar/warp", rev = "9d081461ae1167eb321585ce424f4fef6cf0092b" }
206 # Allow webrender to have a versioned dependency on the older crate on crates.io
207 # in order to build standalone.
208 malloc_size_of_derive = { path = "xpcom/rust/malloc_size_of_derive" }
210 # application-services overrides to make updating them all simpler.
211 interrupt-support = { git = "https://github.com/mozilla/application-services", rev = "5fc8ee2f0f6950e36d4096983757bd046d55df9f" }
212 sql-support = { git = "https://github.com/mozilla/application-services", rev = "5fc8ee2f0f6950e36d4096983757bd046d55df9f" }
213 suggest = { git = "https://github.com/mozilla/application-services", rev = "5fc8ee2f0f6950e36d4096983757bd046d55df9f" }
214 sync15 = { git = "https://github.com/mozilla/application-services", rev = "5fc8ee2f0f6950e36d4096983757bd046d55df9f" }
215 tabs = { git = "https://github.com/mozilla/application-services", rev = "5fc8ee2f0f6950e36d4096983757bd046d55df9f" }
216 viaduct = { git = "https://github.com/mozilla/application-services", rev = "5fc8ee2f0f6950e36d4096983757bd046d55df9f" }
217 webext-storage = { git = "https://github.com/mozilla/application-services", rev = "5fc8ee2f0f6950e36d4096983757bd046d55df9f" }
219 # Patch mio 0.8.8 to use windows-sys 0.52 (backport https://github.com/tokio-rs/mio/commit/eea9e3e0c469480e5c59c01e6c3c7e5fd88f0848)
220 mio_0_8 = { package = "mio", git = "https://github.com/glandium/mio", rev = "9a2ef335c366044ffe73b1c4acabe50a1daefe05" }
222 # Patch mio 0.6 to use winapi 0.3 and miow 0.3, getting rid of winapi 0.2.
223 # There is not going to be new version of mio 0.6, mio now being >= 0.7.11.
224 [patch.crates-io.mio]
225 path = "third_party/rust/mio-0.6.23"
227 [patch."https://github.com/mozilla/uniffi-rs.git"]
228 uniffi = "=0.25.3"
229 uniffi_bindgen = "=0.25.3"
230 uniffi_build = "=0.25.3"
231 uniffi_macros = "=0.25.3"
232 weedle2 = "=4.0.0"