shiv icon indicating copy to clipboard operation
shiv copied to clipboard

Any way to use shiv on read-only filesystem?

Open wimglenn opened this issue 2 years ago • 2 comments

By default it wants to unzip to ~/.shiv. Is it possible to use shiv when there is no writable disk even available? i.e. working in-memory entirely.

A .pyz created from stdlib zipapp will work this way, but they don't play nicely with C extensions (you're in trouble if any dependency used a .so file)

I'm hoping there is a way to abstract an in-memory filesystem in a way that will allow .so extension modules still to be imported.

wimglenn avatar Jul 27 '23 15:07 wimglenn

Hi @wimglenn,

A long time ago we attempted to support something that would allow this, but the use case is extremely narrow so ultimately we decided against continuing to support it. I believe that pex still supports this functionality though! https://pex.readthedocs.io/en/latest/buildingpex.html#zip-safe-not-zip-safe

lorencarvalho avatar Aug 08 '23 16:08 lorencarvalho

Pex does similar, extracting to ~/.pex and I didn't find any way to avoid that either. Unfortunately that zip option doesn't actually do anything, I'm not sure why it's still documented.

wimglenn avatar Aug 08 '23 21:08 wimglenn