GithubHelp home page GithubHelp logo

macalimlim / godot-rust-template Goto Github PK

View Code? Open in Web Editor NEW
52.0 6.0 22.0 151 KB

A template for godot-rust projects

License: MIT License

Makefile 63.84% Rust 28.81% Shell 7.35%
cargo-generate

godot-rust-template's People

Contributors

finnhartshorn avatar macalimlim avatar paul-marechal avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

godot-rust-template's Issues

can't `make run` on my x86_64 macbook

here's the output i get:

$ make run
Makefile:2: *** missing separator.  Stop.

to show my environment:

clang -v
Apple clang version 13.0.0 (clang-1300.0.29.30)
Target: x86_64-apple-darwin20.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

thanks for providing this project!

Wrong dynamic library for gcc?

I used the godot-rust template and when running make run, and the following error came out:

ERROR: Can't open dynamic library: D:/rust/my-awesome-game/godot/../lib/x86_64-pc-windows-msvc/my_awesome_game.dll, error: Error 126: The specified module could not be found.

I used gcc for building, so there's nothing under x86_64-pc-windows-msvc, and the my_awesome_game.dll is under x86_64-pc-windows-gnu instead.


In addition,

run:
	make build-x86_64-pc-windows-gnu-debug
	godot --path godot/ -d
	# make build-x86_64-pc-windows-msvc-debug

I moved the commented part down, because when it (or the gcc, I tried both) is above godot --path godot/ -d there's also a error despite being commented:

mingw32-make[1]: Leaving directory 'D:/rust/my-awesome-game'
# make build-x86_64-pc-windows-msvc-debug
process_begin: CreateProcess(NULL, # make build-x86_64-pc-windows-msvc-debug, ...) failed.
make (e=2): The system cannot find the file specified.
mingw32-make: *** [Makefile:249: run] Error 2

[[: not found

$ cargo make run

error

   Compiling my_awesome_game v0.1.0 (/home/j/projects/my-awesome-game/rust)
    Finished dev [unoptimized + debuginfo] target(s) in 20.57s
/tmp/j/fsio/lc9vQMEIWe.sh: 4: [[: not found
[cargo-make][1] INFO - Running Task: run-godot
/tmp/j/fsio/Pgy2ih9fJa.sh: 4: godot: not found
[cargo-make][1] ERROR - Error while executing command, exit code: 127
[cargo-make][1] WARN - Build Failed.
[cargo-make] ERROR - Error while running duckscript: Source: Unknown Line: 4 - Error while executing command, exit code: 1
[cargo-make] WARN - Build Failed.

My shell, bash, and its version

j at desktop in ~/projects/my-awesome-game on master [?]
$ echo $SHELL
/bin/bash

j at desktop in ~/projects/my-awesome-game on master [?]
$ bash --version
GNU bash, version 5.0.17(1)-release (x86_64-pc-linux-gnu)
Copyright (C) 2019 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

support mac osx targets

The template should have support for mac osx targets from building the library to exporting the game

M1 Mac Support

Hi, I created a new project by following the wiki and when i ran the command cargo make run, I get the following errors:

`OpenGL ES 3.0 Renderer: Apple M1 Pro
Async. shader compilation: OFF

UNSUPPORTED (log once): POSSIBLE ISSUE: unit 1 GLD_TEXTURE_INDEX_2D is unloadable and bound to sampler type (Float) - using zero texture because texture unloadable
Registered camera FaceTime HD Camera with id 1 position 0 at index 0
ERROR: Can't open dynamic library: /Users/user/Developement/godot/godotshop/godot/../lib/x86_64-apple-darwin/libgodotshop.dylib, error: dlopen(/Users/user/Developement/godot/godotshop/godot/../lib/x86_64-apple-darwin/libgodotshop.dylib, 0x0002): tried: '/Users/user/Developement/godot/godotshop/godot/../lib/x86_64-apple-darwin/libgodotshop.dylib' (mach-o file, but is an incompatible architecture (have (x86_64), need (arm64e))), '/Users/user/Developement/godot/godotshop/lib/x86_64-apple-darwin/libgodotshop.dylib' (mach-o file, but is an incompatible architecture (have (x86_64), need (arm64e))).
at: open_dynamic_library (platform/osx/os_osx.mm:1956)
ERROR: No valid library handle, can't get symbol from GDNative object
at: get_symbol (modules/gdnative/gdnative.cpp:510)
ERROR: No nativescript_init in "res://../lib/x86_64-apple-darwin/libgodotshop.dylib" found
at: init_library (modules/gdnative/nativescript/nativescript.cpp:1503)`

Is M1 Mac not supported with this template? Thank you

Support incremental compilation

I notice that iteration on rust code is slow because the cargo make run command cleans the build directory before rebuilding. This is really inefficient and slows down development a lot. Why is this necessary, and is it possible to remove? Removing locally (and fixing the [[ issue) allows the code to rebuild without rebuilding the entire dependency tree.

Setup CI for PRs (and maybe periodical?)

We should try to make sure that the generated projects from this template can actually compile and run. This check should also be run periodically, since it's possible to forget to update the template when releasing a new, breaking version.

make run does not work on windows

I installed llvm and make by choco install make command.
After make run I got this error:

mv -b ./target/x86_64-pc-windows-msvc/debug/*.dll ./lib/x86_64-pc-windows-msvc
process_begin: CreateProcess(NULL, mv -b ./target/x86_64-pc-windows-msvc/debug/*.dll ./lib/x86_64-pc-windows-msvc, ...) failed.
make (e=2): The system cannot find the file specified.
make[1]: *** [Makefile:213: build-x86_64-pc-windows-msvc-debug] Error 2
make[1]: Leaving directory 'D:/p/godot/test-rust'
make: *** [Makefile:249: run] Error 2

use gdnative-project-utils for creation of Godot resources

The project utils crate has an API usable in build scripts and automatically creates any .gdns and .gdnlib files required. Maybe it makes sense for new projects to use that instead of manually creating those resources?

Ideally any issues that come up with the crate should be fixed, I do think it makes the workflow a lot better, so it might make sense to use it in new projects by default?

Let me know what you think!

support iOS targets

The template should have support for iOS targets from building the library to exporting the game

make the filename of the `gndlib` file be the same as the `crate_name`

Make the filename of the godot/native/*.gdnlib file be the same as the crate_name. Currently it is named statically to game.gdnlib, it would be better if we could name this file as the crate_name. Unfortunately the current version of cargo-generate does not support this feature but it was supported in an earlier version. Not entirely sure why was it removed, filed an issue here asking about it.

make run does not work on Mac

make run does not work on Mac because the -b option is not supported. Executing the command result in:

mv -b ./target/x86_64-apple-darwin/debug/*.dylib ./lib/x86_64-apple-darwin
mv: illegal option -- b
usage: mv [-f | -i | -n] [-v] source target
       mv [-f | -i | -n] [-v] source ... directory

On: MacOS Monterey 12.0.1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.