Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libsql-ffi build failed on Windows #1657

Open
wyhaya opened this issue Aug 10, 2024 · 6 comments
Open

libsql-ffi build failed on Windows #1657

wyhaya opened this issue Aug 10, 2024 · 6 comments

Comments

@wyhaya
Copy link
Contributor

wyhaya commented Aug 10, 2024

cargo new demo
cd demo
cargo add libsql
cargo check

Output

error: failed to run custom build command for `libsql-ffi v0.4.0`

Caused by:
  process didn't exit successfully: `C:\Users\...\target\debug\build\libsql-ffi-845dd5bc7ddd4d05\build-script-build` (exit code: 101)
  --- stdout
  cargo:rerun-if-changed=bundled/src/sqlite3.c

  --- stderr
  thread 'main' panicked at C:\Users\...\.cargo\registry\src\index.crates.io-6f17d22bba15001f\libsql-ffi-0.4.0\build.rs:48:10:
  called `Result::unwrap()` on an `Err` value: Error { kind: NotFound, message: "program not found" }
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Command::new("cp")
.arg("--no-preserve=mode,ownership")
.arg("-R")
.arg(format!("{dir}/{bindgen_rs_path}"))
.arg(&out_path)
.output()
.unwrap();

cp is sometimes not available on Windows.


Windows 11 rustc 1.80.0 libsql = "0.5.0"

@milen-denev
Copy link

I have the same issue

@matiassotomejias
Copy link

Hi, were you able to solve the problem? I have the same error

@wyhaya
Copy link
Contributor Author

wyhaya commented Sep 9, 2024

Hi, were you able to solve the problem? I have the same error

You can temporarily use the older version v0.4, which doesn't have this issue.

libsql = "0.4.0"

@milen-denev
Copy link

Hi, were you able to solve the problem? I have the same error

No. The only solution is to use libsql 0.4.0

@milen-denev
Copy link

The reason this occurs is because in the build.rs script the developers have put the Linux cp command for copying. I created my own copycat of cp, rust_cp. The repository has compiled binary, put this in any location you want on your windows system, and add Path environment variable, restart the system, and it should work.

image

@awakecoding
Copy link

I'm also hitting the same problem, calling "cp" directly was obviously going to break the Windows build, does that mean Windows support is not properly tested?

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

No branches or pull requests

4 participants