Skip to content

libsql-ffi: Fix Windows build with encryption feature enabled - #2265

Open
sreejsanas wants to merge 1 commit into
tursodatabase:mainfrom
sreejsanas:bugfix/windows-build-error-with-encryption-feature
Open

libsql-ffi: Fix Windows build with encryption feature enabled#2265
sreejsanas wants to merge 1 commit into
tursodatabase:mainfrom
sreejsanas:bugfix/windows-build-error-with-encryption-feature

Conversation

@sreejsanas

Copy link
Copy Markdown

When the encryption feature is enabled, copy_with_cp copies the SQLite3MultipleCiphers directory into OUT_DIR. cp isn't available on Windows, so it falls back to fs::copy, which cannot copy a directory.

The previous fallback only routed to copy_dir_all when fs::copy returned ErrorKind::InvalidInput, but Windows returns PermissionDenied for a directory, so the copy was never retried and the build failed.

Detect directories explicitly with is_dir() instead of relying on a platform-specific error kind. Unix/macOS/Nix behavior is unchanged.

When the encryption feature is enabled, `copy_with_cp` copies the
`SQLite3MultipleCiphers` directory into OUT_DIR. `cp` isn't available on
Windows, so it falls back to `fs::copy`, which cannot copy a directory.

The previous fallback only routed to `copy_dir_all` when `fs::copy` returned
`ErrorKind::InvalidInput`, but Windows returns `PermissionDenied` for a
directory, so the copy was never retried and the build failed.

Detect directories explicitly with `is_dir()` instead of relying on a
platform-specific error kind. Unix/macOS/Nix behavior is unchanged.
@sreejsanas

Copy link
Copy Markdown
Author

@jussisaurio Is it possible to merge this into 0.10 release? this fails windows builds when encryption is enabled on libsql.

Windows checks job is failing with visual studio not installed, i did verify this change on macos/linux/windows(x86_64, arm64)/ios too locally

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant