summaryrefslogtreecommitdiff
path: root/yjit/bindgen
diff options
context:
space:
mode:
authorNoah Gibbs <noah.gibbs@shopify.com>2022-06-29 17:49:46 +0100
committerGitHub <noreply@github.com>2022-06-29 12:49:46 -0400
commit118e3edc32c9d1768cd4f33ca18f2c40ce9ae333 (patch)
tree13f2b42df3ec9be85db635be83b358bc41e0007e /yjit/bindgen
parentb340d566e5af3795aabea7db060eab6313841503 (diff)
Add a check-yjit-bindgen-unused target. Add to CI. (#6066)
This fails if there are any unused rust-bindgen "allow" entries. For that target we turn on Rust warnings (there are a lot) and grep for the ones that correspond to unused allow entries. I've added check-yjit-bindgen-unused as a dependency of check-yjit-bindings, so unused allow entries will now fail CI. This change also removes our single unused allow entry (VM_CALL.*) which was known to be bad.
Notes
Notes: Merged-By: maximecb <maximecb@ruby-lang.org>
Diffstat (limited to 'yjit/bindgen')
-rw-r--r--yjit/bindgen/Cargo.lock1
-rw-r--r--yjit/bindgen/Cargo.toml1
-rw-r--r--yjit/bindgen/src/main.rs6
3 files changed, 6 insertions, 2 deletions
diff --git a/yjit/bindgen/Cargo.lock b/yjit/bindgen/Cargo.lock
index cf23cbf783..b6ee5ae6f8 100644
--- a/yjit/bindgen/Cargo.lock
+++ b/yjit/bindgen/Cargo.lock
@@ -342,4 +342,5 @@ name = "yjit-bindgen"
version = "0.1.0"
dependencies = [
"bindgen",
+ "env_logger",
]
diff --git a/yjit/bindgen/Cargo.toml b/yjit/bindgen/Cargo.toml
index 18a8fbc463..57fd874939 100644
--- a/yjit/bindgen/Cargo.toml
+++ b/yjit/bindgen/Cargo.toml
@@ -7,3 +7,4 @@ edition = "2021"
[dependencies]
bindgen = "0.59.2"
+env_logger = "0.9.0"
diff --git a/yjit/bindgen/src/main.rs b/yjit/bindgen/src/main.rs
index d8f3c98e89..5abd445dae 100644
--- a/yjit/bindgen/src/main.rs
+++ b/yjit/bindgen/src/main.rs
@@ -27,6 +27,9 @@ fn main() {
SRC_ROOT_ENV
);
+ // We want Bindgen warnings printed to console
+ env_logger::init();
+
// Remove this flag so rust-bindgen generates bindings
// that are internal functions not public in libruby
let filtered_clang_args = env::args().filter(|arg| arg != "-fvisibility=hidden");
@@ -145,8 +148,7 @@ fn main() {
.allowlist_var("rb_mKernel")
// From vm_callinfo.h
- .allowlist_type("VM_CALL.*") // This doesn't work, possibly due to the odd structure of the #defines
- .allowlist_type("vm_call_flag_bits") // So instead we include the other enum and do the bit-shift ourselves.
+ .allowlist_type("vm_call_flag_bits")
.allowlist_type("rb_call_data")
.blocklist_type("rb_callcache.*") // Not used yet - opaque to make it easy to import rb_call_data
.opaque_type("rb_callcache.*")