diff --git a/ci/scripts/rust_build.sh b/ci/scripts/rust_build.sh new file mode 100755 index 0000000000..42630136c0 --- /dev/null +++ b/ci/scripts/rust_build.sh @@ -0,0 +1,26 @@ +#!/usr/bin/env bash +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +set -euxo pipefail + +source_dir="${1}/rust" + +pushd "${source_dir}" +cargo build --all-features --all-targets --workspace +popd diff --git a/ci/scripts/rust_test.sh b/ci/scripts/rust_test.sh new file mode 100755 index 0000000000..439ad5e33c --- /dev/null +++ b/ci/scripts/rust_test.sh @@ -0,0 +1,30 @@ +#!/usr/bin/env bash +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +set -euxo pipefail + +source_dir="${1}/rust" +cpp_libs_dir="${2}" + +export LD_LIBRARY_PATH="${cpp_libs_dir}/lib:${LD_LIBRARY_PATH:-}" +export DYLD_LIBRARY_PATH="${cpp_libs_dir}/lib:${DYLD_LIBRARY_PATH:-}" + +pushd "${source_dir}" +cargo test --all-features --workspace +popd diff --git a/dev/release/post-08-rust.sh b/dev/release/post-08-rust.sh new file mode 100644 index 0000000000..e31427d5b7 --- /dev/null +++ b/dev/release/post-08-rust.sh @@ -0,0 +1,51 @@ +#!/usr/bin/env bash +# -*- indent-tabs-mode: nil; sh-indentation: 2; sh-basic-offset: 2 -*- +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# + +set -e +set -u +set -o pipefail + +SOURCE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +source "${SOURCE_DIR}/utils-common.sh" +source "${SOURCE_DIR}/utils-prepare.sh" + +main() { + if [ "$#" -ne 0 ]; then + echo "Usage: $0" + exit + fi + + local -r tag="apache-arrow-adbc-${RELEASE}" + # Ensure we are being run from the tag + if [[ $(git describe --exact-match --tags) != "${tag}" ]]; then + echo "This script must be run from the tag ${tag}" + exit 1 + fi + + pushd "${SOURCE_TOP_DIR}/rust" + cargo publish --all-features -p adbc_core + popd + + echo "Success! The released Cargo crate is available here:" + echo " https://crates.io/crates/adbc_core" +} + +main "$@" diff --git a/dev/release/post-08-remove-old-artifacts.sh b/dev/release/post-09-remove-old-artifacts.sh similarity index 100% rename from dev/release/post-08-remove-old-artifacts.sh rename to dev/release/post-09-remove-old-artifacts.sh diff --git a/dev/release/post-09-bump-versions.sh b/dev/release/post-10-bump-versions.sh similarity index 100% rename from dev/release/post-09-bump-versions.sh rename to dev/release/post-10-bump-versions.sh diff --git a/dev/release/post-10-website.sh b/dev/release/post-11-website.sh similarity index 100% rename from dev/release/post-10-website.sh rename to dev/release/post-11-website.sh diff --git a/dev/release/verify-release-candidate.sh b/dev/release/verify-release-candidate.sh index 49b7b2dc9c..a41812c20a 100755 --- a/dev/release/verify-release-candidate.sh +++ b/dev/release/verify-release-candidate.sh @@ -475,9 +475,9 @@ test_cpp() { if [ "${USE_CONDA}" -gt 0 ]; then export CMAKE_PREFIX_PATH="${CONDA_BACKUP_CMAKE_PREFIX_PATH}:${CMAKE_PREFIX_PATH}" # The CMake setup forces RPATH to be the Conda prefix - local -r install_prefix="${CONDA_PREFIX}" + export CPP_INSTALL_PREFIX="${CONDA_PREFIX}" else - local -r install_prefix="${ARROW_TMPDIR}/local" + export CPP_INSTALL_PREFIX="${ARROW_TMPDIR}/local" fi export CMAKE_BUILD_PARALLEL_LEVEL=${CMAKE_BUILD_PARALLEL_LEVEL:-${NPROC}} @@ -486,14 +486,14 @@ test_cpp() { export ADBC_CMAKE_ARGS="-DADBC_INSTALL_NAME_RPATH=OFF" export ADBC_USE_ASAN=OFF export ADBC_USE_UBSAN=OFF - "${ADBC_DIR}/ci/scripts/cpp_build.sh" "${ADBC_SOURCE_DIR}" "${ARROW_TMPDIR}/cpp-build" "${install_prefix}" + "${ADBC_DIR}/ci/scripts/cpp_build.sh" "${ADBC_SOURCE_DIR}" "${ARROW_TMPDIR}/cpp-build" "${CPP_INSTALL_PREFIX}" # FlightSQL driver requires running database for testing export BUILD_DRIVER_FLIGHTSQL=0 # PostgreSQL driver requires running database for testing export BUILD_DRIVER_POSTGRESQL=0 # Snowflake driver requires snowflake creds for testing export BUILD_DRIVER_SNOWFLAKE=0 - "${ADBC_DIR}/ci/scripts/cpp_test.sh" "${ARROW_TMPDIR}/cpp-build" "${install_prefix}" + "${ADBC_DIR}/ci/scripts/cpp_test.sh" "${ARROW_TMPDIR}/cpp-build" "${CPP_INSTALL_PREFIX}" export BUILD_DRIVER_FLIGHTSQL=1 export BUILD_DRIVER_POSTGRESQL=1 export BUILD_DRIVER_SNOWFLAKE=1 @@ -637,6 +637,17 @@ test_go() { "${ADBC_DIR}/ci/scripts/go_test.sh" "${ADBC_SOURCE_DIR}" "${ARROW_TMPDIR}/go-build" "${install_prefix}" } +test_rust() { + show_header "Build and test Rust libraries" + + # TODO: setup rust + maybe_setup_conda rust || exit 1 + + # We expect the C++ libraries to exist. + "${ADBC_DIR}/ci/scripts/rust_build.sh" "${ADBC_SOURCE_DIR}" + "${ADBC_DIR}/ci/scripts/rust_test.sh" "${ADBC_SOURCE_DIR}" "${CPP_INSTALL_PREFIX}" +} + ensure_source_directory() { show_header "Ensuring source directory" @@ -722,6 +733,9 @@ test_source_distribution() { if [ ${TEST_R} -gt 0 ]; then test_r fi + if [ ${TEST_RUST} -gt 0 ]; then + test_rust + fi popd } @@ -874,9 +888,10 @@ test_jars() { : ${TEST_JS:=${TEST_SOURCE}} : ${TEST_GO:=${TEST_SOURCE}} : ${TEST_R:=${TEST_SOURCE}} +: ${TEST_RUST:=${TEST_SOURCE}} # Automatically test if its activated by a dependent -TEST_CPP=$((${TEST_CPP} + ${TEST_GO} + ${TEST_GLIB} + ${TEST_PYTHON})) +TEST_CPP=$((${TEST_CPP} + ${TEST_GO} + ${TEST_GLIB} + ${TEST_PYTHON} + ${TEST_RUST})) # Execute tests in a conda enviroment : ${USE_CONDA:=0} diff --git a/rust/Cargo.lock b/rust/Cargo.lock index 883ccf72f6..ea15345040 100644 --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -4,7 +4,7 @@ version = 3 [[package]] name = "adbc_core" -version = "0.13.0" +version = "0.14.0" dependencies = [ "arrow", "libloading", @@ -13,7 +13,7 @@ dependencies = [ [[package]] name = "adbc_dummy" -version = "0.13.0" +version = "0.14.0" dependencies = [ "adbc_core", "arrow",