Bug 1874797 - Upgrade bindgen to 0.69.2. r=emilio,supply-chain-reviewers

Differential Revision: https://phabricator.services.mozilla.com/D198643
This commit is contained in:
Mike Hommey 2024-01-16 21:09:57 +00:00
Родитель db2606acee
Коммит 4d4fc711b1
8 изменённых файлов: 127 добавлений и 36 удалений

Просмотреть файл

@ -90,11 +90,6 @@ git = "https://github.com/mozilla/uniffi-rs.git"
rev = "afb29ebdc1d9edf15021b1c5332fc9f285bbe13b"
replace-with = "vendored-sources"
[source."git+https://github.com/rust-lang/rust-bindgen?rev=86f3dbe846020e2ba573d6eb38d1434d0cbcbb40"]
git = "https://github.com/rust-lang/rust-bindgen"
rev = "86f3dbe846020e2ba573d6eb38d1434d0cbcbb40"
replace-with = "vendored-sources"
[source."git+https://github.com/seanmonstar/warp?rev=9d081461ae1167eb321585ce424f4fef6cf0092b"]
git = "https://github.com/seanmonstar/warp"
rev = "9d081461ae1167eb321585ce424f4fef6cf0092b"

25
Cargo.lock сгенерированный
Просмотреть файл

@ -418,20 +418,21 @@ dependencies = [
name = "bindgen"
version = "0.63.999"
dependencies = [
"bindgen 0.69.1",
"bindgen 0.69.2",
]
[[package]]
name = "bindgen"
version = "0.64.999"
dependencies = [
"bindgen 0.69.1",
"bindgen 0.69.2",
]
[[package]]
name = "bindgen"
version = "0.69.1"
source = "git+https://github.com/rust-lang/rust-bindgen?rev=86f3dbe846020e2ba573d6eb38d1434d0cbcbb40#86f3dbe846020e2ba573d6eb38d1434d0cbcbb40"
version = "0.69.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a4c69fae65a523209d34240b60abe0c42d33d1045d445c0839d8a4894a736e2d"
dependencies = [
"bitflags 2.4.0",
"cexpr",
@ -576,7 +577,7 @@ dependencies = [
name = "builtins-static"
version = "0.1.0"
dependencies = [
"bindgen 0.69.1",
"bindgen 0.69.2",
"mozilla-central-workspace-hack",
"nom",
"pkcs11-bindings",
@ -893,7 +894,7 @@ version = "0.2.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f3120ebb80a9de008e638ad833d4127d50ea3d3a960ea23ea69bc66d9358a028"
dependencies = [
"bindgen 0.69.1",
"bindgen 0.69.2",
]
[[package]]
@ -2027,7 +2028,7 @@ name = "gecko-profiler"
version = "0.1.0"
dependencies = [
"bincode",
"bindgen 0.69.1",
"bindgen 0.69.2",
"lazy_static",
"mozbuild",
"profiler-macros",
@ -2572,7 +2573,7 @@ name = "http3server"
version = "0.1.1"
dependencies = [
"base64 0.21.3",
"bindgen 0.69.1",
"bindgen 0.69.2",
"cfg-if 1.0.0",
"http",
"hyper",
@ -3655,7 +3656,7 @@ name = "mozilla-central-workspace-hack"
version = "0.1.0"
dependencies = [
"arrayvec",
"bindgen 0.69.1",
"bindgen 0.69.2",
"bitflags 2.4.0",
"bytes",
"cc",
@ -3968,7 +3969,7 @@ version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4c17aec6d4e1822c023689899f09311592a36cbf6de8f85dfaf5f01976790d8d"
dependencies = [
"bindgen 0.69.1",
"bindgen 0.64.999",
"mozbuild",
"once_cell",
"pkcs11-bindings",
@ -4340,7 +4341,7 @@ version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d0fabbdbe64b22820753da90995b3a73d02907eaeeac6f2414962a566aaa18ea"
dependencies = [
"bindgen 0.69.1",
"bindgen 0.64.999",
]
[[package]]
@ -5263,7 +5264,7 @@ dependencies = [
"app_units",
"arrayvec",
"atomic_refcell",
"bindgen 0.69.1",
"bindgen 0.69.2",
"bitflags 2.4.0",
"byteorder",
"cssparser",

Просмотреть файл

@ -145,8 +145,6 @@ backtrace = { path = "build/rust/backtrace" }
# Patch bindgen 0.63 and 0.64 to 0.69
bindgen_0_63 = { package = "bindgen", path = "build/rust/bindgen-0.63" }
bindgen_0_64 = { package = "bindgen", path = "build/rust/bindgen-0.64" }
# 0.69.1 + https://github.com/rust-lang/rust-bindgen/pull/2689
bindgen_0_69 = { package = "bindgen", git = "https://github.com/rust-lang/rust-bindgen", rev = "86f3dbe846020e2ba573d6eb38d1434d0cbcbb40" }
# Patch nix 0.24 to 0.27
nix = { path = "build/rust/nix" }

Просмотреть файл

@ -769,7 +769,7 @@ delta = "0.68.1 -> 0.69.1"
[[audits.bindgen]]
who = "Mike Hommey <mh+mozilla@glandium.org>"
criteria = "safe-to-deploy"
delta = "0.69.1 -> 0.69.1@git:86f3dbe846020e2ba573d6eb38d1434d0cbcbb40"
delta = "0.69.1 -> 0.69.2"
[[audits.bit-set]]
who = "Aria Beingessner <a.beingessner@gmail.com>"

Просмотреть файл

@ -23,10 +23,6 @@ url = "https://raw.githubusercontent.com/mozilla/supply-chain/main/audits.toml"
audit-as-crates-io = true
notes = "This is the upstream code plus a few local fixes, see bug 1685697."
[policy."bindgen:0.69.1@git:86f3dbe846020e2ba573d6eb38d1434d0cbcbb40"]
audit-as-crates-io = true
notes = "This is 0.69.1 + https://github.com/rust-lang/rust-bindgen/pull/2689."
[policy.chardetng]
audit-as-crates-io = true
notes = "This is a crate Henri wrote which is also published. We should probably update Firefox to tip and certify that."

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

34
third_party/rust/bindgen/Cargo.toml поставляемый
Просмотреть файл

@ -13,7 +13,7 @@
edition = "2018"
rust-version = "1.60.0"
name = "bindgen"
version = "0.69.1"
version = "0.69.2"
authors = [
"Jyun-Yan You <jyyou.tw@gmail.com>",
"Emilio Cobos Álvarez <emilio@crisal.io>",
@ -24,7 +24,7 @@ build = "build.rs"
description = "Automatically generates Rust FFI bindings to C and C++ libraries."
homepage = "https://rust-lang.github.io/rust-bindgen/"
documentation = "https://docs.rs/bindgen"
readme = "../README.md"
readme = "README.md"
keywords = [
"bindings",
"ffi",
@ -64,28 +64,34 @@ search = "# Unreleased"
name = "bindgen"
path = "lib.rs"
[dependencies]
bitflags = "2.2.1"
cexpr = "0.6"
lazy_static = "1"
lazycell = "1"
peeking_take_while = "0.1.2"
rustc-hash = "1.0.1"
shlex = "1"
[dependencies.annotate-snippets]
version = "0.9.1"
features = ["color"]
optional = true
[dependencies.bitflags]
version = "2.2.1"
[dependencies.cexpr]
version = "0.6"
[dependencies.clang-sys]
version = "1"
features = ["clang_6_0"]
[dependencies.lazy_static]
version = "1"
[dependencies.lazycell]
version = "1"
[dependencies.log]
version = "0.4"
optional = true
[dependencies.peeking_take_while]
version = "0.1.2"
[dependencies.prettyplease]
version = "0.2.7"
features = ["verbatim"]
@ -107,6 +113,12 @@ features = [
]
default-features = false
[dependencies.rustc-hash]
version = "1.0.1"
[dependencies.shlex]
version = "1"
[dependencies.syn]
version = "2.0"
features = [

89
third_party/rust/bindgen/README.md поставляемый Normal file
Просмотреть файл

@ -0,0 +1,89 @@
[![crates.io](https://img.shields.io/crates/v/bindgen.svg)](https://crates.io/crates/bindgen)
[![docs.rs](https://docs.rs/bindgen/badge.svg)](https://docs.rs/bindgen/)
# `bindgen`
**`bindgen` automatically generates Rust FFI bindings to C (and some C++) libraries.**
For example, given the C header `doggo.h`:
```c
typedef struct Doggo {
int many;
char wow;
} Doggo;
void eleven_out_of_ten_majestic_af(Doggo* pupper);
```
`bindgen` produces Rust FFI code allowing you to call into the `doggo` library's
functions and use its types:
```rust
/* automatically generated by rust-bindgen 0.99.9 */
#[repr(C)]
pub struct Doggo {
pub many: ::std::os::raw::c_int,
pub wow: ::std::os::raw::c_char,
}
extern "C" {
pub fn eleven_out_of_ten_majestic_af(pupper: *mut Doggo);
}
```
## Users Guide
[📚 Read the `bindgen` users guide here! 📚](https://rust-lang.github.io/rust-bindgen)
## MSRV
The `bindgen` minimum supported Rust version is **1.60.0**.
The `bindgen-cli` minimum supported Rust version is **1.64.0**.
No MSRV bump policy has been established yet, so MSRV may increase in any release.
The MSRV is the minimum Rust version that can be used to *compile* each crate. However, `bindgen` and `bindgen-cli` can generate bindings that are compatible with Rust versions below the current MSRV.
Most of the time, the `bindgen-cli` crate will have a more recent MSRV than `bindgen` as crates such as `clap` require it.
## API Reference
[API reference documentation is on docs.rs](https://docs.rs/bindgen)
## Environment Variables
In addition to the [library API](https://docs.rs/bindgen) and [executable command-line API][bindgen-cmdline],
`bindgen` can be controlled through environment variables.
End-users should set these environment variables to modify `bindgen`'s behavior without modifying the source code of direct consumers of `bindgen`.
- `BINDGEN_EXTRA_CLANG_ARGS`: extra arguments to pass to `clang`
- Arguments are whitespace-separated
- Use shell-style quoting to pass through whitespace
- Examples:
- Specify alternate sysroot: `--sysroot=/path/to/sysroot`
- Add include search path with spaces: `-I"/path/with spaces"`
- `BINDGEN_EXTRA_CLANG_ARGS_<TARGET>`: similar to `BINDGEN_EXTRA_CLANG_ARGS`,
but used to set per-target arguments to pass to clang. Useful to set system include
directories in a target-specific way in cross-compilation environments with multiple targets.
Has precedence over `BINDGEN_EXTRA_CLANG_ARGS`.
Additionally, `bindgen` uses `libclang` to parse C and C++ header files.
To modify how `bindgen` searches for `libclang`, see the [`clang-sys` documentation][clang-sys-env].
For more details on how `bindgen` uses `libclang`, see the [`bindgen` users guide][bindgen-book-clang].
## Releases
We don't follow a specific release calendar, but if you need a release please
file an issue requesting that (ping `@emilio` for increased effectiveness).
## Contributing
[See `CONTRIBUTING.md` for hacking on `bindgen`!](./CONTRIBUTING.md)
[bindgen-cmdline]: https://rust-lang.github.io/rust-bindgen/command-line-usage.html
[clang-sys-env]: https://github.com/KyleMayes/clang-sys#environment-variables
[bindgen-book-clang]: https://rust-lang.github.io/rust-bindgen/requirements.html#clang