Skip to content

Commit 90fc72d

Browse files
committed
Switch from attributes to callbacks.
This is a major change to autocxx-bindgen which aims to improve maintainability by reducing divergence from upstream bindgen. Specifically, it: * Significantly reduces the textual diffence * Makes the remaining changes less invasive, such that merge conflicts should be easier to resolve * Redoes the changes such that they're more attuned to the current evolution of upstream bindgen, so it may be possible to upstream some or ideally all of these changes. (The ultimate goal is to unfork bindgen!) See google/autocxx#124 and rust-lang#2943 for the background here. Specifically this change: * Removes the #[bindgen_semantic_attributes] which were added to all sorts of items. Instead, * Much more is communicated via the existing ParseCallbacks mechansim. * In some cases, it's still necessary to annotate individual types - in this case we generate a newtype wrapper instead of attributes. This commit also re-enables the bindgen test suite. It does not yet add tests for all the above new functionality; that's yet to come.
1 parent 40daade commit 90fc72d

File tree

113 files changed

+784
-911
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

113 files changed

+784
-911
lines changed

Cargo.lock

+112
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ members = [
44
"bindgen",
55
#"bindgen-cli",
66
#"bindgen-integration",
7-
#"bindgen-tests",
7+
"bindgen-tests",
88
#"bindgen-tests/tests/quickchecking",
99
#"bindgen-tests/tests/expectations",
1010
]
@@ -22,7 +22,7 @@ edition = "2021"
2222
# All dependency version management is centralized here
2323
[workspace.dependencies]
2424
annotate-snippets = "0.11.4"
25-
bindgen = { version = "0.71.1", path = "./bindgen", default-features = false }
25+
autocxx-bindgen = { version = "0.71.1", path = "./bindgen", default-features = false }
2626
bitflags = "2.2.1"
2727
block = "0.1"
2828
cc = "1.0"

bindgen-tests/Cargo.toml

+7-7
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ rust-version.workspace = true
88
edition.workspace = true
99

1010
[dev-dependencies]
11-
bindgen = { workspace = true, default-features = true, features = ["__cli", "experimental"] }
11+
autocxx-bindgen = { workspace = true, default-features = true, features = ["__cli", "experimental"] }
1212
owo-colors.workspace = true
1313
prettyplease = { workspace = true, features = ["verbatim"] }
1414
proc-macro2.workspace = true
@@ -19,10 +19,10 @@ syn.workspace = true
1919
tempfile.workspace = true
2020

2121
[features]
22-
logging = ["bindgen/logging"]
23-
static = ["bindgen/static"]
24-
runtime = ["bindgen/runtime"]
22+
logging = ["autocxx-bindgen/logging"]
23+
static = ["autocxx-bindgen/static"]
24+
runtime = ["autocxx-bindgen/runtime"]
2525

26-
__testing_only_extra_assertions = ["bindgen/__testing_only_extra_assertions"]
27-
__testing_only_libclang_9 = ["bindgen/__testing_only_libclang_9"]
28-
__testing_only_libclang_16 = ["bindgen/__testing_only_libclang_16"]
26+
__testing_only_extra_assertions = ["autocxx-bindgen/__testing_only_extra_assertions"]
27+
__testing_only_libclang_9 = ["autocxx-bindgen/__testing_only_libclang_9"]
28+
__testing_only_libclang_16 = ["autocxx-bindgen/__testing_only_libclang_16"]

bindgen-tests/tests/expectations/tests/381-decltype-alias.rs

-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bindgen-tests/tests/expectations/tests/allowlist_basic.rs

-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bindgen-tests/tests/expectations/tests/anon_enum_trait.rs

-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bindgen-tests/tests/expectations/tests/anon_union.rs

-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bindgen-tests/tests/expectations/tests/attribute_warn_unused_result.rs

-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bindgen-tests/tests/expectations/tests/attribute_warn_unused_result_no_attribute_detection.rs

-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bindgen-tests/tests/expectations/tests/bad-namespace-parenthood-inheritance.rs

-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bindgen-tests/tests/expectations/tests/bitfield-method-same-name.rs

-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bindgen-tests/tests/expectations/tests/builtin-template.rs

-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bindgen-tests/tests/expectations/tests/call-conv-typedef.rs

-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bindgen-tests/tests/expectations/tests/class_nested.rs

-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bindgen-tests/tests/expectations/tests/class_with_enum.rs

+6-21
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)