From 18374a3f58aef5d7ef51dec84ef9f7d499678eb2 Mon Sep 17 00:00:00 2001 From: Jules Villard Date: Wed, 12 Apr 2017 07:16:10 -0700 Subject: [PATCH] [build] set the opam switch even when the switch is specified by the user Reviewed By: jberdine Differential Revision: D4875350 fbshipit-source-id: 0f2952d --- build-infer.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/build-infer.sh b/build-infer.sh index 986865c0e29..72b4649f542 100755 --- a/build-infer.sh +++ b/build-infer.sh @@ -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 @@ -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... "