godotengine / godot-proposals

Godot Improvement Proposals (GIPs)
MIT License
1.13k stars 93 forks source link

Separate Linux and FreeBSD GDNativeLibrary options #2325

Open SeleDreams opened 3 years ago

SeleDreams commented 3 years ago

Describe the project you are working on

I am working on an RPG in C++ on FreeBSD using gdnative with godot-cpp.

Describe the problem or limitation you are having in your project

Because Godot treats all x11 systems as linux systems, there are no categories for freebsd. The main issue is that from what I know, linux and freebsd native libraries aren't cross-compatible due to different kernels and dependencies. That's why if a project is planned to both have a freebsd and a linux version, this can cause issues because it would require a dedicated fork of the project for freebsd in order to not confuse the linux and freebsd versions of the library

Describe the feature / enhancement and how it helps to overcome the problem or limitation

By adding a separate category for freebsd this would allow to not confuse both libraries and keep a unified workflow between all platforms.

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

A simple freebsd category would be added to the gdnativelibrary menu of the editor in order to allow to have a freebsd specific library

If this enhancement will not be used often, can it be worked around with a few lines of script?

It can at the moment be worked around by having a specific branch for freebsd setting the freebsd library as the linux library.

Is there a reason why this should be core and not an add-on in the asset library?

This issue from what I know cannot be fixed from an addon unless I am wrong, this depends on the way godot handles the build process and redirects the calls to the library

image

Calinou commented 3 years ago

How do the various BSDs handle library compatibility nowadays? Is it possible to build an universal library that will work on all recent BSD variants?

SeleDreams commented 3 years ago

How do the various BSDs handle library compatibility nowadays? Is it possible to build an universal library that will work on all recent BSD variants?

I don't know if one exists, I think the issue with bsd is that i'm not sure it has something similar to the linux "snaps" and "flatpaks" to have a unified binary that would work on most platforms

I think a way to handle it to avoid having to officially support more platforms would be an ability to manually add more platforms just like we can add more architectures in this menu

I'm still going to ask about it on the freebsd discord

SeleDreams commented 3 years ago

So I was able to get an answer and it seems that libraries aren't cross compatible between freebsd, openbsd etc

so i guess either only freebsd would be added, either most known bsd flavors, either an option to add custom targets

vnen commented 3 years ago

This is sort of solved in Godot 4 as the OS name better reflect the underlying system (there's Linux, FreeBSD, NetBSD, and just BSD). But the the library editor haven't been updated yet to reflect this. Maybe we also should add OpenBSD to that detection.

9gay commented 2 years ago

@vnen what do you mean by add openbsd? don't you get the name by using https://man.openbsd.org/uname.3 ?