Skip to content

Update to 4.4 #79

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Update to 4.4 #79

wants to merge 1 commit into from

Conversation

paddy-exe
Copy link
Collaborator

Contains changes to .gitignore file due to the addition of .uid files

Question is if we should add the .uid file?

@paddy-exe paddy-exe added the enhancement New feature or request label Mar 4, 2025
@dsnopek
Copy link
Contributor

dsnopek commented Mar 4, 2025

Question is if we should add the .uid file?

Hm. If uid's are supposed to be unique, then I guess we shouldn't add the .uid files? Otherwise everyone who copies the template gets the same uid's, whereas if we leave them out, then Godot generates new unique ones for each project

@Ivorforce
Copy link
Member

Ivorforce commented Mar 4, 2025

I think .uid files should be part of godot-cpp repos. It will likely not matter in most cases, but having consistent IDs across installs will make it more transparent what's happening in possible error reports or when an extension is removed and reinstalled.

If uid's are supposed to be unique [...]

I think it's fine as long as they're unique within one project. I don't see a reason to have them be unique outside of it. Though perhaps I'm missing something about their design that would warrant that.

@dsnopek
Copy link
Contributor

dsnopek commented Mar 4, 2025

I think it's fine as long as they're unique within one project. I don't see a reason to have them be unique outside of it. Though perhaps I'm missing something about their design that would warrant that.

Well, if the .gdextension file in the template gets a .gdextension.uid, and multiple people make GDExtensions via the template and distribute them on the asset library, we could end up with multiple GDExtensions on the asset library having the same uid in their .gdextension.uid.

I'm not sure it would even actually cause problems, but I think we'd want to try and discourage something like that from happening.

The test project within godot-cpp itself should have it's .uid files saved in the repo, though. I don't think it does currently.

@unvermuthet
Copy link
Contributor

unvermuthet commented Mar 5, 2025

I think they should be excluded from the template and regenerated. But adding them to the .gitignore seems like a bad idea. They should be committed once regenerated by the user. Is the a way to do this in .gitattributes?

@paddy-exe
Copy link
Collaborator Author

paddy-exe commented Mar 5, 2025

I think they should be excluded from the template and regenerated. But adding them to the .gitignore seems like a bad idea. They should be committed once regenerated by the user. Is the a way to do this in .gitattributes?

I mean we could alternatively just not commit it here. That would make it easier. The downside is that we will have to make sure it won't ever be committed in the future. Not sure how this might be possible via gitattributes though

Contains changes to .gitignore file due to the addition of .uid files
@paddy-exe
Copy link
Collaborator Author

Alright updated to not include the .uid file as discussed in the GDExtension meeting.

Copy link
Member

@Ivorforce Ivorforce left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about editing the min version from the .gdextension file?

@unvermuthet
Copy link
Contributor

unvermuthet commented Mar 18, 2025

Not sure about the compatibility_minimum in .gdextension. We expect people to raise that themselves if they use APIs from newer versions, right? The parameter describes itself very well and everyone will touch that file.

@Ivorforce
Copy link
Member

Ivorforce commented Mar 18, 2025

godot-cpp-template itself is using an API from 4.4, and the resulting GDExtension is thus compatible only with 4.4+ (before the PR, 4.3+). I think we should raise it because it's just incorrect if we don't.

The parameter describes itself very well and everyone will touch that file.

That's true, but funnily enough I didn't change it myself until a few months after I started working with GDExtension because I thought my extension might be 4.1 compatible and it wouldn't if I changed it. Although that's a problem that will probably be less likely to happen to anyone else once we start expanding the docs about things like these :D

@unvermuthet
Copy link
Contributor

Then it seems I misunderstood backward compatibility with GDExtensions.

@dsnopek
Copy link
Contributor

dsnopek commented Mar 19, 2025

It's true that because we're using the 4.4 branch of godot-cpp, the resulting GDExtension would only load on Godot 4.4+ (and give an error message about it on earlier versions)

However, I think it'd be OK to leave the compatibility_minimum it the .gdextension file at 4.1. That way, if a developer wants to support an earlier version, it's only a matter of rolling godot-cpp back to an earlier version, and doesn't require changing the .gdextension file as well

@unvermuthet
Copy link
Contributor

I think leaving it lower might be misleading then. Kind of like what @Ivorforce said:

I thought my extension might be 4.1 compatible and it wouldn't if I changed it.

I also thought this was the only safeguard. What's the reason for having this twice?

@dsnopek
Copy link
Contributor

dsnopek commented Mar 19, 2025

I also thought this was the only safeguard. What's the reason for having this twice?

The minimum_compatibility is checked by Godot, and it's done before ever trying to load the extension. It's the only way we have to deal with the compatibility break between 4.0 and 4.1, while avoiding crashes.

The second check is done by godot-cpp after the extension has been loaded, but before being initialized. This allows us to automatically derive the compatibility from the extension_api.json that was used, such that the extension developer doesn't need to manually put this into the .gdextension file. Not all extension bindings do something like this

@paddy-exe
Copy link
Collaborator Author

I could alternatively also put some more information into the steps of using the template that godot-cpp should be set to the minimum supported version?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants