Switch to --force | More cleanup
This commit is contained in:
@@ -4,16 +4,12 @@
|
||||
set -e
|
||||
set -o pipefail
|
||||
|
||||
# On macOS, use GNU readlink from 'coreutils' package in Homebrew/MacPorts
|
||||
if [ "$(uname -s)" = "Darwin" ] ; then
|
||||
READLINK=greadlink
|
||||
else
|
||||
READLINK=readlink
|
||||
fi
|
||||
RDIR=$(git rev-parse --show-toplevel)
|
||||
|
||||
# If BASH_SOURCE is undefined, we may be running under zsh, in that case
|
||||
# provide a zsh-compatible alternative
|
||||
DIR="$(dirname "$($READLINK -f "${BASH_SOURCE[0]:-${(%):-%x}}")")"
|
||||
# get helpful utilities
|
||||
source $RDIR/scripts/utils.sh
|
||||
|
||||
common_setup
|
||||
|
||||
usage() {
|
||||
echo "Usage: ${0} [OPTIONS] [riscv-tools | esp-tools]"
|
||||
@@ -28,7 +24,8 @@ usage() {
|
||||
echo "Options"
|
||||
echo " --help -h : Display this message"
|
||||
echo " --unpinned-deps -ud : Use unpinned conda environment"
|
||||
echo " --batch : Skip prompt checking for tagged release/conda"
|
||||
echo " --force -f : Skip prompt checking for tagged release/conda"
|
||||
echo " --skip-validate : DEPRECATED: Same functionality as --force"
|
||||
echo " --skip-conda : Skip conda env creation"
|
||||
echo " --skip-toolchain-extra : Skip building extra RISC-V toolchain collateral (Spike, PK, tests, libgloos)"
|
||||
exit "$1"
|
||||
@@ -36,7 +33,7 @@ usage() {
|
||||
|
||||
TOOLCHAIN="riscv-tools"
|
||||
USE_PINNED_DEPS=true
|
||||
BATCH_FLAG=""
|
||||
FORCE_FLAG=""
|
||||
SKIP_CONDA=false
|
||||
SKIP_TOOLCHAIN=false
|
||||
|
||||
@@ -50,8 +47,8 @@ do
|
||||
TOOLCHAIN=$1 ;;
|
||||
-ud | --unpinned-deps )
|
||||
USE_PINNED_DEPS=false ;;
|
||||
--batch)
|
||||
BATCH_FLAG=$1 ;;
|
||||
--force | -f | --skip-validate)
|
||||
FORCE_FLAG=$1 ;;
|
||||
--skip-conda)
|
||||
SKIP_CONDA=true ;;
|
||||
--skip-toolchain-extra)
|
||||
@@ -65,8 +62,8 @@ done
|
||||
|
||||
if [ "$SKIP_CONDA" = false ]; then
|
||||
# note: lock file must end in .conda-lock.yml - see https://github.com/conda-incubator/conda-lock/issues/154
|
||||
LOCKFILE=$DIR/conda-requirements-$TOOLCHAIN-linux-64.conda-lock.yml
|
||||
YAMLFILE=$DIR/conda-requirements-$TOOLCHAIN.yaml
|
||||
LOCKFILE=$RDIR/conda-requirements-$TOOLCHAIN-linux-64.conda-lock.yml
|
||||
YAMLFILE=$RDIR/conda-requirements-$TOOLCHAIN.yaml
|
||||
|
||||
if [ "$USE_PINNED_DEPS" = false ]; then
|
||||
# auto-gen the lockfile
|
||||
@@ -74,28 +71,28 @@ if [ "$SKIP_CONDA" = false ]; then
|
||||
fi
|
||||
|
||||
# use conda-lock to create env
|
||||
conda-lock install -p $DIR/.conda-env $LOCKFILE
|
||||
conda-lock install -p $RDIR/.conda-env $LOCKFILE
|
||||
|
||||
source $DIR/.conda-env/etc/profile.d/conda.sh
|
||||
conda activate $DIR/.conda-env
|
||||
source $RDIR/.conda-env/etc/profile.d/conda.sh
|
||||
conda activate $RDIR/.conda-env
|
||||
fi
|
||||
|
||||
if [ -z "$BATCH_FLAG" ]; then
|
||||
if [ -z "$FORCE_FLAG" ]; then
|
||||
if [ -z ${CONDA_DEFAULT_ENV+x} ]; then
|
||||
error "ERROR: No conda environment detected. Did you activate the conda environment (e.x. 'conda activate base')?"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
$DIR/scripts/init-submodules-no-riscv-tools.sh $BATCH_FLAG
|
||||
$RDIR/scripts/init-submodules-no-riscv-tools.sh $FORCE_FLAG
|
||||
|
||||
if [ "$SKIP_TOOLCHAIN" = false ]; then
|
||||
$DIR/scripts/build-toolchain-extra.sh $BATCH_FLAG $TOOLCHAIN
|
||||
$RDIR/scripts/build-toolchain-extra.sh $FORCE_FLAG $TOOLCHAIN
|
||||
fi
|
||||
|
||||
$DIR/scripts/gen-tags.sh
|
||||
$RDIR/scripts/gen-tags.sh
|
||||
|
||||
cat << EOT >> env.sh
|
||||
# line auto-generated by $0
|
||||
conda activate $DIR/.conda-env
|
||||
conda activate $RDIR/.conda-env
|
||||
EOT
|
||||
|
||||
Reference in New Issue
Block a user