libsql-ffi: Fix Windows build with encryption feature enabled - #2265
Open
sreejsanas wants to merge 1 commit into
Open
libsql-ffi: Fix Windows build with encryption feature enabled#2265sreejsanas wants to merge 1 commit into
sreejsanas wants to merge 1 commit into
Conversation
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.
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When the encryption feature is enabled,
copy_with_cpcopies theSQLite3MultipleCiphersdirectory into OUT_DIR.cpisn't available on Windows, so it falls back tofs::copy, which cannot copy a directory.The previous fallback only routed to
copy_dir_allwhenfs::copyreturnedErrorKind::InvalidInput, but Windows returnsPermissionDeniedfor 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.