Skip to content

Commit

Permalink
(#101) Fix check for rust dependencies (not needed anymore in most ca…
Browse files Browse the repository at this point in the history
…ses)
  • Loading branch information
mario4tier committed Oct 15, 2024
1 parent cf4d228 commit 7585bf6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
5 changes: 2 additions & 3 deletions scripts/common/__apps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -969,7 +969,8 @@ sb_app_rust_build_and_install() {
local _ASSETS_NAME=$APP_VAR

# Rust (re)build.
echo "Building $SUIBASE_DAEMON_NAME"
echo "Building $_ASSETS_NAME"
exit_if_rust_build_deps_missing
rm -f "$SUIBASE_DAEMON_VERSION_FILE" >/dev/null 2>&1

# Clean the build directory.
Expand Down Expand Up @@ -1052,8 +1053,6 @@ sb_app_install() {
fi

# Check if the platform/arch are supported.

# TODO Implement a trick to force rebuild for dev setup!
if [ "$_PRECOMP_ALLOWED" = "true" ]; then
# Do a precompiled remote installation.
sb_app_init_PRECOMP_REMOTE_vars "$self"
Expand Down
11 changes: 8 additions & 3 deletions scripts/common/__globals.sh
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,13 @@ is_installed() {
return
}

exit_if_rust_build_deps_missing() {
# Check if all rust/cargo building dependencies are installed.
is_installed cmake || setup_error "Need to install cmake. See https://docs.sui.io/build/install#prerequisites"
is_installed rustc || setup_error "Need to install rust. See https://docs.sui.io/build/install#prerequisites"
is_installed cargo || setup_error "Need to install cargo. See https://docs.sui.io/build/install#prerequisites"
}
export -f exit_if_rust_build_deps_missing

SUIBASE_LOCK_CMD=""
SUIBASE_LOCK_TRY_PARAMS=""
Expand Down Expand Up @@ -791,9 +798,6 @@ build_sui_repo_branch() {

is_installed curl || setup_error "Need to install curl. See https://docs.sui.io/build/install#prerequisites"
is_installed git || setup_error "Need to install git. See https://docs.sui.io/build/install#prerequisites"
is_installed cmake || setup_error "Need to install cmake. See https://docs.sui.io/build/install#prerequisites"
is_installed rustc || setup_error "Need to install rust. See https://docs.sui.io/build/install#prerequisites"
is_installed cargo || setup_error "Need to install cargo. See https://docs.sui.io/build/install#prerequisites"
is_installed lsof || setup_error "Need to install 'lsof'."

# Verify Rust is recent enough.
Expand Down Expand Up @@ -925,6 +929,7 @@ build_sui_repo_branch() {
_DO_FINAL_SUI_SANITY_CHECK=true
else
# Build from source.
exit_if_rust_build_deps_missing
local _IS_RELEASE_BUILD=false
if [[ "${CFG_cargo_release:?}" == "true" ]] || [[ "$PASSTHRU_OPTIONS" == *"--release"* ]]; then
_IS_RELEASE_BUILD=true
Expand Down

0 comments on commit 7585bf6

Please sign in to comment.