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

Fail complied with Rust linux-musl #156

Closed
dialogflowchatbot opened this issue Dec 14, 2024 · 2 comments
Closed

Fail complied with Rust linux-musl #156

dialogflowchatbot opened this issue Dec 14, 2024 · 2 comments

Comments

@dialogflowchatbot
Copy link

dialogflowchatbot commented Dec 14, 2024

Hi, I compiled a Rust project for Linux platform (WSL2) with sqlite-vec 0.1.6 on Github Action

Errors were:

  cargo:warning=sqlite-vec.c:68:9: error: unknown type name 'u_int8_t'
  cargo:warning=   68 | typedef u_int8_t uint8_t;
  cargo:warning=      |         ^
  cargo:warning=sqlite-vec.c:69:9: error: unknown type name 'u_int16_t'
  cargo:warning=   69 | typedef u_int16_t uint16_t;
  cargo:warning=      |         ^
  cargo:warning=sqlite-vec.c:70:9: error: unknown type name 'u_int64_t'
  cargo:warning=   70 | typedef u_int64_t uint64_t;

I compiled on Ubuntu 24 with WSL2

@dialogflowchatbot dialogflowchatbot changed the title Fail complied with Rust musl-cc Fail complied with Rust linux-musl Dec 14, 2024
@dialogflowchatbot
Copy link
Author

dialogflowchatbot commented Jan 11, 2025

I copied

cc::Build::new().cargo_output(true).file("sqlite-vec.c").define("SQLITE_CORE", None).compile("sqlite_vec0");

into an empty project, and cargo b ran successfully

But I ran TARGET_CXX=/usr/bin/gcc TARGET_CC=/usr/local/musl/bin/musl-gcc cargo b --release --target=x86_64-unknown-linux-musl failed with these errors

warning: [email protected]: In file included from sqlite-vec.c:1:
warning: [email protected]: sqlite-vec.h:7:10: fatal error: sqlite3.h: No such file or directory
warning: [email protected]:     7 | #include "sqlite3.h"
warning: [email protected]:       |          ^~~~~~~~~~~
warning: [email protected]: compilation terminated.
error: failed to run custom build command for `st v0.1.0 (/mnt/d/work/st)`

Strange thing was I found sqlite3.h at ./home/a/.cargo/registry/src/rsproxy.cn-8f6827c7555bfaf8/sqlite-vec-0.1.6/sqlite3.h and ./home/a/.cargo/registry/src/rsproxy.cn-8f6827c7555bfaf8/libsqlite3-sys-0.30.1/sqlite3/sqlite3.h

@dialogflowchatbot
Copy link
Author

Tried cross: cross b --release --target=x86_64-unknown-linux-musl, still failed with the same error.
But sqlite-vec compiled successfully on Windows and macOS

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

1 participant