fixes
[buildscripts] / rust
diff --git a/rust b/rust
index 38d2a6058405ff713a804682cd313ebb485ec42e..5ed2870e32fcf374b4b8c682ee7cfc866ccfa12d 100755 (executable)
--- a/rust
+++ b/rust
@@ -2,15 +2,16 @@
 # Copyright (C) 2019 Ian Kelling
 # SPDX-License-Identifier: AGPL-3.0-or-later
 
-if [ -z "$BASH_VERSION" ]; then echo "error: shell is not bash" >&2; exit 1; fi
-
-shopt -s inherit_errexit 2>/dev/null ||: # ignore fail in bash < 4.4
-set -eE -o pipefail
-trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR
 # alternatively, using https://iankelling.org/git/?p=errhandle;a=tree
 # source /path/errhandle/err
 # on my machine
 source /a/bin/errhandle/err
+source /a/bin/distro-functions/src/package-manager-abstractions
+
+PATH="$PATH:$HOME/.cargo/bin"
+hash -r
+
+# todo: this should happen in some kind of sandbox or vm
 
 # install rust.
 if type -t rustc &>/dev/null; then
@@ -18,12 +19,15 @@ if type -t rustc &>/dev/null; then
 else
   curl https://sh.rustup.rs -sSf | bash -s -- -y
 fi
-# todo: update this. updates in rust are stupidly complicate
+
 if ! which rg &>/dev/null; then
   cargo install ripgrep
 fi
 
 if ! type -t cargo-install-update &>/dev/null; then
+  # due to
+  # error: failed to run custom build command for `openssl-sys v0.9.53`
+  pi libssl-dev pkg-config
   cargo install cargo-update
 fi