Skip to content

Commit

Permalink
v9.1
Browse files Browse the repository at this point in the history
- DietPi-Software | vaultwarden: Install Rust onto disk instead of /tmp. Use alternative workaround for otherwise failing ARMv7 builds
  • Loading branch information
MichaIng committed Feb 5, 2024
1 parent ce3fa9e commit c004fbd
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions .build/software/vaultwarden/build.bash
Original file line number Diff line number Diff line change
Expand Up @@ -17,26 +17,25 @@ do
done

# Install Rust via https://rustup.rs/
# - ARMv7: Needs to be installed in tmpfs, else builds fail in emulated 32-bit ARM environments: https://github.com/rust-lang/cargo/issues/8719
# - ARMv8: Apply workaround for increased RAM usage: https://github.com/rust-lang/cargo/issues/10583
# shellcheck disable=SC2015
export HOME='/tmp/rustup' CARGO_NET_GIT_FETCH_WITH_CLI='true'
G_EXEC mkdir -p "$HOME"
G_EXEC cd "$HOME"
G_DIETPI-NOTIFY 2 'Installing Rust via rustup'
G_EXEC cd /tmp
G_EXEC curl -sSfo rustup-init.sh 'https://sh.rustup.rs'
G_EXEC chmod +x rustup-init.sh
# - ARMv6: Set default target explicitly, otherwise it compiles for ARMv7 in emulated container
grep -q '^ID=raspbian' /etc/os-release && G_HW_ARCH_NAME='armv6l' host=('--default-host' 'arm-unknown-linux-gnueabihf') || host=()
# - ARMv7: Apply workaround for failing builds in emulated 32-bit ARM environments: https://github.com/rust-lang/cargo/issues/8719#issuecomment-1516492970
# - ARMv8: Apply workaround for increased RAM usage: https://github.com/rust-lang/cargo/issues/10583
export CARGO_NET_GIT_FETCH_WITH_CLI='true' CARGO_REGISTRIES_CRATES_IO_PROTOCOL='sparse'
G_EXEC_OUTPUT=1 G_EXEC ./rustup-init.sh -y --profile minimal --default-toolchain none "${host[@]}"
G_EXEC rm rustup-init.sh
export PATH="$HOME/.cargo/bin:$PATH"

# Obtain latest versions
# - vaultwarden
version=$(curl -sSf 'https://api.github.com/repos/dani-garcia/vaultwarden/releases/latest' | mawk -F\" '/^ "tag_name"/{print $4}')
version=$(curl -sSf 'https://api.github.com/repos/dani-garcia/vaultwarden/releases/latest' | mawk -F\" '/^ *"tag_name": "[^"]*",$/{print $4}')
[[ $version ]] || { G_DIETPI-NOTIFY 1 'No latest vaultwarden version found, aborting ...'; exit 1; }
# - web vault
wv_url=$(curl -sSf 'https://api.github.com/repos/dani-garcia/bw_web_builds/releases/latest' | mawk -F\" '/^ "browser_download_url".*\.tar\.gz"$/{print $4}')
wv_url=$(curl -sSf 'https://api.github.com/repos/dani-garcia/bw_web_builds/releases/latest' | mawk -F\" '/^ *"browser_download_url": ".*\.tar\.gz"$/{print $4}')
[[ $wv_url ]] || { G_DIETPI-NOTIFY 1 'No latest web vault version found, aborting ...'; exit 1; }

# Build
Expand Down

0 comments on commit c004fbd

Please sign in to comment.