Skip to content
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 options to control if ".uid" files are generated #100973

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

Conversation

Daylily-Zeleen
Copy link
Contributor

@Daylily-Zeleen Daylily-Zeleen commented Dec 31, 2024

The main purpose of this pr is to allow not generate ".uid" files for "res://addons/", by setting "editor/resource/generate_uid_files_for_addons" to false in project settings.

Sometimes plugins are not included in version control system( for example, using gd-plug to reference plugins by single script), generate ".uid" for plugin's scripts and reference them by using uid are not reasonable.

Additionally, I add "editor/resource/generate_uid_files" to allow not generate ".uid" for the project, but default is true.
Generate ".uid" for each script make the file resource manager become ugly, and we should manipulate 2 files now.
There are some personal preferences here, I believe some people also have this feeling.
For old users, they should used drag files in editor's file system dock, it should not breaks the reference relationship by using this way, and uid is unreadable, we don't use them for coding directly.
In other words, ".uid" files are not necessary for some users.

@Daylily-Zeleen Daylily-Zeleen requested a review from a team as a code owner December 31, 2024 07:34
@AThousandShips AThousandShips changed the title Add options to control generate ".uid" files or not. Add options to control if ".uid" files are generated Dec 31, 2024
@JoNax97
Copy link
Contributor

JoNax97 commented Dec 31, 2024

I think Godot should commit one way or the other. Leaving this as an optional feature greatly limits it's potential in the future. All future features that build up from the uid system (or the metadata-companion-file concept in general) will be impossible to implement fully if some users don't have uids available.

@Chaosus Chaosus added this to the 4.x milestone Dec 31, 2024
@Daylily-Zeleen
Copy link
Contributor Author

Daylily-Zeleen commented Dec 31, 2024

@JoNax97 What features? You should provide specific situation to make your viewpoint convincing and solve the problem that I mentioned about (".uid" in "res://addons").

If you want to talk about future, to make plugins' detail files outside the version control system is a good future, too.
To be honest, plugin should be referenced like nuget in C# instead of including its detail files, right?

@JoNax97
Copy link
Contributor

JoNax97 commented Dec 31, 2024

I agree with you that add-ons should be handled via some package management system. But until then, we cannot guarantee that a plugin does or does not rely on uids and so it's not safe to disable them for all addons.

My main concern is not with add-ons specifically but in general. Fundamental mechanisms that the engine uses to manage its internals should not be up for disabling IMO.

@Daylily-Zeleen
Copy link
Contributor Author

Daylily-Zeleen commented Dec 31, 2024

I think I grab the point that you focus about.
Maybe we should just disable generate ".uid" in "res://addons/" for compatibility and enabled it for other directories.

We should make a decision before 4.4 release.

@AThousandShips
Copy link
Member

I don't think making UID files optional makes sense, it'd just be disabling an important and helpful feature and solves issues that people have been frustrated at for years, having them be optional just resets that and creates additional sources of bugs and frustration

Now there should be a proposal discussing how to handle UID files in addons, but regardless this PR needs a proposal, this shouldn't be discussed here as per the workflow guidelines, PRs are for discussing the implementation, proposals for discussing the idea

@Daylily-Zeleen
Copy link
Contributor Author

Daylily-Zeleen commented Jan 1, 2025

This pr can be superseded by #100994 now.


Here just talk about make the generate behavior become optional.

There have many remonstrances in #97352, even though it is merged, because not all people have spare time to focus each proposal and pr, they just pull and compile by themselves, and discovery the problem at this time.
We not disagree using uid to handle reference, we just hate it make the filesystem become ugly.
For old users, we can avoid break reference by using editor's file system dock, and we don't want when we actually need manage files outside editor, files become mess.

I very agree this comment.
And I prefer to intergrate all ".uid" into one file and add it to vcs, although it is even less reliable.

Anyway, I know this pr can't solve all problems and satisfy everyone, just provide a possible option to make godot reach to a good future.

@elenakrittik
Copy link
Contributor

This pr can be superseded by #100994 now.

I don't think that PR is a sufficient replacement for this PR. It only contains the "disable for addons" part of this PR, and leaves out the "disable for project" part, which is core to the proposal this PR aims to address.

@Daylily-Zeleen
Copy link
Contributor Author

This pr can be superseded by #100994 now.

I don't think that PR is a sufficient replacement for this PR. It only contains the "disable for addons" part of this PR, and leaves out the "disable for project" part, which is core to the proposal this PR aims to address.

Although the change of “disable for project” part seems more significant, the main purpose of this pr is to temporary avoid compatibility issue of plugins by disabling generate ".uid" files in "res://addons/".

@Daylily-Zeleen Daylily-Zeleen force-pushed the daylily-zeleen/generate_uid_files_options branch from e0f444a to ef314ca Compare January 16, 2025 08:31
@Daylily-Zeleen Daylily-Zeleen force-pushed the daylily-zeleen/generate_uid_files_options branch from ef314ca to bfc87aa Compare January 16, 2025 08:33
@elenakrittik
Copy link
Contributor

Although the change of “disable for project” part seems more significant, the main purpose of this pr is to temporary avoid compatibility issue of plugins by disabling generate ".uid" files in "res://addons/".

I believe that's the purpose of the PR you nominated as a replacement, #100994. This PR is linked to godotengine/godot-proposals#11571, which says "Add an option to disable generation of UID files" (i.e. disable it in general, not just for addons).

@pietru2004
Copy link

pietru2004 commented Jan 16, 2025

  • Is there any chance that editor/resource/generate_uid_files could have popup when upgrading from lower godot version asking should it be enabled/disabled?
  • Is there any chance that editor/resource/generate_uid_files could be switchable as an option when creating new project?
  • Also is there chance this could be part of 4.4 before final release?

Asking cause I want to know what to expect for 4.4 regarding UID files. Basically will I be able to switch UID files off for my project.

@pietru2004
Copy link

pietru2004 commented Jan 30, 2025

Would somebody be able to tell how long review of this PR might take?
I mean only way I can realistically prevent uid files in my git repo is by adding them to git ignore of each of my projects.

@AThousandShips
Copy link
Member

This is a new feature and we are in feature freeze until after 4.4 is released, so this can't be merged until then, but this idea itself is being discussed, see the comments on that for alternative solutions

@pietru2004
Copy link

Is this rl a new feature? To be able to disable another feature?
Can't a setting be added during feature freeze so specified behaviour can be disabled?

@pietru2004
Copy link

It might just me being stupid, but I believe Option for switching off UID files could be added to 4.4
Cause it would be something to control UID files creation.

@AThousandShips
Copy link
Member

One could argue it would be part of the same feature, like the UID upgrade tool added recently, but this is not something that's clearly decided to be wanted or clear that it is a good solution

I don't know what the production team thinks in this case, but I'd say it'd at least require a consensus before this can be considered for 4.4, and there isn't a strong consensus if you check the reactions on this PR (15 positive, and 10 negative)

But the production team can take a look and see what they think

@pietru2004
Copy link

How could production team be asked to check this topic?
By this topic I mean option to disable UID file generation.

I am worried that UID files will be trashing my filesystem - I have a lot of script and txt type files (txt for things such as dialogues and items) Also I had experienced a situation in the past where godot would self change uids when saving open resource.

@AThousandShips
Copy link
Member

Also I had experienced a situation in the past where godot would self change uids when saving open resource.

That's something to report as a bug, not something that should be solved by not using .uid files IMO

@pietru2004
Copy link

Also I had experienced a situation in the past where godot would self change uids when saving open resource.

That's something to report as a bug, not something that should be solved by not using .uid files IMO

I seen it already beeing reported, I added that as just a way of saying uids never been working for me, also I belive path is easier to read than uid

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add an option to disable generation of UID files
7 participants