8000 ci: Change macOS builds from Intel to ARM. · postgres/postgres@dc513bc · GitHub
[go: up one dir, main page]

Skip to content

Commit dc513bc

Browse files
committed
ci: Change macOS builds from Intel to ARM.
Cirrus is about to shut down its macOS-on-Intel support, so it's time to move our CI testing over to ARM instances. The Homebrew package manager changed its default installation prefix for the new architecture, so a couple of tests need tweaks to find binaries. Back-patch to 15, where in-tree CI began. Author: Justin Pryzby <pryzby@telsasoft.com> Discussion: https://postgr.es/m/20221122225744.GF11463%40telsasoft.com
1 parent c4f64cf commit dc513bc

File tree

3 files changed

+19
-6
lines changed

3 files changed

+19
-6
lines changed

.cirrus.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ task:
224224
name: macOS - Monterey
225225

226226
env:
227-
CPUS: 12 # always get that much for cirrusci macOS instances
227+
CPUS: 4 # always get that much for cirrusci macOS instances
228228
BUILD_JOBS: $CPUS
229229
# Test performance regresses noticably when using all cores. 8 seems to
230230
# work OK. See
@@ -238,8 +238,8 @@ task:
238238

239239
only_if: $CIRRUS_CHANGE_MESSAGE !=~ '.*\nci-os-only:.*' || $CIRRUS_CHANGE_MESSAGE =~ '.*\nci-os-only:[^\n]*(macos|darwin|osx).*'
240240

241-
osx_instance:
242-
image: monterey-base
241+
macos_instance:
242+
image: ghcr.io/cirruslabs/macos-monterey-base:latest
243243

244244
sysinfo_script: |
245245
id
@@ -284,7 +284,7 @@ task:
284284
ccache_cache:
285285
folder: $CCACHE_DIR
286286
configure_script: |
287-
brewpath="/usr/local"
287+
brewpath="/opt/homebrew"
288288
INCLUDES="${brewpath}/include:${INCLUDES}"
289289
LIBS="${brewpath}/lib:${LIBS}"
290290

src/test/kerberos/t/001_auth.pl

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,15 @@
2828

2929
my ($krb5_bin_dir, $krb5_sbin_dir);
3030

31-
if ($^O eq 'darwin')
31+
if ($^O eq 'darwin' && -d "/opt/homebrew" )
3232
{
33+
# typical paths for Homebrew on ARM
34+
$krb5_bin_dir = '/opt/homebrew/opt/krb5/bin';
35+
$krb5_sbin_dir = '/opt/homebrew/opt/krb5/sbin';
36+
}
37+
elsif ($^O eq 'darwin')
38+
{
39+
# typical paths for Homebrew on Intel
3340
$krb5_bin_dir = '/usr/local/opt/krb5/bin';
3441
$krb5_sbin_dir = '/usr/local/opt/krb5/sbin';
3542
}

src/test/ldap/t/001_auth.pl

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,15 @@
1616
{
1717
plan skip_all => 'LDAP not supported by this build';
1818
}
19+
elsif ($^O eq 'darwin' && -d '/opt/homebrew/opt/openldap')
20+
{
21+
# typical paths for Homebrew on ARM
22+
$slapd = '/opt/homebrew/opt/openldap/libexec/slapd';
23+
$ldap_schema_dir = '/opt/homebrew/etc/openldap/schema';
24+
}
1925
elsif ($^O eq 'darwin' && -d '/usr/local/opt/openldap')
2026
{
21-
# typical paths for Homebrew
27+
# typical paths for Homebrew on Intel
2228
$slapd = '/usr/local/opt/openldap/libexec/slapd';
2329
$ldap_schema_dir = '/usr/local/etc/openldap/schema';
2430
}

0 commit comments

Comments
 (0)
0