diff --git a/.github/actions/create-conda-env/action.yml b/.github/actions/create-conda-env/action.yml index 250c7f8d..5410ae50 100644 --- a/.github/actions/create-conda-env/action.yml +++ b/.github/actions/create-conda-env/action.yml @@ -23,10 +23,10 @@ runs: if [[ "${{ inputs.install-collateral }}" == 'true' ]]; then echo "Add extra toolchain collateral to RISC-V install area" conda activate ${{ env.conda-env-name-no-time }}-$(date --date "${{ env.workflow-timestamp }}" +%Y%m%d)-riscv-tools - ./scripts/build-toolchain-extra.sh riscv-tools + ./scripts/build-toolchain-extra.sh riscv-tools -p $CONDA_PREFIX/riscv-tools conda deactivate conda activate ${{ env.conda-env-name-no-time }}-$(date --date "${{ env.workflow-timestamp }}" +%Y%m%d)-esp-tools - ./scripts/build-toolchain-extra.sh esp-tools + ./scripts/build-toolchain-extra.sh esp-tools -p $CONDA_PREFIX/esp-tools conda deactivate fi fi diff --git a/scripts/build-setup.sh b/scripts/build-setup.sh index 0fc71ad6..fb4dc782 100755 --- a/scripts/build-setup.sh +++ b/scripts/build-setup.sh @@ -117,7 +117,16 @@ if do_skip "2"; then fi if do_skip "3"; then - $RDIR/scripts/build-toolchain-extra.sh $FORCE_FLAG $TOOLCHAIN_TYPE + if do_skip "1"; then + PREFIX=$CONDA_PREFIX/$TOOLCHAIN_TYPE + else + if [ -z "$RISCV" ] ; then + error "ERROR: If conda initialization skipped, \$RISCV variable must be defined." + exit 1 + fi + PREFIX=$RISCV + fi + $RDIR/scripts/build-toolchain-extra.sh $TOOLCHAIN_TYPE -p $PREFIX fi if do_skip "4"; then diff --git a/scripts/build-toolchain-extra.sh b/scripts/build-toolchain-extra.sh index 1769f4db..1bc54297 100755 --- a/scripts/build-toolchain-extra.sh +++ b/scripts/build-toolchain-extra.sh @@ -23,11 +23,8 @@ usage() { echo " esp-tools: if set, builds esp-tools toolchain used for the hwacha vector accelerator" echo "" echo "Options" - echo " --prefix PREFIX : Install destination. If unset, defaults to $CONDA_PREFIX/riscv-tools" - echo " or $CONDA_PREFIX/esp-tools" + echo " --prefix -p PREFIX : Install destination." echo " --clean-after-install : Run make clean in calls to module_make and module_build" - echo " --force -f : Skip prompt checking for conda" - echo " --skip-validate : DEPRECATED: Same functionality as --force" echo " --help -h : Display this message" exit "$1" } @@ -50,9 +47,6 @@ do CLEANAFTERINSTALL="true" ;; riscv-tools | esp-tools) TOOLCHAIN=$1 ;; - --force | -f | --skip-validate) - FORCE=true; - ;; * ) error "invalid option $1" usage 1 ;; @@ -60,15 +54,8 @@ do shift done -if [ "$FORCE" = 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 chipyard')?" - exit 1 - fi -fi - if [ -z "$RISCV" ] ; then - RISCV="$CONDA_PREFIX/$TOOLCHAIN" + error "ERROR: Prefix not given. If conda is sourced, do you mean $CONDA_PREFIX/$TOOLCHAIN?" fi XLEN=64 @@ -108,7 +95,7 @@ echo '==> Installing espresso logic minimizer' git submodule update --init --checkout generators/constellation cd generators/constellation scripts/install-espresso.sh $RISCV -) +) # Common tools (not in any particular toolchain dir)