Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Problem upgrading packages that use dll's #147

Closed
quarnster opened this Issue Jun 24, 2012 · 3 comments

Comments

2 participants
Contributor

quarnster commented Jun 24, 2012

It seems python or ST2 still keeps dll references around that have been loaded by python modules, so replacing the old dll with a new one when upgrading doesn't work.

Package Control: Skipping file from package named libcache.dll due to an invalid filename
Reloading plugin C:\Users\Fredrik\AppData\Roaming\Sublime Text 2\Packages\SublimeClang\common.py
Reloading plugin C:\Users\Fredrik\AppData\Roaming\Sublime Text 2\Packages\SublimeClang\errormarkers.py
reloading /C/Users/Fredrik/AppData/Roaming/Sublime Text 2/Packages/SublimeClang/SublimeClang.sublime-settings
found 7 files for base name Default.sublime-keymap
found 4 files for base name Main.sublime-menu
Package Control: Skipping file from package named libclang.dll due to an invalid filename
Reloading plugin C:\Users\Fredrik\AppData\Roaming\Sublime Text 2\Packages\SublimeClang\staticanalyzer.py
Reloading plugin C:\Users\Fredrik\AppData\Roaming\Sublime Text 2\Packages\SublimeClang\sublimeclang.py
Reloading plugin C:\Users\Fredrik\AppData\Roaming\Sublime Text 2\Packages\SublimeClang\translationunitcache.py
reloading /C/Users/Fredrik/AppData/Roaming/Sublime Text 2/Packages/User/Package Control.sublime-settings

A user of SublimeClang ran into this and I don't think it can be resolved on the SublimeClang side.

Cut and pasting what I wrote in that issue:

I've taken a closer look at this and I don't think there's anything SublimeClang can do here. I reverted my windows install to a freshly installed state, installed sublimeclang via package control and then immediately uninstalled it again. This removed all python files (and thus all references to the dlls) but the dlls are still loaded it seems.

All of this was without having any c/c++ files opened, or put in different words, there would be no actual calls into neither libcache nor libclang, only the loading of these dll's and getting references to the functions.

I had a look around the net if there's some kind of "on_unload" event or something I could use, but the closest I've found is to implement a class with a "del" function called on garbage collection. However there's no guarantee that this is run when needed, and also I couldn't find any sort of unload functionality in the ctypes python module anyway. I would have expected the ctypes object created when loading the library would also unload the library when that ctypes object is garbage collected, but that doesn't seem to be the case.

So I think this needs to be solved in Package Control when it notices that it can't replace a dll, it'll have to temporarily disable that package, prompt the user to restart Sublime Text 2 and on the next startup install the package properly and re-enable it now that the dlls have been updated.

Owner

wbond commented Nov 10, 2012

Yes, a similar process happens right now when deinstalling packages using DLLs on Windows. As much of the package is removed and then a file is placed in the folder indicating the rest of it should be deleted on the next start.

Unfortunately I can't hold up the release of the current update of Package Control to fix this right now. It has been almost 10 months(yikes!) and I need to get the current SSL and proxy issues tested and pushed out. Hopefully once those are out there will be some more time to do some more Package Control cleanup, and then it will be easier for other engineers to get involved.

Owner

wbond commented Nov 15, 2012

5f80711 and d1b95c9 fix this. I tested it with SublimeClang and stepped through the process, first trying to restart just Sublime Text and then having to restart my whole Windows VM.

@wbond wbond closed this Nov 15, 2012

Contributor

quarnster commented Nov 15, 2012

Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment