-
-
Notifications
You must be signed in to change notification settings - Fork 97
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
Add ExtensionDevelopmentPlugin for in-editor native extension development #3367
Comments
I recommend the use of the https://github.com/mstorsjo/llvm-mingw package for toolchains for systems other than for mac. There's a different discussion about how to build for mac. Benefits:
|
@fire In this case, I think the user will be in charge of installing this, but our build templates should definitely support it. |
The idea is the user can go to the asset library, click download and start immediately developing Godot extensions in like c++. There is no need to also then install msvc and click 5 windows or similar for mingw. |
@fire Okay but in practice you have to remember that
We can refer to the proper Godot documentation page for this, and the plugin can also autodetect toolchains, but user work is unavoidable here. At least it only needs to be done once, since this would be an editor wide setting. |
What about just having the plugin download a docker container with the necessary build tools? This would make it possible for users to get everything they need to develop e.g. c++ with literally a single click. |
@Ansraer sure that could work to some degree, but keep in mind we can't redistribute legally a lot of stuff, like Android toolchain or MacOS/iOS headers. Would still need to do scripts for users to create those themselves. This is in part why, if your extension does not really use anything native, webassembly is a very attractive option for deploy. |
True, we could probably have some sort of setup wizard that guides the user through this. Actually having a window that tells me what I need to download, with a next button I can only press once I placed the downloaded file in the correct folder actually sounds like a really nice idea. Another reason why I would like to use docker containers is libraries and compilers. At least master itself is currently incompatible with a bunch of compilers and libraries. Getting my dev environment for it setup and working took me a few days. The situation might be better when you only want to build gdextensions, but given how cumbersome it is to get anything installed on windows, and how many linux distros ship very outdated versions the idea of a clean controlled environment is very tempting imo. |
Please don't make Docker mandatory. As an option, it is ok. I'm sure it will get use. Yet, I will not use it. Last time I tried Docker on my machine performance was very bad. Yes, I'm overdue an upgrade, but reasons, ok? Instead, I'll set up the development environment. I had no problem following the instructions from the documentation to build Godot. I have seen the idea come up before. And I said the same thing: Please don't make Docker mandatory. On the flip side, you could provide YAML files for CI platforms. For instance I had good experience with AppVeyor for other projects (It is a good fit for .NET projects because of its NuGet integration among other things), and you can put that on Docker if you want to. It does not have to be AppVeyor, it could be Jenkins (I think that is better for Java), it could be Github actions, or something else. I don't know what solution is a better fit for Godot and its community. |
i see the comments sugesting a compiler be shipped with godot or the plugin, but if this gets you to the point where you could compile the extension with 1 command i think it should already be easy enough for most people that want to write their own extensions |
@barbaros83 Downloading a compiler for this is literally no effort and, given large part of the Godot user base will just not need this, including it with the default download would be a large waste of disk, time and bandwidth. Don't want to go the Unity way here. |
@theraot Are you sure that performance problem was actually dockers fault? Dockers overhead is usually only ~5%. There are some rare cases when it can get up to 18%, but that is caused by the security measures against attacks like spectre (which only really matter when you are running on a server). If you run docker with all security features disabled you almost never get a performance impact higher than 2%. |
@Ansraer Listen, I blame my hardware. 5% of what? You are assuming my machine is comparable to yours. Regardless, perhaps Dockers would run better for me now (It is a more recent version of Docker on a more recent version of the OS after all), or in the future with whatever settings. I would still believe Docker should not be mandatory. |
This proposal is great! Having Godot download/generate the files needed and then only having the users supply a compiler and an IDE would be ideal. It would make GDExtension development comparable to the C# support, much more approachable and much easier to know you're doing it "correctly". We should make it very easy to get started with a "Hello World" extension.
Would it be possible to design the system so that it searches for a special category on the Godot Asset Library, so that all languages can be easily grabbed from one menu in Godot? |
@aaronfranke yes sure, that is precisely the idea |
The editor can have a basic "toolchain check" tool for GDE with a set of common configurations and guides, then updates to that tool could be added via addons to keep it up to date. |
I'll comment on some parts, but I don't really understand what this proposal is about and what you have in mind.
We already have an editor plugins that manages build system and exporting for C#. Other languages could benefit from it though, but maybe they could also implement it as an editor plugin like it's done with C#.
The generation of proper C# classes for GDExtension classes is something I will need. However, I want the C# build system to work even when run from the command line or an IDE, not only when launched from Godot. As such, I will likely make a MSBuild task that runs Godot to generate the |
This comment has been minimized.
This comment has been minimized.
This comment was marked as resolved.
This comment was marked as resolved.
Does this mean the Godot Editor would become mandatory to develop extensions? Would this force a specific build system with specific C++ compiler options? (what if I want to use something other than SCons, or a different version of the C++ standard, or other flags?) Also how would developping editor plugins work, especially when non-reloadable? About docker containers: I have no experience in these, but so far I prefer using toolchains I have to do the main development. I might however use it when doing releases, which I do with CI at the moment. Also I wonder if such containers would be used solely for compiling? Because usually my C++ workflow is: "Build a debug library, launch Godot with debugger attached, eventually breakpoint, step and stop, modify code, restart". Do containers intervene in this? An extra point (probably a bit niche): my own extension should be usable by other extensions, probably as described in this proposal, but as personal preference, I plan to also make it usable by source integration. What I mean by that, is that a project using C++ too can depend on it by compiling its sources with it (or statically linking), rather than through Godot class wrappers from a precompiled version. This has the big advantage of having full idiomatic access to the C++ API of the extension, without any limitation from Godot's API, and without ABI compatibility mess. The "project" I refer to here would very likely be a game, and it would result in a single extension binary being compiled, even though the filesystem would still have two, each in their own folder. Would |
Sounds really great! Reasoning part: My view of implementation:
3rd one can be easilly done by a single shell command and you only need to do it one. While Godot docs can provide an example string for less technmically savvy users, more advanced can easily configure it for their needs. i'm talking about getting specific compilers that one need The most ideal for me would be:
Probably thats it. users can then open solution and press build button, or reconfigure their compilers. The only downside i can see is that a project folder will become polluted with intermediate files. Well, that can be worked around with gitignore |
@Barugon Please don't bump issues without contributing significant new information. Use the 👍 reaction button on the first post instead. |
Describe the project you are working on
Godot
Describe the problem or limitation you are having in your project
Extension development is relatively complex. It requires downloading a separate set of headers, generating them, setting up a compiler toolchain, etc. This happens independent of the usage of Godot from the editor, so development can be relatively difficult.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
The idea is to have something called an "ExtensionDevelopmentPlugin" that eases the project generation, compilation, updating the headers and bindings. This way, everything can be properly done from the editor UI.
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
The new ExtensionDevelopmentPlugin will handle extension development. To develop an extension, a tab in the ProjectSettings will allow specifying project folders as well as the plugin used. As an example:
Creating an extension will make the plugin set up the proper toolchains, debug protocol, build system, build command, and everything needed. If something is not present, the plugin will verify this and let you know that its misconfigured (likely showing an error icon). Running the project, the plugin will also attempt to compile the extension and connect to an IDE for debugging.
It is important to note here that extensions that you already download compiled are not managed or tracked by this system. This system is only for extension development. That said, however, the new extension development plugin system makes the extensions in development interact with the other extensions installed by generating and providing the relevant headers (or API depending on the language) for their use.
As an example, in the config menu for an extension in development, you will be able to see a list of extensions installed and tick which ones you want to have access to. In C++ this means that the proper headers will be generated for using this extension. In C#, it means the proper .cs classes will be created to interact with it.
Finally, the extension plugin will also make sure to compile as many platforms as possible on deploy (in the case of compiled languages) but it will be the developer responsibility to install the required toolchains (there is a separate discussion ongoing about supporting GitHub CI for being able to build for every single platform, as well as also using webassembly optionally to ensure what is compiled runs everywhere, but I think this is material for other proposals).
Stock Godot will only come with support for C++ and C# development, but it is expected that you can download these plugins from the asset library, allowing support for development of other languages such as Nim, Rust, etc.
If this enhancement will not be used often, can it be worked around with a few lines of script?
This is core functionality.
Is there a reason why this should be core and not an add-on in the asset library?
This feature allows the creation of add-ons.
The text was updated successfully, but these errors were encountered: