You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unlike "conventional" zipapps, it seems that shiv adds bootstrap code to unpack the archive and run it from an unpacked directory. This allows it to support compiled extension modules, but it also means that the unpacked archives get left around (at least on Windows, as you can't delete a loaded DLL in Windows, and I believe the code doesn't even try to tidy the unpacked archive up anyway).
I think this behaviour should be documented, at least in the "gotchas" section of the readme, as it's likely to be unexpected for at least some users (and may even be a privacy concern for some).
It would be nice if the tool only unpacked when needed, and warned when building an archive that needed unpacking. But I doubt that's possible in practice (it's essentially the "zip safe" flag that setuptools tried to implement for eggs, that is generally considered to have failed).
The text was updated successfully, but these errors were encountered:
I have a personal todo to clean up the documentation (which as you can see, is currently worthless), I'll definitely include a "how it works" section to describe this behavior.
Regarding only unpacking if necessary, in theory I totally agree, and we spent a decent amount of time trying to make zip safety work. Barry even wrote a shared object loader class that would temporarily extract .so files so they could be imported... but the reality is too many libraries expect a real filesystem (building paths off __file__ , etc) and breakage can occur in unexpected ways so we opted to just drop it and always extract.
I'll get started on building the docs up and close this issue once I have a PR!
(Original discussion in pypa/pip#5355).
Unlike "conventional" zipapps, it seems that shiv adds bootstrap code to unpack the archive and run it from an unpacked directory. This allows it to support compiled extension modules, but it also means that the unpacked archives get left around (at least on Windows, as you can't delete a loaded DLL in Windows, and I believe the code doesn't even try to tidy the unpacked archive up anyway).
I think this behaviour should be documented, at least in the "gotchas" section of the readme, as it's likely to be unexpected for at least some users (and may even be a privacy concern for some).
It would be nice if the tool only unpacked when needed, and warned when building an archive that needed unpacking. But I doubt that's possible in practice (it's essentially the "zip safe" flag that setuptools tried to implement for eggs, that is generally considered to have failed).
The text was updated successfully, but these errors were encountered: