Roll simd-adler32: 0.3.9 => 0.3.10 in //third_party/rust.

This CL has been created semi-automatically.  The expected review
process and other details can be found at
//tools/crates/create_update_cl.md

Updated crates:

* simd-adler32: 0.3.9 => 0.3.10;
  https://docs.rs/crate/simd-adler32/0.3.10

Bug: None
Change-Id: Ia4f4a1da2344d139129d0bbbc5e153e08b87fff8
Cq-Include-Trybots: chromium/try:android-rust-arm32-rel
Cq-Include-Trybots: chromium/try:android-rust-arm64-dbg
Cq-Include-Trybots: chromium/try:android-rust-arm64-rel
Cq-Include-Trybots: chromium/try:linux-rust-x64-dbg
Cq-Include-Trybots: chromium/try:linux-rust-x64-rel
Cq-Include-Trybots: chromium/try:win-rust-x64-dbg
Cq-Include-Trybots: chromium/try:win-rust-x64-rel
Disable-Rts: True
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/8107845
Auto-Submit: Liza Burakova <liza@chromium.org>
Commit-Queue: Julia Hansbrough <flowerhack@google.com>
Reviewed-by: Julia Hansbrough <flowerhack@google.com>
Cr-Commit-Position: refs/heads/main@{#1664052}
NOKEYCHECK=True
GitOrigin-RevId: b3a3dd57c9651de583c51ccc7665ad8ceae4fba9
17 files changed
tree: 56161fa7712077dd743c4a59a54f4fbd4adc3e44
  1. addr2line/
  2. adler2/
  3. ahash/
  4. aho_corasick/
  5. android_system_properties/
  6. anstyle/
  7. antlr4rust/
  8. anyhow/
  9. arbitrary_int/
  10. array_init/
  11. autocfg/
  12. backtrace/
  13. base64/
  14. better_any/
  15. bincode/
  16. bincode_derive/
  17. bit_set/
  18. bit_vec/
  19. bitbybit/
  20. bitflags/
  21. bytemuck/
  22. bytemuck_derive/
  23. byteorder/
  24. byteorder_lite/
  25. bytes/
  26. calendrical_calculations/
  27. cc/
  28. cfg_aliases/
  29. cfg_if/
  30. chromium_crates_io/
  31. chrono/
  32. clap/
  33. clap_builder/
  34. clap_lex/
  35. cobs/
  36. codespan_reporting/
  37. const_format/
  38. const_format_proc_macros/
  39. const_panic/
  40. core_foundation_sys/
  41. core_maths/
  42. crc32fast/
  43. ctor/
  44. ctor_proc_macro/
  45. cxx/
  46. cxxbridge_cmd/
  47. cxxbridge_flags/
  48. cxxbridge_macro/
  49. derivre/
  50. diplomat/
  51. diplomat_core/
  52. diplomat_runtime/
  53. displaydoc/
  54. dtor/
  55. dtor_proc_macro/
  56. either/
  57. equivalent/
  58. erased_serde/
  59. fastbloom/
  60. fdeflate/
  61. fend_core/
  62. fixed_decimal/
  63. flate2/
  64. foldhash/
  65. font_types/
  66. fs2/
  67. getrandom/
  68. gimli/
  69. harfrust/
  70. hashbrown/
  71. heck/
  72. hex/
  73. hmac_sha256/
  74. hostname/
  75. iana_time_zone/
  76. icu_calendar/
  77. icu_calendar_data/
  78. icu_casemap/
  79. icu_casemap_data/
  80. icu_collections/
  81. icu_decimal/
  82. icu_decimal_data/
  83. icu_experimental/
  84. icu_experimental_data/
  85. icu_list/
  86. icu_list_data/
  87. icu_locale/
  88. icu_locale_core/
  89. icu_locale_data/
  90. icu_normalizer/
  91. icu_normalizer_data/
  92. icu_pattern/
  93. icu_plurals/
  94. icu_plurals_data/
  95. icu_properties/
  96. icu_properties_data/
  97. icu_provider/
  98. icu_time/
  99. image/
  100. incremental_font_transfer/
  101. indexmap/
  102. itertools/
  103. itoa/
  104. ixdtf/
  105. jiff_tzdb/
  106. jpeg_encoder/
  107. jxl/
  108. jxl_macros/
  109. jxl_simd/
  110. jxl_transforms/
  111. konst/
  112. konst_macro_rules/
  113. lazy_static/
  114. libafl/
  115. libafl_bolts/
  116. libafl_derive/
  117. libc/
  118. libm/
  119. litemap/
  120. llguidance/
  121. lock_api/
  122. log/
  123. mach2/
  124. memchr/
  125. meminterval/
  126. memo_map/
  127. memoffset/
  128. minijinja/
  129. miniz_oxide/
  130. moxcms/
  131. murmur3/
  132. nix/
  133. num_bigint/
  134. num_complex/
  135. num_derive/
  136. num_enum/
  137. num_enum_derive/
  138. num_integer/
  139. num_rational/
  140. num_traits/
  141. object/
  142. once_cell/
  143. ordered_float/
  144. parking_lot/
  145. parking_lot_core/
  146. png/
  147. postcard/
  148. potential_utf/
  149. primal_check/
  150. proc_macro2/
  151. proc_macro_error2/
  152. proc_macro_error_attr2/
  153. prost/
  154. prost_derive/
  155. pxfm/
  156. qr_code/
  157. quote/
  158. rand_core/
  159. read_fonts/
  160. ref_cast/
  161. ref_cast_impl/
  162. regex/
  163. regex_automata/
  164. regex_lite/
  165. regex_syntax/
  166. resb/
  167. rustc_demangle/
  168. rustc_demangle_capi/
  169. rustfft/
  170. rustversion/
  171. ryu/
  172. safe_arch/
  173. scc/
  174. scopeguard/
  175. sdd/
  176. serde/
  177. serde_core/
  178. serde_derive/
  179. serde_json/
  180. serde_json_lenient/
  181. serial_test/
  182. serial_test_derive/
  183. sfv/
  184. shared_brotli_patch_decoder/
  185. simd_adler32/
  186. siphasher/
  187. skera/
  188. skrifa/
  189. small_ctor/
  190. smallvec/
  191. stable_deref_trait/
  192. static_assertions/
  193. strck/
  194. strength_reduce/
  195. strsim/
  196. strum/
  197. strum_macros/
  198. subtle/
  199. symphonia/
  200. symphonia_bundle_flac/
  201. symphonia_bundle_mp3/
  202. symphonia_codec_pcm/
  203. symphonia_codec_vorbis/
  204. symphonia_common/
  205. symphonia_core/
  206. symphonia_metadata/
  207. symphonia_utils_xiph/
  208. syn/
  209. synstructure/
  210. temporal_capi/
  211. temporal_rs/
  212. termcolor/
  213. thiserror/
  214. thiserror_impl/
  215. timezone_provider/
  216. tinystr/
  217. toktrie/
  218. transpose/
  219. tuple_list/
  220. typed_arena/
  221. typed_builder/
  222. typed_builder_macro/
  223. typed_path/
  224. typeid/
  225. typewit/
  226. tzif/
  227. uds/
  228. unicode_ident/
  229. unicode_width/
  230. unicode_xid/
  231. unty/
  232. utf8_iter/
  233. uuid/
  234. version_check/
  235. virtue/
  236. wait_timeout/
  237. wide/
  238. winapi_util/
  239. windows_aarch64_msvc/
  240. windows_i686_msvc/
  241. windows_link/
  242. windows_sys/
  243. windows_targets/
  244. windows_x86_64_msvc/
  245. write_fonts/
  246. writeable/
  247. xml/
  248. xxhash_rust/
  249. yoke/
  250. yoke_derive/
  251. zerocopy/
  252. zerofrom/
  253. zerofrom_derive/
  254. zerotrie/
  255. zerovec/
  256. zerovec_derive/
  257. zip/
  258. zmij/
  259. zoneinfo64/
  260. zune_core/
  261. zune_jpeg/
  262. .clang-format
  263. DEPS
  264. OWNERS
  265. OWNERS-review-checklist.md
  266. PRESUBMIT.py
  267. README-importing-new-crates.md
  268. README.md
README.md

Rust third-party code

This directory contains third-party Rust libraries from https://crates.io (and sometimes thin wrappers around them for Chromium interop).

gnrt: Cargo.toml => vendor + BUILD.gn + README.chromium

Third-party libraries from crates.io, depend on Cargo as a build system. Chromium uses gnrt tool to automate

  • Vendoring crates sources into Chromium repository
  • Generating BUILD.gn and README.chromium files based on crate's Cargo.toml.

The tool can be found in //tools/crates/gnrt and is typically invoked using //tools/crates/run_gnrt.py.

Directory structure for third-party crates

The directory structure for a crate “foo” version 3.4.2 is:

//third_party/
    rust/
        foo/
            wrapper/             (optional FFI glue or Chromium integration)
            v3/                  (version 3.4.2 maps to the v3 epoch)
                BUILD.gn         (generated by gnrt gen)
                README.chromium  (generated by gnrt vendor)
        chromium_crates_io/
            vendor/
                foo-v3/  (sources downloaded from crates.io by gnrt vendor)
            patches/
                foo-v3/  (patches automatically applied during gnrt vendor)
                    0001-Some-changes.diff
                    0002-Other-changes.diff
            Cargo.toml        (version and enabled features of "foo")
            Cargo.lock
            gnrt_config.toml  (additional configuration of "foo")

TODO(https://crbug.com/417250983): Patch directory should be epoch-specific.

Most of the files above are managed automatically by gnrt. The only “foo”-specific manually-authored files and directories are:

There are also other, non-crate-specific files such as:

  • //third_party/rust:
    • .md - this doc and other docs
    • OWNERS, PRESUBMIT.py
  • //third_party/rust/chromium_crates_io:
    • BUILD.gn.hbs - template for BUILD.gn files
    • README.chromium.hbs - template for README.chromium files
    • PRESUBMIT.py
    • .py helper scripts used by PRESUBMIT.py and by //tools/crates.
    • Somewhat obsolete cargo vet-support items - we keep supply-chain/audits.toml to preserve Chromium audits that are imported into https://github.com/google/rust-crate-audits/blob/main/sources.list)
    • Various infrastructure pieces to disable auto-formatting of the vendored files (e.g. .gitattributes, .rustfmt.toml, .style.yapf, etc.)

Importing new third-party crates

See //third_party/rust/README-importing-new-crates.md for instructions on how to import a crate from https://crates.io into Chromium.

Updating existing third-party crates

Third-party crates will get updated semi-automatically through the process described in ../tools/crates/create_update_cl.md. If you nevertheless need to manually update a crate to its latest minor or major version, then follow the steps below. To facilitate easier review, we recommend uploading separate patchsets for 1) manual changes, and 2) tool-driven, automated changes.

  1. Change directory to the root src/ dir of Chromium.
  2. Update the versions in //third_party/rust/chromium_crates_io/Cargo.toml.
    • vpython3 ./tools/crates/run_gnrt.py update <crate name>.
    • Under the hood this invokes cargo update and accepts the same command line parameters. In particular, you may need to specify --breaking when working on major version updates.
  3. Download any updated crate's files:
    • ./tools/crates/run_gnrt.py vendor
  4. Add the downloaded files to git:
    • git add -f third_party/rust/chromium_crates_io/vendor
    • The -f is important, as files may be skipped otherwise from a .gitignore inside the crate.
  5. Generate the BUILD.gn files
    • vpython3 ./tools/crates/run_gnrt.py gen
    • Or, directly through (nightly) cargo: cargo run --release --manifest-path tools/crates/gnrt/Cargo.toml --target-dir out/gnrt gen
  6. Add the generated files to git:
    • git add third_party/rust

Writing a wrapper for binding generation

Most Rust libraries will need a more C++-friendly API written on top of them in order to generate C++ bindings to them. The wrapper library can be placed in //third_party/rust/<cratename>/wrapper or at another single place that all C++ goes through to access the library. The CXX is used to generate bindings between C++ and Rust.

See //third_party/rust/serde_json_lenient/v0_1/wrapper/ and //components/qr_code_generator for examples.

See //docs/rust-ffi.md for information on C++/Rust FFI.