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

Can't generate C-binding for Mac OS #236

Closed
ababo opened this issue Mar 30, 2023 · 3 comments
Closed

Can't generate C-binding for Mac OS #236

ababo opened this issue Mar 30, 2023 · 3 comments

Comments

@ababo
Copy link

ababo commented Mar 30, 2023

When doing make include/accesskit.h I get:

rustup run nightly cbindgen | clang-format '--assume-filename=*.c' > include/accesskit.h
ERROR: Parsing crate `accesskit_c`: couldn't run `cargo rustc -Zunpretty=expanded`: Compile("   Compiling objc-sys v0.2.0-beta.2\n   Compiling paste v1.0.12\n    Checking accesskit v0.11.0 (/Users/ababo/Desktop/accesskit/common)\n    Checking once_cell v1.17.1\n     Running `rustc --crate-name build_script_build --edition=2021 /Users/ababo/.cargo/registry/src/index.crates.io-6f17d22bba15001f/objc-sys-0.2.0-beta.2/build.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C split-debuginfo=unpacked --cfg 'feature=\"alloc\"' --cfg 'feature=\"apple\"' --cfg 'feature=\"std\"' -C metadata=220f63b3ce9ff133 -C extra-filename=-220f63b3ce9ff133 --out-dir /Users/ababo/Desktop/accesskit/target/debug/build/objc-sys-220f63b3ce9ff133 -L dependency=/Users/ababo/Desktop/accesskit/target/debug/deps --cap-lints allow`\n     Running `rustc --crate-name build_script_build --edition=2018 /Users/ababo/.cargo/registry/src/index.crates.io-6f17d22bba15001f/paste-1.0.12/build.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C split-debuginfo=unpacked -C metadata=a16a7e33d8fe27a8 -C extra-filename=-a16a7e33d8fe27a8 --out-dir /Users/ababo/Desktop/accesskit/target/debug/build/paste-a16a7e33d8fe27a8 -L dependency=/Users/ababo/Desktop/accesskit/target/debug/deps --cap-lints allow`\n     Running `rustc --crate-name once_cell --edition=2021 /Users/ababo/.cargo/registry/src/index.crates.io-6f17d22bba15001f/once_cell-1.17.1/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata -C embed-bitcode=no -C split-debuginfo=unpacked -C debuginfo=2 --cfg 'feature=\"alloc\"' --cfg 'feature=\"default\"' --cfg 'feature=\"race\"' --cfg 'feature=\"std\"' -C metadata=2a7f93e778555b50 -C extra-filename=-2a7f93e778555b50 --out-dir /Users/ababo/Desktop/accesskit/target/debug/deps -L dependency=/Users/ababo/Desktop/accesskit/target/debug/deps --cap-lints allow`\n     Running `rustc --crate-name accesskit --edition=2021 common/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata -C embed-bitcode=no -C split-debuginfo=unpacked -C debuginfo=2 -C metadata=4e1d10932258b155 -C extra-filename=-4e1d10932258b155 --out-dir /Users/ababo/Desktop/accesskit/target/debug/deps -C incremental=/Users/ababo/Desktop/accesskit/target/debug/incremental -L dependency=/Users/ababo/Desktop/accesskit/target/debug/deps`\n     Running `/Users/ababo/Desktop/accesskit/target/debug/build/paste-a16a7e33d8fe27a8/build-script-build`\n     Running `/Users/ababo/Desktop/accesskit/target/debug/build/objc-sys-220f63b3ce9ff133/build-script-build`\n    Checking accesskit_consumer v0.15.0 (/Users/ababo/Desktop/accesskit/consumer)\n     Running `rustc --crate-name accesskit_consumer --edition=2021 consumer/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata -C embed-bitcode=no -C split-debuginfo=unpacked -C debuginfo=2 -C metadata=819d4ea332376bc3 -C extra-filename=-819d4ea332376bc3 --out-dir /Users/ababo/Desktop/accesskit/target/debug/deps -C incremental=/Users/ababo/Desktop/accesskit/target/debug/incremental -L dependency=/Users/ababo/Desktop/accesskit/target/debug/deps --extern accesskit=/Users/ababo/Desktop/accesskit/target/debug/deps/libaccesskit-4e1d10932258b155.rmeta`\n     Running `rustc --crate-name paste --edition=2018 /Users/ababo/.cargo/registry/src/index.crates.io-6f17d22bba15001f/paste-1.0.12/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type proc-macro --emit=dep-info,link -C prefer-dynamic -C embed-bitcode=no -C split-debuginfo=unpacked -C metadata=f9c6ee9186bc447f -C extra-filename=-f9c6ee9186bc447f --out-dir /Users/ababo/Desktop/accesskit/target/debug/deps -L dependency=/Users/ababo/Desktop/accesskit/target/debug/deps --extern proc_macro --cap-lints allow`\n     Running `rustc --crate-name objc_sys --edition=2021 /Users/ababo/.cargo/registry/src/index.crates.io-6f17d22bba15001f/objc-sys-0.2.0-beta.2/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata -C embed-bitcode=no -C split-debuginfo=unpacked -C debuginfo=2 --cfg 'feature=\"alloc\"' --cfg 'feature=\"apple\"' --cfg 'feature=\"std\"' -C metadata=dd06ec88ad260d98 -C extra-filename=-dd06ec88ad260d98 --out-dir /Users/ababo/Desktop/accesskit/target/debug/deps -L dependency=/Users/ababo/Desktop/accesskit/target/debug/deps --cap-lints allow -l dylib=objc --cfg apple --cfg apple_new`\n    Checking objc2-encode v2.0.0-pre.2\n     Running `rustc --crate-name objc2_encode --edition=2021 /Users/ababo/.cargo/registry/src/index.crates.io-6f17d22bba15001f/objc2-encode-2.0.0-pre.2/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata -C embed-bitcode=no -C split-debuginfo=unpacked -C debuginfo=2 --cfg 'feature=\"alloc\"' --cfg 'feature=\"apple\"' --cfg 'feature=\"std\"' -C metadata=89826d8f72b45eea -C extra-filename=-89826d8f72b45eea --out-dir /Users/ababo/Desktop/accesskit/target/debug/deps -L dependency=/Users/ababo/Desktop/accesskit/target/debug/deps --extern objc_sys=/Users/ababo/Desktop/accesskit/target/debug/deps/libobjc_sys-dd06ec88ad260d98.rmeta --cap-lints allow`\n    Checking objc2 v0.3.0-beta.3.patch-leaks.2\n     Running `rustc --crate-name objc2 --edition=2021 /Users/ababo/.cargo/registry/src/index.crates.io-6f17d22bba15001f/objc2-0.3.0-beta.3.patch-leaks.2/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata -C embed-bitcode=no -C split-debuginfo=unpacked -C debuginfo=2 --cfg 'feature=\"alloc\"' --cfg 'feature=\"apple\"' --cfg 'feature=\"default\"' --cfg 'feature=\"foundation\"' --cfg 'feature=\"std\"' -C metadata=22d343e4bc921c49 -C extra-filename=-22d343e4bc921c49 --out-dir /Users/ababo/Desktop/accesskit/target/debug/deps -L dependency=/Users/ababo/Desktop/accesskit/target/debug/deps --extern objc_sys=/Users/ababo/Desktop/accesskit/target/debug/deps/libobjc_sys-dd06ec88ad260d98.rmeta --extern objc2_encode=/Users/ababo/Desktop/accesskit/target/debug/deps/libobjc2_encode-89826d8f72b45eea.rmeta --cap-lints allow`\nerror[E0277]: `<<I as IvarType>::Type as InnerIvarType>::Output` is not an iterator\n   --> /Users/ababo/.cargo/registry/src/index.crates.io-6f17d22bba15001f/objc2-0.3.0-beta.3.patch-leaks.2/src/declare/ivar_forwarding_impls.rs:165:5\n    |\n165 |     fn nth(&mut self, n: usize) -> Option<<<Self as Deref>::Target as Iterator>::Item> {\n    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `<<I as IvarType>::Type as InnerIvarType>::Output` is not an iterator\n    |\n    = help: the trait `Iterator` is not implemented for `<<I as IvarType>::Type as InnerIvarType>::Output`\nnote: required for `ivar::Ivar<I>` to implement `Iterator`\n   --> /Users/ababo/.cargo/registry/src/index.crates.io-6f17d22bba15001f/objc2-0.3.0-beta.3.patch-leaks.2/src/declare/ivar_forwarding_impls.rs:154:19\n    |\n154 | impl<I: IvarType> Iterator for Ivar<I>\n    |                   ^^^^^^^^     ^^^^^^^\n155 | where\n156 |     <Self as Deref>::Target: Iterator,\n    |                              -------- unsatisfied trait bound introduced here\nhelp: consider further restricting the associated type\n    |\n165 |     fn nth(&mut self, n: usize) -> Option<<<Self as Deref>::Target as Iterator>::Item> where <<I as IvarType>::Type as InnerIvarType>::Output: Iterator {\n    |                                                                                        ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n\nerror[E0277]: `<<I as IvarType>::Type as InnerIvarType>::Output` is not an iterator\n   --> /Users/ababo/.cargo/registry/src/index.crates.io-6f17d22bba15001f/objc2-0.3.0-beta.3.patch-leaks.2/src/declare/ivar_forwarding_impls.rs:165:5\n    |\n165 |     fn nth(&mut self, n: usize) -> Option<<<Self as Deref>::Target as Iterator>::Item> {\n    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `<<I as IvarType>::Type as InnerIvarType>::Output` is not an iterator\n    |\n    = help: the trait `Iterator` is not implemented for `<<I as IvarType>::Type as InnerIvarType>::Output`\nhelp: consider further restricting the associated type\n    |\n165 |     fn nth(&mut self, n: usize) -> Option<<<Self as Deref>::Target as Iterator>::Item> where <<I as IvarType>::Type as InnerIvarType>::Output: Iterator {\n    |                                                                                        ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n\nFor more information about this error, try `rustc --explain E0277`.\nerror: could not compile `objc2` (lib) due to 2 previous errors\n\nCaused by:\n  process didn't exit successfully: `rustc --crate-name objc2 --edition=2021 /Users/ababo/.cargo/registry/src/index.crates.io-6f17d22bba15001f/objc2-0.3.0-beta.3.patch-leaks.2/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata -C embed-bitcode=no -C split-debuginfo=unpacked -C debuginfo=2 --cfg 'feature=\"alloc\"' --cfg 'feature=\"apple\"' --cfg 'feature=\"default\"' --cfg 'feature=\"foundation\"' --cfg 'feature=\"std\"' -C metadata=22d343e4bc921c49 -C extra-filename=-22d343e4bc921c49 --out-dir /Users/ababo/Desktop/accesskit/target/debug/deps -L dependency=/Users/ababo/Desktop/accesskit/target/debug/deps --extern objc_sys=/Users/ababo/Desktop/accesskit/target/debug/deps/libobjc_sys-dd06ec88ad260d98.rmeta --extern objc2_encode=/Users/ababo/Desktop/accesskit/target/debug/deps/libobjc2_encode-89826d8f72b45eea.rmeta --cap-lints allow` (exit status: 1)\n")
ERROR: Couldn't generate bindings for /Users/ababo/Desktop/accesskit/bindings/c.
@mwcampbell
Copy link
Contributor

Looks like we can't generate the header file on macOS due to errors when compiling objc2 with the nightly compiler. Please use our pre-built header file and libraries instead; here's the current accesskit_c release.

@madsmtm
Copy link
Contributor

madsmtm commented Sep 10, 2023

I think this is fixed by now, see madsmtm/objc2#432

@DataTriny
Copy link
Member

We got no feedback from the author for a few months now, closing per the comment above.

Please re-open this if the issue occurs again.

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

No branches or pull requests

4 participants