Skip to content

Commit

Permalink
Fixes for publishing rust package to crates.io (#207)
Browse files Browse the repository at this point in the history
Some minor fixes that are required to publish our rust bindings to crates.io:

 * using relative paths in the cuvs-sys cmake files didn't work, get around this by symlinking required files instead
 * Need to specify an actual version for cuvs-sys and ndarray-rand packages in the rust/cuvs/Cargo.toml file

Authors:
  - Ben Frederickson (https://github.com/benfred)

Approvers:
  - Corey J. Nolet (https://github.com/cjnolet)
  - Ray Douglass (https://github.com/raydouglass)

URL: #207
  • Loading branch information
benfred authored Jul 1, 2024
1 parent 34644fb commit 307ea67
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions ci/release/update-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ sed_runner "s|=[0-9][0-9].[0-9][0-9]|=${NEXT_SHORT_TAG}|g" README.md
# rust can't handle leading 0's in the major/minor/patch version - remove
NEXT_FULL_RUST_TAG=$(printf "%d.%d.%d" $((10#$NEXT_MAJOR)) $((10#$NEXT_MINOR)) $((10#$NEXT_PATCH)))
sed_runner "s/version = \".*\"/version = \"${NEXT_FULL_RUST_TAG}\"/g" rust/Cargo.toml
sed_runner "s/version = \".*\"/version = \"${NEXT_FULL_RUST_TAG}\"/g" rust/cuvs/Cargo.toml

# .devcontainer files
find .devcontainer/ -type f -name devcontainer.json -print0 | while IFS= read -r -d '' filename; do
Expand Down
4 changes: 2 additions & 2 deletions rust/cuvs-sys/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

cmake_minimum_required(VERSION 3.26.4 FATAL_ERROR)

include(../../rapids_config.cmake)
include(rapids_config.cmake)
include(rapids-cmake)
include(rapids-cpm)
include(rapids-export)
Expand Down Expand Up @@ -57,7 +57,7 @@ if(NOT cuvs_FOUND)
add_subdirectory(../../cpp cuvs-cpp EXCLUDE_FROM_ALL)
endif()

include(../../cpp/cmake/thirdparty/get_dlpack.cmake)
include(get_dlpack.cmake)

# add a dummy target here,
add_library(cuvs-rust INTERFACE)
Expand Down
1 change: 1 addition & 0 deletions rust/cuvs-sys/VERSION
1 change: 1 addition & 0 deletions rust/cuvs-sys/get_dlpack.cmake
1 change: 1 addition & 0 deletions rust/cuvs-sys/rapids_config.cmake
4 changes: 2 additions & 2 deletions rust/cuvs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ authors.workspace = true
license.workspace = true

[dependencies]
ffi = { package = "cuvs-sys", path = "../cuvs-sys" }
ffi = { package = "cuvs-sys", path = "../cuvs-sys", version = "24.8.0" }
ndarray = "0.15"

[dev-dependencies]
ndarray-rand = "*"
ndarray-rand = "0.14"

0 comments on commit 307ea67

Please sign in to comment.