diff --git a/Makefile b/Makefile index 4e1801b6e..cf70fbf2f 100644 --- a/Makefile +++ b/Makefile @@ -51,7 +51,7 @@ test: all # Auto-detection pre: - @which fstar.exe >/dev/null 2>&1 || [ -x $(FSTAR_HOME)/bin/fstar.exe ] || \ + @command -v fstar.exe >/dev/null 2>&1 || [ -x $(FSTAR_HOME)/bin/fstar.exe ] || \ { echo "Didn't find fstar.exe in the path or in FSTAR_HOME (which is: $(FSTAR_HOME))"; exit 1; } @ocamlfind query fstarlib >/dev/null 2>&1 || [ -f $(FSTAR_HOME)/bin/fstarlib/fstarlib.cmxa ] || \ { echo "Didn't find fstarlib via ocamlfind or in FSTAR_HOME (which is: $(FSTAR_HOME)); run $(MAKE) -C $(FSTAR_HOME)/ulib/ml"; exit 1; } diff --git a/build_local.sh b/build_local.sh index 510cf4c75..89edbf902 100755 --- a/build_local.sh +++ b/build_local.sh @@ -1,15 +1,15 @@ -#!/usr/bin/env bash +#!/bin/sh set -e # Look for config.json file FILE=".docker/build/config.json" -if [[ ! -f $FILE ]]; then +if [ ! -f $FILE ]; then echo "File $FILE does not exist." fi # In case you want to build windows, change agentOS here to windows-nt if OSTYPE is not working agentOS=linux -if [[ "$OSTYPE" == "cygwin" ]]; then +if [ "$OSTYPE" == "cygwin" ]; then agentOS=linux #windows-nt fi @@ -32,7 +32,7 @@ REQUESTEDBRANCHNAME=$(jq -c -r ".BranchName" "$FILE") REQUESTEDCOMMITID=$(jq -c -r ".BaseContainerImageTagOrCommitId" "$FILE") COMMITURL=$(jq -c -r ".GithubCommitUrl" "$FILE")/$REQUESTEDBRANCHNAME -if [[ $(jq -c -r ".BaseContainerImageTagOrCommitId" "$FILE") -ne "latest" ]]; then +if [ "$(jq -c -r '.BaseContainerImageTagOrCommitId' "$FILE")" -ne "latest" ]; then COMMITURL=$(jq -c -r ".GithubCommitUrl" "$FILE")/$REQUESTEDCOMMITID fi diff --git a/kremlib/Makefile b/kremlib/Makefile index 962067cb0..741c8893a 100644 --- a/kremlib/Makefile +++ b/kremlib/Makefile @@ -47,7 +47,7 @@ ROOTS = $(wildcard *.fst) $(wildcard *.fsti) $(wildcard ../runtime/*.fst) \ clean: clean-c rm -rf *.checked *.source .depend -SHELL:=$(shell which bash) +SHELL:=$(shell command -v bash) clean-c: rm -rf dist out extract-all */*.o diff --git a/src/Driver.ml b/src/Driver.ml index f85efd070..ecf690854 100644 --- a/src/Driver.ml +++ b/src/Driver.ml @@ -221,7 +221,7 @@ let detect_fstar () = fstar_home := r; fstar := r ^^ "bin" ^^ "fstar.exe" with Not_found -> try - fstar := read_one_line "which" [| "fstar.exe" |]; + fstar := read_one_line "sh" [| "-c"; "command -v fstar.exe" |]; fstar_home := d (d !fstar); if not !Options.silent then KPrint.bprintf "FSTAR_HOME is %s (via fstar.exe in PATH)\n" !fstar_home