Setting up PostgreSQL buildfarm animal

Generic instructions are here

PostgreSQL Buildfarm Howto - PostgreSQL wiki

Following instructions are setting up an MSVC-based buildfarm animal for Windows on Arm machine.

Install build dependencies

See 18.1. Building with Visual C++ or the Microsoft Windows SDK

Tested with the following tools and seems to work.

  • Strawberry Perl

  • Make

  • Flex and bison (Installed with MSYS2 works)

  • MSVC toolchain (v142)

  • OpenSSL (Installed with vcpkg)

  • Python 3.10

Enable Developer Mode

Buildfarm scripts require mklink to create symbolic links. By default, only admins can create symbolic links unless developer mode is enabled.

Search | HUAWEI Support Global

Download and configure buildfarm animal scripts

Download scripts from http://buildfarm.postgresql.org/downloads

Copy build_farm.config.sample to build_farm.config and make following changes

  1. Add credentials for buildfarm animal

animal => "Linaro", secret => "...",

To request credentials - https://buildfarm.postgresql.org/cgi-bin/register-form.pl

2. Add SCM repository

Default is a community git repository but can be changed to either use GitHub official mirror or a fork

scmrepo => 'https://github.com/nsait-linaro/postgres.git', # default

3. Enable MSVC

using_msvc => 1,

4. Set MAX_CONNECTIONS in build_env

MAX_CONNECTIONS => '3',

5. Set base_port

Note: This might not be required after upstreaming local changes

base_port => 5432

6. Change MSVC setup to match the following config

# MSVC setup if ($conf{using_msvc}) { # get the settings from the VisualStudio installation require "PGBuild/VSenv.pm"; ## no critic (RequireBarewordIncludes) # ancestor of vcvarsall.bat script we will use my $VSdir = "c:/Program Files (x86)/Microsoft Visual Studio/2019"; # the more specific you are here the quicker the search will be # e.g. # $VSdir = "$VSdir/BuildTools/VC/Auxiliary/Build"; my $vsenv = PGBuild::VSenv::getenv($VSdir, 'x86_arm64'); # add other elements to the PATH, LIB and INCLUDE if needed $vsenv->{PATH} = join(';', 'C:/Users/niysai01/AppData/Local/Microsoft/WindowsApps/', 'C:/Strawberry/perl/bin/', 'C:/msys64/usr/bin/', 'c:/windows/system32/', 'C:/Program Files/Git/cmd/' ,'C:/Users/niysai01/workspace/openssl_install/release/bin/', $vsenv->{PATH}); %{ $conf{build_env} } = (%{ $conf{build_env} }, %$vsenv); # MSVC needs a somewhat different style of config opts (why??) # What we write here will be literally (via Data::Dumper) put into # the config.pl file for the MSVC build. $conf{config_opts} = { asserts => 1, # --enable-cassert integer_datetimes => 1, # --enable-integer-datetimes nls => undef, # --enable-nls=<path> tcl => undef, # --with-tcl=<path> perl => undef, # --with-perl=<path> python => undef, # --with-python=<path> krb5 => undef, # --with-krb5=<path> ldap => 0, # --with-ldap openssl => 'C:\Users\niysai01\Workspace\openssl_install\release', # --with-ssl=<path> xml => undef, # --with-libxml=<path> xslt => undef, # --with-libxslt=<path>, iconv => undef, # path to iconv library zlib => undef, # --with-zlib=<path> tap_tests => undef, # --enable-tap-tests }; }

Remember to add required paths to $vsenv->{PATH}

Example buildfarm.config used for a successful run.

 

Â