Git Product home page Git Product logo

apple-sys's Introduction

apple-sys's People

Contributors

pranav2612000 avatar youknowone avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

apple-sys's Issues

Let's collaborate on `objc2`!

Greetings @youknowone

I fairly recently completed an initial version of icrate over at the objc2 project, and wanted to tell you about it, as you seem to be doing a lot of the same in this project.

The desire with icrate is basically to be your one-stop-shop for all of Apple's frameworks, but importantly, with correct memory management and type-safety.

A few differences between apple-sys:

  • The bindings are generated beforehand, so that the user doesn't have to run clang in their build script, and so that we can support docs.rs
  • I went with creating the binding generator from scratch instead of using bindgen, since there were just too many things that would need changing to support (to name two things, multiple architectures in the same repo, and a nice file diff). In any case, the binding generator implementation is an implementation detail, and I actually intend to change it again
  • I have something similar to Bindgen.toml called translation-config.toml. But for the most part, the intention is that fixes are implemented in normal Rust code, instead of imbedded in that file.

Feel free to ask me any questions if there's something I haven't fully explained!

(I discovered your project a little while ago when researching names for icrate, and didn't really think much of it then, but I see that you are still active here, so I figured I would try to recruit you - or at the very least, get input from you if icrate doesn't suit your needs ;) ).

Unable to build for intel mac architecture

Encountering the following error when trying to build apple-sys with screencapture-kit feature

Non floating-type complex? Type(_Complex _Float16, kind: Complex, cconv: 100, decl: Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None), canon: Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None)), Type(_Float16, kind: Float16, cconv: 100, decl: Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None), canon: Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None))

Another `IORPCMessage` debug trait issue

See https://github.com/segevfiner/keepawake-rs/actions/runs/4272014787/jobs/7436882628

 error[E0119]: conflicting implementations of trait `Debug` for type `IORPCMessage`
     --> /Users/runner/work/keepawake-rs/keepawake-rs/target/aarch64-apple-darwin/release/build/apple-sys-7a498b7b0123b7f9/out/IOKit.rs:55036:10
      |
55036 | #[derive(Debug)]
      |          ^^^^^ conflicting implementation for `IORPCMessage`
...
82951 | impl ::std::fmt::Debug for IORPCMessage {
      | --------------------------------------- first implementation here
      |
      = note: this error originates in the derive macro `Debug` (in Nightly builds, run with -Z macro-backtrace for more info)

Build Failure: `IORPCMessage` doesn't implement `Debug`

When compiling apple-sys v0.1.2 as a dependancy with stable-aarch64-apple-darwin 1.67.1 on Apple Silicon M2 Pro I get the following error:

error[E0277]: `IORPCMessage` doesn't implement `Debug`
     --> /Users/linus/CLionProjects/coconut-ctrl/target/release/build/apple-sys-9c941ba7ed467999/out/IOKit.rs:55699:5
      |
55697 | #[derive(Debug)]
      |          ----- in this derive macro expansion
55698 | pub struct IORPCMessageErrorReturnContent {
55699 |     pub hdr: IORPCMessage,
      |     ^^^^^^^^^^^^^^^^^^^^^ `IORPCMessage` cannot be formatted using `{:?}`
      |
      = help: the trait `Debug` is not implemented for `IORPCMessage`
      = note: add `#[derive(Debug)]` to `IORPCMessage` or manually `impl Debug for IORPCMessage`
      = note: this error originates in the derive macro `Debug` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating `IORPCMessage` with `#[derive(Debug)]`
      |
55687 | #[derive(Debug)]
      |

Bindgen is creating conflicting implementations of trait `ARKit::UIViewController_` for type `UIViewController`

When using apple-sys = { version = "0.2.0", features = ["CoreFoundation", "ARKit"] }, bindgen creates multiple conflicting implementations of trait ARKit::UIViewController_ for type UIViewController (see here: https://gist.github.com/marcpabst/2f1c7ac510daf9389d4df1f8b81e667d). Renaming the traits seems to fix the issue. I guess there is something wrong with how the trait names are generated.

IORPCMessage doesn't implement `Debug`

Error:

/claves/target/debug/build/apple-sys-2c839338cff8c061/out/Carbon.rs:56522:5
      |
56520 | #[derive(Debug)]
      |          ----- in this derive macro expansion
56521 | pub struct IORPCMessageErrorReturnContent {
56522 |     pub hdr: IORPCMessage,
      |     ^^^^^^^^^^^^^^^^^^^^^ `IORPCMessage` cannot be formatted using `{:?}`
      |
      = help: the trait `Debug` is not implemented for `IORPCMessage`
      = note: add `#[derive(Debug)]` to `IORPCMessage` or manually `impl Debug for IORPCMessage`
      = note: this error originates in the derive macro `Debug` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating `IORPCMessage` with `#[derive(Debug)]`
      |
56510 | #[derive(Debug)]
      |

For more information about this error, try `rustc --explain E0277`.
error: could not compile `apple-sys` due to previous error

OS: MacOS 13.0.0

compile error on github actions macos-latest

Hi, I get the following compile error, if I try to compile this carte on github actions using macos-latest runner.
I am using this crates as dependency from keepawake.

 error: expected item after attributes
 --> /Users/runner/work/mission2teegarden-b/mission2teegarden-b/target/debug/build/apple-sys-1fef9ac78fba900c/out/CoreFoundation.rs:3:2249
  |
3 | ... :: { self , msg_send , sel , sel_impl , class } ; # [allow (non_camel_case_types)] 
  |                                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: expected item after attributes
 --> /Users/runner/work/mission2teegarden-b/mission2teegarden-b/target/debug/build/apple-sys-1fef9ac78fba900c/out/IOKit.rs:3:2249
  |
3 | ... :: { self , msg_send , sel , sel_impl , class } ; # [allow (non_camel_case_types)] 
  |                                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: could not compile `apple-sys` (lib) due to 2 previous errors

https://github.com/LuckyTurtleDev/mission2teegarden-b/actions/runs/5466717079/jobs/9952050311?pr=130

Not working at all

for apple-bindgen not apple-sys

apple-bindgen --sdk /Users/user/Downloads/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk CoreHaptics
/Users/user/ch2/CoreHaptics.h:1:9: fatal error: could not build module 'CoreHaptics'
thread 'main' panicked at 'binding generation failed: ClangDiagnostic("/Users/user/ch2/CoreHaptics.h:1:9: fatal error: could not build module 'CoreHaptics'\n")', /Users/user/.cargo/registry/src/github.com-x/apple-bindgen-0.2.0/src/main.rs:69:34
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Build error when include ScreenCaptureKit

apple-sys = { version = "*", features = ["ScreenCaptureKit"] }

/Users/bigduu/.cargo/registry/src/github.com-1ecc6299db9ec823/apple-sys-0.2.0/ScreenCaptureKit.h:1:2: fatal error: malformed or corrupted AST file: 'duplicate DECL_OFFSET record in AST file'
/Users/bigduu/.cargo/registry/src/github.com-1ecc6299db9ec823/apple-sys-0.2.0/ScreenCaptureKit.h:1:2: note: after modifying system headers, please delete the module cache at '/var/folders/xw/5cb3hk_x61zfbcyf_8ww7zlm0000gn/C/clang/ModuleCache/Z1130PPJ7JDN'
thread 'main' panicked at 'libclang error; possible causes include:

  • Invalid flag syntax
  • Unrecognized flags
  • Invalid flag arguments
  • File I/O errors
  • Host vs. target architecture mismatch
    If you encounter an error missing from this list, please file an issue or a PR!', /Users/bigduu/.cargo/registry/src/github.com-1ecc6299db9ec823/bindgen-0.63.0/ir/context.rs:530:15
    stack backtrace:
    0: rust_begin_unwind
    at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/panicking.rs:579:5
    1: core::panicking::panic_fmt
    at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/core/src/panicking.rs:64:14
    2: core::panicking::panic_display
    at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/core/src/panicking.rs:147:5
    3: core::panicking::panic_str
    at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/core/src/panicking.rs:131:5
    4: core::option::expect_failed
    at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/core/src/option.rs:2045:5
    5: core::option::Option::expect
    6: bindgen::ir::context::BindgenContext::new
    7: bindgen::Bindings::generate
    8: bindgen::Builder::generate
    9: apple_bindgen::builder::Builder::generate
    10: build_script_build::main
    11: core::ops::function::FnOnce::call_once
    note: Some details are omitted, run with RUST_BACKTRACE=full for a verbose backtrace.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.