ryanmcgrath / cacao

Rust bindings for AppKit (macOS) and UIKit (iOS/tvOS). Experimental, but working!
MIT License
1.8k stars 65 forks source link

Build fails for webview feature #6

Closed sciguy16 closed 3 years ago

sciguy16 commented 3 years ago

Hi, this crate is currently failing to build with the webview feature turned on.

From the build errors it looks like this is due to the recent refactoring work on the Layout components:

Build errors

``` -cargo build --features=webview Compiling cacao v0.1.0 (/Users/david/gits/cacao) error[E0599]: no variant or associated item named `new` found for enum `LayoutAnchorY` in the current scope --> src/webview/mod.rs:131:33 | 131 | top: LayoutAnchorY::new(unsafe { msg_send![view, topAnchor] }), | ^^^ variant or associated item not found in `LayoutAnchorY` | ::: src/layout/vertical.rs:11:1 | 11 | pub enum LayoutAnchorY { | ---------------------- variant or associated item `new` not found here error[E0599]: no variant or associated item named `new` found for enum `LayoutAnchorX` in the current scope --> src/webview/mod.rs:132:37 | 132 | leading: LayoutAnchorX::new(unsafe { msg_send![view, leadingAnchor] }), | ^^^ variant or associated item not found in `LayoutAnchorX` | ::: src/layout/horizontal.rs:14:1 | 14 | pub enum LayoutAnchorX { | ---------------------- variant or associated item `new` not found here error[E0599]: no variant or associated item named `new` found for enum `LayoutAnchorX` in the current scope --> src/webview/mod.rs:133:38 | 133 | trailing: LayoutAnchorX::new(unsafe { msg_send![view, trailingAnchor] }), | ^^^ variant or associated item not found in `LayoutAnchorX` | ::: src/layout/horizontal.rs:14:1 | 14 | pub enum LayoutAnchorX { | ---------------------- variant or associated item `new` not found here error[E0599]: no variant or associated item named `new` found for enum `LayoutAnchorY` in the current scope --> src/webview/mod.rs:134:36 | 134 | bottom: LayoutAnchorY::new(unsafe { msg_send![view, bottomAnchor] }), | ^^^ variant or associated item not found in `LayoutAnchorY` | ::: src/layout/vertical.rs:11:1 | 11 | pub enum LayoutAnchorY { | ---------------------- variant or associated item `new` not found here error[E0599]: no variant or associated item named `new` found for enum `LayoutAnchorDimension` in the current scope --> src/webview/mod.rs:135:43 | 135 | width: LayoutAnchorDimension::new(unsafe { msg_send![view, widthAnchor] }), | ^^^ variant or associated item not found in `LayoutAnchorDimension` | ::: src/layout/dimension.rs:20:1 | 20 | pub enum LayoutAnchorDimension { | ------------------------------ variant or associated item `new` not found here error[E0599]: no variant or associated item named `new` found for enum `LayoutAnchorDimension` in the current scope --> src/webview/mod.rs:136:44 | 136 | height: LayoutAnchorDimension::new(unsafe { msg_send![view, heightAnchor] }), | ^^^ variant or associated item not found in `LayoutAnchorDimension` | ::: src/layout/dimension.rs:20:1 | 20 | pub enum LayoutAnchorDimension { | ------------------------------ variant or associated item `new` not found here error[E0599]: no variant or associated item named `new` found for enum `LayoutAnchorX` in the current scope --> src/webview/mod.rs:137:38 | 137 | center_x: LayoutAnchorX::new(unsafe { msg_send![view, centerXAnchor] }), | ^^^ variant or associated item not found in `LayoutAnchorX` | ::: src/layout/horizontal.rs:14:1 | 14 | pub enum LayoutAnchorX { | ---------------------- variant or associated item `new` not found here error[E0599]: no variant or associated item named `new` found for enum `LayoutAnchorY` in the current scope --> src/webview/mod.rs:138:38 | 138 | center_y: LayoutAnchorY::new(unsafe { msg_send![view, centerYAnchor] }), | ^^^ variant or associated item not found in `LayoutAnchorY` | ::: src/layout/vertical.rs:11:1 | 11 | pub enum LayoutAnchorY { | ---------------------- variant or associated item `new` not found here error[E0599]: no variant or associated item named `new` found for enum `LayoutAnchorY` in the current scope --> src/webview/mod.rs:162:33 | 162 | top: LayoutAnchorY::new(unsafe { msg_send![view, topAnchor] }), | ^^^ variant or associated item not found in `LayoutAnchorY` | ::: src/layout/vertical.rs:11:1 | 11 | pub enum LayoutAnchorY { | ---------------------- variant or associated item `new` not found here error[E0599]: no variant or associated item named `new` found for enum `LayoutAnchorX` in the current scope --> src/webview/mod.rs:163:37 | 163 | leading: LayoutAnchorX::new(unsafe { msg_send![view, leadingAnchor] }), | ^^^ variant or associated item not found in `LayoutAnchorX` | ::: src/layout/horizontal.rs:14:1 | 14 | pub enum LayoutAnchorX { | ---------------------- variant or associated item `new` not found here error[E0599]: no variant or associated item named `new` found for enum `LayoutAnchorX` in the current scope --> src/webview/mod.rs:164:38 | 164 | trailing: LayoutAnchorX::new(unsafe { msg_send![view, trailingAnchor] }), | ^^^ variant or associated item not found in `LayoutAnchorX` | ::: src/layout/horizontal.rs:14:1 | 14 | pub enum LayoutAnchorX { | ---------------------- variant or associated item `new` not found here error[E0599]: no variant or associated item named `new` found for enum `LayoutAnchorY` in the current scope --> src/webview/mod.rs:165:36 | 165 | bottom: LayoutAnchorY::new(unsafe { msg_send![view, bottomAnchor] }), | ^^^ variant or associated item not found in `LayoutAnchorY` | ::: src/layout/vertical.rs:11:1 | 11 | pub enum LayoutAnchorY { | ---------------------- variant or associated item `new` not found here error[E0599]: no variant or associated item named `new` found for enum `LayoutAnchorDimension` in the current scope --> src/webview/mod.rs:166:43 | 166 | width: LayoutAnchorDimension::new(unsafe { msg_send![view, widthAnchor] }), | ^^^ variant or associated item not found in `LayoutAnchorDimension` | ::: src/layout/dimension.rs:20:1 | 20 | pub enum LayoutAnchorDimension { | ------------------------------ variant or associated item `new` not found here error[E0599]: no variant or associated item named `new` found for enum `LayoutAnchorDimension` in the current scope --> src/webview/mod.rs:167:44 | 167 | height: LayoutAnchorDimension::new(unsafe { msg_send![view, heightAnchor] }), | ^^^ variant or associated item not found in `LayoutAnchorDimension` | ::: src/layout/dimension.rs:20:1 | 20 | pub enum LayoutAnchorDimension { | ------------------------------ variant or associated item `new` not found here error[E0599]: no variant or associated item named `new` found for enum `LayoutAnchorX` in the current scope --> src/webview/mod.rs:168:38 | 168 | center_x: LayoutAnchorX::new(unsafe { msg_send![view, centerXAnchor] }), | ^^^ variant or associated item not found in `LayoutAnchorX` | ::: src/layout/horizontal.rs:14:1 | 14 | pub enum LayoutAnchorX { | ---------------------- variant or associated item `new` not found here error[E0599]: no variant or associated item named `new` found for enum `LayoutAnchorY` in the current scope --> src/webview/mod.rs:169:38 | 169 | center_y: LayoutAnchorY::new(unsafe { msg_send![view, centerYAnchor] }), | ^^^ variant or associated item not found in `LayoutAnchorY` | ::: src/layout/vertical.rs:11:1 | 11 | pub enum LayoutAnchorY { | ---------------------- variant or associated item `new` not found here error[E0308]: mismatched types --> src/webview/mod.rs:219:76 | 219 | fn get_from_backing_node R, R>(&self, handler: F) -> R { | --------------------- - ^ expected type parameter `R`, found `()` | | | | | this type parameter | implicitly returns `()` as its body has no tail or `return` expression | = note: expected type parameter `R` found unit type `()` error: aborting due to 17 previous errors Some errors have detailed explanations: E0308, E0599. For more information about an error, try `rustc --explain E0308`. error: could not compile `cacao` To learn more, run the command again with --verbose. ```

ryanmcgrath commented 3 years ago

Hmmm, wouldn't surprise me - but I can patch this up today. Will probably write some GitHub CI tests to at least try building on each push to catch stuff like this; my "kitchen sink" app uses just about everything... except the webview, lol

Appreciate the heads up!

ryanmcgrath commented 3 years ago

This should be fixed - there's also a (very basic, this week is rough time-wise for me) browser example that can be run with the following:

cargo run --example browser --features webview

sciguy16 commented 3 years ago

Thanks for getting it updated so quickly!