-
Notifications
You must be signed in to change notification settings - Fork 99
Add more functionality to LLFile and cleanup LLAPRFile #5151
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
Conversation
d710b20 to
39ad777
Compare
# Conflicts: # indra/llcrashlogger/llcrashlock.cpp # indra/llrender/llshadermgr.cpp # indra/test/CMakeLists.txt
39ad777 to
40ab3b5
Compare
|
@RyeMutt are you fine with adding this to linux branch? Seems like the only issue is 'out of memory' for mac builds which does not look to be specific to this change. |
|
I'm currently working on a changeset to resolve the out of memory/diskspace issue on the macos runner by splitting the test and viewer builds into seperate jobs. I'd like to get that in first and have a few days to put this branch through a good round of regression testing before it gets merged into linux. |
File operations are mostly covered by unit tests, like llcontrol test - creates a settings file, writes, reads. If you think something isn't properly covered yet should be checked, perhaps you can suggest a unit test to implement? |
|
Thanks, adding those changes. |
|
It looks like this is potentially caused by |
Yes, it's probably better to return 0 (it returns ec either way) instead of looking for everything that expects non zero value. Lots of places do !vf.getSize() |
The idea was to fix the callers of LLFile::size() and I think I got them almost all but seems one or two escaped (or might be caused by Linux specific changes, the patch was developed against the development branch). For LLFileSystem::getSize() I think it is easiest for now to limit the returned value to 0 although the checks should be probably rather changed to "vf.getSize() > 0" for a more generic fix since that function is defined to return a signed value. I do have more thorough changes that will avoid some of these problems (and completely do away with LLAPRFile) but it got somewhat hard to manage with the new Linux compatibility requirement too. |
|
Switched size functions to return 0. Double-checked logs and I see nothing suspicious.
I don't think it adds much value. If someone needs to check the error state, they can check ec variant.
Sorry for adding more work, at the moment it might be wise to wait a bit with that. |
The problem is not in the places that call LLFile::size(). It's called only a handful times throughout so far and except in LLFileSystem the caller is actually properly checking for the value to be positive to determine if the file is valid. #5172 is an attempt to fix this although testing has been limited. A quick and dirty fix would be to limit the return value of LLFileSystem::getSize(). However that does only mask the real problem. There is more opportunity to clean/optimize things in several of those places, but I tried to make it not to big. |
|
Seems you accidentality changed the permissions of 20 of the 33 files to be executable (chmod 755) from their original read and user owner write (chmod 644). There is really no need for that to have happened and seemed like it was done on accident. |
Thanks for noticing. No idea how that happened, probably was same way in the original commit. Will fix some time later, probably after the holidays. |
…ocations and utf8->utf16 conversions Fix LLFile::tmpdir failing when temp directory is located in a unicode path on windows Add Tracy profiler tagging to LLFile that's disabled by default Replace LLFile::utf8StringToWstring with our fsyspath std::filesystem::path adapter Introduce std::filesystem::path to llifstream/llofstream wrappers Add move operators to fsyspath to match copy operator Restore LLUniqueFile RAII class for direct c file io wrapping and reducing merge conflicts with downstream code that may depend upon it Signed-off-by: Rye <rye@alchemyviewer.org>
…he with new LLFile IO code Add non-allocating to_chars and to_wchars string creation functions to LLUUID Signed-off-by: Rye <rye@alchemyviewer.org>
Signed-off-by: Rye <rye@alchemyviewer.org>
Signed-off-by: Rye <rye@alchemyviewer.org>
After your recent commit, there are still 9 more that were changed to be executable that shouldn't be. |
Fixed. For some reason those weren't visible locally. |
RyeMutt
left a comment
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.
LGTM!
|
@RyeMutt Thank you! |
Draft, applying 'Add more functionality to LLFile and cleanup LLAPRFile' on top of a develop-linux branch to see how it goes.