diff --git a/util/buildscripts/build.sh b/util/buildscripts/build.sh index d0e110047..765995dfd 100755 --- a/util/buildscripts/build.sh +++ b/util/buildscripts/build.sh @@ -7,6 +7,18 @@ SKIPCOMPILE="" LLVM_ARM32=$(readlink -f $(dirname $0)/support/llvm_arm32) LLVM_ARM64=$(readlink -f $(dirname $0)/support/llvm_arm64) +native_path() { + if which cygpath >/dev/null 2>&1; then + cygpath -w "${1}"; + elif which wslpath >/dev/null 2>&1; then + wslpath -w "${1}"; + else + echo "${1}"; + fi; +} + +export -f native_path + usage() { echo "Usage: $0 --official|--snapshot [options...]"; echo; diff --git a/util/buildscripts/scripts/prepare_symbols.sh b/util/buildscripts/scripts/prepare_symbols.sh index dda7c964d..cc95a9b5c 100755 --- a/util/buildscripts/scripts/prepare_symbols.sh +++ b/util/buildscripts/scripts/prepare_symbols.sh @@ -24,7 +24,9 @@ fi ########################################################## # Create a source-mapping file to embed into PDBs -cat << EOF > /tmp/pdbstr.txt +PDBSTR="${REPO_ROOT}"/pdbstr.txt + +cat << EOF > "${PDBSTR}" SRCSRV: ini ------------------------------------------------ VERSION=2 VERCTRL=http @@ -40,17 +42,19 @@ for I in $(find "${REPO_ROOT}" \( -path '*/3rdparty' -o -path '*/build-android*' done | sed -e '{s#\*'"${REPO_ROOT}"'/\?#\*#g}' | sed -e '{s#^/\(.\)/#\1:/#g}' | - awk -F"*" '{gsub("/","\\",$1); print $1 "*" $2}' >> /tmp/pdbstr.txt + awk -F"*" '{gsub("/","\\",$1); print $1 "*" $2}' >> "${PDBSTR}" -echo "SRCSRV: end ------------------------------------------------" >> /tmp/pdbstr.txt +echo "SRCSRV: end ------------------------------------------------" >> "${PDBSTR}" ########################################################## # Apply the source-indexing mapping into every pdb file for PDB in "${REPO_ROOT}"/Win32/Release/*.pdb "${REPO_ROOT}"/x64/Release/*.pdb; do - "${BUILD_ROOT}"/support/pdbstr.exe -w -p:$PDB -s:srcsrv -i:/tmp/pdbstr.txt + "${BUILD_ROOT}"/support/pdbstr.exe -w -p:$(native_path $PDB) -s:srcsrv -i:$(native_path "${PDBSTR}") done +rm "${PDBSTR}" + if [ ! -f "${BUILD_ROOT}"/support/symstore.exe ]; then echo "Need symstore.exe from Windows Debugger folder in build root." echo "e.g. C:\Program Files (x86)\Windows Kits\10\Debuggers\x64\symstore.exe"; @@ -64,11 +68,6 @@ fi TMPSTORE="${REPO_ROOT}"/symstore -if which cygpath >/dev/null 2>&1; then - TMPSTORE=$(cygpath -w "${TMPSTORE}") - SYMSTORE=$(cygpath -w "${SYMSTORE}") -fi - echo "Storing symbols for $GITTAG in symbol store $SYMSTORE temporarily in $TMPSTORE" mkdir -p "${SYMSTORE}" @@ -95,7 +94,7 @@ for ARCH in Win32 x64; do done if [ -d "${TMPSTORE}" ]; then - MSYS2_ARG_CONV_EXCL="*" "${BUILD_ROOT}"/support/symstore.exe add /s "${SYMSTORE}" /compress /r /f "${TMPSTORE}" /t RenderDoc /v $GITTAG + MSYS2_ARG_CONV_EXCL="*" "${BUILD_ROOT}"/support/symstore.exe add /s "$(native_path "${SYMSTORE}")" /compress /r /f "$(native_path "${TMPSTORE}")" /t RenderDoc /v $GITTAG fi done diff --git a/util/buildscripts/scripts/sign.sh b/util/buildscripts/scripts/sign.sh index 6ad3aabba..d84f15bc1 100755 --- a/util/buildscripts/scripts/sign.sh +++ b/util/buildscripts/scripts/sign.sh @@ -28,10 +28,8 @@ INPUTFILE="$1" # Don't convert any arguments automatically, convert paths if needed MSYS2_ARG_CONV_EXCL="*" -if which cygpath >/dev/null 2>&1; then - KEYFILE=$(cygpath -w "${KEYFILE}") - INPUTFILE=$(cygpath -w "${INPUTFILE}") -fi +KEYFILE=$(native_path "${KEYFILE}") +INPUTFILE=$(native_path "${INPUTFILE}") # First check to see if it is already signed. # An exit value of 1 from signtool indicates it is not signed.