Skip to content

Commit

Permalink
[build] set the opam switch even when the switch is specified by the …
Browse files Browse the repository at this point in the history
…user

Reviewed By: jberdine

Differential Revision: D4875350

fbshipit-source-id: 0f2952d
  • Loading branch information
jvillard authored and facebook-github-bot committed Apr 12, 2017
1 parent e105085 commit 18374a3
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions build-infer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ BUILD_CLANG=${BUILD_CLANG:-no}
BUILD_JAVA=${BUILD_JAVA:-no}
INTERACTIVE=${INTERACTIVE:-yes}
ONLY_SETUP_OPAM=${ONLY_SETUP_OPAM:-no}
# do not set INFER_OPAM_SWITCH by default
INFER_OPAM_SWITCH=${INFER_OPAM_SWITCH:-$INFER_OPAM_SWITCH_DEFAULT}
ORIG_ARGS="$*"

while [[ $# > 0 ]]; do
Expand Down Expand Up @@ -152,10 +152,11 @@ install_opam_deps () {

echo "initializing opam... "
check_installed opam
if [ -z $INFER_OPAM_SWITCH ]; then
# the user didn't pass an opam switch explicitly, set up a custom switch for infer
INFER_OPAM_SWITCH=$INFER_OPAM_SWITCH_DEFAULT
if [ "$INFER_OPAM_SWITCH" = "$INFER_OPAM_SWITCH_DEFAULT" ]; then
# set up the custom infer switch
setup_opam
else
opam switch set -j $NCPU $INFER_OPAM_SWITCH
fi
eval $(SHELL=bash opam config env --switch=$INFER_OPAM_SWITCH)
echo "installing infer dependencies... "
Expand Down

0 comments on commit 18374a3

Please sign in to comment.