LFS-locked Files lose write-access on cancelled C++ compilations
Here is a linked issue from the global Git-LFS: https://github.com/git-lfs/git-lfs/issues/2913
Copied text from my latest comment there: The behaviour occurs when you hit "compile" in UE4 (which triggers it's own preprocessor and then Visual Studio's MSVC C++ compiler), but then you cancel the compilation before it succeeds or fails. You end up with a read-only file although it's LFS-locked.
I wanted to supply that to your attention :]
Hi @ArtyMcLabin, thanks for reporting this!
So, do you think this is a problem with the Unreal Editor? Should I try to fix the write flag by myself? I should check the Perforce plugin to see if/how they handle such situations...
To be honest, I'll start a new job very soon, so I don't expect to have time for the git plugin for the foreseeable future...
Hey @SRombauts, i have reported that because i think you should have a clearer view on this situation as you are the author of the code and you know how it works much better than anybody else.
Maybe there is nothing to do about it at all in the plugin, i can't judge. A possible solution i thought of is to bind a function to compilation cancellation, which will ensure locked files getting their write access back.
I am not sure it is appropriate to the plugin, and possibly should be implemented in the engine itself instead. I have used Perforce before and didn't encounter such a behaviour, but the project had much less files back then so i don't want to guarantee that Perforce is free of that bug.
By the way why don't Epic update the git plugin to support LFS? it would be nice if they took some part in that. I am sad that i can't contribute to that repo myself, as plugin programming is pretty different from the standard UE4 API and i can't allow myself to spend time on learning that unfortunately.
Hi @ArtyMcLabin, sure, you did well by reporting that to me!
At one point I should try to reproduce the problem with Git, and then switch to Perforce and/or Plastic SCM and see if I get the same issue.
Regarding LFS 2 File Lock support in UE, the "fault" is mine: I don't want to rush the integration since I don't feel it is robust/polish/performant enough. The problem is that when it's integrated, bug fix will be very painfully slow for everyone...
Don't you have performance problems with LFS 2? ( #54Git LFS 2: Poor performances of 'lfs locks' on Windows command line) What do you think of the state of the plugin?
@SRombauts, the plugin is pretty robust. Aside from some slow "lfs locks" and the bug in this thread (which is easily solved by running "git lfs unlock ; git lfs lock" on the problematic file) the plugin works great and i use it for production rather than testing it vs Perforce.
Git without LFS is simply not usable in a team of more than one person, because it's not built for [.uasset/.umap/binaries] . Yes, the older version possibly has less bugs, but the result is what counts, right? LFS really saved my project. Before that we have spent like 30% of dev time on fixing branch incompatibilities.
I think that LFS2 should definitely be in the UE4 master branch.
- it will attract more UE4 devs to use Git, and as statistics say, some of them will know UE4 plugins workflow and will contribute to the code. one smart move could be mentioning the temporary solution of "git lfs unlock ; git lfs lock" in instructions.