From 17a60e478bf285e516f6c7accd1e43a7007479fb Mon Sep 17 00:00:00 2001 From: striderDM <51991544+StriderDM@users.noreply.github.com> Date: Fri, 9 Jul 2021 03:52:31 +0200 Subject: [PATCH] Script fixes Restored ${PKG_PATH} variable Restored universal directory for iOS Resolved warnings in mobile_build.sh Make libsqlite3-sys an optional dependency --- base_layer/wallet/Cargo.toml | 6 +- base_layer/wallet_ffi/Cargo.toml | 4 +- base_layer/wallet_ffi/mobile_build.sh | 158 ++++++++++++++------------ comms/dht/Cargo.toml | 4 +- 4 files changed, 95 insertions(+), 77 deletions(-) diff --git a/base_layer/wallet/Cargo.toml b/base_layer/wallet/Cargo.toml index ecf46867dc..5386917a7c 100644 --- a/base_layer/wallet/Cargo.toml +++ b/base_layer/wallet/Cargo.toml @@ -23,12 +23,12 @@ blake2 = "0.9.0" chrono = { version = "0.4.6", features = ["serde"]} crossbeam-channel = "0.3.8" digest = "0.9.0" -diesel_migrations = "1.4" -diesel = {version="1.4.7", features = ["sqlite", "serde_json", "chrono"]} +diesel = { version="1.4.7", features = ["sqlite", "serde_json", "chrono"]} +diesel_migrations = "1.4.0" +libsqlite3-sys = { version = ">=0.8.0, <0.13.0", features = ["bundled"], optional=true } fs2 = "0.3.0" futures = { version = "^0.3.1", features =["compat", "std"]} lazy_static = "1.4.0" -libsqlite3-sys = { version = ">=0.8.0, <0.13.0", features = ["bundled"] } log = "0.4.6" log4rs = {version = "0.8.3", features = ["console_appender", "file_appender", "file", "yaml_format"]} lmdb-zero = "0.4.4" diff --git a/base_layer/wallet_ffi/Cargo.toml b/base_layer/wallet_ffi/Cargo.toml index 3c32a3fdd6..6b30969a4e 100644 --- a/base_layer/wallet_ffi/Cargo.toml +++ b/base_layer/wallet_ffi/Cargo.toml @@ -7,8 +7,8 @@ version = "0.17.0" edition = "2018" [dependencies] -tari_comms = { version = "^0.9", path = "../../comms" } -tari_comms_dht = { version = "^0.9", path = "../../comms/dht" } +tari_comms = { version = "^0.9", path = "../../comms", default-features = false} +tari_comms_dht = { version = "^0.9", path = "../../comms/dht", default-features = false } tari_crypto = "0.11.1" tari_key_manager = { version = "^0.9", path = "../key_manager" } tari_p2p = { version = "^0.9", path = "../p2p" } diff --git a/base_layer/wallet_ffi/mobile_build.sh b/base_layer/wallet_ffi/mobile_build.sh index 92b468f3d7..3f833070b0 100755 --- a/base_layer/wallet_ffi/mobile_build.sh +++ b/base_layer/wallet_ffi/mobile_build.sh @@ -14,7 +14,7 @@ NC='\033[0m' # No Color source build.config TARI_REPO_PATH=${TARI_REPO_PATH:-$(git rev-parse --show-toplevel)} CURRENT_DIR=${TARI_REPO_PATH}/base_layer/wallet_ffi -cd ${CURRENT_DIR} || exit +cd "${CURRENT_DIR}" || exit mkdir -p logs cd logs || exit mkdir -p ios @@ -57,36 +57,39 @@ fi DEPENDENCIES=${IOS_WALLET_PATH} # PKG_PATH, BUILD_IOS is defined in build.config -# shellcheck disable=SC2153 -if [ -n "${DEPENDENCIES}" ] && [ "${BUILD_IOS}" -eq 1 ] && [ "${MACHINE}" == "Mac" ]; then +if [ -n "${DEPENDENCIES}" ] && [ -n "${PKG_PATH}" ] && [ "${BUILD_IOS}" -eq 1 ] && [ "${MACHINE}" == "Mac" ]; then echo "${GREEN}Commencing iOS build${NC}" echo "${YELLOW}Build logs can be found at ${IOS_LOG_PATH}${NC}" + # shellcheck disable=SC2028 echo "\t${CYAN}Configuring Rust${NC}" - rustup target add aarch64-apple-ios x86_64-apple-ios >> ${IOS_LOG_PATH}/rust.txt 2>&1 - cargo install cargo-lipo >> ${IOS_LOG_PATH}/rust.txt 2>&1 + rustup target add aarch64-apple-ios x86_64-apple-ios >> "${IOS_LOG_PATH}/rust.txt" 2>&1 + cargo install cargo-lipo >> "${IOS_LOG_PATH}/rust.txt" 2>&1 + # shellcheck disable=SC2028 echo "\t${CYAN}Configuring complete${NC}" - #below line is temporary - cd ${DEPENDENCIES} || exit + cd "${DEPENDENCIES}" || exit mkdir -p build cd build || exit BUILD_ROOT=$PWD cd .. - cd ${CURRENT_DIR} || exit + cd "${CURRENT_DIR}" || exit if [ "${CARGO_CLEAN}" -eq "1" ]; then - cargo clean >> ${IOS_LOG_PATH}/cargo.txt 2>&1 + cargo clean >> "${IOS_LOG_PATH}/cargo.txt" 2>&1 fi cp wallet.h "${DEPENDENCIES}/MobileWallet/TariLib/" export PKG_CONFIG_PATH=${PKG_PATH} + # shellcheck disable=SC2028 echo "\t${CYAN}Building Wallet FFI${NC}" - cargo-lipo lipo --release > ${IOS_LOG_PATH}/cargo.txt 2>&1 + cargo-lipo lipo --release > "${IOS_LOG_PATH}/cargo.txt" 2>&1 cd ../.. cd target || exit - cd aarch64-apple-ios || exit + # Copy the fat library (which contains symbols for all built iOS architectures) created by the lipo tool + # XCode will select the relevant set of symbols to be included in the mobile application depending on which arch is built + cd universal || exit cd release || exit cp libtari_wallet_ffi.a "${DEPENDENCIES}/MobileWallet/TariLib/" cd ../../.. || exit rm -rf target - cd ${DEPENDENCIES} || exit + cd "${DEPENDENCIES}" || exit echo "${GREEN}iOS build completed${NC}" elif [ "${BUILD_IOS}" -eq 1 ]; then echo "${RED}Cannot configure iOS Wallet Library build${NC}" @@ -96,17 +99,18 @@ fi DEPENDENCIES=$ANDROID_WALLET_PATH # PKG_PATH, BUILD_ANDROID, NDK_PATH is defined in build.config -# shellcheck disable=SC2153 -if [ -n "${DEPENDENCIES}" ] && [ -n "${NDK_PATH}" ] && [ "${BUILD_ANDROID}" -eq 1 ]; then +if [ -n "${DEPENDENCIES}" ] && [ -n "${NDK_PATH}" ] && [ -n "${PKG_PATH}" ] && [ "${BUILD_ANDROID}" -eq 1 ]; then echo "${GREEN}Commencing Android build${NC}" echo "${YELLOW}Build logs can be found at ${ANDROID_LOG_PATH}${NC}" + # shellcheck disable=SC2028 echo "\t${CYAN}Configuring Rust${NC}" - rustup target add x86_64-linux-android aarch64-linux-android armv7-linux-androideabi i686-linux-android arm-linux-androideabi > ${ANDROID_LOG_PATH}/rust.txt 2>&1 + rustup target add x86_64-linux-android aarch64-linux-android armv7-linux-androideabi i686-linux-android arm-linux-androideabi > "${ANDROID_LOG_PATH}/rust.txt" 2>&1 if [ "${MAC_MAIN_VERSION}" -le 10 ]; then if [ "${MAC_SUB_VERSION}" -lt 15 ]; then - cargo install cargo-ndk >> ${ANDROID_LOG_PATH}/rust.txt 2>&1 + cargo install cargo-ndk > "${ANDROID_LOG_PATH}/rust.txt" 2>&1 fi fi + # shellcheck disable=SC2028 echo "\t${CYAN}Configuring complete${NC}" export NDK_HOME=${NDK_PATH} export PKG_CONFIG_PATH=${PKG_PATH} @@ -114,35 +118,35 @@ if [ -n "${DEPENDENCIES}" ] && [ -n "${NDK_PATH}" ] && [ "${BUILD_ANDROID}" -eq DEPENDENCIES=${DEPENDENCIES}/jniLibs SQLITE_BUILD_FOUND=0 - if [ -f ${DEPENDENCIES}/x86_64/libsqlite3.a ] && [ -f ${DEPENDENCIES}/armeabi-v7a/libsqlite3.a ] && [ -f ${DEPENDENCIES}/arm64-v8a/libsqlite3.a ]; then + if [ -f "${DEPENDENCIES}/x86_64/libsqlite3.a" ] && [ -f "${DEPENDENCIES}/armeabi-v7a/libsqlite3.a" ] && [ -f "${DEPENDENCIES}/arm64-v8a/libsqlite3.a" ]; then SQLITE_BUILD_FOUND=1 fi SSL_BUILD_FOUND=0 - if [ -f ${DEPENDENCIES}/x86_64/libssl.a ] && [ -f ${DEPENDENCIES}/x86_64/libcrypto.a ] && \ - [ -f ${DEPENDENCIES}/armeabi-v7a/libssl.a ] && [ -f ${DEPENDENCIES}/armeabi-v7a/libcrypto.a ] && \ - [ -f ${DEPENDENCIES}/arm64-v8a/libssl.a ] && [ -f ${DEPENDENCIES}/arm64-v8a/libcrypto.a ]; then + if [ -f "${DEPENDENCIES}/x86_64/libssl.a" ] && [ -f "${DEPENDENCIES}/x86_64/libcrypto.a" ] && \ + [ -f "${DEPENDENCIES}/armeabi-v7a/libssl.a" ] && [ -f "${DEPENDENCIES}/armeabi-v7a/libcrypto.a" ] && \ + [ -f "${DEPENDENCIES}/arm64-v8a/libssl.a" ] && [ -f "${DEPENDENCIES}/arm64-v8a/libcrypto.a" ]; then SSL_BUILD_FOUND=1 fi - cd ${DEPENDENCIES} || exit + cd "${DEPENDENCIES}" || exit mkdir -p build cd build || exit BUILD_ROOT=${PWD} if [ "${MACHINE}" == "Mac" ]; then if [ "${MAC_MAIN_VERSION}" -le 10 ]; then if [ "${MAC_SUB_VERSION}" -ge 15 ]; then - cd ${NDK_HOME}/sources/cxx-stl/llvm-libc++/include || exit + cd "${NDK_HOME}/sources/cxx-stl/llvm-libc++/include" || exit mkdir -p sys #Fix for missing header, c code should reference limits.h instead of syslimits.h, happens with code that has been around for a long time. cp "${NDK_HOME}/sources/cxx-stl/llvm-libc++/include/limits.h" "${NDK_HOME}/sources/cxx-stl/llvm-libc++/include/sys/syslimits.h" - cd ${BUILD_ROOT} || exit + cd "${BUILD_ROOT}" || exit fi else - cd ${NDK_HOME}/sources/cxx-stl/llvm-libc++/include || exit + cd "${NDK_HOME}/sources/cxx-stl/llvm-libc++/include" || exit mkdir -p sys cp "${NDK_HOME}/sources/cxx-stl/llvm-libc++/include/limits.h" "${NDK_HOME}/sources/cxx-stl/llvm-libc++/include/sys/syslimits.h" - cd ${BUILD_ROOT} || exit + cd "${BUILD_ROOT}" || exit fi fi cd .. @@ -155,18 +159,19 @@ if [ -n "${DEPENDENCIES}" ] && [ -n "${NDK_PATH}" ] && [ "${BUILD_ANDROID}" -eq #21 22 23 26 26 27 28 29 not included at present do if [ ${SSL_BUILD_FOUND} -eq 0 ]; then - touch ${ANDROID_LOG_PATH}/ssl_${PLATFORMABI}_${LEVEL}.txt + touch "${ANDROID_LOG_PATH}/ssl_${PLATFORMABI}_${LEVEL}.txt" fi if [ ${SQLITE_BUILD_FOUND} -eq 0 ]; then - touch ${ANDROID_LOG_PATH}/sqlite_${PLATFORMABI}_${LEVEL}.txt + touch "${ANDROID_LOG_PATH}/sqlite_${PLATFORMABI}_${LEVEL}.txt" fi - touch ${ANDROID_LOG_PATH}/cargo_${PLATFORMABI}_${LEVEL}.txt + touch "${ANDROID_LOG_PATH}/cargo_${PLATFORMABI}_${LEVEL}.txt" PLATFORM=$(cut -d'-' -f1 <<<"${PLATFORMABI}") - PLATFORM_OUTDIR="" + # Below "null" is to prevent it exiting with mismatched '"' once it reaches the end of the script + PLATFORM_OUTDIR="null" if [ "${PLATFORM}" == "i686" ]; then PLATFORM_OUTDIR="x86" elif [ "${PLATFORM}" == "x86_64" ]; then @@ -178,19 +183,19 @@ if [ -n "${DEPENDENCIES}" ] && [ -n "${NDK_PATH}" ] && [ "${BUILD_ANDROID}" -eq else PLATFORM_OUTDIR=${PLATFORM} fi - cd ${BUILD_ROOT} || exit - mkdir -p ${PLATFORM_OUTDIR} - OUTPUT_DIR=${BUILD_ROOT}/${PLATFORM_OUTDIR} + cd "${BUILD_ROOT}" || exit + mkdir -p "${PLATFORM_OUTDIR}" + OUTPUT_DIR="${BUILD_ROOT}/${PLATFORM_OUTDIR}" if [ ${SQLITE_BUILD_FOUND} -eq 1 ]; then - mkdir -p ${BUILD_ROOT}/${PLATFORM_OUTDIR}/lib + mkdir -p "${BUILD_ROOT}/${PLATFORM_OUTDIR}/lib" fi if [ ${SSL_BUILD_FOUND} -eq 1 ]; then - mkdir -p ${BUILD_ROOT}/${PLATFORM_OUTDIR}/usr/local/lib + mkdir -p "${BUILD_ROOT}/${PLATFORM_OUTDIR}/usr/local/lib" fi - cd ${DEPENDENCIES} || exit + cd "${DEPENDENCIES}" || exit PLATFORMABI_TOOLCHAIN=${PLATFORMABI} PLATFORMABI_COMPILER=${PLATFORMABI} @@ -199,8 +204,8 @@ if [ -n "${DEPENDENCIES}" ] && [ -n "${NDK_PATH}" ] && [ "${BUILD_ANDROID}" -eq PLATFORMABI_COMPILER="armv7a-linux-androideabi" fi # set toolchain path - TOOLCHAIN_PATH=${NDK_HOME}/toolchains/llvm/prebuilt/darwin-x86_64/ - export TOOLCHAIN=${TOOLCHAIN_PATH}${PLATFORMABI_TOOLCHAIN} + TOOLCHAIN_PATH="${NDK_HOME}/toolchains/llvm/prebuilt/darwin-x86_64/" + export TOOLCHAIN="${TOOLCHAIN_PATH}${PLATFORMABI_TOOLCHAIN}" # undo compiler configuration (if set) of previous iteration for ssl scripts unset AR; @@ -218,11 +223,14 @@ if [ -n "${DEPENDENCIES}" ] && [ -n "${NDK_PATH}" ] && [ "${BUILD_ANDROID}" -eq mkdir -p ${SSL_FOLDER} cd ${SSL_FOLDER} || exit if [ ${SSL_BUILD_FOUND} -eq 0 ]; then + # shellcheck disable=SC2028 echo "\t${CYAN}Fetching SSL source${NC}" OPENSSL_SOURCE="https://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz" - curl -s ${OPENSSL_SOURCE} | tar -xvf - -C ${PWD} >> ${ANDROID_LOG_PATH}/ssl_${PLATFORMABI}_${LEVEL}.txt 2>&1 || exit + curl -s "${OPENSSL_SOURCE}" | tar -xvf - -C "${PWD}" >> "${ANDROID_LOG_PATH}/ssl_${PLATFORMABI}_${LEVEL}.txt" 2>&1 || exit + # shellcheck disable=SC2028 echo "\t${CYAN}Source fetched${NC}" - cd openssl-${OPENSSL_VERSION} || exit + cd "openssl-${OPENSSL_VERSION}" || exit + # shellcheck disable=SC2028 echo "\t${CYAN}Building SSL${NC}" # Required by openssl-build-script ANDROID_NDK=${NDK_PATH} @@ -242,13 +250,15 @@ if [ -n "${DEPENDENCIES}" ] && [ -n "${NDK_PATH}" ] && [ "${BUILD_ANDROID}" -eq ;; esac # Required by openssl-build-script - export PATH=${TOOLCHAIN}/bin:${TOOLCHAIN_PATH}/bin:"${PATH}" - make clean >> ${ANDROID_LOG_PATH}/ssl_${PLATFORMABI}_${LEVEL}.txt 2>&1 - ./Configure ${SSL_TARGET} ${SSL_OPTIONS} >> ${ANDROID_LOG_PATH}/ssl_${PLATFORMABI}_${LEVEL}.txt 2>&1 - make >> ${ANDROID_LOG_PATH}/ssl_${PLATFORMABI}_${LEVEL}.txt 2>&1 - make install DESTDIR=${OUTPUT_DIR} >> ${ANDROID_LOG_PATH}/ssl_${PLATFORMABI}_${LEVEL}.txt 2>&1 + export PATH="${TOOLCHAIN}/bin:${TOOLCHAIN_PATH}/bin:${PATH}" + make clean > "${ANDROID_LOG_PATH}/ssl_${PLATFORMABI}_${LEVEL}.txt" 2>&1 + ./Configure "${SSL_TARGET}" "${SSL_OPTIONS}" > "${ANDROID_LOG_PATH}/ssl_${PLATFORMABI}_${LEVEL}.txt" 2>&1 + make >> "${ANDROID_LOG_PATH}/ssl_${PLATFORMABI}_${LEVEL}.txt" 2>&1 + make install DESTDIR="${OUTPUT_DIR}" >> "${ANDROID_LOG_PATH}/ssl_${PLATFORMABI}_${LEVEL}.txt" 2>&1 + # shellcheck disable=SC2028 echo "\t${CYAN}SSL built${NC}" else + # shellcheck disable=SC2028 echo "\t${CYAN}SSL located${NC}" fi cd ../.. @@ -287,16 +297,21 @@ if [ -n "${DEPENDENCIES}" ] && [ -n "${NDK_PATH}" ] && [ "${BUILD_ANDROID}" -eq mkdir -p ${SQLITE_FOLDER} cd ${SQLITE_FOLDER} || exit if [ ${SQLITE_BUILD_FOUND} -eq 0 ]; then + # shellcheck disable=SC2028 echo "\t${CYAN}Fetching Sqlite3 source${NC}" - curl -s ${SQLITE_SOURCE} | tar -xvf - -C ${PWD} >> ${ANDROID_LOG_PATH}/sqlite_${PLATFORMABI}_${LEVEL}.txt 2>&1 + curl -s "${SQLITE_SOURCE}" | tar -xvf - -C "${PWD}" >> "${ANDROID_LOG_PATH}/sqlite_${PLATFORMABI}_${LEVEL}.txt" 2>&1 + # shellcheck disable=SC2028 echo "\t${CYAN}Source fetched${NC}" cd "$(find . -type d -maxdepth 1 -print | grep -m1 'sqlite')" || exit + # shellcheck disable=SC2028 echo "\t${CYAN}Building Sqlite3${NC}" - make clean >> ${ANDROID_LOG_PATH}/sqlite_${PLATFORMABI}_${LEVEL}.txt 2>&1 - ./configure --host=${PLATFORMABI} --prefix=${OUTPUT_DIR} >> ${ANDROID_LOG_PATH}/sqlite_${PLATFORMABI}_${LEVEL}.txt 2>&1 - make install >> ${ANDROID_LOG_PATH}/sqlite_${PLATFORMABI}_${LEVEL}.txt 2>&1 + make clean > "${ANDROID_LOG_PATH}/sqlite_${PLATFORMABI}_${LEVEL}.txt" 2>&1 + ./configure --host=${PLATFORMABI} --prefix="${OUTPUT_DIR}" > "${ANDROID_LOG_PATH}/sqlite_${PLATFORMABI}_${LEVEL}.txt" 2>&1 + make install > "${ANDROID_LOG_PATH}/sqlite_${PLATFORMABI}_${LEVEL}.txt" 2>&1 + # shellcheck disable=SC2028 echo "\t${CYAN}Sqlite3 built${NC}" else + # shellcheck disable=SC2028 echo "\t${CYAN}Sqlite3 located${NC}" fi cd ../.. @@ -312,21 +327,22 @@ if [ -n "${DEPENDENCIES}" ] && [ -n "${NDK_PATH}" ] && [ "${BUILD_ANDROID}" -eq fi fi export LDFLAGS="-L${NDK_HOME}/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/lib/${PLATFORMABI_TOOLCHAIN}/${LEVEL} -L${OUTPUT_DIR}/lib -L${OUTPUT_DIR}/usr/local/lib -lc++ -lsqlite3 -lcrypto -lssl" - cd ${OUTPUT_DIR}/lib || exit + cd "${OUTPUT_DIR}/lib" || exit if [ ${SQLITE_BUILD_FOUND} -eq 1 ]; then - cp ${DEPENDENCIES}/${PLATFORM_OUTDIR}/libsqlite3.a ${OUTPUT_DIR}/lib/libsqlite3.a + cp "${DEPENDENCIES}/${PLATFORM_OUTDIR}/libsqlite3.a" "${OUTPUT_DIR}/lib/libsqlite3.a" fi if [ ${SSL_BUILD_FOUND} -eq 1 ]; then - cp ${DEPENDENCIES}/${PLATFORM_OUTDIR}/libcrypto.a ${OUTPUT_DIR}/usr/local/lib/libcrypto.a - cp ${DEPENDENCIES}/${PLATFORM_OUTDIR}/libssl.a ${OUTPUT_DIR}/usr/local/lib/libssl.a + cp "${DEPENDENCIES}/${PLATFORM_OUTDIR}/libcrypto.a" "${OUTPUT_DIR}/usr/local/lib/libcrypto.a" + cp "${DEPENDENCIES}/${PLATFORM_OUTDIR}/libssl.a" "${OUTPUT_DIR}/usr/local/lib/libssl.a" fi + # shellcheck disable=SC2028 echo "\t${CYAN}Configuring Cargo${NC}" - cd ${CURRENT_DIR} || exit + cd "${CURRENT_DIR}" || exit if [ "${CARGO_CLEAN}" -eq "1" ]; then - cargo clean >> ${ANDROID_LOG_PATH}/cargo_${PLATFORMABI}_${LEVEL}.txt 2>&1 + cargo clean > "${ANDROID_LOG_PATH}/cargo_${PLATFORMABI}_${LEVEL}.txt" 2>&1 fi mkdir -p .cargo cd .cargo || exit @@ -343,7 +359,6 @@ linker = "${CC}" rustflags = "-L${OUTPUT_DIR}/lib -L${OUTPUT_DIR}/usr/local/lib" EOF - else cat > config <> ${ANDROID_LOG_PATH}/cargo_${PLATFORMABI}_${LEVEL}.txt 2>&1 + cargo build --lib --release > "${ANDROID_LOG_PATH}/cargo_${PLATFORMABI}_${LEVEL}.txt" 2>&1 else - cargo ndk --target ${PLATFORMABI} --android-platform ${LEVEL} -- build --release >> ${ANDROID_LOG_PATH}/cargo_${PLATFORMABI}_${LEVEL}.txt 2>&1 + cargo ndk --target ${PLATFORMABI} --android-platform ${LEVEL} -- build --release > "${ANDROID_LOG_PATH}/cargo_${PLATFORMABI}_${LEVEL}.txt" 2>&1 fi else # Fix for lmdb-sys compilation for armv7 on Big Sur @@ -388,7 +405,7 @@ EOF # shellcheck disable=SC2028 echo "\t${CYAN}Extraction complete, continuing build ${NC}" fi - cargo build --lib --release >> ${ANDROID_LOG_PATH}/cargo_${PLATFORMABI}_${LEVEL}.txt 2>&1 + cargo build --lib --release > "${ANDROID_LOG_PATH}/cargo_${PLATFORMABI}_${LEVEL}.txt" 2>&1 if [ "${PLATFORMABI}" == "armv7-linux-androideabi" ]; then BACKTRACK=${PWD} # shellcheck disable=SC2028 @@ -399,37 +416,38 @@ EOF fi fi else - cargo ndk --target ${PLATFORMABI} --android-platform ${LEVEL} -- build --release >> ${ANDROID_LOG_PATH}/cargo_${PLATFORMABI}_${LEVEL}.txt 2>&1 + cargo ndk --target ${PLATFORMABI} --android-platform ${LEVEL} -- build --release > "${ANDROID_LOG_PATH}/cargo_${PLATFORMABI}_${LEVEL}.txt" 2>&1 fi - cp wallet.h ${DEPENDENCIES}/ + cp wallet.h "${DEPENDENCIES}/" rm -rf .cargo cd ../.. cd target || exit cd ${PLATFORMABI} || exit cd release || exit - cp libtari_wallet_ffi.a ${OUTPUT_DIR} + cp libtari_wallet_ffi.a "${OUTPUT_DIR}" cd ../.. rm -rf target - cd ${DEPENDENCIES} || exit - mkdir -p ${PLATFORM_OUTDIR} - cd ${PLATFORM_OUTDIR} || exit + cd "${DEPENDENCIES}" || exit + mkdir -p "${PLATFORM_OUTDIR}" + cd "${PLATFORM_OUTDIR}" || exit if [ ${SQLITE_BUILD_FOUND} -eq 0 ]; then - cp ${OUTPUT_DIR}/lib/libsqlite3.a ${PWD} + cp "${OUTPUT_DIR}/lib/libsqlite3.a" "${PWD}" fi if [ ${SSL_BUILD_FOUND} -eq 0 ]; then - cp ${OUTPUT_DIR}/usr/local/lib/libcrypto.a ${PWD} - cp ${OUTPUT_DIR}/usr/local/lib/libssl.a ${PWD} + cp "${OUTPUT_DIR}/usr/local/lib/libcrypto.a" "${PWD}" + cp "${OUTPUT_DIR}/usr/local/lib/libssl.a" "${PWD}" fi - cp ${OUTPUT_DIR}/libtari_wallet_ffi.a ${PWD} + cp "${OUTPUT_DIR}/libtari_wallet_ffi.a" "${PWD}" + # shellcheck disable=SC2028 echo "\t${GREEN}Wallet library built for android architecture ${PLATFORM_OUTDIR} with minimum platform level support of ${LEVEL}${NC}" done done - cd ${DEPENDENCIES} || exit + cd "${DEPENDENCIES}" || exit rm -rf build rm -rf ${SQLITE_FOLDER} rm -rf ${SSL_FOLDER} echo "${GREEN}Android build completed${NC}" -elif [ ${BUILD_ANDROID} -eq 1 ]; then +elif [ "${BUILD_ANDROID}" -eq 1 ]; then echo "${RED}Cannot configure Android Wallet Library build${NC}" else echo "${GREEN}Android Wallet is configured not to build${NC}" diff --git a/comms/dht/Cargo.toml b/comms/dht/Cargo.toml index 98f4736c98..bca8d7d6ce 100644 --- a/comms/dht/Cargo.toml +++ b/comms/dht/Cargo.toml @@ -23,10 +23,10 @@ bytes = "0.4.12" chacha20 = "0.7.1" chrono = "0.4.9" diesel = {version="1.4.7", features = ["sqlite", "serde_json", "chrono", "numeric"]} -diesel_migrations = "1.4" +diesel_migrations = "1.4.0" +libsqlite3-sys = { version = ">=0.8.0, <0.13.0", features = ["bundled"], optional=true } digest = "0.9.0" futures= {version= "^0.3.1"} -libsqlite3-sys = { version = ">=0.8.0, <0.13.0", features = ["bundled"] } log = "0.4.8" prost = "=0.6.1" prost-types = "=0.6.1"