diff --git a/.cargo/config.in b/.cargo/config.in index 8814c5662d52..7adb1255702f 100644 --- a/.cargo/config.in +++ b/.cargo/config.in @@ -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" diff --git a/Cargo.lock b/Cargo.lock index 6151dae8ea34..184d0efd12cb 100644 --- a/Cargo.lock +++ b/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", diff --git a/Cargo.toml b/Cargo.toml index 054a51543308..f10f6726cd38 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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" } diff --git a/supply-chain/audits.toml b/supply-chain/audits.toml index b8d081db25b9..c081f0e3255f 100644 --- a/supply-chain/audits.toml +++ b/supply-chain/audits.toml @@ -769,7 +769,7 @@ delta = "0.68.1 -> 0.69.1" [[audits.bindgen]] who = "Mike Hommey " 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 " diff --git a/supply-chain/config.toml b/supply-chain/config.toml index be0763425c95..0cba9cfde542 100644 --- a/supply-chain/config.toml +++ b/supply-chain/config.toml @@ -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." diff --git a/third_party/rust/bindgen/.cargo-checksum.json b/third_party/rust/bindgen/.cargo-checksum.json index 28485844049e..27e2330cd3c7 100644 --- a/third_party/rust/bindgen/.cargo-checksum.json +++ b/third_party/rust/bindgen/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"2a1c0d2ac8fd6370a19be10bd918bd7e00dac00ec93b69859208b9cc681b9bf6","LICENSE":"c23953d9deb0a3312dbeaf6c128a657f3591acee45067612fa68405eaa4525db","build.rs":"4a9c4ac3759572e17de312a9d3f4ced3b6fd3c71811729e5a8d06bfbd1ac8f82","callbacks.rs":"cd5a1b0fc665b034d97615d0b6817cbef299dbf5276254c7e63f1c29674993ad","clang.rs":"5865e207df0c182c7433a08515cf1049d7885eb1273911cb2ea6155638b469a7","codegen/bitfield_unit.rs":"fddeaeab5859f4e82081865595b7705f5c0774d997df95fa5c655b81b9cae125","codegen/bitfield_unit_tests.rs":"9df86490de5e9d66ccea583dcb686dd440375dc1a3c3cf89a89d5de3883bf28a","codegen/dyngen.rs":"6d8bed53c6de66bc658b3186041c2b75549f49b0f0363ff18b87c8dcf2f5a05b","codegen/error.rs":"0c3d198f4866ccbbcd8b1136fc5cfd2507a9eca5ab85934af29a7e2a7d8d8c2a","codegen/helpers.rs":"0c28751565c90b4ab385ae2113cde02afa34225d85ae48fd296817aac36c5940","codegen/impl_debug.rs":"80df6136327b1ca8c7d1c2961290b5ab00b85b49b22c02f26a590bc68fb230af","codegen/impl_partialeq.rs":"db739d7ba6f5ba4033d6bf62c276f35217c20eab27230cf07dadf59e8b2f71bb","codegen/mod.rs":"d7f28d62feba79278ec2196c2fd23a9fbf28f28fcce55d209c5d8d6ea88e9673","codegen/postprocessing/merge_extern_blocks.rs":"284457a3c75e945217bab4e5a4280fef0fcc03c31e12cc5010aab87f34c0b6c7","codegen/postprocessing/mod.rs":"160a6d6701cabf2514e23570df1bd1b648c909cc27b7c583f21d98fe0c16722e","codegen/postprocessing/sort_semantically.rs":"f465d1e8cc119082eb79c164b5cd780a370821e8bf56585b287dd3b51fc4a542","codegen/serialize.rs":"c39112e01686f741eca4a89dca83a10e66c611b3d21d7c9548ba76f8c2d43a2b","codegen/struct_layout.rs":"07007251c91e0d4eb1e46535068d8c22881d248baa2e38cab96d72691927c2e4","deps.rs":"af3dd24a7808b5abf0c4ed4b10bbceb8eef32be980ff085b8a766d8f089af1a4","diagnostics.rs":"dc40cd5e9710922422c5c9420e2351f5d976e7a1d7275e4f4ce742cad9eb53f8","extra_assertions.rs":"fb4484c0e9fcbea9ec7265f5fbd01e2b33ac022b2b17e060dce7886819d57e40","features.rs":"29f2df89716a47a7d9dbd33b1ff4da61645e729a92772530bed3a04163afc08f","ir/analysis/derive.rs":"cba290e9c4ba271e90524149ad3b874f37843bfdfab12d513cc85d2665447fd5","ir/analysis/has_destructor.rs":"e7e95c3b0989b6375cd3eabaac85a36ecc2915a1fd3700c7d26fe04e8dc83ba3","ir/analysis/has_float.rs":"a56b97bf913f132c2c63dc202b45c692c416a8c9fdc6b2baeee30362fb0d4405","ir/analysis/has_type_param_in_array.rs":"788ebb4ba2cf46a22f1e4ff3005d51f38d414b72e95355f7ff4125521e2d9525","ir/analysis/has_vtable.rs":"83efa40ae89147170eabdff1387e60aba574ca4cd4cdef22692753594f09d6c6","ir/analysis/mod.rs":"9d949c27451da4ed72994b31c04ddeb89eeb342fd23ea572d3962d4ccf774841","ir/analysis/sizedness.rs":"f0a9302f3c6ad694d76cfab11dbaf5392ecaf7f04bc7b211a5a003776b963896","ir/analysis/template_params.rs":"3ff27e2198e292a348876aa1faba39cc4b1870a24a7e173feac0b3c592001e13","ir/annotations.rs":"5ed03d025862d0d21852a76c86a993772624e123fdc3752415d588a0b4e643ab","ir/comment.rs":"4c9c20b5a3da086211e92adec0822831dbc0b7ebee98fee313edcae9ae8d55ec","ir/comp.rs":"fb32715ed8fc14bee51c344a41c1f7a8a802d4a6dceb2775034ea33a88670df7","ir/context.rs":"a1c591532b44bc532c18f8e5afa0ba4aa94934db2de23f2c71dbdfcb384fd333","ir/derive.rs":"c21e470bb0091f20bfa366110880d48984fc3cf7071fdf36eccfa64f3eca231c","ir/dot.rs":"75bdfd83d9e754ba726f6a5529ba1d9ff46f5bf49bf237452985eb008fed0854","ir/enum_ty.rs":"f4bfa6d18ba4977fb66f5d5e4a7674eded93b761404d91cdd6fdd50029db455a","ir/function.rs":"8acde871c277069d94c96cf4dea68497b2d6253e66014db9655dd825906b19cc","ir/int.rs":"601736f0ad0949e40684a9ce89bafbfefa71743df6ee6c342e44888a0f141ae0","ir/item.rs":"9e79006baca2ff6072ffcf32479b8fab7a4d6ddb1a6900a007dd0531c8b43b23","ir/item_kind.rs":"33e21104b0bb824a696a52cd520567ae56158010a1df14777e68ac5f8ad7e8fa","ir/layout.rs":"8fbafc0eeee17abb703a18613be1066e38838d4b67f5916f714bf545e545bc1a","ir/mod.rs":"a3b98b1732111a980a795c72eaf1e09101e842ef2de76b4f2d4a7857f8d4cee4","ir/module.rs":"b2961ffa4acb0c19f084c5db084b8a17bda7158066782a73b80ee7d838789bf9","ir/objc.rs":"8f57a9180d57a690449f20ed1be80209db5f8a410bb067ae8bf5e0ecab16a5e4","ir/template.rs":"3f59efa9670ca90215d4374be869c9dbecb98a8d1041e7c6e4ab69a62bb982c2","ir/traversal.rs":"a4ec73d3533d4b93386153baf6a2ca846ee51228c76ed51105229d3ddcd74466","ir/ty.rs":"69300e7f8255627da1a3fe641ffe7215f7889d4b3c0fcbf7c366b78e3849d5cb","ir/var.rs":"40d18226706de0ee5f002d0b5617dbcba35de0605edd531c75e3a76d000f0f4f","lib.rs":"1c5b0c2f6e71895059a0c0bf3b9bc0d6ff1c32cf296c8547e1b63d58fe589319","log_stubs.rs":"9f974e041e35c8c7e29985d27ae5cd0858d68f8676d1dc005c6388d7d011707f","options/as_args.rs":"76efa4e662cc7f89ef1c1fe089d03a3c1c019ffe2aa0a30a4d49ed41e987d1c7","options/helpers.rs":"f4a7681e29b2dcc3be9249478c499d685b9e29d4f4ca4ae8bff7a91668cd8f15","options/mod.rs":"2df5cd073da0f5fc68707551f6c86a9795225195da8e630a7670e49d205dc05d","parse.rs":"fce3616e0464aa7414888e5d00d4df18c83bb3034a1c807d36a07a3c586e475a","regex_set.rs":"b411d64bc803947a3f69dcedcd7d03716aacbc7b1c5148b82de1cc469d9336d9","time.rs":"8efe317e7c6b5ba8e0865ce7b49ca775ee8a02590f4241ef62f647fa3c22b68e"},"package":null} \ No newline at end of file +{"files":{"Cargo.toml":"700e9df94a3086bebcb19c2b9bbcbca993778ccca161eb32a124623dfc9b0687","LICENSE":"c23953d9deb0a3312dbeaf6c128a657f3591acee45067612fa68405eaa4525db","README.md":"b2334e4077a9bc329516e3e0c7f89887c4f073647d95fb71b6917edf4c310ba3","build.rs":"4a9c4ac3759572e17de312a9d3f4ced3b6fd3c71811729e5a8d06bfbd1ac8f82","callbacks.rs":"cd5a1b0fc665b034d97615d0b6817cbef299dbf5276254c7e63f1c29674993ad","clang.rs":"5865e207df0c182c7433a08515cf1049d7885eb1273911cb2ea6155638b469a7","codegen/bitfield_unit.rs":"fddeaeab5859f4e82081865595b7705f5c0774d997df95fa5c655b81b9cae125","codegen/bitfield_unit_tests.rs":"9df86490de5e9d66ccea583dcb686dd440375dc1a3c3cf89a89d5de3883bf28a","codegen/dyngen.rs":"6d8bed53c6de66bc658b3186041c2b75549f49b0f0363ff18b87c8dcf2f5a05b","codegen/error.rs":"0c3d198f4866ccbbcd8b1136fc5cfd2507a9eca5ab85934af29a7e2a7d8d8c2a","codegen/helpers.rs":"0c28751565c90b4ab385ae2113cde02afa34225d85ae48fd296817aac36c5940","codegen/impl_debug.rs":"80df6136327b1ca8c7d1c2961290b5ab00b85b49b22c02f26a590bc68fb230af","codegen/impl_partialeq.rs":"db739d7ba6f5ba4033d6bf62c276f35217c20eab27230cf07dadf59e8b2f71bb","codegen/mod.rs":"d7f28d62feba79278ec2196c2fd23a9fbf28f28fcce55d209c5d8d6ea88e9673","codegen/postprocessing/merge_extern_blocks.rs":"284457a3c75e945217bab4e5a4280fef0fcc03c31e12cc5010aab87f34c0b6c7","codegen/postprocessing/mod.rs":"160a6d6701cabf2514e23570df1bd1b648c909cc27b7c583f21d98fe0c16722e","codegen/postprocessing/sort_semantically.rs":"f465d1e8cc119082eb79c164b5cd780a370821e8bf56585b287dd3b51fc4a542","codegen/serialize.rs":"c39112e01686f741eca4a89dca83a10e66c611b3d21d7c9548ba76f8c2d43a2b","codegen/struct_layout.rs":"07007251c91e0d4eb1e46535068d8c22881d248baa2e38cab96d72691927c2e4","deps.rs":"af3dd24a7808b5abf0c4ed4b10bbceb8eef32be980ff085b8a766d8f089af1a4","diagnostics.rs":"dc40cd5e9710922422c5c9420e2351f5d976e7a1d7275e4f4ce742cad9eb53f8","extra_assertions.rs":"fb4484c0e9fcbea9ec7265f5fbd01e2b33ac022b2b17e060dce7886819d57e40","features.rs":"29f2df89716a47a7d9dbd33b1ff4da61645e729a92772530bed3a04163afc08f","ir/analysis/derive.rs":"cba290e9c4ba271e90524149ad3b874f37843bfdfab12d513cc85d2665447fd5","ir/analysis/has_destructor.rs":"e7e95c3b0989b6375cd3eabaac85a36ecc2915a1fd3700c7d26fe04e8dc83ba3","ir/analysis/has_float.rs":"a56b97bf913f132c2c63dc202b45c692c416a8c9fdc6b2baeee30362fb0d4405","ir/analysis/has_type_param_in_array.rs":"788ebb4ba2cf46a22f1e4ff3005d51f38d414b72e95355f7ff4125521e2d9525","ir/analysis/has_vtable.rs":"83efa40ae89147170eabdff1387e60aba574ca4cd4cdef22692753594f09d6c6","ir/analysis/mod.rs":"9d949c27451da4ed72994b31c04ddeb89eeb342fd23ea572d3962d4ccf774841","ir/analysis/sizedness.rs":"f0a9302f3c6ad694d76cfab11dbaf5392ecaf7f04bc7b211a5a003776b963896","ir/analysis/template_params.rs":"3ff27e2198e292a348876aa1faba39cc4b1870a24a7e173feac0b3c592001e13","ir/annotations.rs":"5ed03d025862d0d21852a76c86a993772624e123fdc3752415d588a0b4e643ab","ir/comment.rs":"4c9c20b5a3da086211e92adec0822831dbc0b7ebee98fee313edcae9ae8d55ec","ir/comp.rs":"fb32715ed8fc14bee51c344a41c1f7a8a802d4a6dceb2775034ea33a88670df7","ir/context.rs":"a1c591532b44bc532c18f8e5afa0ba4aa94934db2de23f2c71dbdfcb384fd333","ir/derive.rs":"c21e470bb0091f20bfa366110880d48984fc3cf7071fdf36eccfa64f3eca231c","ir/dot.rs":"75bdfd83d9e754ba726f6a5529ba1d9ff46f5bf49bf237452985eb008fed0854","ir/enum_ty.rs":"f4bfa6d18ba4977fb66f5d5e4a7674eded93b761404d91cdd6fdd50029db455a","ir/function.rs":"8acde871c277069d94c96cf4dea68497b2d6253e66014db9655dd825906b19cc","ir/int.rs":"601736f0ad0949e40684a9ce89bafbfefa71743df6ee6c342e44888a0f141ae0","ir/item.rs":"9e79006baca2ff6072ffcf32479b8fab7a4d6ddb1a6900a007dd0531c8b43b23","ir/item_kind.rs":"33e21104b0bb824a696a52cd520567ae56158010a1df14777e68ac5f8ad7e8fa","ir/layout.rs":"8fbafc0eeee17abb703a18613be1066e38838d4b67f5916f714bf545e545bc1a","ir/mod.rs":"a3b98b1732111a980a795c72eaf1e09101e842ef2de76b4f2d4a7857f8d4cee4","ir/module.rs":"b2961ffa4acb0c19f084c5db084b8a17bda7158066782a73b80ee7d838789bf9","ir/objc.rs":"8f57a9180d57a690449f20ed1be80209db5f8a410bb067ae8bf5e0ecab16a5e4","ir/template.rs":"3f59efa9670ca90215d4374be869c9dbecb98a8d1041e7c6e4ab69a62bb982c2","ir/traversal.rs":"a4ec73d3533d4b93386153baf6a2ca846ee51228c76ed51105229d3ddcd74466","ir/ty.rs":"69300e7f8255627da1a3fe641ffe7215f7889d4b3c0fcbf7c366b78e3849d5cb","ir/var.rs":"40d18226706de0ee5f002d0b5617dbcba35de0605edd531c75e3a76d000f0f4f","lib.rs":"1c5b0c2f6e71895059a0c0bf3b9bc0d6ff1c32cf296c8547e1b63d58fe589319","log_stubs.rs":"9f974e041e35c8c7e29985d27ae5cd0858d68f8676d1dc005c6388d7d011707f","options/as_args.rs":"76efa4e662cc7f89ef1c1fe089d03a3c1c019ffe2aa0a30a4d49ed41e987d1c7","options/helpers.rs":"f4a7681e29b2dcc3be9249478c499d685b9e29d4f4ca4ae8bff7a91668cd8f15","options/mod.rs":"2df5cd073da0f5fc68707551f6c86a9795225195da8e630a7670e49d205dc05d","parse.rs":"fce3616e0464aa7414888e5d00d4df18c83bb3034a1c807d36a07a3c586e475a","regex_set.rs":"b411d64bc803947a3f69dcedcd7d03716aacbc7b1c5148b82de1cc469d9336d9","time.rs":"8efe317e7c6b5ba8e0865ce7b49ca775ee8a02590f4241ef62f647fa3c22b68e"},"package":"a4c69fae65a523209d34240b60abe0c42d33d1045d445c0839d8a4894a736e2d"} \ No newline at end of file diff --git a/third_party/rust/bindgen/Cargo.toml b/third_party/rust/bindgen/Cargo.toml index 5caae0942512..9914cde30405 100644 --- a/third_party/rust/bindgen/Cargo.toml +++ b/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 ", "Emilio Cobos Álvarez ", @@ -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 = [ diff --git a/third_party/rust/bindgen/README.md b/third_party/rust/bindgen/README.md new file mode 100644 index 000000000000..620ad0ab94f9 --- /dev/null +++ b/third_party/rust/bindgen/README.md @@ -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_`: 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