-
-
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
Refactor VS specific glob_recursive_2
function
#98998
Conversation
It also: * Deletes old unused `add_to_vs_project` function * Ensures that list passed to json.dumps is properly sorted Signed-off-by: Yevhen Babiichuk (DustDFG) <[email protected]>
CC @shana |
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.
This change is dropping directories without files but that have subdirectories with files in them, which means the filters file will not have complete entries and some files will be missing. Compare the output of vcxproj.filters before and after this change (sort the file in an editor for an easier comparison, and note that, for instance, the Filter
entries Source Files\misc
, Source Files\misc\dist
and Source Files\misc\dist\ios_xcode
are all missing for the path misc\dist\ios_xcode\godot_ios\dummy.cpp
. These entries are required for the filtering to work, and without them, the project will have all of those files dumped into the root of the project instead of sorted into the respective folders. You should open the project after generating to see if there are any orphan files at the root of the project - there shouldn't be any loose files outside of folders.
First of all. I use Linux... Yeah, I understand what you think that I am proposing changes to vs code while not use... But this info is crucial for context of my following questions...
|
Do you agree about |
Just thought that I forgot to look at variables of Lines 1057 to 1060 in e65a237
Lines 83 to 91 in e65a237
But looks like the only real place where they were is used is a function deleted in the same commit as in the description of PR will check later and maybe will split this PR |
@dustdfg oh sorry, totally missed your question there. Yeah, I left the code in because the new implementation was optional initially, but there's no point in keeping the old code around now, deleting is great. As for the sorting, I didn't realize it wasn't actually sorting, so yeah, using sorted is good. Sorting is important there because we're calculating an md5 hash of all the content so we can avoid touching the file if it hasn't been changed, to avoid VS reloading projects and potentially some user customizations that might be lost in that unavoidable process, so we should keep those keys sorted. |
As all fruitful and non destructive changes are extracted in a separate PR, I am closing this because see that probably refactoring will use more SCons internals than necessary, can impact performance (I don't think that much but can), possibly can't be tested by me, I am a bit tired of this concrete topic and maybe will return to it later @shana but I would appreciate if you answer other questions which will allow me to get deeper knowledge |
It's totally fine to generate VS project files on Linux. You probably can't use them to build on Linux if you don't have an IDE that supports the format, but that doesn't mean you can't have a CI generate the project files and send them off with the source to a Windows machine to use (as an example).
Yes, the entire folder structure of a path has to be generated, with each part of the path as a separate entry building up to the full path:
This is what is produced when I run it on master:
It must be backslashes |
It also:
add_to_vs_project
functionjson.dumps
is properly sortedBoth these additional "bugs" were added in 7638a6c
add_to_vs_project
function was just overlookedsort_keys
parameter ofjson.dumps
doesn't have any sense when you pass there a list which doesn't have any keys... Before consistent order was provided by deterministic nature of search code and list concatenation but now it will be ensured by usingsorted()
. Andsorted()
in this PR is mandatory because when you do[*list, *set]
, order of elements will be random when you expand sets...