From 3439e76657e7b31a049ba7bf921aaebaca6404c6 Mon Sep 17 00:00:00 2001 From: Marco Castelluccio Date: Thu, 7 Dec 2023 15:50:38 +0000 Subject: [PATCH] Bug 1866608 - Update bindgen with fix from https://github.com/rust-lang/rust-bindgen/pull/2689. r=emilio,supply-chain-reviewers Differential Revision: https://phabricator.services.mozilla.com/D195060 UltraBlame original commit: 160bfd7365875ceea03d8b499ea08ee9051d9239 --- .cargo/config.in | 60 ++ Cargo.lock | 25 +- Cargo.toml | 59 ++ supply-chain/audits.toml | 49 ++ supply-chain/config.toml | 57 ++ third_party/rust/bindgen/.cargo-checksum.json | 17 +- third_party/rust/bindgen/Cargo.toml | 131 ++- third_party/rust/bindgen/README.md | 772 ------------------ third_party/rust/bindgen/ir/item.rs | 35 +- 9 files changed, 312 insertions(+), 893 deletions(-) delete mode 100644 third_party/rust/bindgen/README.md diff --git a/.cargo/config.in b/.cargo/config.in index 2089187fc3e1..56029808e718 100644 --- a/.cargo/config.in +++ b/.cargo/config.in @@ -1124,6 +1124,66 @@ 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 +/ servo / rust diff --git a/Cargo.lock b/Cargo.lock index ee483d3e55bd..4f4fe5ba2785 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2483,7 +2483,7 @@ version source = " -registry +git + https : @@ -2497,16 +2497,15 @@ rust - lang / -crates -. -io +rust - -index -" -checksum +bindgen +? +rev = -" -9ffcebc3849946a7170a05992aac39da343a90676ab392c51a4280981d6379c2 +86f3dbe846020e2ba573d6eb38d1434d0cbcbb40 +# +86f3dbe846020e2ba573d6eb38d1434d0cbcbb40 " dependencies = @@ -21782,9 +21781,9 @@ dependencies bindgen 0 . -66 +69 . -999 +1 " " mozbuild @@ -23870,9 +23869,9 @@ dependencies bindgen 0 . -66 +69 . -999 +1 " ] [ diff --git a/Cargo.toml b/Cargo.toml index acbb9b2cdc36..9d48a3488e0b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1204,6 +1204,65 @@ bindgen " } # +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 diff --git a/supply-chain/audits.toml b/supply-chain/audits.toml index 8993022e88fa..2cdc3e96be12 100644 --- a/supply-chain/audits.toml +++ b/supply-chain/audits.toml @@ -6602,6 +6602,55 @@ delta [ audits . +bindgen +] +] +who += +" +Mike +Hommey +< +mh ++ +mozilla +glandium +. +org +> +" +criteria += +" +safe +- +to +- +deploy +" +delta += +" +0 +. +69 +. +1 +- +> +0 +. +69 +. +1 +git +: +86f3dbe846020e2ba573d6eb38d1434d0cbcbb40 +" +[ +[ +audits +. bit - set diff --git a/supply-chain/config.toml b/supply-chain/config.toml index fa31a10498d4..46810b0b7501 100644 --- a/supply-chain/config.toml +++ b/supply-chain/config.toml @@ -211,6 +211,63 @@ bug [ 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 diff --git a/third_party/rust/bindgen/.cargo-checksum.json b/third_party/rust/bindgen/.cargo-checksum.json index df08179caf7c..a57f548bda97 100644 --- a/third_party/rust/bindgen/.cargo-checksum.json +++ b/third_party/rust/bindgen/.cargo-checksum.json @@ -11,7 +11,7 @@ toml " : " -e42a53f0727990f7c85c9faa0ba1934e51ce0f42ead43729cf25431b681a6e76 +2a1c0d2ac8fd6370a19be10bd918bd7e00dac00ec93b69859208b9cc681b9bf6 " " LICENSE @@ -21,15 +21,6 @@ LICENSE c23953d9deb0a3312dbeaf6c128a657f3591acee45067612fa68405eaa4525db " " -README -. -md -" -: -" -b2334e4077a9bc329516e3e0c7f89887c4f073647d95fb71b6917edf4c310ba3 -" -" build . rs @@ -453,7 +444,7 @@ rs " : " -0a58e318959266630e7e3b94d631c8a64b9a0eeaeae5a510c345fb6c3f6b088b +9e79006baca2ff6072ffcf32479b8fab7a4d6ddb1a6900a007dd0531c8b43b23 " " ir @@ -637,7 +628,5 @@ rs package " : -" -9ffcebc3849946a7170a05992aac39da343a90676ab392c51a4280981d6379c2 -" +null } diff --git a/third_party/rust/bindgen/Cargo.toml b/third_party/rust/bindgen/Cargo.toml index dec58e84b49b..94c196361775 100644 --- a/third_party/rust/bindgen/Cargo.toml +++ b/third_party/rust/bindgen/Cargo.toml @@ -232,6 +232,9 @@ bindgen readme = " +. +. +/ README . md @@ -438,95 +441,103 @@ rs " [ dependencies -. -annotate -- -snippets ] -version +bitflags = " -0 +2 . -9 +2 . 1 " -features +cexpr = -[ " -color +0 +. +6 " -] -optional +lazy_static = -true -[ -dependencies -. -bitflags -] -version +" +1 +" +lazycell = " -2 -. -2 -. 1 " -[ -dependencies +peeking_take_while += +" +0 . -cexpr -] -version +1 +. +2 +" +rustc +- +hash = " +1 +. 0 . -6 +1 +" +shlex += +" +1 " [ dependencies . -clang +annotate - -sys +snippets ] version = " +0 +. +9 +. 1 " features = [ " -clang_6_0 +color " ] +optional += +true [ dependencies . -lazy_static +clang +- +sys ] version = " 1 " -[ -dependencies -. -lazycell -] -version +features = +[ " -1 +clang_6_0 " +] [ dependencies . @@ -545,20 +556,6 @@ true [ dependencies . -peeking_take_while -] -version -= -" -0 -. -1 -. -2 -" -[ -dependencies -. prettyplease ] version @@ -642,32 +639,6 @@ false [ dependencies . -rustc -- -hash -] -version -= -" -1 -. -0 -. -1 -" -[ -dependencies -. -shlex -] -version -= -" -1 -" -[ -dependencies -. syn ] version diff --git a/third_party/rust/bindgen/README.md b/third_party/rust/bindgen/README.md deleted file mode 100644 index 82f4e21e0e9b..000000000000 --- a/third_party/rust/bindgen/README.md +++ /dev/null @@ -1,772 +0,0 @@ -[ -! -[ -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 diff --git a/third_party/rust/bindgen/ir/item.rs b/third_party/rust/bindgen/ir/item.rs index 4b729db559df..90da08cef59b 100644 --- a/third_party/rust/bindgen/ir/item.rs +++ b/third_party/rust/bindgen/ir/item.rs @@ -7086,15 +7086,18 @@ Continue } } } -if +match cursor . kind ( ) -= -= +{ +CXCursor_LinkageSpec +| CXCursor_UnexposedDecl += +> { Err ( @@ -7104,15 +7107,6 @@ ParseError Recurse ) } -else -{ -match -cursor -. -kind -( -) -{ CXCursor_MacroDefinition | CXCursor_MacroExpansion @@ -7152,6 +7146,13 @@ kind cursor ) ; +Err +( +ParseError +: +: +Continue +) } CXCursor_InclusionDirective = @@ -7233,6 +7234,13 @@ into_boxed_str ; } } +Err +( +ParseError +: +: +Continue +) } _ = @@ -7284,8 +7292,6 @@ cursor ) ; } -} -} Err ( ParseError @@ -7295,6 +7301,7 @@ Continue ) } } +} pub ( crate