frida/frida-rust

Frida-core.h file not found, both auto-download and manual install do not solve the problem.

bruhderek opened this issue · 2 comments

Title. I'm on MacOS arm64 and put the necessary files in both /usr/local/lib and /usr/local/include. I also tried using frida = [ "frida/auto-download" ] in cargo.toml to no avail. Here's the build log:

/Users/derek/.cargo/bin/cargo check --message-format json --workspace --all-targets -Z unstable-options --keep-going
    Checking bytes v1.6.0
    Checking pin-project-lite v0.2.14
    Checking stable_deref_trait v1.2.0
    Checking futures-core v0.3.30
    Checking core-foundation-sys v0.8.6
    Checking libc v0.2.155
    Checking itoa v1.0.11
    Checking zerofrom v0.1.4
    Checking yoke v0.7.4
    Checking writeable v0.5.5
    Checking litemap v0.7.3
    Checking fnv v1.0.7
    Checking mio v0.8.11
    Checking socket2 v0.5.7
    Checking pin-utils v0.1.0
    Checking futures-task v0.3.30
    Checking zerovec v0.10.2
    Checking bitflags v2.5.0
    Checking http v1.1.0
    Checking smallvec v1.13.2
    Checking once_cell v1.19.0
    Checking futures-util v0.3.30
    Checking core-foundation v0.9.4
    Checking tinystr v0.7.6
    Checking tokio v1.38.0
    Checking errno v0.3.9
    Checking tracing-core v0.1.32
    Checking cfg-if v1.0.0
    Checking equivalent v1.0.1
    Checking hashbrown v0.14.5
    Checking icu_locid_transform_data v1.5.0
    Checking futures-sink v0.3.30
    Checking icu_locid v1.5.0
    Checking tracing v0.1.40
    Checking rustix v0.38.34
    Checking http-body v1.0.0
    Checking icu_collections v1.5.0
    Checking indexmap v2.2.6
    Checking tokio-util v0.7.11
    Checking slab v0.4.9
    Checking icu_provider v1.5.0
    Checking security-framework-sys v2.11.0
    Checking atomic-waker v1.1.2
    Checking fastrand v2.1.0
    Checking try-lock v0.2.5
    Checking icu_properties_data v1.5.0
    Checking icu_locid_transform v1.5.0
    Checking security-framework v2.11.0
    Checking h2 v0.4.5
    Checking pin-project v1.1.5
    Checking tempfile v3.10.1
    Checking httparse v1.9.3
    Checking want v0.3.1
    Checking futures-channel v0.3.30
    Checking icu_properties v1.5.0
    Checking icu_normalizer_data v1.5.0
    Checking write16 v1.0.0
    Checking tower-layer v0.3.2
    Checking utf16_iter v1.0.5
    Checking tower-service v0.3.2
    Checking percent-encoding v2.3.1
    Checking utf8_iter v1.0.4
    Checking hyper v1.3.1
    Checking native-tls v0.2.12
   Compiling frida-sys v0.13.6
    Checking system-configuration-sys v0.5.0
    Checking tower v0.4.13
    Checking form_urlencoded v1.2.1
    Checking serde v1.0.203
    Checking http-body-util v0.1.2
    Checking icu_normalizer v1.5.0
    Checking tokio-native-tls v0.3.1
    Checking rustls-pki-types v1.7.0
    Checking hyper-util v0.1.5
    Checking base64 v0.22.1
    Checking ryu v1.0.18
    Checking idna v1.0.0
    Checking bitflags v1.3.2
    Checking thiserror v1.0.61
    Checking rustls-pemfile v2.1.2
    Checking encoding_rs v0.8.34
    Checking serde_urlencoded v0.7.1
    Checking url v2.5.1
    Checking hyper-tls v0.6.0
    Checking system-configuration v0.5.1
    Checking sync_wrapper v0.1.2
    Checking log v0.4.21
    Checking mime v0.3.17
    Checking ipnet v2.9.0
    Checking reqwest v0.12.4
error: failed to run custom build command for `frida-sys v0.13.6`
error: failed to run custom build command for `frida-sys v0.13.6`
note: To improve backtraces for build dependencies, set the CARGO_PROFILE_DEV_BUILD_OVERRIDE_DEBUG=true environment variable to enable debug information generation.
Caused by:
  process didn't exit successfully: `/Users/derek/RustroverProjects/math-rs/target/debug/build/frida-sys-506ddd02c7ac5ad3/build-script-build` (exit status: 101)
  --- stdout
  cargo:rustc-link-search=/Users/derek/.cargo/registry/src/index.crates.io-6f17d22bba15001f/frida-sys-0.13.6
  cargo:rustc-link-lib=frida-core
  cargo:rustc-link-lib=bsm
  cargo:rustc-link-lib=resolv
  cargo:rustc-link-lib=pthread
  cargo:rustc-link-lib=framework=AppKit
  cargo:rerun-if-env-changed=TARGET
  cargo:rerun-if-env-changed=BINDGEN_EXTRA_CLANG_ARGS_aarch64-apple-darwin
  cargo:rerun-if-env-changed=BINDGEN_EXTRA_CLANG_ARGS_aarch64_apple_darwin
  cargo:rerun-if-env-changed=BINDGEN_EXTRA_CLANG_ARGS
  --- stderr
  /Users/derek/.cargo/registry/src/index.crates.io-6f17d22bba15001f/frida-sys-0.13.6/core.h:1:10: fatal error: 'frida-core.h' file not found
  thread 'main' panicked at /Users/derek/.cargo/registry/src/index.crates.io-6f17d22bba15001f/frida-sys-0.13.6/build.rs:61:10:
  called `Result::unwrap()` on an `Err` value: ClangDiagnostic("/Users/derek/.cargo/registry/src/index.crates.io-6f17d22bba15001f/frida-sys-0.13.6/core.h:1:10: fatal error: 'frida-core.h' file not found\n")
  stack backtrace:
     0: rust_begin_unwind
               at /rustc/7cf61ebde7b22796c69757901dd346d0fe70bd97/library/std/src/panicking.rs:647:5
     1: core::panicking::panic_fmt
               at /rustc/7cf61ebde7b22796c69757901dd346d0fe70bd97/library/core/src/panicking.rs:72:14
     2: core::result::unwrap_failed
               at /rustc/7cf61ebde7b22796c69757901dd346d0fe70bd97/library/core/src/result.rs:1649:5
     3: build_script_build::main
     4: core::ops::function::FnOnce::call_once
  note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

Hi.

You need to either put the extracted gum/core devkit files in frida-rust/frida-gum-sys/frida-rust/frida-sys directories, or you need to use the auto-download feature flag, by having something like the following in your cargo.toml:

frida-core = { version = "0.13.6", features = [ "auto-download" ] }

@s1341 Thanks for the info. I solved the problem by putting my libs in /Library/Developer/CommandLineTools/usr/include instead