imjp94 / gd-plug Goto Github PK
View Code? Open in Web Editor NEWMinimal plugin manager for Godot
License: MIT License
Minimal plugin manager for Godot
License: MIT License
After a plugin is installed through this script, delete the plugin's whole folder in addons/,
the plugin will still be considered as installed.
when running install
or update
, nothing will happen.
I think they should be re-installed.
After installing and enabling the ThreadPool plugin with the following plug.gd
:
extends "res://addons/gd-plug/plug.gd"
func _plugging():
plug("zmarcos/godothreadpool")
Future invocations of the plug.gd
script fail with the error messages:
ERROR: get_global_class_path: Condition "!global_classes.has(p_class)" is true. Returned: String()
At: core/script_language.cpp:239.
SCRIPT ERROR: GDScript::reload: Parse Error: Can't override name of the unique global class "ThreadPool". It already exists at:
At: res://addons/gd-plug/plug.gd:832.
ERROR: reload: Method failed. Returning: ERR_PARSE_ERROR
At: modules/gdscript/gdscript.cpp:583.
SCRIPT ERROR: GDScript::reload: Parse Error: Script isn't fully loaded (cyclic preload?): res://addons/gd-plug/plug.gd
At: res://plug.gd:1.
ERROR: reload: Method failed. Returning: ERR_PARSE_ERROR
At: modules/gdscript/gdscript.cpp:583.
This is because the ThreadPool plugin declares the unique global class here:
class_name ThreadPool
which conflicts with gd-plug's inner class:
gd-plug/addons/gd-plug/plug.gd
Line 832 in 83cd8f5
I can also see the potential for conflict with gd-plug's other inner classes. Logger
with some logging related plugin, and (maybe less likely) GitExecutable
with some git related plugin.
More widely, this is related to github proposal #1566 Implement namespaces to avoid collisions in third-party add-ons. A suggested workaround there is to add a prefix to class names.
Some ideas (assuming these inner classes are for private use only and not part of the pubilc gd-plug API):
ThreadPool
-> GDPlugThreadPool
Logger
-> GDPlugLogger
GitExecutable
-> GDPlugGitExecutable
ThreadPool
-> _ThreadPool
Logger
-> _Logger
GitExecutable
-> _GitExecutable
class_name _Logger
or class_name _ThreadPool
for whatever reason.autoload script references in project setting are not cleared as plugin uninstalled.
Workaround: Manually remove autoload scripts from project setting
Can elaborate what does this mean?
So if a plugin has an autoload, that autoload is not removed on uninstalling the plugin?
Not really an issue, but a comment. This is a really nice plugin, and is similar to my tool gs-project-manager
https://gitlab.com/godot-stuff/gs-project-manager
I really like the integration with Godot.
SCRIPT ERROR: Invalid get index 'do' (on base: 'Dictionary').
at: install (res://addons/gd-plug/plug.gd:433)
Hello there!
I really liked your work on this and It makes creating complex projects, especially those which uses the REUSE spec easier.
But an problem that I found while incorporating your plugin into my project is that when downloading GDExtentions/GDNative plugins which doesn't have the plugin files already pre-compiled within the repository refuses to download anything.
Affected Plugins: Godot Jolt
Godot Version: 4.1.1 Stable
Non root addons dont install correctly like godot-box2d
It will not install in addons but in the project root.
It kind of work with {"install_root": "addons/godot-box2d"}
but it is installed in addons/godot-box2d/bin/addons/godot-box2d
Edit: I found that box2D need to be install via the zip file in the release section so this issue do not apply anymore.
See #31 for the issue for box2D
Even if I configured GitHub credentials, I cannot use this plugin to manage private repositories.
logs:
cmdline_args: ["install", "debug"]
Plug start
Installation config loaded
Plug: { "name": "*****", "url": "https://git::@github.com/*****/*****.git", "plug_dir": "res://.plugged/*****", "include": [], "exclude": [], "branch": "", "tag": "", "commit": "", "dev": false, "on_updated": "", "install_root": "" }
Installing...
Request quit declined, threadpool is still running
Execute task <SceneTree#24830280835>.install_plugin()
Installing plugin *****...
Downloading ***** from https://git::@github.com/*****/*****.git...
Cloning from https://git::@github.com/*****/*****.git to C:/*****...
Execute "cd "C:/*****" && git clone --depth=1 --progress "https://git::@github.com/*****/*****.git" "C:/*****" 2> nul"
Execution ended(code:128): [""]
Failed to clone from https://git::@github.com/*****/*****.git
Failed to download *****
Failed to install plugin ***** with error code 128
Execution finished <SceneTree#24830280835>.install_plugin()
All thread finished
If I run git clone
directly in cmd, there is no problem.
Platform/versions: Linux, Godot 3.3.2-stable, gd-plug 0.1.1
Steps to reproduce:
plug.gd
file with some plugin. For example:extends "res://addons/gd-plug/plug.gd"
func _plugging():
plug("bitwes/Gut")
godot --no-window -s plug.gd install
Expected: Install plugins.
Actual: Fails with:
Failed to download Gut
Failed to install plugin Gut with error code 1
Output when running install command with debug logging:
Godot Engine v3.3.2.stable.custom_build - https://godotengine.org
WARNING: initialize: XOpenIM failed
At: platform/x11/os_x11.cpp:200.
WARNING: initialize: XCreateIC couldn't create xic
At: platform/x11/os_x11.cpp:508.
OpenGL ES 3.0 Renderer: NVIDIA GeForce GTX 1060/PCIe/SSE2
OpenGL ES Batching: ON
cmdline_args: [install, debug]
Plug start
Installation config loaded
Plug: {branch:, commit:, dev:False, exclude:[...], include:[], install_root:, name:Gut, on_updated:, plug_dir:res://.plugged/Gut, tag:, url:https://git::@github.com/bitwes/Gut.git}
Installing...
Execute task [SceneTree:1180].install_plugin()
Request quit declined, threadpool is still running
Installing plugin Gut...
Downloading Gut from https://git::@github.com/bitwes/Gut.git...
Cloning from https://git::@github.com/bitwes/Gut.git to /home/leroy/New Game Project/.plugged/Gut...
Execute "cd /home/leroy/New Game Project/.plugged/Gut && git clone --depth=1 --progress https://git::@github.com/bitwes/Gut.git /home/leroy/New Game Project/.plugged/Gut"
Execution ended(code:1): []
Failed to clone from https://git::@github.com/bitwes/Gut.git
Failed to download Gut
Failed to install plugin Gut with error code 1
Execution finished [SceneTree:1180].install_plugin()
All thread finished
Plugged config saved
Finished, elapsed 0.163s
Cause: I think it is caused by the spaces in the directory name which are not escaped escaped with "\". Example:
[leroy@laptop ~]$ cd /home/leroy/New Game Project/
bash: cd: too many arguments
[leroy@laptop ~]$ echo $?
1
[leroy@laptop ~]$ cd /home/leroy/New\ Game\ Project/
[leroy@laptop New Game Project]$ echo $?
0
Generally, I never create directories with spaces because of issues like these, but in this case I used the default project name as I wanted to quickly test something and stumbled upon this error.
Thank you for porting this incredibly useful plugin to Godot 4. When I run the Godot 4 version on Linux, I get the error "Unexpected OS: Linux".
Comparing the 3.5 docs to the 4.0 docs shows that the OS.get_name()
values for the Unix-like OSes have changed from "OSX", "X11", "Server"
to "macOS", "Linux", "FreeBSD", "NetBSD", "OpenBSD", "BSD"
.
Updating these names in the following line resolves the issue.
gd-plug/addons/gd-plug/plug.gd
Line 709 in b4ac59b
After I updated to 0.2.3 from 0.2.1 using upgrade
, running any command will get stuck.
If I remove all the additions related to threadpool.active
, it works just as it did before.
This also happens in a nearly empty project.
Godot version: v4.1 dev4 and v4.1 beta1
Hey there! Thanks for this plugin, it saves a bunch of time while adding and updating external plugins!
Since adding gd-plug, i've noticed that godot lsp happily traverses into the .plugged directory and reports errors from all the cloned addon repos - is there any way to prevent this or some workaround that you're using to avoid seeing all the extra errors for files that aren't used by your game?
Or maybe this is just a problem on my end? I'm using emacs as an external editor and connecting to lsp in the running godot editor instance - maybe it's a problem in my setup.
It feels like godot lsp should ignore files in a folder with .gdignore
, but for now this seems like a rare issue - not sure if anyone else is experiencing it.
Thanks for any help or insight!
I tried to install godot-box2d but it need to be installed with the zip file from the release section.
Adding support for http and local zip file will fix that.
Thanks
Probably surrounding the dest
path on _GitExecutable.clone()
with quotes should fix it.
Another small issue I'm facing is this warning message being printed after running gd-plug:
WARNING: A Thread object has been destroyed without wait_to_finish() having been called on it. Please do so to ensure correct cleanup of the thread.
at: ~Thread (core/os/thread.cpp:116)
While the plugin seems to work fine, it would be nice to not see this warning message every time I run it.
Simply adding a call to threadpool._flush_threads()
in _finalize()
resolves the warning. However, I notice that _flush_threads()
is a private method, so I'm not sure if this is how you want to fix it.
diff --git a/addons/gd-plug/plug.gd b/addons/gd-plug/plug.gd
index 088a203..a90d47f 100644
--- a/addons/gd-plug/plug.gd
+++ b/addons/gd-plug/plug.gd
@@ -94,6 +94,7 @@ func _idle(delta):
func _finalize():
_plug_end()
+ threadpool._flush_threads()
logger.info("Finished, elapsed %.3fs" % ((Time.get_ticks_msec() - _start_time) / 1000.0))
func _on_updated(plugin):
Again, thanks for your hard work on this fantastic plugin!
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.