1wilkens / pam-sys

Rust FFI bindings to the Linux Pluggable Authentication Modules (PAM)
https://docs.rs/pam-sys/
Apache License 2.0
18 stars 20 forks source link

fail to build under rust 1.78.0 #29

Open liyimeng opened 5 months ago

liyimeng commented 5 months ago

cargo --version cargo 1.78.0 (54d8815d0 2024-03-26)

error: failed to run custom build command for `pam-sys v1.0.0-alpha5`
Caused by:
  process didn't exit successfully: `/app/target/debug/build/pam-sys-b0342a7291a9caed/build-script-build` (exit status: 101)
  --- stdout
  cargo:rustc-link-lib=pam
  cargo:rustc-link-lib=pam_misc
  cargo:rerun-if-changed=wrapper.h
  --- stderr
  thread 'main' panicked at /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/clang-sys-1.7.0/src/lib.rs:1860:1:
  a `libclang` shared library is not loaded on this thread
  stack backtrace:
     0:     0x5fd2c4ab56a2 - std::backtrace_rs::backtrace::libunwind::trace::he4ee80166a02c846
                                 at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/std/src/../../backtrace/src/backtrace/libunwind.rs:105:5
     1:     0x5fd2c4ab56a2 - std::backtrace_rs::backtrace::trace_unsynchronized::h476faccf57e88641
                                 at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
     2:     0x5fd2c4ab56a2 - std::sys_common::backtrace::_print_fmt::h430c922a77e7a59c
                                 at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/std/src/sys_common/backtrace.rs:68:5
     3:     0x5fd2c4ab56a2 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hffecb437d922f988
                                 at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/std/src/sys_common/backtrace.rs:44:22
     4:     0x5fd2c4ade14c - core::fmt::rt::Argument::fmt::hf3df69369399bfa9
                                 at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/core/src/fmt/rt.rs:142:9
     5:     0x5fd2c4ade14c - core::fmt::write::hd9a8d7d029f9ea1a
                                 at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/core/src/fmt/mod.rs:1153:17
     6:     0x5fd2c4ab2d0f - std::io::Write::write_fmt::h0e1226b2b8d973fe
                                 at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/std/src/io/mod.rs:1843:15
     7:     0x5fd2c4ab5474 - std::sys_common::backtrace::_print::hd2df4a083f6e69b8
                                 at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/std/src/sys_common/backtrace.rs:47:5
     8:     0x5fd2c4ab5474 - std::sys_common::backtrace::print::he907f6ad7eee41cb
                                 at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/std/src/sys_common/backtrace.rs:34:9
     9:     0x5fd2c4ab6a8b - std::panicking::default_hook::{{closure}}::h3926193b61c9ca9b
    10:     0x5fd2c4ab67e3 - std::panicking::default_hook::h25ba2457dea68e65
                                 at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/std/src/panicking.rs:292:9
    11:     0x5fd2c4ab6f2d - std::panicking::rust_panic_with_hook::h0ad14d90dcf5224f
                                 at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/std/src/panicking.rs:779:13
    12:     0x5fd2c4ab6e02 - std::panicking::begin_panic_handler::{{closure}}::h4a1838a06f542647
                                 at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/std/src/panicking.rs:657:13
    13:     0x5fd2c4ab5b76 - std::sys_common::backtrace::__rust_end_short_backtrace::h77cc4dc3567ca904
                                 at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/std/src/sys_common/backtrace.rs:171:18
    14:     0x5fd2c4ab6b34 - rust_begin_unwind
                                 at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/std/src/panicking.rs:645:5
    15:     0x5fd2c43ce2f5 - core::panicking::panic_fmt::h940d4fd01a4b4fd1
                                 at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/core/src/panicking.rs:72:14
    16:     0x5fd2c4adc921 - core::panicking::panic_display::h277de99b44f66bbb
                                 at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/core/src/panicking.rs:197:5
    17:     0x5fd2c43ce2bb - core::panicking::panic_str::h6e5626df23cd5848
                                 at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/core/src/panicking.rs:172:5
    18:     0x5fd2c43ce2bb - core::option::expect_failed::h9d76e63e47b0f089
                                 at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/core/src/option.rs:1995:5
    19:     0x5fd2c48e6fe2 - core::option::Option<T>::expect::hdbfc92d91f647cf5
                                 at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/core/src/option.rs:896:21
    20:     0x5fd2c48c8924 - clang_sys::clang_createIndex::h64a508ff1feb426d
                                 at /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/clang-sys-1.7.0/src/link.rs:177:25
    21:     0x5fd2c44c70fd - bindgen::clang::Index::new::hbacd5ba925a5b785
                                 at /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bindgen-0.69.4/clang.rs:1780:20
    22:     0x5fd2c4567c95 - bindgen::ir::context::BindgenContext::new::h6a4fd09192a29480
                                 at /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bindgen-0.69.4/ir/context.rs:541:21
    23:     0x5fd2c445854a - bindgen::Bindings::generate::h5bc3aa94245a0042
                                 at /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bindgen-0.69.4/lib.rs:896:27
    24:     0x5fd2c44562b7 - bindgen::Builder::generate::h04c16c191f11bc60
                                 at /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bindgen-0.69.4/lib.rs:349:9
    25:     0x5fd2c43d237b - build_script_build::main::h510fb405cdc8811d
                                 at /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/pam-sys-1.0.0-alpha5/build.rs:66:20
    26:     0x5fd2c43cf98b - core::ops::function::FnOnce::call_once::ha8b3949a493e800b
                                 at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/core/src/ops/function.rs:250:5
    27:     0x5fd2c43ceb5e - std::sys_common::backtrace::__rust_begin_short_backtrace::h06170cb89002f0da
                                 at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/std/src/sys_common/backtrace.rs:155:18
    28:     0x5fd2c43cf521 - std::rt::lang_start::{{closure}}::h59113a629f058471
                                 at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/std/src/rt.rs:166:18
    29:     0x5fd2c4aaeb83 - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::h52f5991f9ab8b369
                                 at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/core/src/ops/function.rs:284:13
    30:     0x5fd2c4aaeb83 - std::panicking::try::do_call::h0ac4bee9a397a1bf
                                 at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/std/src/panicking.rs:552:40
    31:     0x5fd2c4aaeb83 - std::panicking::try::hc005decaf198d0ed
                                 at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/std/src/panicking.rs:516:19
    32:     0x5fd2c4aaeb83 - std::panic::catch_unwind::hb0f967d870b2a382
                                 at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/std/src/panic.rs:146:14
    33:     0x5fd2c4aaeb83 - std::rt::lang_start_internal::{{closure}}::hd140b84b0efe534b
                                 at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/std/src/rt.rs:148:48
    34:     0x5fd2c4aaeb83 - std::panicking::try::do_call::h1ddfaf1d0d576c38
                                 at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/std/src/panicking.rs:552:40
    35:     0x5fd2c4aaeb83 - std::panicking::try::hdd4bdf855547659f
                                 at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/std/src/panicking.rs:516:19
    36:     0x5fd2c4aaeb83 - std::panic::catch_unwind::h276ba91c7706110c
                                 at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/std/src/panic.rs:146:14
    37:     0x5fd2c4aaeb83 - std::rt::lang_start_internal::h103c42a9c4e95084
                                 at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/std/src/rt.rs:148:20
    38:     0x5fd2c43cf4fa - std::rt::lang_start::hb3caf5884d69df09
                                 at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/std/src/rt.rs:165:17
    39:     0x5fd2c43d25fe - main
    40:     0x7e6e7881a083 - __libc_start_main
                                 at /build/glibc-e2p3jK/glibc-2.31/csu/../csu/libc-start.c:308:16
    41:     0x5fd2c43cea8e - _start
    42:                0x0 - <unknown>
warning: build failed, waiting for other jobs to finish...
hohaidang commented 1 month ago

Maybe you are missing libclang in your PC? sudo apt-get install libclang or something simillar

liyimeng commented 1 month ago

tried, no help

hohaidang commented 1 month ago

Maybe you can try export LIBCLANG_PATH="-clang-17.0.6-lib/lib" for example export LIBCLANG_PATH=/nix/store/92db16g3bi4fxwafskysvpsfbpsi1vkw-clang-17.0.6-lib/lib

liyimeng commented 1 month ago

will give it a try