alexcrichton / openssl-src-rs

Source code and logic to build OpenSSL from source
Apache License 2.0
69 stars 114 forks source link

Musl builds broken on readonly filesystems #155

Open rushmorem opened 2 years ago

rushmorem commented 2 years ago

Compiling using the Nix package manager on musl panics:-

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 13, kind: PermissionDenied, message: "Permission denied" }', /nix/store/3bcpw5cb4pibbj8hc1z21m5i9rxa9s3r-crates-io/openssl-src-111.22.0+1.1.1q/src/lib.rs:547:26

This is because of

fs::write(path, buf).unwrap();

which tries to overwrite crypto/rand/rand_unix.c. Nix mounts /nix/store readonly.

rushmorem commented 2 years ago

I worked around this by setting OPENSSL_NO_VENDOR to skip this crate.