summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Allsopp <david.allsopp@metastack.com>2021-01-06 14:41:55 +0000
committerDavid Allsopp <david.allsopp@metastack.com>2021-01-06 14:41:55 +0000
commitcccda37580cdb90c4ef82099ef71c83b7e5ff749 (patch)
treeb1b9106b142f2b2131f2c4f199ecb7716a4af3a4
parent1b01d00bda6bac5bf2ae87a575918e4655e24866 (diff)
downloadocaml-cccda37580cdb90c4ef82099ef71c83b7e5ff749.tar.gz
AppVeyor: refactor UTF-8 parts
Moves the UTF-8 definitions solely into appveyor_build.cmd (Cygwin then inherits them correctly by ensuring the script always runs with chcp 65001). The setting up of the build environment (Visual Studio, etc.) is also now done in install phase, where it belongs, rather than build.
-rw-r--r--.gitattributes1
-rw-r--r--tools/ci/appveyor/appveyor_build.cmd30
-rw-r--r--tools/ci/appveyor/appveyor_build.sh7
3 files changed, 13 insertions, 25 deletions
diff --git a/.gitattributes b/.gitattributes
index fe0c30c90e..fe589028be 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -64,7 +64,6 @@ tools/mantis2gh_stripped.csv typo.missing-header
# tools/ci/appveyor/appveyor_build.cmd only has missing-header because
# dra27 too lazy to update check-typo to interpret Cmd-style comments!
/tools/ci/appveyor/appveyor_build.cmd typo.very-long-line typo.missing-header typo.non-ascii
-/tools/ci/appveyor/appveyor_build.sh typo.non-ascii
/tools/ci/inria/bootstrap/remove-sinh-primitive.patch typo.prune
/release-info/howto.md typo.missing-header typo.long-line
/release-info/templates/*.md typo.missing-header typo.very-long-line=may
diff --git a/tools/ci/appveyor/appveyor_build.cmd b/tools/ci/appveyor/appveyor_build.cmd
index d5985741b0..d417472265 100644
--- a/tools/ci/appveyor/appveyor_build.cmd
+++ b/tools/ci/appveyor/appveyor_build.cmd
@@ -20,6 +20,10 @@
@rem Do not call setlocal!
@echo off
+chcp 65001 > nul
+set BUILD_PREFIX=🐫реализация
+set OCAMLROOT=%PROGRAMFILES%\Бактріан🐫
+
if "%1" neq "install" goto %1
setlocal enabledelayedexpansion
echo AppVeyor Environment
@@ -68,9 +72,14 @@ if %CYGWIN_UPGRADE_REQUIRED% equ 1 (
goto :EOF
:install
-chcp 65001 > nul
-rem This must be kept in sync with appveyor_build.sh
-set BUILD_PREFIX=🐫реализация
+
+if defined SDK set SDK=call %SDK%
+if not defined SDK (
+ if "%PORT%" equ "msvc64" set SDK=call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64\vcvars64.bat"
+ if "%PORT%" equ "msvc32" set SDK=call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\vcvars32.bat"
+)
+%SDK%
+
git worktree add "..\%BUILD_PREFIX%-%PORT%" -b appveyor-build-%PORT%
cd "..\%BUILD_PREFIX%-%PORT%"
@@ -125,21 +134,6 @@ call :UpgradeCygwin
goto :EOF
:build
-rem Testing %SDK% is tricky, since it can contain double-quotes. The "trick",
-rem is to make SDK_TEST the second character of %SDK%. If %SDK% is un-set then
-rem SDK_TEST will be the literal string %SDK:~1,1%, obviously. However, that
-rem means %SDK_TEST:~1,1% only expands to the empty string if SDK was itself
-rem un-set. <sigh>
-set SDK_TEST=%SDK:~1,1%
-if "%SDK_TEST:~1,1%" neq "" (
- if "%PORT%" equ "msvc64" set SDK=call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64\vcvars64.bat"
- if "%PORT%" equ "msvc32" set SDK=call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\vcvars32.bat"
-) else (
- set SDK=call %SDK%
-)
-
-%SDK%
-
"%CYG_ROOT%\bin\bash.exe" -lc "$APPVEYOR_BUILD_FOLDER/tools/ci/appveyor/appveyor_build.sh" || exit /b 1
goto :EOF
diff --git a/tools/ci/appveyor/appveyor_build.sh b/tools/ci/appveyor/appveyor_build.sh
index 62a96c924b..a114ced43e 100644
--- a/tools/ci/appveyor/appveyor_build.sh
+++ b/tools/ci/appveyor/appveyor_build.sh
@@ -89,12 +89,7 @@ function set_configuration {
}
APPVEYOR_BUILD_FOLDER=$(echo "$APPVEYOR_BUILD_FOLDER" | cygpath -f -)
-# These directory names are specified here, because getting UTF-8 correctly
-# through appveyor.yml -> Command Script -> Bash is quite painful...
-OCAMLROOT=$(echo "$PROGRAMFILES/Бактріан🐫" | cygpath -f - -m)
-
-# This must be kept in sync with appveyor_build.cmd
-BUILD_PREFIX=🐫реализация
+OCAMLROOT=$(echo "$OCAMLROOT" | cygpath -f - -m)
if [[ $BOOTSTRAP_FLEXDLL = 'false' ]] ; then
case "$PORT" in