Skip to content

Commit

Permalink
Remove need for conda in build-toolchains-extra.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
abejgonzalez committed Dec 12, 2022
1 parent a8d99eb commit a0ad9d2
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 19 deletions.
4 changes: 2 additions & 2 deletions .github/actions/create-conda-env/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 10 additions & 1 deletion scripts/build-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
19 changes: 3 additions & 16 deletions scripts/build-toolchain-extra.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
Expand All @@ -50,25 +47,15 @@ do
CLEANAFTERINSTALL="true" ;;
riscv-tools | esp-tools)
TOOLCHAIN=$1 ;;
--force | -f | --skip-validate)
FORCE=true;
;;
* )
error "invalid option $1"
usage 1 ;;
esac
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
Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit a0ad9d2

Please sign in to comment.