GithubHelp home page GithubHelp logo

gd-plug's People

Contributors

difint avatar imjp94 avatar lihop avatar martinejaw avatar nathanlovato avatar univeous avatar xphere 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  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

gd-plug's Issues

Inner class name conflict with other plugins

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:

class ThreadPool extends Reference:

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):

  • Add a plugin-specific prefix like "GDPlug" to the class names:
    ThreadPool -> GDPlugThreadPool
    Logger -> GDPlugLogger
    GitExecutable -> GDPlugGitExecutable
    This is a little ugly but least-likely to conflict with other plugins.
  • Add an underscore prefix:
    ThreadPool -> _ThreadPool
    Logger -> _Logger
    GitExecutable -> _GitExecutable
    This marks the inner classes as private and keeps the pretty names. It shouldn't be too likely that these conflict with other plugins, but who knows. Perhaps another plugin developer might declare class_name _Logger or class_name _ThreadPool for whatever reason.

Autoload script not removed

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?

GDExtentions which needs compilation is ignored by GDPlug

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.

Possible workarounds

  • Attempt to use the GitHub Releases API to download the plugins from the releases section(where most likely the bins are precompiled there and ready to use). The possible solution
  • Attempt to compile the plugin using cmake or an compilation script within the repo. Most likely the hardest to achieve
  • Warn the user that GDExtentions which requires compilation after cloning would be ignored. Easiest, Documented But defeats the purpose of being able to download all kinds of plugins TBH...

Affected Plugins: Godot Jolt
Godot Version: 4.1.1 Stable

Non root addons dont install correctly

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

private repository support

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.

Fails to install when there are spaces in project directory name

Platform/versions: Linux, Godot 3.3.2-stable, gd-plug 0.1.1
Steps to reproduce:

  1. Create new project with the default name "New Game Project"
    2021-07-16-185130_498x162_scrot
  2. Install gd-plug from Asset Lib.
  3. Add a plug.gd file with some plugin. For example:
extends "res://addons/gd-plug/plug.gd"

func _plugging():
	plug("bitwes/Gut")
  1. Run install command:
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.

Unexpected OS: Linux

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.

"X11", "OSX", "Server":

Stuck when running any command

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

Godot LSP reports errors on all .plugged repo files

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!

Add compressed file support

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

Warning: Thread destroyed without wait_to_finish() called

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!

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.