Skip to content

Commit

Permalink
Update proc-macro2 to 1.0.70
Browse files Browse the repository at this point in the history
Summary:
This release includes a fix to `proc_macro2::Ident::new` to report invalid input at the call site using #[track_caller], instead of inside proc-macro2 code.

This affects LLVM staging (which is LLVM 18) because old bindgen (<0.62.0) is incompatible with Clang 16+, manifesting as panicks in `Ident::new`. See {D40685340}.

**Before:**

```
Action failed: fbsource//third-party/rust:loopdev-0.4.0-build-script-run (buildscript)
thread 'main' panicked at '"enum_(unnamed_at_/usr/include/linux/loop_h_21_1)" is not a valid Ident', third-party/rust/vendor/proc-macro2-1.0.69/src/fallback.rs:817:9

Action failed: fbsource//third-party/rust:virt-sys-0.1.0-build-script-run (buildscript)
thread 'main' panicked at '"_virTypedParameter_union_(unnamed_at___/__/__/__/__/__/fbcode/ca3f1b68f56b9220/third-party-buck/platform010/build/libvirt/__include__/include/include/libvirt/libvirt-common_h_206_5)" is not a valid Ident', third-party/rust/vendor/proc-macro2-1.0.69/src/fallback.rs:817:9
```

**After:**

```
Action failed: fbsource//third-party/rust:loopdev-0.4.0-build-script-run (buildscript)
thread 'main' panicked at '"enum_(unnamed_at_/usr/include/linux/loop_h_21_1)" is not a valid Ident', third-party/rust/vendor/bindgen-0.59.2/src/ir/context.rs:878:9

Action failed: fbsource//third-party/rust:virt-sys-0.1.0-build-script-run (buildscript)
thread 'main' panicked at '"_virTypedParameter_union_(unnamed_at___/__/__/__/__/__/fbcode/ca3f1b68f56b9220/third-party-buck/platform010/build/libvirt/__include__/include/include/libvirt/libvirt-common_h_206_5)" is not a valid Ident', third-party/rust/vendor/bindgen-0.59.2/src/ir/context.rs:878:9
```

Of course, that panic still needs to be fixed properly. I will pursue that next. But at least the location of the faulty code is reported correctly.

Reviewed By: zertosh

Differential Revision: D51633230

fbshipit-source-id: db9794ed4ea70f773925bdaf9a11de289d2aa25c
  • Loading branch information
David Tolnay authored and facebook-github-bot committed Nov 28, 2023
1 parent 2c09844 commit 5f5b56a
Show file tree
Hide file tree
Showing 15 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions hphp/hack/src/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ path = "../../print_opcode_impl.rs"
convert_case = "0.4.0"
hash = { version = "0.0.0", path = "../../../../../utils/hash" }
hhbc-gen = { version = "0.0.0", path = "../../../../../../../tools/hhbc-gen" }
proc-macro2 = { version = "1.0.64", features = ["span-locations"] }
proc-macro2 = { version = "1.0.70", features = ["span-locations"] }
quote = "1.0.29"
syn = { version = "1.0.109", features = ["extra-traits", "fold", "full", "visit", "visit-mut"] }

Expand Down
2 changes: 1 addition & 1 deletion hphp/hack/src/hackc/cargo/assemble_opcode_macro/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ proc-macro = true
[dependencies]
hhbc-gen = { version = "0.0.0", path = "../../../../../tools/hhbc-gen" }
itertools = "0.11.0"
proc-macro2 = { version = "1.0.64", features = ["span-locations"] }
proc-macro2 = { version = "1.0.70", features = ["span-locations"] }
quote = "1.0.29"
syn = { version = "1.0.109", features = ["extra-traits", "fold", "full", "visit", "visit-mut"] }
2 changes: 1 addition & 1 deletion hphp/hack/src/hackc/cargo/parse_macro/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ proc-macro = true

[dependencies]
proc-macro-error = "1.0"
proc-macro2 = { version = "1.0.64", features = ["span-locations"] }
proc-macro2 = { version = "1.0.70", features = ["span-locations"] }
quote = "1.0.29"
2 changes: 1 addition & 1 deletion hphp/hack/src/hackc/hhbc/cargo/emit_opcodes/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ path = "../../emit_opcodes.rs"
[dependencies]
convert_case = "0.4.0"
hhbc-gen = { version = "0.0.0", path = "../../../../../../tools/hhbc-gen" }
proc-macro2 = { version = "1.0.64", features = ["span-locations"] }
proc-macro2 = { version = "1.0.70", features = ["span-locations"] }
quote = "1.0.29"
syn = { version = "1.0.109", features = ["extra-traits", "fold", "full", "visit", "visit-mut"] }

Expand Down
2 changes: 1 addition & 1 deletion hphp/hack/src/hackc/ir/cargo/parse_macro/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ proc-macro = true

[dependencies]
proc-macro-error = "1.0"
proc-macro2 = { version = "1.0.64", features = ["span-locations"] }
proc-macro2 = { version = "1.0.70", features = ["span-locations"] }
quote = "1.0.29"

[dev-dependencies]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ proc-macro = true

[dependencies]
hhbc-gen = { version = "0.0.0", path = "../../../../../../../tools/hhbc-gen" }
proc-macro2 = { version = "1.0.64", features = ["span-locations"] }
proc-macro2 = { version = "1.0.70", features = ["span-locations"] }
quote = "1.0.29"
syn = { version = "1.0.109", features = ["extra-traits", "fold", "full", "visit", "visit-mut"] }
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ proc-macro = true
[dependencies]
itertools = "0.11.0"
proc-macro-error = "1.0"
proc-macro2 = { version = "1.0.64", features = ["span-locations"] }
proc-macro2 = { version = "1.0.70", features = ["span-locations"] }
quote = "1.0.29"
syn = { version = "1.0.109", features = ["extra-traits", "fold", "full", "visit", "visit-mut"] }
2 changes: 1 addition & 1 deletion hphp/hack/src/hackc/ir/macros/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ doctest = false
proc-macro = true

[dependencies]
proc-macro2 = { version = "1.0.64", features = ["span-locations"] }
proc-macro2 = { version = "1.0.70", features = ["span-locations"] }
quote = "1.0.29"
syn = { version = "1.0.109", features = ["extra-traits", "fold", "full", "visit", "visit-mut"] }
2 changes: 1 addition & 1 deletion hphp/hack/src/hh_codegen/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ path = "hh_codegen.rs"
anyhow = "=1.0.72"
clap = { version = "4.4.7", features = ["derive", "env", "string", "unicode", "wrap_help"] }
hash = { version = "0.0.0", path = "../utils/hash" }
proc-macro2 = { version = "1.0.64", features = ["span-locations"] }
proc-macro2 = { version = "1.0.70", features = ["span-locations"] }
quote = "1.0.29"
signed_source = { version = "0.0.0", path = "../utils/rust/signed_source" }
syn = { version = "1.0.109", features = ["extra-traits", "fold", "full", "visit", "visit-mut"] }
Expand Down
2 changes: 1 addition & 1 deletion hphp/hack/src/utils/eq_modulo_pos_derive/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ doctest = false
proc-macro = true

[dependencies]
proc-macro2 = { version = "1.0.64", features = ["span-locations"] }
proc-macro2 = { version = "1.0.70", features = ["span-locations"] }
quote = "1.0.29"
synstructure = "0.12"
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ aast_parser = { version = "0.0.0", path = "../../../../parser/cargo/aast_parser"
naming_special_names_rust = { version = "0.0.0", path = "../../../../naming" }
oxidized = { version = "0.0.0", path = "../../../../oxidized" }
parser_core_types = { version = "0.0.0", path = "../../../../parser/cargo/core_types" }
proc-macro2 = { version = "1.0.64", features = ["span-locations"] }
proc-macro2 = { version = "1.0.70", features = ["span-locations"] }
quote = "1.0.29"
regex = "1.9.2"
relative_path = { version = "0.0.0", path = "../../../rust/relative_path" }
Expand Down
2 changes: 1 addition & 1 deletion hphp/hack/src/utils/no_pos_hash/derive/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ doctest = false
proc-macro = true

[dependencies]
proc-macro2 = { version = "1.0.64", features = ["span-locations"] }
proc-macro2 = { version = "1.0.70", features = ["span-locations"] }
quote = "1.0.29"
syn = { version = "1.0.109", features = ["extra-traits", "fold", "full", "visit", "visit-mut"] }
synstructure = "0.12"
2 changes: 1 addition & 1 deletion hphp/hack/src/utils/test/macro_test_util/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ edition = "2021"
path = "../macro_test_util.rs"

[dependencies]
proc-macro2 = { version = "1.0.64", features = ["span-locations"] }
proc-macro2 = { version = "1.0.70", features = ["span-locations"] }
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ doctest = false
proc-macro = true

[dependencies]
proc-macro2 = { version = "1.0.64", features = ["span-locations"] }
proc-macro2 = { version = "1.0.70", features = ["span-locations"] }
quote = "1.0.29"
syn = { version = "1.0.109", features = ["extra-traits", "fold", "full", "visit", "visit-mut"] }

0 comments on commit 5f5b56a

Please sign in to comment.