Skip to content

Commit

Permalink
Remove some redundant compiler flags on Windows (#4555)
Browse files Browse the repository at this point in the history
And consolidate the rust test code to use the Makefile command
  • Loading branch information
benjaminwinger authored Nov 21, 2024
1 parent 4f643c1 commit d12c21f
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 30 deletions.
17 changes: 5 additions & 12 deletions .github/workflows/ci-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -180,12 +180,11 @@ jobs:
run: make javatest

- name: Rust test with pre-built library
working-directory: tools/rust_api
env:
KUZU_SHARED: 1
KUZU_INCLUDE_DIR: ${{ github.workspace }}/build/release/src
KUZU_LIBRARY_DIR: ${{ github.workspace }}/build/release/src
run: cargo test --profile=relwithdebinfo --locked --features arrow -- --test-threads=12
run: make rusttest

gcc-build-test-in-mem-vector-size:
name: gcc build & test in-mem only with various vector size
Expand Down Expand Up @@ -316,8 +315,7 @@ jobs:
- uses: actions/checkout@v4

- name: Rust test
working-directory: tools/rust_api
run: cargo test --profile=relwithdebinfo --locked --features arrow -- --test-threads=12
run: make rusttest

- name: Rust example
working-directory: examples/rust
Expand Down Expand Up @@ -420,12 +418,11 @@ jobs:
run: make javatest

- name: Rust test with pre-built library
working-directory: tools/rust_api
env:
KUZU_SHARED: 1
KUZU_INCLUDE_DIR: ${{ github.workspace }}/build/release/src
KUZU_LIBRARY_DIR: ${{ github.workspace }}/build/release/src
run: cargo test --profile=relwithdebinfo --locked --features arrow -- --test-threads=12
run: make rusttest

clang-build-test-various-page-sizes:
strategy:
Expand Down Expand Up @@ -555,12 +552,9 @@ jobs:
- name: Rust test
shell: cmd
working-directory: tools/rust_api
run: |
call "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvars64.bat"
set CFLAGS=/MD
set CXXFLAGS=/MD /std:c++20
cargo test --profile=relwithdebinfo --locked -- --test-threads=12
make rusttest
- name: Java test
shell: cmd
Expand All @@ -569,7 +563,6 @@ jobs:
make javatest
- name: Rust test with pre-built library
working-directory: tools/rust_api
env:
KUZU_SHARED: 1
KUZU_INCLUDE_DIR: ${{ github.workspace }}/build/release/src
Expand All @@ -578,7 +571,7 @@ jobs:
run: |
call "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvars64.bat"
set PATH=%PATH%;${{ github.workspace }}/build/release/src
cargo test --profile=relwithdebinfo --locked --features arrow -- --test-threads=12
make rusttest
sanity-checks:
name: sanity checks
Expand Down
23 changes: 10 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -137,17 +137,6 @@ python:
python-debug:
$(call run-cmake-debug, -DBUILD_PYTHON=TRUE)

rust:
ifeq ($(OS),Windows_NT)
set CFLAGS=/MDd
set CXXFLAGS=/MDd /std:c++20 /Zc:__cplusplus
set CARGO_BUILD_JOBS=$(NUM_THREADS)
else
export CARGO_BUILD_JOBS=$(NUM_THREADS)
endif
cd tools/rust_api && cargo build --all-features


# Language API tests
javatest:
ifeq ($(OS),Windows_NT)
Expand All @@ -167,10 +156,18 @@ pytest: python
pytest-debug: python-debug
cmake -E env PYTHONPATH=tools/python_api/build python3 -m pytest -vv tools/python_api/test

rusttest: rust
rusttest:
ifeq ($(OS),Windows_NT)
set CARGO_BUILD_JOBS=$(NUM_THREADS)
else
export CARGO_BUILD_JOBS=$(NUM_THREADS)
endif
export CARGO_BUILD_JOBS=$(NUM_THREADS)
# Note that the number of test threads has a hard limit (unlike with ctest)
# since they are all run in the same process and most tests create a database
# (requiring mmapping 8TB of virtual memory). This quickly exhausts the process' virtual memory.
cd tools/rust_api && cargo test --profile=relwithdebinfo --locked --all-features -- --test-threads=12


wasmtest:
mkdir -p build/wasm && cd build/wasm &&\
emcmake cmake $(CMAKE_FLAGS) -DCMAKE_BUILD_TYPE=Release -DBUILD_WASM=TRUE -DBUILD_BENCHMARK=FALSE -DBUILD_TESTS=TRUE -DBUILD_SHELL=FALSE ../.. && \
Expand Down
6 changes: 1 addition & 5 deletions tools/rust_api/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,7 @@ fn link_mode() -> &'static str {
}

fn get_target() -> String {
if cfg!(windows) && std::env::var("CXXFLAGS").is_err() {
"release".to_string()
} else {
env::var("PROFILE").unwrap()
}
env::var("PROFILE").unwrap()
}

fn link_libraries() {
Expand Down

0 comments on commit d12c21f

Please sign in to comment.