ellerh / softfido

A software FIDO2/U2F authenticator
37 stars 7 forks source link

Build error #5

Closed pepa65 closed 11 months ago

pepa65 commented 1 year ago

After installing libudev-dev I get this when I do RUST_BACKTRACE=full cargo build:

   Compiling softfido v0.1.0 (/home/pp/git/softfido)
error: failed to run custom build command for `softfido v0.1.0 (/home/pp/git/softfido)`

Caused by:
  process didn't exit successfully: `/home/pp/git/softfido/target/debug/build/softfido-8df2957bb4a5c795/build-script-build` (exit status: 101)
  --- stderr
  thread 'main' panicked at '"usbip_header_union_(unnamed_at_src/k_usbip_common_h_211_2)" is not a valid Ident', /home/pp/.cargo/registry/src/github.com-1ecc6299db9ec823/proc-macro2-1.0.56/src/fallback.rs:811:9
  stack backtrace:
     0:     0x561ae2deb853 - std::backtrace_rs::backtrace::libunwind::trace::he0156af2558114c2
                                 at /build/rustc-Oic09u/rustc-1.65.0+dfsg0ubuntu1/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
     1:     0x561ae2deb853 - std::backtrace_rs::backtrace::trace_unsynchronized::h1e2672bcf5105eb5
                                 at /build/rustc-Oic09u/rustc-1.65.0+dfsg0ubuntu1/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
     2:     0x561ae2deb853 - std::sys_common::backtrace::_print_fmt::haa919a14d8d859ec
                                 at /build/rustc-Oic09u/rustc-1.65.0+dfsg0ubuntu1/library/std/src/sys_common/backtrace.rs:66:5
     3:     0x561ae2deb853 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hf15e8f9e6884dd5f
                                 at /build/rustc-Oic09u/rustc-1.65.0+dfsg0ubuntu1/library/std/src/sys_common/backtrace.rs:45:22
     4:     0x561ae2e0944c - core::fmt::write::he42254d9e3c27115
                                 at /build/rustc-Oic09u/rustc-1.65.0+dfsg0ubuntu1/library/core/src/fmt/mod.rs:1202:17
     5:     0x561ae2dd3aa5 - std::io::Write::write_fmt::hfb37e0ab3a125c66
                                 at /build/rustc-Oic09u/rustc-1.65.0+dfsg0ubuntu1/library/std/src/io/mod.rs:1679:15
     6:     0x561ae2dd6bb4 - std::sys_common::backtrace::_print::h8078bdb0e2e92b53
                                 at /build/rustc-Oic09u/rustc-1.65.0+dfsg0ubuntu1/library/std/src/sys_common/backtrace.rs:48:5
     7:     0x561ae2dd6bb4 - std::sys_common::backtrace::print::h09fd65486fb9c4f7
                                 at /build/rustc-Oic09u/rustc-1.65.0+dfsg0ubuntu1/library/std/src/sys_common/backtrace.rs:35:9
     8:     0x561ae2dd6bb4 - std::panicking::default_hook::{{closure}}::hb89b98c578903f40
                                 at /build/rustc-Oic09u/rustc-1.65.0+dfsg0ubuntu1/library/std/src/panicking.rs:295:22
     9:     0x561ae2dd67f4 - std::panicking::default_hook::h27aa44be03b01ac8
                                 at /build/rustc-Oic09u/rustc-1.65.0+dfsg0ubuntu1/library/std/src/panicking.rs:314:9
    10:     0x561ae2dd7193 - std::panicking::rust_panic_with_hook::he7013d2ea706cde0
                                 at /build/rustc-Oic09u/rustc-1.65.0+dfsg0ubuntu1/library/std/src/panicking.rs:698:17
    11:     0x561ae2debe57 - std::panicking::begin_panic_handler::{{closure}}::hd66fe345adc7bed2
                                 at /build/rustc-Oic09u/rustc-1.65.0+dfsg0ubuntu1/library/std/src/panicking.rs:588:13
    12:     0x561ae2deb994 - std::sys_common::backtrace::__rust_end_short_backtrace::ha2b47ffe9f27aed9
                                 at /build/rustc-Oic09u/rustc-1.65.0+dfsg0ubuntu1/library/std/src/sys_common/backtrace.rs:138:18
    13:     0x561ae2dd6e82 - rust_begin_unwind
                                 at /build/rustc-Oic09u/rustc-1.65.0+dfsg0ubuntu1/library/std/src/panicking.rs:584:5
    14:     0x561ae288d153 - core::panicking::panic_fmt::hbfca70bd08ba6212
                                 at /build/rustc-Oic09u/rustc-1.65.0+dfsg0ubuntu1/library/core/src/panicking.rs:142:14
    15:     0x561ae2c58a7e - proc_macro2::fallback::validate_ident::h0f24d1c3db952742
                                 at /home/pp/.cargo/registry/src/github.com-1ecc6299db9ec823/proc-macro2-1.0.56/src/fallback.rs:811:9
    16:     0x561ae2c587cf - proc_macro2::fallback::Ident::_new::hbf4ed346e1b4e930
                                 at /home/pp/.cargo/registry/src/github.com-1ecc6299db9ec823/proc-macro2-1.0.56/src/fallback.rs:753:9
    17:     0x561ae2c5885d - proc_macro2::fallback::Ident::new::h525166b799bbfe02
                                 at /home/pp/.cargo/registry/src/github.com-1ecc6299db9ec823/proc-macro2-1.0.56/src/fallback.rs:763:9
    18:     0x561ae2c3ea36 - proc_macro2::imp::Ident::new::h3e54e360259dd6b4
                                 at /home/pp/.cargo/registry/src/github.com-1ecc6299db9ec823/proc-macro2-1.0.56/src/wrapper.rs:701:50
    19:     0x561ae2c524e5 - proc_macro2::Ident::new::h7108ddd4d9439312
                                 at /home/pp/.cargo/registry/src/github.com-1ecc6299db9ec823/proc-macro2-1.0.56/src/lib.rs:972:21
    20:     0x561ae29b9276 - bindgen::ir::context::BindgenContext::rust_ident_raw::hff1ed9929bdc5dfc
                                 at /home/pp/.cargo/registry/src/github.com-1ecc6299db9ec823/bindgen-0.52.0/src/ir/context.rs:893:9
    21:     0x561ae29b8f80 - bindgen::ir::context::BindgenContext::rust_ident::hd8697e49b6c0cf8b
                                 at /home/pp/.cargo/registry/src/github.com-1ecc6299db9ec823/bindgen-0.52.0/src/ir/context.rs:885:9
    22:     0x561ae28dcd6b - <bindgen::ir::comp::CompInfo as bindgen::codegen::CodeGenerator>::codegen::h0a2779d381ea0092
                                 at /home/pp/.cargo/registry/src/github.com-1ecc6299db9ec823/bindgen-0.52.0/src/codegen/mod.rs:1544:31
    23:     0x561ae29328aa - <bindgen::ir::ty::Type as bindgen::codegen::CodeGenerator>::codegen::h7e041e2387d6f31e
                                 at /home/pp/.cargo/registry/src/github.com-1ecc6299db9ec823/bindgen-0.52.0/src/codegen/mod.rs:673:39
    24:     0x561ae29325af - <bindgen::ir::item::Item as bindgen::codegen::CodeGenerator>::codegen::h5b8e49aa0bf10768
                                 at /home/pp/.cargo/registry/src/github.com-1ecc6299db9ec823/bindgen-0.52.0/src/codegen/mod.rs:381:17
    25:     0x561ae28e07e4 - <bindgen::ir::comp::CompInfo as bindgen::codegen::CodeGenerator>::codegen::h0a2779d381ea0092
                                 at /home/pp/.cargo/registry/src/github.com-1ecc6299db9ec823/bindgen-0.52.0/src/codegen/mod.rs:1874:13
    26:     0x561ae29328aa - <bindgen::ir::ty::Type as bindgen::codegen::CodeGenerator>::codegen::h7e041e2387d6f31e
                                 at /home/pp/.cargo/registry/src/github.com-1ecc6299db9ec823/bindgen-0.52.0/src/codegen/mod.rs:673:39
    27:     0x561ae29325af - <bindgen::ir::item::Item as bindgen::codegen::CodeGenerator>::codegen::h5b8e49aa0bf10768
                                 at /home/pp/.cargo/registry/src/github.com-1ecc6299db9ec823/bindgen-0.52.0/src/codegen/mod.rs:381:17
    28:     0x561ae29f3471 - <bindgen::ir::module::Module as bindgen::codegen::CodeGenerator>::codegen::{{closure}}::h46455ea2dac29aec
                                 at /home/pp/.cargo/registry/src/github.com-1ecc6299db9ec823/bindgen-0.52.0/src/codegen/mod.rs:403:21
    29:     0x561ae28cd396 - <bindgen::ir::module::Module as bindgen::codegen::CodeGenerator>::codegen::h00252c9846a5fd97
                                 at /home/pp/.cargo/registry/src/github.com-1ecc6299db9ec823/bindgen-0.52.0/src/codegen/mod.rs:433:13
    30:     0x561ae293257f - <bindgen::ir::item::Item as bindgen::codegen::CodeGenerator>::codegen::h5b8e49aa0bf10768
                                 at /home/pp/.cargo/registry/src/github.com-1ecc6299db9ec823/bindgen-0.52.0/src/codegen/mod.rs:372:17
    31:     0x561ae29fcbaf - bindgen::codegen::codegen::{{closure}}::h3371cf41105218c0
                                 at /home/pp/.cargo/registry/src/github.com-1ecc6299db9ec823/bindgen-0.52.0/src/codegen/mod.rs:3770:9
    32:     0x561ae29bbc22 - bindgen::ir::context::BindgenContext::gen::hfbb51de8867a6e7f
                                 at /home/pp/.cargo/registry/src/github.com-1ecc6299db9ec823/bindgen-0.52.0/src/ir/context.rs:1206:19
    33:     0x561ae29fc25e - bindgen::codegen::codegen::h1cd0bf2ba31aad1d
                                 at /home/pp/.cargo/registry/src/github.com-1ecc6299db9ec823/bindgen-0.52.0/src/codegen/mod.rs:3744:5
    34:     0x561ae2a09602 - bindgen::Bindings::generate::hd2ce6019052b2699
                                 at /home/pp/.cargo/registry/src/github.com-1ecc6299db9ec823/bindgen-0.52.0/src/lib.rs:2052:32
    35:     0x561ae2a07408 - bindgen::Builder::generate::hdf52ca56f166ceb2
                                 at /home/pp/.cargo/registry/src/github.com-1ecc6299db9ec823/bindgen-0.52.0/src/lib.rs:1375:9
    36:     0x561ae288f256 - build_script_build::main::h1440e750c4eecfe4
                                 at /home/pp/git/softfido/build.rs:4:20
    37:     0x561ae288e6eb - core::ops::function::FnOnce::call_once::ha1c2f4ad7e610dc6
                                 at /build/rustc-Oic09u/rustc-1.65.0+dfsg0ubuntu1/library/core/src/ops/function.rs:248:5
    38:     0x561ae288fd2e - std::sys_common::backtrace::__rust_begin_short_backtrace::hd7a86052180bc392
                                 at /build/rustc-Oic09u/rustc-1.65.0+dfsg0ubuntu1/library/std/src/sys_common/backtrace.rs:122:18
    39:     0x561ae288f481 - std::rt::lang_start::{{closure}}::h5ee0ca8f12011dee
                                 at /build/rustc-Oic09u/rustc-1.65.0+dfsg0ubuntu1/library/std/src/rt.rs:166:18
    40:     0x561ae2dd2f68 - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::h62af992155415807
                                 at /build/rustc-Oic09u/rustc-1.65.0+dfsg0ubuntu1/library/core/src/ops/function.rs:283:13
    41:     0x561ae2dd2f68 - std::panicking::try::do_call::hcfafbbba7d4f6a6c
                                 at /build/rustc-Oic09u/rustc-1.65.0+dfsg0ubuntu1/library/std/src/panicking.rs:492:40
    42:     0x561ae2dd2f68 - std::panicking::try::h7ee1bfcad42abe9b
                                 at /build/rustc-Oic09u/rustc-1.65.0+dfsg0ubuntu1/library/std/src/panicking.rs:456:19
    43:     0x561ae2dd2f68 - std::panic::catch_unwind::h009aa132eb8dd7d2
                                 at /build/rustc-Oic09u/rustc-1.65.0+dfsg0ubuntu1/library/std/src/panic.rs:137:14
    44:     0x561ae2dd2f68 - std::rt::lang_start_internal::{{closure}}::h93ae259af980c7d0
                                 at /build/rustc-Oic09u/rustc-1.65.0+dfsg0ubuntu1/library/std/src/rt.rs:148:48
    45:     0x561ae2dd2f68 - std::panicking::try::do_call::ha0627c997265a210
                                 at /build/rustc-Oic09u/rustc-1.65.0+dfsg0ubuntu1/library/std/src/panicking.rs:492:40
    46:     0x561ae2dd2f68 - std::panicking::try::h64a0afc1377cc785
                                 at /build/rustc-Oic09u/rustc-1.65.0+dfsg0ubuntu1/library/std/src/panicking.rs:456:19
    47:     0x561ae2dd2f68 - std::panic::catch_unwind::h1c61ea510b397b89
                                 at /build/rustc-Oic09u/rustc-1.65.0+dfsg0ubuntu1/library/std/src/panic.rs:137:14
    48:     0x561ae2dd2f68 - std::rt::lang_start_internal::ha75927e1903320fe
                                 at /build/rustc-Oic09u/rustc-1.65.0+dfsg0ubuntu1/library/std/src/rt.rs:148:20
    49:     0x561ae288f45a - std::rt::lang_start::h7aba871300438c34
                                 at /build/rustc-Oic09u/rustc-1.65.0+dfsg0ubuntu1/library/std/src/rt.rs:165:17
    50:     0x561ae288f411 - main
    51:     0x7ff1f0229d90 - __libc_start_call_main
                                 at ./csu/../sysdeps/nptl/libc_start_call_main.h:58:16
    52:     0x7ff1f0229e40 - __libc_start_main_impl
                                 at ./csu/../csu/libc-start.c:392:3
    53:     0x561ae288d385 - _start
    54:                0x0 - <unknown>
ellerh commented 1 year ago

I tried to reproduce this in a fresh container, but it seems to compile as it should. I used the following steps:

  1. Start a podman container: podman run -it docker.io/library/ubuntu:latest
  2. Install dependencies (inside the container): apt-get update apt-get install git cargo libclang-dev libudev-dev
  3. Clone the repo: cd /tmp/ git clone https://github.com/ellerh/softfido
  4. Compile it: cd softfido cargo build
asulyi commented 11 months ago

This is a clang issue, see https://github.com/rust-lang/rust-bindgen/issues/2312.

pepa65 commented 11 months ago

Building in a container somehow works, same version of ubuntu as on the host... But on the host it also works after installing packages libclang-14-dev libclang-common-14-dev libclang-dev libobjc-11-dev so I think that sums up the issue.