tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

Cargo.toml (12422B)


      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  "browser/app/nmhproxy/",
      9  "js/src/rust",
     10  "netwerk/base/idna_glue",
     11  "netwerk/test/http3server",
     12  "security/manager/ssl/abridged_certs",
     13  "security/manager/ssl/ipcclientcerts",
     14  "security/manager/ssl/osclientcerts",
     15  "security/manager/ssl/tests/unit/pkcs11testmodule",
     16  "security/manager/ssl/tests/unit/test_trust_anchors",
     17  "security/manager/ssl/qwac_trust_anchors",
     18  "security/manager/ssl/trust_anchors",
     19  "security/mls/mls_gk",
     20  "services/app-services-tools/embedded-uniffi-bindgen",
     21  "services/app-services-tools/nimbus-fml",
     22  "testing/geckodriver",
     23  "toolkit/components/uniffi-bindgen-gecko-js",
     24  "toolkit/crashreporter/client/app",
     25  "toolkit/crashreporter/crash_helper_server",
     26  "toolkit/crashreporter/crash_helper_client",
     27  "toolkit/crashreporter/crashping",
     28  "toolkit/crashreporter/minidump-analyzer/android/export",
     29  "toolkit/crashreporter/mozwer-rust",
     30  "toolkit/library/gtest/rust",
     31  "toolkit/library/rust/",
     32  "services/application-services/components/viaduct-necko",
     33 ]
     34 
     35 # Excluded crates may be built as dependencies, but won't be considered members
     36 # of the workspace and their dev-dependencies won't be included.
     37 exclude = [
     38  # Exclude third-party code vendored into mozilla-central.
     39  "servo",
     40  "third_party/rust",
     41 
     42  # Excluded because these crates have their own Cargo workspaces so they can't
     43  # be included in the top-level one.
     44  "gfx/wr",
     45 
     46  # Excluded because they are used only as dependencies, not top-level targets,
     47  # so we don't need to vendor their dev-dependencies.
     48  "gfx/webrender_bindings",
     49  "media/mp4parse-rust/mp4parse",
     50  "media/mp4parse-rust/mp4parse_capi",
     51  "xpcom/rust/gkrust_utils",
     52  "toolkit/components/protobuf/scripts",
     53  "toolkit/crashreporter/minidump-analyzer",
     54  "tools/lint/test/files/clippy",
     55  "tools/fuzzing/rust",
     56  "dom/base/rust",
     57  "dom/origin-trials/ffi",
     58  "ipc/rust/ipdl_utils",
     59 
     60  # Excluded because we don't want to vendor their dependencies.
     61  "intl/l10n/rust/l10nregistry-tests",
     62 ]
     63 
     64 # Use the new dependency resolver to reduce some of the platform-specific dependencies.
     65 # This is required for 'third_party/rust/wgpu-hal'
     66 resolver = "2"
     67 
     68 [workspace.package]
     69 rust-version = "1.87.0"
     70 
     71 [workspace.dependencies]
     72 # Shared across multiple UniFFI consumers.
     73 uniffi = "0.29.3"
     74 uniffi_bindgen = "0.29.3"
     75 uniffi_pipeline = "0.29.3"
     76 # Shared across multiple application-services consumers.
     77 rusqlite = "0.37"
     78 # Shared across multiple glean consumers.
     79 glean = "=66.2.0"
     80 
     81 # Explicitly specify what our profiles use.  The opt-level setting here is
     82 # a total fiction; see the setup of MOZ_RUST_DEFAULT_FLAGS for what the
     83 # opt-level setting will be as a result of various other configure flags.
     84 [profile.dev]
     85 opt-level = 1
     86 rpath = false
     87 lto = false
     88 debug-assertions = true
     89 panic = "abort"
     90 
     91 [profile.release]
     92 opt-level = 2
     93 rpath = false
     94 debug-assertions = false
     95 panic = "abort"
     96 
     97 # Optimize build dependencies, because bindgen and proc macros / style
     98 # compilation take more to run than to build otherwise.
     99 [profile.dev.build-override]
    100 opt-level = 1
    101 
    102 [profile.release.build-override]
    103 opt-level = 1
    104 
    105 # optimizing glsl more makes a big difference in swgl build times
    106 [profile.dev.package.glsl]
    107 opt-level = 2
    108 
    109 [profile.release.package.glsl]
    110 opt-level = 2
    111 
    112 [patch.crates-io]
    113 # The build system doesn't want those to be used, but they are pulled anyways (because
    114 # dependencies can't be disabled based on features), but remain unused. We ensure they
    115 # stay unused by overriding them with crates that contain enough to build the current
    116 # code and will fail the build in unwanted cases.
    117 cmake = { path = "build/rust/cmake" }
    118 vcpkg = { path = "build/rust/vcpkg" }
    119 
    120 # Helper crate for integration in the gecko build system.
    121 mozbuild = { path = "build/rust/mozbuild" }
    122 
    123 # Workspace hack
    124 mozilla-central-workspace-hack = { path = "build/workspace-hack" }
    125 
    126 # windows-targets replacement. It avoids the large dependencies of the original
    127 # crate, which we don't really need as we require MSVC anyways.
    128 windows-targets = { path = "build/rust/windows-targets" }
    129 
    130 # Patch windows to use a non-vendored local copy of the crate.
    131 windows = { path = "build/rust/windows" }
    132 
    133 # Dummy oslog replacement. It's only used by glean in code that is not actually used.
    134 oslog = { path = "build/rust/oslog" }
    135 
    136 # Override terminal_size with a dummy crate that returns a fixed 80x25 terminal size.
    137 terminal_size = { path = "build/rust/terminal_size" }
    138 
    139 # Patch bitflags 1.0 to 2.0
    140 bitflags = { path = "build/rust/bitflags" }
    141 
    142 # Patch r-efi to an empty crate
    143 r-efi = { path = "build/rust/r-efi" }
    144 
    145 # Patch redox_users to an empty crate
    146 redox_users = { path = "build/rust/redox_users" }
    147 
    148 # Patch redox_syscall to an empty crate
    149 redox_syscall = { path = "build/rust/redox_syscall" }
    150 
    151 # Patch hermit-abi to an empty crate
    152 hermit-abi = { path = "build/rust/hermit-abi" }
    153 
    154 # Patch base64 0.21 to 0.22
    155 base64_21 = { package = "base64", path = "build/rust/base64" }
    156 
    157 # Patch wasi 0.11 to 0.14
    158 wasi_0_11 = { package = "wasi", path = "build/rust/wasi" }
    159 
    160 # tokio 0.29.0 includes an experimental "tracing" feature which requires
    161 # backtrace ^0.3.58 and the `tokio_unstable` flag. We don't use it, and nothing
    162 # else we do use requires backtrace, so dummy it out for now.
    163 backtrace = { path = "build/rust/backtrace" }
    164 
    165 # Locally patch bindgen to a yet-unreleased version.
    166 bindgen_0_72 = { package = "bindgen", git = "https://github.com/rust-lang/rust-bindgen", rev = "9366e0af8da529c958b4cd4fcbe492d951c86f5c" }
    167 
    168 # Patch bindgen 0.69 to 0.72
    169 bindgen = { path = "build/rust/bindgen" }
    170 
    171 # Patch nix 0.29 to 0.30+
    172 nix = { path = "build/rust/nix" }
    173 
    174 # Patch siphasher 0.3 to 1.0
    175 # TODO: Remove once https://github.com/mozilla/uniffi-rs/pull/2709 lands in m-c.
    176 siphasher = { path = "build/rust/siphasher" }
    177 
    178 # Patch autocfg to hide rustc output. Workaround for https://github.com/cuviper/autocfg/issues/30
    179 autocfg = { path = "third_party/rust/autocfg" }
    180 
    181 # Patch goblin 0.7.0 to 0.8
    182 goblin = { path = "build/rust/goblin" }
    183 
    184 # Implement getrandom 0.2 in terms of 0.3
    185 getrandom = { path = "build/rust/getrandom" }
    186 
    187 # Patch rustc-hash 1.1.0 to 2.1.1
    188 rustc-hash = { path = "build/rust/rustc-hash" }
    189 
    190 # Patch memoffset from 0.8.0 to 0.9.0 since it's compatible and it avoids duplication
    191 memoffset = { path = "build/rust/memoffset" }
    192 
    193 # Patch `hashbrown` 0.13.* to depend on 0.15.*
    194 hashbrown_0_13 = { package = "hashbrown", path = "build/rust/hashbrown-0.13" }
    195 
    196 # Patch `hashbrown` 0.14.* to depend on 0.15.*
    197 hashbrown_0_14 = { package = "hashbrown", path = "build/rust/hashbrown-0.14" }
    198 
    199 # Patch `hashbrown` 0.15.* to depend on 0.16.*
    200 hashbrown_0_15 = { package = "hashbrown", path = "build/rust/hashbrown" }
    201 
    202 # Patch `hashlink` 0.10.* to 0.11.*
    203 # This technically breaks `hashbrown::DefaultHashBuilder: Copy`, but it's not something we use.
    204 hashlink = { path = "build/rust/hashlink" }
    205 
    206 # Patch `thiserror` 1 to 2.
    207 thiserror = { path = "build/rust/thiserror" }
    208 
    209 # Patch `toml` 0.5 to 0.9
    210 toml = { path = "build/rust/toml" }
    211 
    212 # Patch thin_vec with not-yet-published changes.
    213 thin-vec = { path = "third_party/rust/thin-vec" }
    214 
    215 # The following overrides point to dummy projects, as a temporary measure until this is resolved:
    216 # https://github.com/rust-lang/cargo/issues/6179
    217 js-sys = { path = "build/rust/dummy-web/js-sys" }
    218 wasm-bindgen = { path = "build/rust/dummy-web/wasm-bindgen" }
    219 web-sys = { path = "build/rust/dummy-web/web-sys" }
    220 
    221 
    222 # Upgrade `core-foundation` 0.9.* to 0.10.
    223 core-foundation = { path = "build/rust/core-foundation" }
    224 # Patch `core-graphics-types` 0.1.* to 0.2.
    225 core-graphics-types = { path = "build/rust/core-graphics-types" }
    226 
    227 # Patch `half` 1.* to 2.
    228 half = { path = "build/rust/half" }
    229 
    230 # Upgrade `rusqlite` 0.31 to 0.33.
    231 rusqlite = { path = "build/rust/rusqlite" }
    232 
    233 # Overrides to allow easier use of common internal crates.
    234 moz_asserts = { path = "mozglue/static/rust/moz_asserts" }
    235 
    236 # Patch `rure` to disable building the cdylib and staticlib targets
    237 # Cargo has no way to disable building targets your dependencies provide which
    238 # you don't depend on, and linking the cdylib breaks during instrumentation
    239 # builds.
    240 # Workaround for https://github.com/rust-lang/cargo/issues/11232
    241 rure = { path = "third_party/rust/rure" }
    242 
    243 # To-be-published changes.
    244 unicode-bidi = { git = "https://github.com/servo/unicode-bidi", rev = "ca612daf1c08c53abe07327cb3e6ef6e0a760f0c" }
    245 nss-gk-api = { git = "https://github.com/beurdouche/nss-gk-api", rev = "e48a946811ffd64abc78de3ee284957d8d1c0d63" }
    246 
    247 # Other overrides
    248 any_all_workaround = { git = "https://github.com/hsivonen/any_all_workaround", rev = "7fb1b7034c9f172aade21ee1c8554e8d8a48af80" }
    249 chardetng = { git = "https://github.com/hsivonen/chardetng", rev = "a07d20273ce36146adaf76bd667dd57bd7b3508b" }
    250 chardetng_c = { git = "https://github.com/hsivonen/chardetng_c", rev = "2f0aba284677d098de14f91ffe5a9e5b9a4922c2" }
    251 cose = { git = "https://github.com/franziskuskiefer/cose-rust", rev = "43c22248d136c8b38fe42ea709d08da6355cf04b" }
    252 firefox-on-glean = { path = "toolkit/components/glean/api" }
    253 icu_capi = { path = "intl/icu_capi" }
    254 icu_segmenter_data = { path = "intl/icu_segmenter_data" }
    255 libudev-sys = { path = "dom/webauthn/libudev-sys" }
    256 midir = { git = "https://github.com/mozilla/midir.git", rev = "54759f681f3b523e120d047adec2bb1a97152017" }
    257 # Allow webrender to have a versioned dependency on the older crate on crates.io
    258 # in order to build standalone.
    259 malloc_size_of_derive = { path = "xpcom/rust/malloc_size_of_derive" }
    260 # Use the in-tree code instead of pulling it in. It matches the crates.io version
    261 wr_malloc_size_of = { path = "gfx/wr/wr_malloc_size_of" }
    262 
    263 # objc 0.2.7 + fa7ca43b862861dd1cd000d7ad01e6e0266cda13
    264 objc = { git = "https://github.com/glandium/rust-objc", rev = "4de89f5aa9851ceca4d40e7ac1e2759410c04324" }
    265 
    266 # allocator-api2 + f95e3419ce41883904fcb2279b52aa35b5f04d76 + fdd92751afa7ce34408b677004b429d597e72c90
    267 allocator-api2 = { git = "https://github.com/glandium/allocator-api2", rev = "ad5f3d56a5a4519eff52af4ff85293431466ef5c" }
    268 
    269 # application-services overrides to make updating them all simpler.
    270 context_id = { git = "https://github.com/mozilla/application-services", rev = "0376c542e4a31cde8d33dd0e8da17dcfbc6c58b2" }
    271 error-support = { git = "https://github.com/mozilla/application-services", rev = "0376c542e4a31cde8d33dd0e8da17dcfbc6c58b2" }
    272 filter_adult = { git = "https://github.com/mozilla/application-services", rev = "0376c542e4a31cde8d33dd0e8da17dcfbc6c58b2" }
    273 interrupt-support = { git = "https://github.com/mozilla/application-services", rev = "0376c542e4a31cde8d33dd0e8da17dcfbc6c58b2" }
    274 relevancy = { git = "https://github.com/mozilla/application-services", rev = "0376c542e4a31cde8d33dd0e8da17dcfbc6c58b2" }
    275 search = { git = "https://github.com/mozilla/application-services", rev = "0376c542e4a31cde8d33dd0e8da17dcfbc6c58b2" }
    276 sql-support = { git = "https://github.com/mozilla/application-services", rev = "0376c542e4a31cde8d33dd0e8da17dcfbc6c58b2" }
    277 suggest = { git = "https://github.com/mozilla/application-services", rev = "0376c542e4a31cde8d33dd0e8da17dcfbc6c58b2" }
    278 sync15 = { git = "https://github.com/mozilla/application-services", rev = "0376c542e4a31cde8d33dd0e8da17dcfbc6c58b2" }
    279 tabs = { git = "https://github.com/mozilla/application-services", rev = "0376c542e4a31cde8d33dd0e8da17dcfbc6c58b2" }
    280 tracing-support = { git = "https://github.com/mozilla/application-services", rev = "0376c542e4a31cde8d33dd0e8da17dcfbc6c58b2" }
    281 viaduct = { git = "https://github.com/mozilla/application-services", rev = "0376c542e4a31cde8d33dd0e8da17dcfbc6c58b2" }
    282 webext-storage = { git = "https://github.com/mozilla/application-services", rev = "0376c542e4a31cde8d33dd0e8da17dcfbc6c58b2" }
    283 logins = { git = "https://github.com/mozilla/application-services", rev = "0376c542e4a31cde8d33dd0e8da17dcfbc6c58b2" }
    284 init_rust_components = { git = "https://github.com/mozilla/application-services", rev = "0376c542e4a31cde8d33dd0e8da17dcfbc6c58b2" }
    285 # Patched version of zip 2.4.2 to allow for reading omnijars.
    286 zip = { path = "third_party/rust/zip" }
    287 
    288 # Patch libcrux-traits to avoid unnecessary unused dependencies and conflicts.
    289 libcrux-traits = { path = "build/rust/libcrux-traits" }