Add more skips to build-setup

This commit is contained in:
abejgonzalez
2022-09-15 11:42:46 -07:00
parent 2e7fd25025
commit 0527bcd07e

View File

@@ -29,12 +29,16 @@ usage() {
echo " --help -h : Display this message" echo " --help -h : Display this message"
echo " --unpinned-deps -ud : Use unpinned conda environment" echo " --unpinned-deps -ud : Use unpinned conda environment"
echo " --skip-validate : Skip prompt checking for tagged release/conda" echo " --skip-validate : Skip prompt checking for tagged release/conda"
echo " --skip-conda : Skip conda env creation"
echo " --skip-toolchain-extra : Skip building extra RISC-V toolchain collateral (Spike, PK, tests, libgloos)"
exit "$1" exit "$1"
} }
TOOLCHAIN="riscv-tools" TOOLCHAIN="riscv-tools"
USE_PINNED_DEPS=true USE_PINNED_DEPS=true
SKIP_VALIDATE_FLAG="" SKIP_VALIDATE_FLAG=""
SKIP_CONDA=false
SKIP_TOOLCHAIN=false
# getopts does not support long options, and is inflexible # getopts does not support long options, and is inflexible
while [ "$1" != "" ]; while [ "$1" != "" ];
@@ -48,6 +52,10 @@ do
USE_PINNED_DEPS=false ;; USE_PINNED_DEPS=false ;;
--skip-validate) --skip-validate)
SKIP_VALIDATE_FLAG=$1 ;; SKIP_VALIDATE_FLAG=$1 ;;
--skip-conda)
SKIP_CONDA=true ;;
--skip-toolchain-extra)
SKIP_TOOLCHAIN=true ;;
* ) * )
error "invalid option $1" error "invalid option $1"
usage 1 ;; usage 1 ;;
@@ -55,13 +63,7 @@ do
shift shift
done done
if [ "$SKIP_VALIDATE" = false ]; then if [ "$SKIP_CONDA" = false ]; 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
# note: lock file must end in .conda-lock.yml - see https://github.com/conda-incubator/conda-lock/issues/154 # 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 LOCKFILE=$DIR/conda-requirements-$TOOLCHAIN-linux-64.conda-lock.yml
YAMLFILE=$DIR/conda-requirements-$TOOLCHAIN.yaml YAMLFILE=$DIR/conda-requirements-$TOOLCHAIN.yaml
@@ -76,9 +78,20 @@ conda-lock install -p $DIR/.conda-env $LOCKFILE
source $DIR/.conda-env/etc/profile.d/conda.sh source $DIR/.conda-env/etc/profile.d/conda.sh
conda activate $DIR/.conda-env conda activate $DIR/.conda-env
fi
if [ -z "$SKIP_VALIDATE_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 $SKIP_VALIDATE_FLAG $DIR/scripts/init-submodules-no-riscv-tools.sh $SKIP_VALIDATE_FLAG
if [ "$SKIP_TOOLCHAIN" = false ]; then
$DIR/scripts/build-toolchain-extra.sh $SKIP_VALIDATE_FLAG $TOOLCHAIN $DIR/scripts/build-toolchain-extra.sh $SKIP_VALIDATE_FLAG $TOOLCHAIN
fi
cat << EOT >> env.sh cat << EOT >> env.sh
# line auto-generated by $0 # line auto-generated by $0