Re: Cirrus CI (Windows help wanted)

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Cirrus CI (Windows help wanted)
Date: 2021-01-12 14:04:51
Message-ID: 7e6844c5-11f7-2bc1-9087-c1372475fd1e@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On 1/5/21 11:19 PM, Thomas Munro wrote:
>
> It seems we can make our own, either on-the-fly with caching, or
> hosted somewhere, like this:
>
> https://cirrus-ci.org/guide/docker-builder-vm/#dockerfile-as-a-ci-environment
>
>

OK, I got this working.

There is some weirdness that I had to work around in the way they do
docker. So here's what works for me, with the docker image nicely cached
even across repos:

.cirrus.yml:

task:
  name: Windows
  windows_container:
    dockerfile: ci/Dockerfile
  build_script:
      - cd "c:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Auxiliary/Build"
      - vcvarsall x64
      - echo on
      - cd C:\Users\ContainerAdministrator\AppData\Local\Temp\cirrus-ci-build
      - set PATH=C:\strawberry\perl\bin;%PATH%
      - perl src/tools/msvc/mkvcbuild.pl
      - set IgnoreWarnIntDirInTempDetected=true
      - msbuild pgsql.sln
  test_script:
      - set PATH=C:\strawberry\perl\bin;%PATH%
      - perl src/tools/msvc/vcregress.pl check

ci/Dockerfile:

FROM cirrusci/windowsservercore:2019

SHELL ["powershell", "-NoLogo", "-NoProfile", "-Command"]

RUN \
    pwd ; \
    choco feature disable -n=usePackageExitCodes ; \
    choco install -y --no-progress --version=16.8.3.0 visualstudio2019buildtools

# cirrus does something odd with this command, so it's stuck in a bat file
# and copied to the docker container and then executed
COPY ci/inst-tools.bat .
RUN \
    cmd /c .\inst-tools.bat

RUN \
    choco install -y --no-progress strawberryperl ; \
    choco install -y --no-progress winflexbison diffutils ; \
    Rename-Item -Path c:\ProgramData\chocolatey\bin\win_flex.exe flex.exe ; \
    Rename-Item -Path c:\ProgramData\chocolatey\bin\win_bison.exe bison.exe ; \
    Remove-Item C:\ProgramData\chocolatey\logs\*.* -Force -Recurse ; \
    Remove-Item C:\Users\ContainerAdministrator\AppData\Local\Temp\*.* -Force -Recurse

ci/inst-tools.bat:

choco install -y --no-progress --version=1.0.0 visualstudio2019-workload-vctools  --install-args="--add Microsoft.VisualStudio.Component.VC.CLI.Support"

cheers

andrew

--
Andrew Dunstan
EDB: https://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Konstantin Knizhnik 2021-01-12 14:05:22 Re: libpq compression
Previous Message Heikki Linnakangas 2021-01-12 13:49:36 Re: Yet another fast GiST build