libsql-ffi: broken builds under Nix on macOS
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 86/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- rust
- Área
- build-system
Línea de trabajo
Comienza en el build.rs de libsql-ffi, especialmente en la implementación de copy_with_cp y en la segunda copia de bindgen.rs en OUT_DIR descrita en el informe. Reproduce o inspecciona después la compilación de Nix-on-macOS y verifica que la copia se realice correctamente allí sin volver a introducir la advertencia de macOS ni afectar a otras plataformas.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Hi everyone,
I think I have just run into a regression introduced in #2103. copy_with_cp was specifically modified in #1911 to support sandboxes with read only sources like Nix. As mentioned in #1911 the fix was needed even in macOS, because inside a Nix build the GNU cp is used not the BSD cp. Since #2103 stopped passing --no-preserve=mode,ownership on macOS, GNU cp running in Nix sandbox on macOS now preserves the read only mode of the vendored sources, and the build script's second copy of bindgen.rs into OUT_DIR fails:
> error: failed to run custom build command for `libsql-ffi v0.9.19`
>
> Caused by:
> process didn't exit successfully: `/nix/var/nix/builds/nix-73971-3647907535/source/target/release/build/libsql-ffi-f32cd2e5cc844f3c/build-script-build` (exit status: 101)
> --- stdout
> cargo:rustc-link-lib=framework=Security
> cargo:rerun-if-changed=bundled/src/sqlite3.c
> cargo:lib_dir=/nix/var/nix/builds/nix-73971-3647907535/source/target/release/build/libsql-ffi-cab26cdcde7adda8/out
>
> --- stderr
> cp: cannot create regular file '/nix/var/nix/builds/nix-73971-3647907535/source/target/release/build/libsql-ffi-cab26cdcde7adda8/out/bindgen.rs': Permission denied
>
> thread 'main' (3643659) panicked at /nix/store/zy31wgm2qx0sdf22rywv7fcn46aajm3b-vendor-cargo-deps/c19b7c6f923b580ac259164a89f2577984ad5ab09ee9d583b888f934adbbe8d0/libsql-ffi-0.9.19/build.rs:196:64:
> called `Result::unwrap()` on an `Err` value: Os { code: 13, kind: PermissionDenied, message: "Permission denied" }
> note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Since we shouldn't just remove the macOS cfg block, because if we do unsandoxed macOS users will start getting the illegal option warning again. I propose that we add a -f flag to the cp invocation which is supported by the GNU and the BSD cp command. When the destination can't be overwritten, cp will remove the old file and write a new one.
I have tested this by patching the crate in my project and the Nix build on macOS succeeds, other platforms are unaffected.
- Lenguaje dominante
- C
- Estrellas
- 17.3k
- Forks
- 545
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de tursodatabase/libsql
-
Rust local Row::get_value truncates embedded NUL TEXT and panics on malformed UTF-8 (0.9.30)Posiblemente ocupada @Sanjays2402 la tomó hace 8 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
tursodatabase/libsql#2285 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
tursodatabase/libsql#2226 ·
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 65/100
tursodatabase/libsql#1925 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
tursodatabase/libsql#1892 ·
-
Rust: final update-hook closure and captures leak on connection closePosiblemente ocupada @atontini la tomó hace 1 día. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 58/100
tursodatabase/libsql#2295 ·
Todos los issues de tursodatabase/libsql
Issues similares
-
[WinReg] update to v12.0.0Abiertocategory:port-update
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 2 días
-
feat(palindrome): add C solutionPosiblemente ocupada @aadiitya2007 la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
techcsispit/code-corner#58 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
[LOGO] Add Ruxt Linux LogoAbiertologo request
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
fastfetch-cli/fastfetch#2661 ·
Los mantenedores suelen responder en 1 día
-
Mark ignored Mac OS partitions RecoveryOSContainer and iBootSystemContainerPosiblemente ocupada @meven la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
storaged-project/udisks#1559 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 71/100
awslabs/aws-checksums#121 ·