dgiagio / warp

Create self-contained single binary applications
MIT License
1.92k stars 92 forks source link

Application cache path should be unique per application version (or hash). #3

Closed damianh closed 1 year ago

damianh commented 6 years ago

Not sure if this is a big issue but raising so there is a record of a discussion.

Currently, the cache path using the application executable name prog:

https://github.com/dgiagio/warp/blob/master/warp-runner/src/main.rs#L32-L38

Could this be problematic if:

Possible solution: include a deterministic GUID and warp-packer time that is then subsequently used as the cache folder.

damianh commented 6 years ago

This may also require some consideration to cleaning up the cache for apps no longer being run. Perhaps extracting to temp would be a better place?

mitchhentges commented 2 years ago

I've written a fix for this over in my fork here that you may be interested in cherry-picking.

At pack-time, it does a sha256 hash of the packed input files, then stores/compares it in $data_dir/state.bin.