@@ -17,13 +17,17 @@ jobs:
17
17
parameters :
18
18
XCODE_VER :
19
19
type : string
20
- default : " 12.5.1"
20
+ # https://circleci.com/docs/using-macos/#supported-xcode-versions-silicon
21
+ default : " 13.4.1"
21
22
CC :
22
23
type : string
23
24
default : " " # e.g. "clang"
24
25
CXX :
25
26
type : string
26
27
default : " " # e.g. "clang++"
28
+ CPP :
29
+ type : string
30
+ default : " " # e.g. "clang -E"
27
31
CC_STDVER :
28
32
type : string
29
33
default : " " # e.g. "-std=gnu17"
@@ -39,15 +43,27 @@ jobs:
39
43
BREW_MORE :
40
44
type : string
41
45
default : " " # e.g. "avahi" for all-driver tests
46
+ # HOMEBREW_PREFIX:
47
+ # Detected below at run-time
48
+ # See https://docs.brew.sh/Installation :
49
+ # * /opt/homebrew for Apple Silicon,
50
+ # * /usr/local for macOS Intel and
51
+ # * /home/linuxbrew/.linuxbrew for Linux
52
+ # TODO: Find a way to select one of the values based on the platform?
53
+ # type: string
54
+ # default: "/opt/homebrew" # since July 2024 CircleCI only serves Apple Silicon instances
55
+ # default: "/usr/local" # was when CircleCI builders had x86
42
56
43
57
environment :
44
58
CC : << parameters.CC >>
45
59
CXX : << parameters.CXX >>
60
+ CPP : << parameters.CPP >>
46
61
CC_STDVER : << parameters.CC_STDVER >>
47
62
CXX_STDVER : << parameters.CXX_STDVER >>
48
63
BUILD_TYPE : << parameters.BUILD_TYPE >>
49
64
CI_BUILDDIR : << parameters.CI_BUILDDIR >>
50
65
BREW_MORE : << parameters.BREW_MORE >>
66
+ # HOMEBREW_PREFIX: << parameters.HOMEBREW_PREFIX >>
51
67
52
68
# Specify the execution environment. You can specify an image from Dockerhub or use one of our Convenience Images from CircleCI's Developer Hub.
53
69
# See: https://circleci.com/docs/2.0/configuration-reference/#docker-machine-macos-windows-executor
@@ -65,25 +81,68 @@ jobs:
65
81
66
82
# Note: MacOS default /bin/bash 3.x is too old for ci_build.sh
67
83
# Brew brings /usr/local/bin/bash 5.x as of this writing
68
- # TODO: Are Binutils needed?
84
+ # We also reinstall/relink openssl@3 because asciidoc deps pull
85
+ # in openssl@1 and MAYBE they conflict (cause lack of exposed
86
+ # symlinks).
69
87
- run :
70
88
name : " homebrew"
71
89
command : |-
72
90
HOMEBREW_NO_AUTO_UPDATE=1; export HOMEBREW_NO_AUTO_UPDATE;
73
- brew install ccache bash libtool pkg-config gd libusb neon net-snmp openssl $BREW_MORE #binutils
91
+ brew install ccache bash libtool binutils autoconf automake git m4 \
92
+ pkg-config aspell asciidoc docbook-xsl cppunit gd \
93
+ libusb neon net-snmp \
94
+ nss openssl \
95
+ libmodbus freeipmi powerman $BREW_MORE
96
+ #brew reinstall openssl@3
97
+ if ps -ef | grep -v grep | grep sshd ; then
98
+ brew install mc
99
+ ifconfig -a || true
100
+ fi
74
101
75
- # - run:
76
- # name: "homebrew-libtool"
77
- # command: |-
78
- # #find /usr /opt /lib* -name '*ltdl*' -ls 2>/dev/null || true
79
- # brew unlink libtool && brew link libtool
80
- # #find /usr /opt /lib* -name '*ltdl*' -ls 2>/dev/null || true
102
+ # https://github.com/Homebrew/legacy-homebrew/issues/15488
103
+ - run :
104
+ name : " homebrew-relink"
105
+ command : |-
106
+ #find /usr /opt /lib* -name '*ltdl*' -ls 2>/dev/null || true
107
+ brew unlink libtool && brew link libtool
108
+ #find /usr /opt /lib* -name '*ltdl*' -ls 2>/dev/null || true
109
+ brew info openssl
110
+ #brew info openssl@3
111
+ #brew info openssl@1.1
112
+ #command -v pkg-config || true
113
+ #pkg-config --list-all || true
114
+ #HOMEBREW_PREFIX="`brew config | grep HOMEBREW_PREFIX: | awk '{print $2}'`"
115
+ #ls -la "${HOMEBREW_PREFIX}/lib/pkgconfig" || true
116
+ #ls -la "${HOMEBREW_PREFIX}/include/openssl" || true
117
+ #ls -la "${HOMEBREW_PREFIX}/include/openssl"/* || true
118
+ #find "${HOMEBREW_PREFIX}"/Cellar/openssl* -ls || true
119
+ pkg-config --libs --cflags nss
120
+ pkg-config --libs --cflags openssl || {
121
+ brew unlink openssl && brew link --force openssl
122
+ pkg-config --libs --cflags openssl ; }
123
+ brew unlink net-snmp && brew link --force net-snmp
81
124
82
125
- restore_cache :
83
126
keys :
84
127
- ccache-{{ .Branch }}-{{ arch }}-{{ .Environment.CIRCLE_JOB }}
85
128
- ccache-master-{{ arch }}-{{ .Environment.CIRCLE_JOB }}
86
129
130
+ # Help SEMVER look right (optionally)
131
+ - run :
132
+ name : " fetch git tags"
133
+ command : git fetch --tags || true
134
+
135
+ # Fail fast if we had a problem with prerequisites - this
136
+ # situation would likely impact all build branches anyway.
137
+ # Requires a Personal API token in the building account:
138
+ # https://support.circleci.com/hc/en-us/articles/360052058811-Exit-Build-Early-if-Any-Test-Fails
139
+ - run :
140
+ name : Fail Fast
141
+ when : on_fail
142
+ command : |-
143
+ echo "Canceling workflow as a step resulted in failure"
144
+ curl -X POST --header "Content-Type: application/json" "https://circleci.com/api/v2/workflow/${CIRCLE_WORKFLOW_ID}/cancel?circle-token=${CIRCLE_TOKEN}"
145
+
87
146
# - run:
88
147
# name: "check shell"
89
148
# command: /usr/bin/env bash --version || true; command -v bash || true
@@ -99,14 +158,16 @@ jobs:
99
158
# uses of sem_init() and sem_destroy() in nut-scanner.c)
100
159
# NOTE: CANBUILD_NIT_TESTS=yes to check if single-executor environments
101
160
# do not have a problem with it.
161
+ # NOTE: python3.11 is available but broken on some of the workers
162
+ # (no homebrew dirs in search path)
102
163
- run :
103
164
name : " ci_build"
104
165
command : |-
105
- CI_CCACHE_SYMLINKDIR="/usr/local/opt/ccache/libexec " \
166
+ HOMEBREW_PREFIX="`brew config | grep HOMEBREW_PREFIX: | awk '{print $2}'` " \
106
167
CANBUILD_NIT_TESTS=yes \
107
- CFLAGS="$CC_STDVER -Wno-poison-system-directories -Wno-deprecated-declarations " \
108
- CXXFLAGS="$CXX_STDVER -Wno-poison-system-directories " \
109
- LDFLAGS="-L/usr/local/lib" \
168
+ CFLAGS="$CC_STDVER" \
169
+ CXXFLAGS="$CXX_STDVER" \
170
+ PYTHON=python3.11 \
110
171
./ci_build.sh
111
172
112
173
- run :
@@ -125,53 +186,81 @@ jobs:
125
186
- ~/.ccache
126
187
key : ccache-{{ .Branch }}-{{ arch }}-{{ .Environment.CIRCLE_JOB }}
127
188
189
+ - store_artifacts :
190
+ path : config.log
191
+
192
+ - store_artifacts :
193
+ path : config.nut_report_feature.log
194
+
195
+
128
196
# Invoke jobs via workflows
129
197
# See: https://circleci.com/docs/2.0/configuration-reference/#workflows
130
198
workflows :
131
199
xcode-workflow :
132
200
jobs :
133
201
# Note: while "ccache" lists hordes of symlinks to gcc-XXX versions,
134
202
# in practice these toolkits are not installed (by default)
203
+ # or actually identify as clang
135
204
136
205
# ## This scenario is a subset of fightwarn-all below (modulo C standard),
137
206
# ## so disabled to not waste time from free CircleCI allowance limit:
138
207
# - osx-xcode:
139
- # name: "gnu17-clang-xcode12_5_1 -default-all-errors"
140
- # XCODE_VER: "12.5 .1"
208
+ # name: "gnu17-clang-xcode13_4_1 -default-all-errors"
209
+ # XCODE_VER: "13.4 .1"
141
210
# CC: "clang"
142
211
# CXX: "clang++"
143
212
# CC_STDVER: "-std=gnu17"
144
213
# CXX_STDVER: "-std=gnu++17"
145
214
215
+ # - osx-xcode:
216
+ # name: "gnu11-gcc-xcode13_4_1-out-of-tree"
217
+ # CC: "gcc"
218
+ # CXX: "g++"
219
+ # CC_STDVER: "-std=gnu11"
220
+ # CXX_STDVER: "-std=gnu++11"
221
+ # # Try an out-of-tree build:
222
+ # CI_BUILDDIR: "obj"
223
+
224
+ # - osx-xcode:
225
+ # name: "c99-cxx11-gcc-xcode13_4_1-default-distcheck"
226
+ # CC: "gcc"
227
+ # CXX: "g++"
228
+ # CC_STDVER: "-std=c99"
229
+ # CXX_STDVER: "-std=c++11"
230
+ # # Try usual and distchecked build:
231
+ # BUILD_TYPE: "default"
232
+
146
233
- osx-xcode :
147
- name : " gnu11-gcc-xcode12_5_1-out-of-tree"
148
- CC : " gcc"
149
- CXX : " g++"
234
+ name : " gnu11-clang-xcode13_4_1-out-of-tree"
235
+ CC : " clang"
236
+ CXX : " clang++"
237
+ CPP : " clang -E"
150
238
CC_STDVER : " -std=gnu11"
151
239
CXX_STDVER : " -std=gnu++11"
152
240
# Try an out-of-tree build:
153
241
CI_BUILDDIR : " obj"
154
242
155
243
- osx-xcode :
156
- name : " c99-cxx11-gcc-xcode12_5_1-default-distcheck"
157
- CC : " gcc"
158
- CXX : " g++"
244
+ name : " c99-cxx11-clang-xcode13_4_1-default-distcheck"
245
+ CC : " clang"
246
+ CXX : " clang++"
247
+ CPP : " clang -E"
159
248
CC_STDVER : " -std=c99"
160
249
CXX_STDVER : " -std=c++11"
161
250
# Try usual and distchecked build:
162
251
BUILD_TYPE : " default"
163
252
164
253
- osx-xcode :
165
- name : " stdDefault-xcode12_5_1 -fightwarn-all"
254
+ name : " stdDefault-xcode13_4_1 -fightwarn-all"
166
255
# Run "default-all-errors" with both compiler families,
167
256
# using their default C/C++ standard for current release:
168
257
BUILD_TYPE : " fightwarn-all"
169
258
170
259
# ## This does not work due to missing dependencies built for MacOS in homebrew:
171
260
# ## TODO? Evaluate other packagers (MacPorts, fink...)?
172
261
# - osx-xcode:
173
- # name: "c17-clang-xcode12_5_1 -alldrv"
174
- # XCODE_VER: "12.5 .1"
262
+ # name: "c17-clang-xcode13_4_1 -alldrv"
263
+ # XCODE_VER: "13.4 .1"
175
264
# CC: "clang"
176
265
# CXX: "clang++"
177
266
# CC_STDVER: "-std=c17"
0 commit comments