Skip to content

Commit

Permalink
Merge pull request #2591 from kuzudb/openssl-windows
Browse files Browse the repository at this point in the history
Fix rust CI on windows
  • Loading branch information
benjaminwinger committed Dec 18, 2023
2 parents f58e56e + 6266409 commit 7c19009
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 40 deletions.
1 change: 0 additions & 1 deletion .github/workflows/ci-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,6 @@ jobs:
working-directory: tools/rust_api
run: |
call "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat"
set OPENSSL_DIR=C:\Program Files\OpenSSL-Win64
set KUZU_TESTING=1
set CFLAGS=/MDd
set CXXFLAGS=/MDd /std:c++20
Expand Down
2 changes: 0 additions & 2 deletions tools/rust_api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ arrow = {version="43", optional=true, default-features=false, features=["ffi"]}
cxx-build = "1.0"
num_cpus = "1.0"
cmake = "0.1"
[target.'cfg(windows)'.build-dependencies]
which = "4"

[dev-dependencies]
tempfile = "3"
Expand Down
37 changes: 0 additions & 37 deletions tools/rust_api/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,37 +9,6 @@ fn link_mode() -> &'static str {
}
}

fn find_openssl_windows() {
// Find openssl library relative to the path of the openssl executable
// Or fall back to OPENSSL_DIR
#[cfg(windows)]
{
let openssl_dir = if let Ok(mut path) = which::which("openssl") {
path.pop();
path.pop();
path
} else if let Ok(path) = env::var("OPENSSL_CONF") {
Path::new(&path)
.parent()
.unwrap()
.parent()
.unwrap()
.to_path_buf()
} else if let Ok(path) = env::var("OPENSSL_DIR") {
Path::new(&path).to_path_buf()
} else {
panic!(
"OPENSSL_DIR must be set if the openssl library cannot be found \
using the path of the openssl executable"
)
};
println!(
"cargo:rustc-link-search=native={}/lib",
openssl_dir.display()
);
}
}

fn get_target() -> String {
if cfg!(windows) && std::env::var("CXXFLAGS").is_err() {
"release".to_string()
Expand All @@ -65,12 +34,6 @@ fn link_libraries() {
println!("cargo:rustc-link-lib=dylib=stdc++");
}

if env::var("KUZU_TESTING").is_ok() && cfg!(windows) {
find_openssl_windows();
println!("cargo:rustc-link-lib=dylib=libssl");
println!("cargo:rustc-link-lib=dylib=libcrypto");
}

println!("cargo:rustc-link-lib=static=utf8proc");
println!("cargo:rustc-link-lib=static=antlr4_cypher");
println!("cargo:rustc-link-lib=static=antlr4_runtime");
Expand Down

0 comments on commit 7c19009

Please sign in to comment.