Bug 1771374 - Use {bool, T} instead of Maybe<T> for now. r=gfx-reviewers,lsalzman
[gecko.git] / Cargo.toml
blob767120d7198dbeb55ba9501e5fc372fe66d6075f
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   "js/src/frontend/smoosh",
9   "js/src/rust",
10   "netwerk/test/http3server",
11   "security/manager/ssl/ipcclientcerts",
12   "security/manager/ssl/osclientcerts",
13   "testing/geckodriver",
14   "toolkit/crashreporter/rust_minidump_writer_linux",
15   "toolkit/crashreporter/mozwer-rust",
16   "toolkit/library/gtest/rust",
17   "toolkit/library/rust/",
18   "toolkit/mozapps/defaultagent/rust",
21 # Excluded crates may be built as dependencies, but won't be considered members
22 # of the workspace and their dev-dependencies won't be included.
23 exclude = [
24   # Excluded because it's for a toolchain task
25   "build/liblowercase",
27   # Exclude third-party code vendored into mozilla-central.
28   "servo",
29   "third_party/rust",
31   # Excluded because these crates have their own Cargo workspaces so they can't
32   # be included in the top-level one.
33   "gfx/wr",
35   # Excluded because they are used only as dependencies, not top-level targets,
36   # so we don't need to vendor their dev-dependencies.
37   "gfx/webrender_bindings",
38   "media/mp4parse-rust/mp4parse",
39   "media/mp4parse-rust/mp4parse_capi",
40   "xpcom/rust/gkrust_utils",
41   "tools/lint/test/files/clippy",
42   "tools/fuzzing/rust",
43   "dom/base/rust",
44   "dom/origin-trials/ffi",
47 # Use the new dependency resolver to reduce some of the platform-specific dependencies.
48 # This is required for 'third_party/rust/wgpu-hal'
49 resolver = "2"
51 # Explicitly specify what our profiles use.  The opt-level setting here is
52 # a total fiction; see the setup of MOZ_RUST_DEFAULT_FLAGS for what the
53 # opt-level setting will be as a result of various other configure flags.
54 [profile.dev]
55 opt-level = 1
56 rpath = false
57 lto = false
58 debug-assertions = true
59 panic = "abort"
61 [profile.release]
62 opt-level = 2
63 rpath = false
64 debug-assertions = false
65 panic = "abort"
67 # Optimize build dependencies, because bindgen and proc macros / style
68 # compilation take more to run than to build otherwise.
69 [profile.dev.build-override]
70 opt-level = 1
72 [profile.release.build-override]
73 opt-level = 1
75 # optimizing glsl more makes a big difference in swgl build times
76 [profile.dev.package.glsl]
77 opt-level = 2
79 [profile.release.package.glsl]
80 opt-level = 2
82 [patch.crates-io]
83 # The build system doesn't want those to be used, but they are pulled anyways (because
84 # dependencies can't be disabled based on features), but remain unused. We ensure they
85 # stay unused by overriding them with crates that contain enough to build the current
86 # code and will fail the build in unwanted cases.
87 cmake = { path = "build/rust/cmake" }
88 vcpkg = { path = "build/rust/vcpkg" }
90 # Helper crate for integration in the gecko build system.
91 mozbuild = { path = "build/rust/mozbuild" }
93 # Patch bindgen 0.56 to 0.59.
94 bindgen = { path = "build/rust/bindgen" }
96 # Patch cfg-if 0.1 to 1.0
97 cfg-if = { path = "build/rust/cfg-if" }
99 # Patch redox_users to an empty crate
100 redox_users = { path = "build/rust/redox_users" }
102 # Patch memmap2 0.2 to 0.3
103 memmap2 = { path = "build/rust/memmap2" }
105 # Patch getrandom 0.7 to 0.8
106 rand = { path = "build/rust/rand" }
108 # Patch tokio-util 0.6 to 0.7
109 tokio-util = { path = "build/rust/tokio-util" }
111 # Patch env_logger 0.8 to 0.9
112 env_logger = { path = "build/rust/env_logger" }
114 # Patch toml 0.4 to 0.5
115 toml = { path = "build/rust/toml" }
117 # Patch parking_lot 0.12 down to 0.11, which is compatible for most crates that use it, to avoid
118 # dependencies on windows-sys.
119 parking_lot = { path = "build/rust/parking_lot" }
121 # Override tinyvec with smallvec
122 tinyvec = { path = "build/rust/tinyvec" }
124 # Patch wasi 0.10 to 0.11
125 wasi = { path = "build/rust/wasi" }
127 # Patch autocfg to hide rustc output. Workaround for https://github.com/cuviper/autocfg/issues/30
128 autocfg = { path = "third_party/rust/autocfg" }
130 # The following overrides point to dummy projects, as a temporary measure until this is resolved:
131 # https://github.com/rust-lang/cargo/issues/6179
132 js-sys = { path = "build/rust/dummy-web/js-sys" }
133 slotmap = { path = "build/rust/dummy-web/slotmap" }
134 wasm-bindgen = { path = "build/rust/dummy-web/wasm-bindgen" }
135 web-sys = { path = "build/rust/dummy-web/web-sys" }
137 # Overrides to allow easier use of common internal crates.
138 moz_asserts = { path = "mozglue/static/rust/moz_asserts" }
140 # Other overrides
141 async-task = { git = "https://github.com/smol-rs/async-task", rev="f6488e35beccb26eb6e85847b02aa78a42cd3d0e" }
142 chardetng = { git = "https://github.com/hsivonen/chardetng", rev="3484d3e3ebdc8931493aa5df4d7ee9360a90e76b" }
143 chardetng_c = { git = "https://github.com/hsivonen/chardetng_c", rev="ed8a4c6f900a90d4dbc1d64b856e61490a1c3570" }
144 coremidi = { git = "https://github.com/chris-zen/coremidi.git", rev="fc68464b5445caf111e41f643a2e69ccce0b4f83" }
145 fog = { path = "toolkit/components/glean/api" }
146 libudev-sys = { path = "dom/webauthn/libudev-sys" }
147 packed_simd = { package = "packed_simd_2", git = "https://github.com/hsivonen/packed_simd", rev="c149d0a519bf878567c7630096737669ec2ff15f" }
148 midir = { git = "https://github.com/mozilla/midir.git", rev = "e1b4dcb767f9e69afe95a860374aaa9635d81e3d" }
149 minidump_writer_linux = { git = "https://github.com/rust-minidump/minidump-writer.git", rev = "75ada456c92a429704691a85e1cb42fef8cafc0d" }
151 # application-services overrides to make updating them all simpler.
152 interrupt-support = { git = "https://github.com/mozilla/application-services", rev = "2689788cecf24c385e6b7440e3aa1a89c511f14a" }
153 sql-support = { git = "https://github.com/mozilla/application-services", rev = "2689788cecf24c385e6b7440e3aa1a89c511f14a" }
154 sync15-traits = { git = "https://github.com/mozilla/application-services", rev = "2689788cecf24c385e6b7440e3aa1a89c511f14a" }
155 viaduct = { git = "https://github.com/mozilla/application-services", rev = "2689788cecf24c385e6b7440e3aa1a89c511f14a" }
156 webext-storage = { git = "https://github.com/mozilla/application-services", rev = "2689788cecf24c385e6b7440e3aa1a89c511f14a" }
158 # Patch mio 0.6 to use winapi 0.3 and miow 0.3, getting rid of winapi 0.2.
159 # There is not going to be new version of mio 0.6, mio now being >= 0.7.11.
160 [patch.crates-io.mio]
161 path = "third_party/rust/mio-0.6.23"
163 # Patch neqo 0.5.7 to be compatible with newer versions of the log crate.
164 # https://github.com/mozilla/neqo/pull/1350
165 [patch."https://github.com/mozilla/neqo"]
166 neqo-common = { path = "third_party/rust/neqo-common" }