Skip to content

Commit a4bdc54

Browse files
committed
[1.5>1.6] [MERGE #3107 @obastemur] xplat: fix script location
Merge pull request #3107 from obastemur:symlink `dirname $0` may return relative path, while some part of the script require it to be absolute.
2 parents 22b4c07 + a96455e commit a4bdc54

File tree

3 files changed

+13
-9
lines changed

3 files changed

+13
-9
lines changed

build.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ PRINT_USAGE() {
5454
echo " --sanitize=CHECKS Build with clang -fsanitize checks,"
5555
echo " e.g. undefined,signed-integer-overflow."
5656
echo " -t, --test-build Test build. Enables test flags on a release build."
57-
echo " --target-os[=S] Target OS"
57+
echo " --target[=S] Target OS"
5858
echo " --target-path[=S] Output path for compiled binaries. Default: out/"
5959
echo " --trace Enables experimental built-in trace."
6060
echo " --xcode Generate XCode project."
@@ -79,7 +79,9 @@ script (at your own risk)"
7979
echo ""
8080
}
8181

82-
CHAKRACORE_DIR=`dirname $0`
82+
pushd `dirname $0` > /dev/null
83+
CHAKRACORE_DIR=`pwd -P`
84+
popd > /dev/null
8385
_CXX=""
8486
_CC=""
8587
_VERBOSE=""

test/runtests.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@
88
# This script is mainly for CI only. In case you have ChakraCore is compiled for multiple
99
# targets, this script may fail to test all of them. Use runtests.py instead.
1010

11-
test_path=`dirname "$0"`
12-
11+
pushd `dirname $0` > /dev/null
12+
test_path=`pwd -P`
13+
popd > /dev/null
1314
build_type=
1415
binary_path=
1516
release_build=0
@@ -52,9 +53,8 @@ else
5253
fi
5354
fi
5455

55-
RES=$(pwd)
56-
CH_ABSOLUTE_PATH="$RES/${test_path}/../out/${binary_path}/ch"
57-
RES=$(cd $RES/$test_path/native-tests; ./test_native.sh ${CH_ABSOLUTE_PATH} ${binary_path} 2>&1)
56+
CH_ABSOLUTE_PATH="${test_path}/../out/${binary_path}/ch"
57+
RES=$(cd $test_path/native-tests; ./test_native.sh ${CH_ABSOLUTE_PATH} ${binary_path} 2>&1)
5858
if [[ $? != 0 ]]; then
5959
echo "Error: Native tests failed"
6060
echo -e "$RES"

tools/RecyclerChecker/build.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ echo " --llvm-config=PATH llvm-config executable"
1717
echo ""
1818
}
1919

20-
SCRIPT_DIR=`dirname $0`
20+
pushd `dirname $0` > /dev/null
21+
SCRIPT_DIR=`pwd -P`
22+
popd > /dev/null
2123
CLANG_INC=
2224
CXX_COMPILER=
2325
LLVM_CONFIG=
@@ -80,4 +82,4 @@ cmake \
8082
_RET=$?
8183

8284
popd > /dev/null
83-
exit $_RET
85+
exit $_RET

0 commit comments

Comments
 (0)