macalimlim / godot-rust-template Goto Github PK
View Code? Open in Web Editor NEWA template for godot-rust projects
License: MIT License
A template for godot-rust projects
License: MIT License
The template should have support for android x86 and x86_64 targets from building the library to exporting the game
support for linux x86 target from building the library to exporting the game
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!
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
$ 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.
Currently the exported Android
apk has all the libraries bunched up in one apk. We should have different apks for each target.
The template should have support for mac osx targets from building the library to exporting the game
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
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.
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.
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
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!
The template should have support for iOS targets from building the library to exporting the game
replace travis with github actions
currently the makefile's run target assumes that you are on linux x86-64, make it so that the run command is dependent on the user's platform.
As per recommendations, separate the rust project from the godot project. I will propose a directory layout in the next few days...
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 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
The template should have support for windows desktop targets from building the library to exporting the game
add filters to exclude some files upon exporting a game
file extensions to be excluded:
*.rs
*.toml
*.lock
*.x86_64
*.x86
*.exe
*.apk
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.