zetzit / zz

πŸΊπŸ™ ZetZ a zymbolic verifier and tranzpiler to bare metal C
MIT License
1.6k stars 52 forks source link

zz shouldn't try to create an index in read only directory #157

Closed sternenseemann closed 3 years ago

sternenseemann commented 3 years ago

In the zz version packaged for NixOS, we install the modules shipped with the compiler globally into a read-only file system. This means that compiling anything with dependencies on that library will fail with:

finished parsing ::mem
thread 'main' panicked at 'cannot create target/repos: Os { code: 30, kind: Other, message: "Read-only file system" }', src/repos.rs:27:14
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
aep commented 3 years ago

oh yeah, that's a probem for all distros.

the cache is relative to the modules zz.toml because out of lazyness is just change current directory to the module before calling index().

it was bound to cause problems eventually.

now the real question is where should the cache go? golang uses a per-user global cache, which makes it more space efficient, rust puts it per project, which makes it easier to clean.

aep commented 3 years ago

quickfix looks easy actually. we can just not write a cachefile if there are no repos.

std modules can't have repos, because they wouldnt be stable

aep commented 3 years ago

please reopen if its not fixed