Skip to content

Commit

Permalink
Merge pull request #1741 from kuzudb/rust-packaging
Browse files Browse the repository at this point in the history
Rust packaging
  • Loading branch information
benjaminwinger committed Jul 4, 2023
2 parents 7684461 + 6173f97 commit 7ff1fe5
Show file tree
Hide file tree
Showing 13 changed files with 229 additions and 126 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ jobs:
run: |
call "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat"
set OPENSSL_DIR=C:\Program Files\OpenSSL-Win64
set CARGO_TARGET_DIR=%cd%/rustb
make rusttest NUM_THREADS=18
- name: Java test
Expand Down
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ if(${ENABLE_UBSAN})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=undefined -fno-common -fpermissive")
endif()
endif()
option(BUILD_PYTHON_API "Build Python API." TRUE)
option(BUILD_SHELL "Build Interactive Shell" TRUE)
option(BUILD_TESTS "Build C++ and Python tests." FALSE)
option(BUILD_BENCHMARK "Build benchmarks." FALSE)

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ ifeq ($(OS),Windows_NT)
cargo test -- --test-threads=1
else
cd $(ROOT_DIR)/tools/rust_api && \
KUZU_TESTING=1 cargo test -- --test-threads=1
CARGO_BUILD_JOBS=$(NUM_THREADS) KUZU_TESTING=1 cargo test -- --test-threads=1
endif

clean-python-api:
Expand Down
28 changes: 28 additions & 0 deletions examples/rust/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions tools/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
add_subdirectory(shell)
if(${BUILD_SHELL})
add_subdirectory(shell)
endif()
if(${BUILD_JAVA})
add_subdirectory(java_api)
endif()
if(${BUILD_NODEJS})
add_subdirectory(nodejs_api)
endif()
add_subdirectory(python_api)
if(${BUILD_PYTHON_API})
add_subdirectory(python_api)
endif()
if(${BUILD_BENCHMARK})
add_subdirectory(benchmark)
endif()
18 changes: 16 additions & 2 deletions tools/rust_api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,24 @@ version = "0.0.4"
description = "An in-process property graph database management system built for query speed and scalability"
# Note: 1.63 required for building tests
rust-version = "1.51"
readme = "../../README.md"
readme = "kuzu-src/README.md"
homepage = "http://kuzudb.com/"
repository = "https://github.com/kuzudb/kuzu"
license = "MIT"
categories = ["database"]
# Only include files required to build to keep crate size small
include = [
"build.rs",
"/src",
"/include",
"/kuzu-src/src",
"/kuzu-src/third_party",
"/kuzu-src/external/CMakeLists.txt",
"/kuzu-src/external/arrow",
"/kuzu-src/Makefile",
"/kuzu-src/CMakeLists.txt",
"/kuzu-src/tools/CMakeLists.txt",
]

edition = "2018"
links = "kuzu"
Expand All @@ -22,10 +35,11 @@ time = "0.3"
[build-dependencies]
cxx-build = "1.0"
num_cpus = "1.0"
cmake = "0.1"
[target.'cfg(windows)'.build-dependencies]
which = "4"

[dev-dependencies]
tempdir = "0.3"
tempfile = "3"
anyhow = "1"
time = {version="0.3", features=["macros"]}
Loading

0 comments on commit 7ff1fe5

Please sign in to comment.