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

Build failing on my Mac #2

Closed
AlexKnauth opened this issue Sep 24, 2023 · 3 comments · Fixed by rbspy/proc-maps#24
Closed

Build failing on my Mac #2

AlexKnauth opened this issue Sep 24, 2023 · 3 comments · Fixed by rbspy/proc-maps#24

Comments

@AlexKnauth
Copy link
Contributor

When I try to build this repository on my Mac now, I get error messages like this:

$ cargo b
   Compiling libproc v0.12.0
   Compiling wasi-cap-std-sync v13.0.0
   Compiling wasmtime-wasi v13.0.0
error: failed to run custom build command for `libproc v0.12.0`

Caused by:
  process didn't exit successfully: `/Users/Alex/Documents/GitHub/LiveSplit/asr-debugger/target/debug/build/libproc-1cc21033949d4d98/build-script-build` (exit status: 101)
  --- stderr
  thread 'main' panicked at '"mach_port_options_union_(anonymous_at_/Applications/Xcode_app/Contents/Developer/Platforms/MacOSX_platform/Developer/SDKs/MacOSX_sdk/usr/include/mach/port_h_381_2)" is not a valid Ident', /Users/Alex/.cargo/registry/src/index.crates.io-6f17d22bba15001f/proc-macro2-1.0.67/src/fallback.rs:774:9
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...

I try to run it with the RUST_BACKTRACE=1 suggestion and get this:

$ RUST_BACKTRACE=1 cargo b
   Compiling libproc v0.12.0
error: failed to run custom build command for `libproc v0.12.0`
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/Alex/Documents/GitHub/LiveSplit/asr-debugger/target/debug/build/libproc-1cc21033949d4d98/build-script-build` (exit status: 101)
  --- stderr
  thread 'main' panicked at '"mach_port_options_union_(anonymous_at_/Applications/Xcode_app/Contents/Developer/Platforms/MacOSX_platform/Developer/SDKs/MacOSX_sdk/usr/include/mach/port_h_381_2)" is not a valid Ident', /Users/Alex/.cargo/registry/src/index.crates.io-6f17d22bba15001f/proc-macro2-1.0.67/src/fallback.rs:774:9
  stack backtrace:
     0: rust_begin_unwind
               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/std/src/panicking.rs:593:5
     1: core::panicking::panic_fmt
               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/core/src/panicking.rs:67:14
     2: proc_macro2::fallback::validate_ident
     3: proc_macro2::fallback::Ident::_new
     4: proc_macro2::fallback::Ident::new
     5: proc_macro2::imp::Ident::new
     6: proc_macro2::Ident::new
     7: bindgen::ir::context::BindgenContext::rust_ident_raw
     8: bindgen::ir::context::BindgenContext::rust_ident
     9: <bindgen::ir::comp::CompInfo as bindgen::codegen::CodeGenerator>::codegen
    10: <bindgen::ir::ty::Type as bindgen::codegen::CodeGenerator>::codegen
    11: <bindgen::ir::item::Item as bindgen::codegen::CodeGenerator>::codegen
    12: <bindgen::ir::comp::CompInfo as bindgen::codegen::CodeGenerator>::codegen
    13: <bindgen::ir::ty::Type as bindgen::codegen::CodeGenerator>::codegen
    14: <bindgen::ir::item::Item as bindgen::codegen::CodeGenerator>::codegen
    15: <bindgen::ir::module::Module as bindgen::codegen::CodeGenerator>::codegen::{{closure}}
    16: <bindgen::ir::module::Module as bindgen::codegen::CodeGenerator>::codegen
    17: <bindgen::ir::item::Item as bindgen::codegen::CodeGenerator>::codegen
    18: bindgen::codegen::codegen::{{closure}}
    19: bindgen::ir::context::BindgenContext::gen
    20: bindgen::codegen::codegen
    21: bindgen::Bindings::generate
    22: bindgen::Builder::generate
    23: build_script_build::main
    24: core::ops::function::FnOnce::call_once
  note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
@AlexKnauth
Copy link
Contributor Author

AlexKnauth commented Sep 24, 2023

The most similar problem I could find when searching for things in this error message was this Stack Overflow question: https://stackoverflow.com/questions/76443280/rust-bindgen-causes-a-is-not-a-valid-ident-error-on-build

One of the things that an answer on that suggests is:

update your bindgen crate to v0.62.0 or above (which is when the fix was applied)

And I see in the Cargo.lock that bindgen is on version "0.59.2". However, when I try running cargo update, it doesn't seem to want to update bindgen to anything newer than that, so is there some other version constraint?

Edit: these issues may be related:
rbspy/proc-maps#23
benfred/py-spy#596

@AlexKnauth
Copy link
Contributor Author

AlexKnauth commented Sep 24, 2023

I have made a PR to proc-maps here: rbspy/proc-maps#24

With that PR and similar updates to make sure transitive dependencies use that, this build error goes away.

@AlexKnauth
Copy link
Contributor Author

Fixed by af76dd2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant