Skip to content

Commit

Permalink
etc: DependencyInstaller: Add option for constant build directory
Browse files Browse the repository at this point in the history
Signed-off-by: Eryk Szpotanski <eszpotanski@antmicro.com>
  • Loading branch information
eszpotanski authored and glatosinski committed Sep 10, 2024
1 parent 3556bc2 commit ca7db85
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion etc/DependencyInstaller.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,15 @@ _installCommon() {
pip3 install --no-cache-dir --user -U $pkgs
fi

baseDir=$(mktemp -d /tmp/DependencyInstaller-orfs-XXXXXX)
if [[ "$constantBuildDir" == "true" ]]; then
baseDir="/tmp/DependencyInstaller-ORFS"
if [[ -d "$baseDir" ]]; then
echo "[INFO] Removing old building directory $baseDir"
fi
mkdir -p "$baseDir"
else
baseDir=$(mktemp -d /tmp/DependencyInstaller-orfs-XXXXXX)
fi

# Install Verilator
verilatorPrefix=`realpath ${PREFIX:-"/usr/local"}`
Expand Down Expand Up @@ -237,6 +245,9 @@ Usage: $0
# sudo or with root access.
$0 -ci
# Installs CI tools
$0 -constant-build-dir
# Use constant build directory, instead of
# random one.
EOF
exit "${1:-1}"
}
Expand All @@ -249,6 +260,7 @@ PREFIX=""
option="all"
# default isLocal
isLocal="false"
constantBuildDir="false"
CI="no"

# default values, can be overwritten by cmdline args
Expand Down Expand Up @@ -281,6 +293,10 @@ while [ "$#" -gt 0 ]; do
OR_INSTALLER_ARGS="${OR_INSTALLER_ARGS} $1"
PREFIX=${1#*=}
;;
-constant-build-dir)
OR_INSTALLER_ARGS="${OR_INSTALLER_ARGS} $1"
constantBuildDir="true"
;;
*)
echo "unknown option: ${1}" >&2
_help
Expand Down

0 comments on commit ca7db85

Please sign in to comment.