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

Turtle does not compile on mac #241

Closed
ssempervirens opened this issue Jun 12, 2021 · 5 comments
Closed

Turtle does not compile on mac #241

ssempervirens opened this issue Jun 12, 2021 · 5 comments

Comments

@ssempervirens
Copy link

ssempervirens commented Jun 12, 2021

I tried to add turtle to my project by adding turtle = "1.0.0-rc.3". When I ran cargo build, I get a compile error which looks to be an issue of one of turtle's dependencies, winit v0.19.5. This might be a mac specific issue of some kind? I am on a M1 macbook, Big Sur version 11.2.3. Here's the mess of error I get. Thanks for any help resolving this, and thanks again for your work maintaining this project!

   --> /Users/camille/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.19.5/src/platform/macos/view.rs:209:9
    |
205 | extern fn has_marked_text(this: &Object, _sel: Sel) -> BOOL {
    |                                                        ---- expected `bool` because of return type
...
209 |         (marked_text.length() > 0) as i8
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found `i8`

error[E0308]: mismatched types
   --> /Users/camille/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.19.5/src/platform/macos/window.rs:103:26
    |
103 |             is_zoomed != 0
    |                          ^ expected `bool`, found integer

error[E0308]: mismatched types
   --> /Users/camille/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.19.5/src/platform/macos/window.rs:175:57
    |
175 |                 self.window.setFrame_display_(new_rect, 0);
    |                                                         ^ expected `bool`, found integer

error[E0308]: mismatched types
    --> /Users/camille/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.19.5/src/platform/macos/window.rs:1301:48
     |
1301 |         window.setFrame_display_(current_rect, 0)
     |                                                ^ expected `bool`, found integer

error[E0308]: mismatched types
    --> /Users/camille/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.19.5/src/platform/macos/window.rs:1308:48
     |
1308 |         window.setFrame_display_(current_rect, 0)
     |                                                ^ expected `bool`, found integer

error[E0308]: mismatched types
    --> /Users/camille/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.19.5/src/platform/macos/window.rs:1325:48
     |
1325 |         window.setFrame_display_(current_rect, 0)
     |                                                ^ expected `bool`, found integer

error[E0308]: mismatched types
    --> /Users/camille/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.19.5/src/platform/macos/window.rs:1332:48
     |
1332 |         window.setFrame_display_(current_rect, 0)
     |                                                ^ expected `bool`, found integer

error: aborting due to 7 previous errors

For more information about this error, try `rustc --explain E0308`.
error: could not compile `winit`
@sunjay
Copy link
Owner

sunjay commented Jun 13, 2021

Sorry about the issue you're running into! We've been unable to release a new version of turtle for a few years because of dependency issues (#183). That means that the version on crates.io is severely outdated and won't work on most machines these days. :(

You can usually address this by switching to the master branch as detailed here: #202 (comment). You will still run into issues on Mac because of #183, but the crate should be mostly usable.

Appreciate you reporting this issue! Please let me know if this suggestion resolves things for you.

@ssempervirens
Copy link
Author

Thanks for the response! I gave that a try, and replaced the crate line in my cargo.toml file with turtle = {git = "https://github.com/sunjay/turtle", rev = "bf64b8333a2be1914378d8a22a4788947711182b"}.

Unfortunately, I get the same error as before with winit. It seems like this workaround no longer works for some reason. In any case it sounds like this issue isn't new, but what might be new is that switching to the master branch doesn't work?

Thanks again.

@gaetgu
Copy link

gaetgu commented Jun 23, 2021

I am also having the same issue even after putting the suggested line in.

@sunjay
Copy link
Owner

sunjay commented Jun 24, 2021

Does it work if you use the following in your Cargo.toml? (Removed the rev so it uses the latest master branch)

turtle = {git = "https://github.com/sunjay/turtle"}

You may need to run cargo update in conjunction with this to make sure Cargo updates your Cargo.lock file to the latest revision of this repository.

Please keep in mind that the crate will have some known bugs (#183) when you use the master branch like this. It should hopefully still be fairly usable though.

@sunjay
Copy link
Owner

sunjay commented Sep 7, 2021

Appears to be fixed now (at least on the master branch). Make sure you run cargo update so you have latest version of all the dependencies. My Cargo.lock file lists winit version 0.25.0 and that seems to work fine.

@sunjay sunjay closed this as completed Sep 7, 2021
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

3 participants