-
-
Notifications
You must be signed in to change notification settings - Fork 21.2k
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
Make the project data directory customizable #52548
Make the project data directory customizable #52548
Conversation
@@ -121,6 +121,7 @@ public Client(string identity, string godotProjectDir, IMessageHandler messageHa | |||
this.messageHandler = messageHandler; | |||
this.logger = logger; | |||
|
|||
// TODO: Need to fetch the project data dir name from ProjectSettings instead of defaulting to ".godot" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@godotengine/mono What would be the proper way to fetch the project data directory name from the ProjectSettings
and pass it here instead of the default value (.godot
)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[member application/config/project_data_dir_name][code]/imported/[/code]
That is basically unreadable across all the docs changes in this PR. It should be rephrased everywhere.
I think it's better to leave the original phrasing referring to .godot
and only mention the configuration property in parenthesis, like (see [member application/config/project_data_dir_name])
.
I'm not sure that this a good reason to make the path customizable. We could probably rename the (virtual) directory for the exported project on such platforms during the export. |
That sounds more complex than this approach. As you can see from the changed files, the project data directory is referred in multiple locations throughout the codebase. @pycbouh Trying to understand your feedback, what's the issue with the current approach? |
It just creates an opportunity for everyone to shoot their foot because some platforms have limitations. I feel like that solution has greater effect than the problem it tries to solve, i.e. it's too wide while the issue is very specific. That folder is used for all kinds of meta information, so allowing users to freely configure it can be dangerous. |
472c924
to
1153aa3
Compare
Done. |
I guess I disagree in that regard.
The alternative you proposed seems more complex in my opinion, but if you have a proposal (or PR) to show that it isn't, I'm open to take a look. |
It's not just for import.
|
I know. I've taken a look at the code behind it, and tested the behavior, and it behaves as expected when the directory is updated. In addition, from |
I'm not against removing hardcoded values from code. I'm just not in favor of making it user-configurable. It's internal stuff, used for various editor data for the project. If we have problems with specific platforms, we should solve those problems behind the scenes, and making users fix it for us by changing internal parameters of the editor behavior is a wrong approach. If the current folder structure breaks some exported projects, we can just find a solution that works everywhere. There is no concrete reason for the imported folder to be specifically |
This is assuming that all Godot users (the vast majority is indeed) are using the editor, and that we are aware of all the platforms and their quirks.
If there's a proposal on the table that addresses the points I have made, I'm open to see it. |
I obviously don't have a proposal for something that I've only just learnt is a problem. Either way, I've made my case, and since it's pre-approved by reduz, I don't see any point deliberating further. |
@pycbouh I appreciate the feedback, it's just hard to argue in a vacuum (e.g: without a counter-proposal). |
Can we know more about what tools exactly have an issue with the current pattern? I'm not against the solution, but we need to know why we change it specifically. If it's for some specific tools but actually not a requirement of the platform itself, maybe those tools are wrong and should be fixed to follow the same specification as the platform they target. We've used such hidden paths since 3.0 and it was not a known problem prior to this PR. If it's the platform itself, instead of making it configurable by the user (which means they need to be aware of platform quirks and handle them manually in each project), we should maybe make this a platform-specific hardcoded path (like I.e. most of the code in this PR would be reused, but instead of making it a user decision to change that path, it should be an engine decision based on knowing platform requirements and handling them for the user. It does imply having to rename/copy the folder with a different name on export to the affected platform(s), and might be tricky since the I'm not strictly against making this user configurable, but it does create potential issues:
So all in all, I really need to understand the exact problem before approving a solution which does IMO make things more complex. Edit: Apart from this, the implementation in this PR seems good to me from a technical standpoint. |
Build tools for the Android platform by default strip hidden directory out of the apk's
The current approach indeed ensures that it's consistent for a project since the user is likely to edit on a desktop platform, then run the project on another platform. The option you proposed of making it platform specific would lead to a similar set of changes, but in addition would make the platform export logic fairly complex and prompt to bugs (e.g: any update to the project data dir structure would need to mirrored in the corresponding platform). In addition, it would not solve the issue you highlighted above as the plugin will still break when running on the platform with the modified path. I would also assume that projects with old plugins would not see a need to modify the default since they are and have been already working well with it.
That's a valid point for the
|
The issue with that approach is you can't make it platform specific as it significantly increases code complexity (which could lead to subtle bugs creeping in), and introduce an additional (lengthy step for large projects) where all the |
The root of the problem is that we have a metadata folder ( But if we do not want to introduce platform-specific complications, I would suggest we rename the folder but not in the working directory, but in the exported data for all the platforms. So working |
@pycbouh Can you clarify what you mean by unhiding the folder? |
My issue with this approach is how much it would increase export time for large projects as all the |
Even on Windows tools consider them hidden if they are prefixed with a period. It's a universal convention used by virtually all development tools I've used, and I'm only working from Windows. It's also a signal to developers themselves not to touch those files manually. IDEs, VCSs all use that pattern.
Export time is hardly an important metric, unless it increases several times over. But we don't even need to edit the files themselves, if we can help it. It's important that the folder is not hidden, not what is written in files. We can dynamically adjust |
To clarify, the
So export-time remapping might be doable, but it would need a proof of concept to validate if it's really a better approach than what is proposed here. Both have significant cons. |
@akien-mga In the meantime, since we agree that providing a getter is a good option, i split that logic into a separate PR: #52711 |
|
c9ad2f2
to
21e1a1c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After discussion, given the scope of the changes and the fact that documentation can make it clear that this is reserved for advanced use cases, I'm fine with the change (as it's needed by some users and there's no possible workaround aside from a hard fork).
21e1a1c
to
a5c45ef
Compare
a5c45ef
to
3e44a63
Compare
@akien-mga I've addressed the feedback, and tested the changes, all good to go! |
Thanks! |
FYI We've discussed some issues in 3.x version of this PR #52556 In short:
I don't think it was a good decision to replace |
@Listwon Thanks for the feedback! I'll work on a another PR to address them.
This was done to handle scenarios where the path would have a trailing There are probably other approaches to solve this that don't introduce the issues you observed with |
User supplied paths should be sanitized to either include or exclude the trailing slash for every input, depending on how the value is used. |
This PR makes the default project data directory (
.godot
) customizable.This is useful on platforms where certain directory patterns are disallowed (e.g: some Android build tools disallow hidden directories in the generated APK).