-
Notifications
You must be signed in to change notification settings - Fork 1
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
Cleanup after building errors #33
Comments
Found out that the order of destruction of classes is a problem; the destructor of MlFMuProcess is called before the destructor of MlFmuBuilder, and thus it already deletes the instance of MlFmuBuilder, and then tries to delete it again. Also had some issues debugging mlfmu.py - might be that things are not organized as they should for a 'default' python package such that there are circular imports (you cannot import mlfmu subpackages in mlfmu). Will see if I can do some quick fixes to resolve the destructor issue or if we should refactor more. |
Update; deleting of the temp folder was the real issue, not order of deletion - will change how temp folder is made/deleted. |
I can easily catch the error and let the process finish without further complaints (the temp dir mlfmu_* does not get removed but its src and build folders are empty). The error is as Kristoffer described, with a folder being in use. Specifically, this is the Example: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\\Users\\STEKEM\\AppData\\Local\\Temp\\mlfmu_953ni9ba\\build' One thing I found is that they recommend using TemporaryDirectory with the I am not sure if there are any strong reasons for having the structure as it is now, because it does not seem like the utils stuff (eg builder) is used elsewhere, so I see no real reason for the current splits. The core functionality is in builder, but e.g. the temporary dir is made in api/MlFmiBuilder. If we made the temporary dirs only where they are needed, it could be done with There is a possibility that the error is because cmake is somehow still using the build dir. I am not sure how/why this could be the case, cannot find anything relevant on that. It does not seem like cmake would keep stuff in use after running, and the subprocess does not exit with any errors. I also tried to add I will do some cleanup (remove all the debugging printouts) and then commit the additional try/except statements that I have put in place in various places. Then we can see about restructuring later. |
Ok, found the error. The |
There seems to some bugs when deleting the build files after the processes for build/generate/compile is done.
The error message is "PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: [Path]".
It seems that most of the files are deleted before this error is raised. So it is not a big deal, but it would be nice if the tool did not raise an error every time it is used.
I have not found out what other process is using the folder. I think it could be because several processes are trying to delete the file at the same time. Or perhaps the cmake building process is still running in the background somehow.
The text was updated successfully, but these errors were encountered: