Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Broken CI with bindgen and anonymous enum in mbed #334

Open
geonnave opened this issue Jan 22, 2025 · 1 comment · May be fixed by #335
Open

Broken CI with bindgen and anonymous enum in mbed #334

geonnave opened this issue Jan 22, 2025 · 1 comment · May be fixed by #335

Comments

@geonnave
Copy link
Collaborator

geonnave commented Jan 22, 2025

This is blocking new PRs, including #331 and #333 .

See for example https://github.com/openwsn-berkeley/lakers/actions/runs/12909246534/job/35996534344?pr=331#logs

Issue is related to bindgen which is used by lakers-crypto-psa:

  thread 'main' panicked at /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bindgen-0.59.2/src/ir/context.rs:878:9:
  "enum_(unnamed_at_/home/runner/work/lakers/lakers/target/debug/build/psa-crypto-sys-748506a5ebbac601/out/include/mbedtls/cipher_h_205_1)" is not a valid Ident
  stack backtrace:
     0: rust_begin_unwind
               at /rustc/c1b336cb6b491b3be02cd821774f03af4992f413/library/std/src/panicking.rs:661:5
     1: core::panicking::panic_fmt
               at /rustc/c1b336cb6b491b3be02cd821774f03af4992f413/library/core/src/panicking.rs:74:14
     2: proc_macro2::fallback::validate_ident
     3: proc_macro2::fallback::Ident::new_checked
     4: proc_macro2::imp::Ident::new_checked
     5: proc_macro2::Ident::new
     6: bindgen::ir::context::BindgenContext::rust_ident_raw
     7: bindgen::ir::context::BindgenContext::rust_ident
     8: <bindgen::ir::enum_ty::Enum as bindgen::codegen::CodeGenerator>::codegen
     9: <bindgen::ir::ty::Type as bindgen::codegen::CodeGenerator>::codegen
    10: <bindgen::ir::item::Item as bindgen::codegen::CodeGenerator>::codegen
    11: <bindgen::ir::module::Module as bindgen::codegen::CodeGenerator>::codegen::{{closure}}
    12: <bindgen::ir::module::Module as bindgen::codegen::CodeGenerator>::codegen
    13: <bindgen::ir::item::Item as bindgen::codegen::CodeGenerator>::codegen
    14: bindgen::codegen::codegen::{{closure}}
    15: bindgen::ir::context::BindgenContext::gen
    16: bindgen::codegen::codegen
    17: bindgen::Bindings::generate
    18: bindgen::Builder::generate
    19: build_script_build::common::generate_mbed_crypto_bindings
    20: build_script_build::operations::script_operations
    21: build_script_build::main
    22: core::ops::function::FnOnce::call_once
  note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
@geonnave
Copy link
Collaborator Author

First guess was version update, but

(1) version is pinned at @malishav's fork of psa crate

bindgen = { version = "0.59.2", optional = true }

and

(2) using latest version works fine

+++ b/crypto/lakers-crypto-psa/Cargo.toml
@@ -11,6 +11,7 @@ readme.workspace = true
 [dependencies]
 lakers-shared.workspace = true
 psa-crypto = { version = "0.9.2" }
+bindgen = "=0.71.1"

running with RUST_BACKTRACE=1 cargo test -p lakers -p lakers-crypto -p lakers-shared --no-default-features --features="lakers-crypto/psa, test-ead-none" --no-fail-fast -- --test-threads 1 compiles and runs all tests successfully.

@geonnave geonnave changed the title Broken CI with: unit-tests (lakers-crypto/psa, ead-none) Broken CI with bindgen and anonymous enum in mbed Jan 22, 2025
@geonnave geonnave linked a pull request Jan 22, 2025 that will close this issue
@geonnave geonnave linked a pull request Jan 22, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant