-
Notifications
You must be signed in to change notification settings - Fork 116
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
libduckdb-sys build failed #413
Comments
same here |
It seems there is an incorrect path separator when building the project on Windows. After modifying Code Changes in
|
Yep, seems there is a huge mistake among the libduckdb-sys... I tried to set Environment path to static link the libduckdb, but I cant fix that also. So I turned to use rusqlite.... |
I was able to successfully build and run the project by setting the following environment variables in project/.cargo/config.toml:
I used the stable-x86_64-pc-windows-msvc toolchain along with the Git Bash environment. However, when running tests or debugging, a build.rs script is still required to copy the lib/dll files to the deps directory. build.rs: fn main() {
let duck_db_dir = std::env::var("DUCKDB_INCLUDE_DIR").unwrap();
let profile = std::env::var("PROFILE").unwrap();
let (os, extension) = match std::env::consts::OS {
"windows" => ("windows", "dll"),
"linux" => ("linux", "so"),
_ => {
eprintln!("Unsupported OS: {}", std::env::consts::OS);
std::process::exit(1);
}
};
let file_path = std::path::Path::new(&duck_db_dir).join(std::format!("duckdb.{}", extension));
let target_dir = std::fs::canonicalize(
std::path::Path::new("target")
.join(profile),
).expect("file not found");
println!(
"cargo:warning=will copy {} to {}",
file_path.to_str().unwrap(),
target_dir.to_str().unwrap()
);
std::fs::copy(
file_path,
target_dir.join(std::format!("duckdb.{}", extension)),
)
.expect("copy duckdb failed");
} |
I will have a try, thank you!!! |
Hello! I'm using duckdb in my rust code, but I cannt add it into my cargo
After using cargo add duckdb --features bundled and cargo run, this happenes
Is there someone facing such issues the same as me? How to solve it?
Waiting for the aid....
error: failed to run custom build command for
libduckdb-sys v1.1.1
Caused by:
process didn't exit successfully:
D:\rsuploader\target\debug\build\libduckdb-sys-e241cf1d72830267\build-script-build
(exit code: 1)--- stderr
error occurred in cc-rs: Command "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.42.34433\bin\HostX64\x64\cl.exe" "-nologo" "-MD" "-Z7" "-Brepro" "-I" "duckdb" "-I" "D:\rsuploader\target\debug\build\libduckdb-sys-6c8c2a903944fbe3\out/duckdb/third_party/mbedtls/library" "-I" "D:\rsuploader\target\debug\build\libduckdb-sys-6c8c2a903944fbe3\out/duckdb/third_party/brotli/common" "-I" "D:\rsuploader\target\debug\build\libduckdb-sys-6c8c2a903944fbe3\out/duckdb/third_party/brotli/dec" "-I" "D:\rsuploader\target\debug\build\libduckdb-sys-6c8c2a903944fbe3\out/duckdb/third_party/utf8proc" "-I" "D:\rsuploader\target\debug\build\libduckdb-sys-6c8c2a903944fbe3\out/duckdb/third_party/miniz" "-I" "D:\rsuploader\target\debug\build\libduckdb-sys-6c8c2a903944fbe3\out/duckdb/third_party/brotli/enc" "-I" "D:\rsuploader\target\debug\build\libduckdb-sys-6c8c2a903944fbe3\out/duckdb/src/include" "-I" "D:\rsuploader\target\debug\build\libduckdb-sys-6c8c2a903944fbe3\out/duckdb/third_party/re2" "-I" "D:\rsuploader\target\debug\build\libduckdb-sys-6c8c2a903944fbe3\out/duckdb/third_party/libpg_query/include" "-I" "D:\rsuploader\target\debug\build\libduckdb-sys-6c8c2a903944fbe3\out/duckdb/third_party/fast_float" "-I" "D:\rsuploader\target\debug\build\libduckdb-sys-6c8c2a903944fbe3\out/duckdb/third_party/tdigest" "-I" "D:\rsuploader\target\debug\build\libduckdb-sys-6c8c2a903944fbe3\out/duckdb/third_party/lz4" "-I" "D:\rsuploader\target\debug\build\libduckdb-sys-6c8c2a903944fbe3\out/duckdb/third_party/pcg" "-I" "D:\rsuploader\target\debug\build\libduckdb-sys-6c8c2a903944fbe3\out/duckdb/third_party/brotli/include" "-I" "D:\rsuploader\target\debug\build\libduckdb-sys-6c8c2a903944fbe3\out/duckdb/third_party/skiplist" "-I" "D:\rsuploader\target\debug\build\libduckdb-sys-6c8c2a903944fbe3\out/duckdb/third_party/mbedtls" "-I" "D:\rsuploader\target\debug\build\libduckdb-sys-6c8c2a903944fbe3\out/duckdb/third_party/mbedtls/include" "-I" "D:\rsuploader\target\debug\build\libduckdb-sys-6c8c2a903944fbe3\out/duckdb/third_party/hyperloglog" "-I" "D:\rsuploader\target\debug\build\libduckdb-sys-6c8c2a903944fbe3\out/duckdb/third_party/jaro_winkler" "-I" "D:\rsuploader\target\debug\build\libduckdb-sys-6c8c2a903944fbe3\out/duckdb/third_party/httplib" "-I" "D:\rsuploader\target\debug\build\libduckdb-sys-6c8c2a903944fbe3\out/duckdb/third_party/fastpforlib" "-I" "D:\rsuploader\target\debug\build\libduckdb-sys-6c8c2a903944fbe3\out/duckdb/third_party/fsst" "-I" "D:\rsuploader\target\debug\build\libduckdb-sys-6c8c2a903944fbe3\out/duckdb/third_party/concurrentqueue" "-I" "D:\rsuploader\target\debug\build\libduckdb-sys-6c8c2a903944fbe3\out/duckdb/third_party/fmt/include" "-I" "D:\rsuploader\target\debug\build\libduckdb-sys-6c8c2a903944fbe3\out/duckdb/third_party/libpg_query" "-I" "D:\rsuploader\target\debug\build\libduckdb-sys-6c8c2a903944fbe3\out/duckdb/third_party/yyjson/include" "-I" "D:\rsuploader\target\debug\build\libduckdb-sys-6c8c2a903944fbe3\out/duckdb/third_party/utf8proc/include" "-I" "D:\rsuploader\target\debug\build\libduckdb-sys-6c8c2a903944fbe3\out/duckdb/third_party/jaro_winkler/details" "/bigobj" "-DDUCKDB_EXTENSION_AUTOINSTALL_DEFAULT=1" "-DDUCKDB_EXTENSION_AUTOLOAD_DEFAULT=1" "-DDUCKDB_BUILD_LIBRARY" "-FoD:\rsuploader\target\debug\build\libduckdb-sys-6c8c2a903944fbe3\out\9f89209d66126409-ub_src_execution.o" "-c" "D:\rsuploader\target\debug\build\libduckdb-sys-6c8c2a903944fbe3\out/duckdb/ub_src_execution.cpp" with args cl.exe did not execute successfully (status code exit code: 2).
The text was updated successfully, but these errors were encountered: