Skip to content

bug: vfs AddZip is fragile to zip file format #856

@nick1udwig

Description

@nick1udwig

doesn't work:

$ unzip 0602e2f7715d5ea6849f1d93505976d9d994a78e87534e3f697cf4d7f99469a0.zip 
Archive:  0602e2f7715d5ea6849f1d93505976d9d994a78e87534e3f697cf4d7f99469a0.zip
  inflating: loolama-mama.wasm       
  inflating: manifest.json           
  inflating: api.zip                 
  inflating: ui/index.html           
  inflating: ui/assets/index-BHGW2mXo.css  
  inflating: ui/assets/react-h3aPdYU7.svg  
  inflating: ui/assets/vite.svg      
  inflating: ui/assets/index-ZF6nJohw.js  

works:

$ unzip b3ed1a93ae91029854eee0cb10c6cf6cc76a2b94c13703efa2046d53317578ea.zip 
Archive:  b3ed1a93ae91029854eee0cb10c6cf6cc76a2b94c13703efa2046d53317578ea.zip
  inflating: api.zip                 
  inflating: foolol.wasm             
  inflating: manifest.json           
   creating: ui/
   creating: ui/assets/
  inflating: ui/assets/index-bOEXPLSj.css  
  inflating: ui/assets/index-j1D6ibRv.js  
  inflating: ui/assets/react-h3aPdYU7.svg  
  inflating: ui/assets/vite.svg      
  inflating: ui/index.html           

the difference is whether the zip archive explcitly contains directories or not. AddZip should be robust to this (i.e. create_dir_all if dir dne)

https://github.com/hyperware-ai/hyperdrive/blob/main/hyperdrive/src/vfs.rs#L624

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions