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

Unable to finish "hello world" tutorial - "does not have a library for current platform" #742

Closed
Mercanuis opened this issue May 23, 2021 · 9 comments

Comments

@Mercanuis
Copy link

Mercanuis commented May 23, 2021

Computer: M1 MacbookPro
Godot: v3.3.stable.offical

running the tutorial I am unable to seem to run the project

godot-rust-poc
├── README.md
├── poc-godot
│   ├── HelloWorld.gdns
│   ├── default_env.tres
│   ├── icon.png
│   ├── icon.png.import
│   ├── libpoc_rust.dylib
│   ├── libpoc_rust.tres
│   └── project.godot
└── poc-rust
    ├── Cargo.lock
    ├── Cargo.toml
    └── src
        └── lib.rs

3 directories, 11 files

Screen shots seem to suggest that either

  1. Godot doesn't have the support yet for M1
  2. The rust-godot is not finding it
  3. I screwed up the tutorial, just as likely :P

I have the attached screen shots, cargo build runs fine and the library bin seems fine

Screen Shot 2021-05-23 at 13 01 50 (2)
Screen Shot 2021-05-23 at 13 02 21 (2)
Screen Shot 2021-05-23 at 13 02 34 (2)
Screen Shot 2021-05-23 at 13 04 05 (2)
Screen Shot 2021-05-23 at 13 04 50 (2)

@Mercanuis
Copy link
Author

Doing a bit more fiddling around, I found this quick guide that showed me I might have had the dynamic library added incorrectly. However, I did seem to find something similar to an issue I had with a separate godot tool
here

Screen Shot 2021-05-23 at 14 35 00 (2)
Screen Shot 2021-05-23 at 14 35 36 (2)
Screen Shot 2021-05-23 at 14 35 57 (2)

The error logs seem to suggest that the current architecture is not there or available.

@ghost
Copy link

ghost commented May 23, 2021

I'd imagine that if you're running a x86_64 version of Godot through Rosetta, it'll be looking for a dynamic library built for x86_64. cargo build targets your host platform by default and should give you a M1 binary instead. You might be able to cross-compile for x86_64 Macs by passing --target x86_64-apple-darwin to cargo.

Unfortunately, I don't have a M1 Mac to try this out locally. You're on your own here.

@Bromeon
Copy link
Member

Bromeon commented May 23, 2021

They have the same problem in godot-cpp, maybe you can have a look: godotengine/godot-cpp#529

Also interesting: godotengine/godot#47355
Did you compile Rust for arm64 architecture?

@Mercanuis
Copy link
Author

Thanks for the update. Seems everyone is learning and having to adapt to the new ARM stuff. I'll try to run the following and see if that's a good workaround

Seems the rust guys are trying to add M1 to the list of keychains, they seem to have a build going
rust-lang/rust#73908

https://github.com/shepmaster/rust/blob/silicon/silicon/README.md

@Mercanuis
Copy link
Author

They have the same problem in godot-cpp, maybe you can have a look: godotengine/godot-cpp#529

Also interesting: godotengine/godot#47355
Did you compile Rust for arm64 architecture?

I'm going to guess that per @toasteater 's comment, that since it and M1 and I didn't specify any build targets or goals, it built to the default. So if Godot needs an x86_64 then the idea might be to tell cargo the target and see if that helps

@Mercanuis
Copy link
Author

Did you compile Rust for arm64 architecture?

Per rustup

Default host: x86_64-apple-darwin
rustup home:  /Users/mercanuis/.rustup

installed toolchains
--------------------

stable-x86_64-apple-darwin
nightly-x86_64-apple-darwin (default)

active toolchain
----------------

nightly-x86_64-apple-darwin (default)
rustc 1.54.0-nightly (8cf990c9b 2021-05-15)

@Mercanuis
Copy link
Author

file $(which rustup)
/Users/mercanuis/.cargo/bin/rustup: Mach-O 64-bit executable x86_64

so it looks like that Rust is using the x86_64 build, which means it should work with the Godot version yes? I installed Godot via brew install --cask godot so I would figure that was either the 'universal' build or the x86_64 one

@Mercanuis
Copy link
Author

I hunted down the issue. It looks like the root cause was that per what @toasteater said, the presumption was that Godot was running off rosetta. turns out, the flag to tell MacOS to run Godot with Rosetta was turned off. So the actual issue was a reverse of what we thought: that it was Godot running arm and not Rust

I think we can close the issue now if we want. Thanks to @toasteater and @Bromeon for their help and patience

@ghost
Copy link

ghost commented May 23, 2021

Glad to hear that! This should probably be mentioned in the user guide. Tracking issue: godot-rust/book#27

@ghost ghost closed this as completed May 23, 2021
@Bromeon Bromeon modified the milestone: v0.10.1 Jul 16, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants