some AppVeyor files

Started by Peter Eisentrautalmost 6 years ago3 messages
#1Peter Eisentraut
peter.eisentraut@2ndquadrant.com
3 attachment(s)

Many people enjoy the Windows testing the cfbot runs on the AppVeyor
service.

You can also run this yourself without the detour through the commit
fest app. Attached are three patches that add .appveyor.yml files, for
MSVC, MinGW, and Cygwin respectively. (An open problem is to combine
them all into one.) I have been using these regularly over the last few
months to test code on these Windows variants.

To use them, first you need to set up your AppVeyor account and link it
to a github (or gitlab or ...) repository. Then git am the patch on top
of some branch, push to github (or ...) and watch it build.

This is just for individual enjoyment; I don't mean to commit them at
this time.

(Some of this has been cribbed from the cfbot work and many other places
all over the web.)

--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Attachments:

0001-AppVeyor-configuration-for-Cygwin.patchtext/plain; charset=UTF-8; name=0001-AppVeyor-configuration-for-Cygwin.patch; x-mac-creator=0; x-mac-type=0Download
From 732e7ac33eb1bf5a3d42d20307747089d6f54fa5 Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <peter@eisentraut.org>
Date: Tue, 10 Mar 2020 19:22:22 +0100
Subject: [PATCH] AppVeyor configuration for Cygwin

---
 .appveyor.yml | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)
 create mode 100644 .appveyor.yml

diff --git a/.appveyor.yml b/.appveyor.yml
new file mode 100644
index 0000000000..1d271dbaaa
--- /dev/null
+++ b/.appveyor.yml
@@ -0,0 +1,32 @@
+environment:
+  global:
+    CYG_MIRROR: http://cygwin.mirror.rafal.ca/
+    CYG_CACHE: C:/cygwin/var/cache/setup
+  matrix:
+    - CYG_ARCH: x86
+      CYG_ROOT: C:/cygwin
+    - CYG_ARCH: x86_64
+      CYG_ROOT: C:/cygwin64
+
+install:
+  - set PATH=%CYG_ROOT%/bin;%PATH%
+  - 'appveyor DownloadFile http://cygwin.com/setup-%CYG_ARCH%.exe -FileName setup.exe'
+  - 'setup.exe -qnNdO -R "%CYG_ROOT%" -s "%CYG_MIRROR%" -l "%CYG_CACHE%" -P flex -P libreadline-devel -P libssl-devel -P libxml2-devel -P libxslt-devel -P openldap-devel -P zlib-devel'
+  - sh -l -c "cygserver-config --yes"
+  - sh -l -c "cygrunsrv -S cygserver"
+
+build_script:
+  - set HOME=.
+  - set PATH=%CYG_ROOT%/bin;%PATH%
+  - sh -l -c "./configure --enable-cassert --enable-debug --enable-nls --with-ldap --with-libxml --with-libxslt --with-openssl"
+  - sh -l -c "make world COPT=-Werror"
+
+test_script:
+  - set HOME=.
+  - set PATH=%CYG_ROOT%/bin;%PATH%
+  - sh -l -c "make check-world COPT=-Werror"
+
+on_failure:
+  - set HOME=.
+  - sh -l -c "test -f config.status || cat config.log"
+  - sh -l -c "find . -name regression.diffs | xargs cat"
-- 
2.25.0

0001-AppVeyor-configuration-for-MinGW.patchtext/plain; charset=UTF-8; name=0001-AppVeyor-configuration-for-MinGW.patch; x-mac-creator=0; x-mac-type=0Download
From a04c2140482645a810bfd682b204bac5194eea8d Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <peter@eisentraut.org>
Date: Tue, 10 Mar 2020 19:23:46 +0100
Subject: [PATCH] AppVeyor configuration for MinGW

---
 .appveyor.yml | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)
 create mode 100644 .appveyor.yml

diff --git a/.appveyor.yml b/.appveyor.yml
new file mode 100644
index 0000000000..fffa351e90
--- /dev/null
+++ b/.appveyor.yml
@@ -0,0 +1,31 @@
+environment:
+  matrix:
+    - MSYSTEM: MINGW32
+    - MSYSTEM: MINGW64
+
+# https://www.postgresql.org/message-id/flat/f1caef93-9640-022e-9211-bbe8755a56b0%402ndQuadrant.com
+matrix:
+  allow_failures:
+    - MSYSTEM: MINGW64
+
+install:
+  - set PATH=C:/msys64/usr/bin;%PATH%
+  - sh -l -c "pacman --noconfirm -S --needed ${MINGW_PACKAGE_PREFIX}-gettext ${MINGW_PACKAGE_PREFIX}-icu ${MINGW_PACKAGE_PREFIX}-libxml2 ${MINGW_PACKAGE_PREFIX}-libxslt ${MINGW_PACKAGE_PREFIX}-openssl"
+  - sh -l -c "curl -L http://cpanmin.us | perl - --self-upgrade"
+  - sh -l -c "cpanm --notest IPC::Run"
+
+build_script:
+  - set HOME=.
+  - set PATH=C:/msys64/usr/bin;%PATH%
+  - sh -l -c "./configure --enable-cassert --enable-debug --enable-nls --enable-tap-tests --with-icu --with-ldap --with-libxml --with-libxslt --with-openssl"
+  - sh -l -c "make world COPT=-Werror"
+
+test_script:
+  - set HOME=.
+  - set PATH=C:/msys64/usr/bin;%PATH%
+  - sh -l -c "make check-world COPT=-Werror"
+
+on_failure:
+  - set HOME=.
+  - sh -l -c "test -f config.status || cat config.log"
+  - sh -l -c "find . -name regression.diffs | xargs cat"
-- 
2.25.0

0001-AppVeyor-configuration-for-MSVC.patchtext/plain; charset=UTF-8; name=0001-AppVeyor-configuration-for-MSVC.patch; x-mac-creator=0; x-mac-type=0Download
From ed6610fb02d8c63d66315a83b752de5c6b9b84eb Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <peter@eisentraut.org>
Date: Tue, 10 Mar 2020 19:25:54 +0100
Subject: [PATCH] AppVeyor configuration for MSVC

---
 .appveyor.yml | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
 create mode 100644 .appveyor.yml

diff --git a/.appveyor.yml b/.appveyor.yml
new file mode 100644
index 0000000000..124736ce3a
--- /dev/null
+++ b/.appveyor.yml
@@ -0,0 +1,19 @@
+install:
+  - appveyor-retry cinst winflexbison
+  - rename c:\ProgramData\chocolatey\bin\win_flex.exe flex.exe
+  - rename c:\ProgramData\chocolatey\bin\win_bison.exe bison.exe
+  - '"C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x64'
+  - '"C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" x86_amd64'
+
+configuration:
+  - Release
+
+before_build:
+  - perl src/tools/msvc/mkvcbuild.pl
+
+build:
+  project: pgsql.sln
+
+test_script:
+  - cd src/tools/msvc && vcregress check
+  - cd src/tools/msvc && vcregress ecpgcheck
-- 
2.25.0

#2Thomas Munro
thomas.munro@gmail.com
In reply to: Peter Eisentraut (#1)
Re: some AppVeyor files

On Tue, Mar 24, 2020 at 5:05 AM Peter Eisentraut
<peter.eisentraut@2ndquadrant.com> wrote:

You can also run this yourself without the detour through the commit
fest app. Attached are three patches that add .appveyor.yml files, for
MSVC, MinGW, and Cygwin respectively. (An open problem is to combine
them all into one.) I have been using these regularly over the last few
months to test code on these Windows variants.

Thanks! I added a link to this thread to a Wiki page that tries to
collect information on this topic[1]https://wiki.postgresql.org/wiki/Continuous_Integration. Another thing you could be
interested in is the ability to test on several different MSVC
versions (I tried to find some appveyor.yml files I had around here
somewhere to do that, but no cigar... it's just different paths for
those .bat files that set up the environment).

Here is my current wish list for Windows CI:

1. Run check-world with tap tests.
2. Turn on the equivalent of -Werror (maybe).
3. Turn on asserts.
4. Print backtraces on crash.
5. Dump all potentially relevant logs on failure (initdb.log,
regression.diff etc).
6. Find a Windows thing that is like ccache and preserve its cache
across builds (like Travis, which saves some build time).

[1]: https://wiki.postgresql.org/wiki/Continuous_Integration

#3Mike Palmiotto
mike.palmiotto@crunchydata.com
In reply to: Thomas Munro (#2)
Re: some AppVeyor files

On Tue, Mar 24, 2020 at 10:27 PM Thomas Munro <thomas.munro@gmail.com> wrote:

Thanks! I added a link to this thread to a Wiki page that tries to
collect information on this topic[1]. Another thing you could be
interested in is the ability to test on several different MSVC
versions (I tried to find some appveyor.yml files I had around here
somewhere to do that, but no cigar... it's just different paths for
those .bat files that set up the environment).

Here is my current wish list for Windows CI:

1. Run check-world with tap tests.
2. Turn on the equivalent of -Werror (maybe).
3. Turn on asserts.
4. Print backtraces on crash.
5. Dump all potentially relevant logs on failure (initdb.log,
regression.diff etc).

FWIW, you can RDP to the AppVeyor instance by setting an appveyor
password and pausing the machine on failure[1]https://www.appveyor.com/docs/how-to/rdp-to-build-worker/. I played around with
setting the registry key to add localdumps for postgres with the
intent of feeding those to procdump. I didn't have any success with
generating dump files, but that also could have been because I wasn't
getting actual crashes.

At any rate, getting into the machine is useful in general for getting
more post-build/post-failure information, in case you weren't
configured for it already.

[1]: https://www.appveyor.com/docs/how-to/rdp-to-build-worker/

Thanks,
--
Mike Palmiotto
https://crunchydata.com