youknowone / apple-sys Goto Github PK
View Code? Open in Web Editor NEWThe auto-managed -sys crate for Apple platforms using bindgen directly from build environment
License: BSD 2-Clause "Simplified" License
The auto-managed -sys crate for Apple platforms using bindgen directly from build environment
License: BSD 2-Clause "Simplified" License
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
:
clang
in their build script, and so that we can support docs.rsbindgen
, 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 againBindgen.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 ;) ).
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))
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)
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)]
|
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.
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
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
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
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:
RUST_BACKTRACE=full
for a verbose backtrace.A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.