Skip to contentSkip to conversation

Improve FreeBSD and macOS jobs in the Cirrus-CI

PATCH In review Thomas Huth 2 participants 8 messages Jul 28, 2020

lore
Share & tools
lore
#0 lore raw

v2 cover Improve FreeBSD and macOS jobs in the Cirrus-CI

Our configure script does not enable -Werror on macOS and FreeBSD by default yet. That's bad in the CI, since we might miss compiler warnings and thus bugs this way. So after fixing a problem in the configure script in the first patch, we now turn on -Werror here in the second and third patch. The fourth patch is just a cosmetical one, since Cirrus-CI seems to upgrade all jobs automatically to Cataline these days.

v2:
- Split the -Werror enablement patch into two, one for FreeBSD and one for macOS
- Use -Wno-error=deprecated-declarations instead of --disable-sasl on macOS to work-around the deprecation messages from Apple.

Thomas Huth (4):
configure: Fix atomic64 test for --enable-werror on macOS cirrus.yml: Compile FreeBSD with -Werror cirrus.yml: Compile macOS with -Werror cirrus.yml: Update the macOS jobs to Catalina

 .cirrus.yml | 13 ++++++++-----
 configure   | 10 +++++-----
 2 files changed, 13 insertions(+), 10 deletions(-)
Signature · 1 line
2.18.1
#1 lore raw

PATCH v2 1/4 configure: Fix atomic64 test for --enable-werror on macOS

When using --enable-werror for the macOS builders in the Cirrus-CI, the atomic64 test is currently failing, and config.log shows a bunch of error messages like this:

config-temp/qemu-conf.c:6:7: error: implicit declaration of function '__atomic_load_8' is invalid in C99 [-Werror,-Wimplicit-function-declaration]

  y = __atomic_load_8(&x, 0);
      ^

config-temp/qemu-conf.c:6:7: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes]

Seems like these __atomic_*_8 functions are available in one of the libraries there, so that the test links and passes there when not using --enable-werror. But there does not seem to be a valid prototype for them in any of the header files, so that the test fails when using --enable-werror.

Fix it by using the "official" built-in functions instead (see e.g.
https://gcc.gnu.org/onlinedocs/gcc/_005f_005fatomic-Builtins.html).
We are not using the *_8 variants in QEMU anyway.

---
 configure | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
configure +5 -5
index 2acc4d1465..6fbc72c794 100755
@@ -5919,11 +5919,11 @@ int main(void)
 {
   uint64_t x = 0, y = 0;
 #ifdef __ATOMIC_RELAXED
-  y = __atomic_load_8(&x, 0);
-  __atomic_store_8(&x, y, 0);
-  __atomic_compare_exchange_8(&x, &y, x, 0, 0, 0);
-  __atomic_exchange_8(&x, y, 0);
-  __atomic_fetch_add_8(&x, y, 0);
+  y = __atomic_load_n(&x, __ATOMIC_RELAXED);
+  __atomic_store_n(&x, y, __ATOMIC_RELAXED);
+  __atomic_compare_exchange_n(&x, &y, x, 0, __ATOMIC_RELAXED, __ATOMIC_RELAXED);
+  __atomic_exchange_n(&x, y, __ATOMIC_RELAXED);
+  __atomic_fetch_add(&x, y, __ATOMIC_RELAXED);
 #else
   typedef char is_host64[sizeof(void *) >= sizeof(uint64_t) ? 1 : -1];
   __sync_lock_test_and_set(&x, y);
Signature · 1 line
2.18.1
#2 lore raw

PATCH v2 2/4 cirrus.yml: Compile FreeBSD with -Werror

In reply to Thomas Huth

Compiler warnings currently go unnoticed in our FreeBSD builds, since -Werror is only enabled for Linux and MinGW builds by default. So let's enable them here now, too.

---
 .cirrus.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
.cirrus.yml +1 -1
index f287d23c5b..b50da72eec 100644
@@ -12,7 +12,7 @@ freebsd_12_task:
   script:
     - mkdir build
     - cd build
-    - ../configure || { cat config.log; exit 1; }
+    - ../configure --enable-werror || { cat config.log; exit 1; }
     - gmake -j8
     - gmake V=1 check
 
Signature · 1 line
2.18.1
Reviewed-by on v2 2/4
#3 lore raw

Re: [PATCH v2 2/4] cirrus.yml: Compile FreeBSD with -Werror

Quoted 9 lines · Thomas Huth

Compiler warnings currently go unnoticed in our FreeBSD builds, since -Werror is only enabled for Linux and MinGW builds by default. So let's enable them here now, too.

---
 .cirrus.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Regards,
Daniel

Signature · 3 lines
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
#4 lore raw

PATCH v2 3/4 cirrus.yml: Compile macOS with -Werror

In reply to Thomas Huth

Compiler warnings currently go unnoticed in our macOS builds, since -Werror is only enabled for Linux and MinGW builds by default. So let's enable them here now, too.
Unfortunately, the sasl header is marked as deprecated in the macOS headers and thus generates a lot of deprecation warnings. Thus we have to also use -Wno-error=deprecated-declarations to be able to compile the code here.

---
 .cirrus.yml | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
.cirrus.yml +5 -2
index b50da72eec..86a059c12f 100644
@@ -24,7 +24,9 @@ macos_task:
   script:
     - mkdir build
     - cd build
-    - ../configure --python=/usr/local/bin/python3 || { cat config.log; exit 1; }
+    - ../configure --python=/usr/local/bin/python3 --enable-werror
+                   --extra-cflags='-Wno-error=deprecated-declarations'
+                   || { cat config.log; exit 1; }
     - gmake -j$(sysctl -n hw.ncpu)
     - gmake check
 
@@ -37,6 +39,7 @@ macos_xcode_task:
   script:
     - mkdir build
     - cd build
-    - ../configure --cc=clang || { cat config.log; exit 1; }
+    - ../configure --extra-cflags='-Wno-error=deprecated-declarations'
+                   --enable-werror --cc=clang || { cat config.log; exit 1; }
     - gmake -j$(sysctl -n hw.ncpu)
     - gmake check
Signature · 1 line
2.18.1
Reviewed-by on v2 3/4
#5 lore raw

Re: [PATCH v2 3/4] cirrus.yml: Compile macOS with -Werror

Quoted 11 lines · Thomas Huth

Compiler warnings currently go unnoticed in our macOS builds, since -Werror is only enabled for Linux and MinGW builds by default. So let's enable them here now, too.
Unfortunately, the sasl header is marked as deprecated in the macOS headers and thus generates a lot of deprecation warnings. Thus we have to also use -Wno-error=deprecated-declarations to be able to compile the code here.

---
 .cirrus.yml | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

Regards,
Daniel

Signature · 3 lines
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
#6 lore raw

PATCH v2 4/4 cirrus.yml: Update the macOS jobs to Catalina

In reply to Thomas Huth

When looking at the CI jobs on cirrus-ci.com, it seems like the mojave-based images have been decomissioned a while ago already, since apparently all our jobs get automatically upgraded to catalina. So let's update our YML script accordingly to avoid confusion.

---
 .cirrus.yml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
.cirrus.yml +2 -2
index 86a059c12f..0742aaf8a3 100644
@@ -18,7 +18,7 @@ freebsd_12_task:
 
 macos_task:
   osx_instance:
-    image: mojave-base
+    image: catalina-base
   install_script:
     - brew install pkg-config python gnu-sed glib pixman make sdl2 bash
   script:
@@ -33,7 +33,7 @@ macos_task:
 macos_xcode_task:
   osx_instance:
     # this is an alias for the latest Xcode
-    image: mojave-xcode
+    image: catalina-xcode
   install_script:
     - brew install pkg-config gnu-sed glib pixman make sdl2 bash
   script:
Signature · 1 line
2.18.1
Reviewed-by on v2 4/4
#7 lore raw

Re: [PATCH v2 4/4] cirrus.yml: Update the macOS jobs to Catalina

Quoted 10 lines · Thomas Huth

When looking at the CI jobs on cirrus-ci.com, it seems like the mojave-based images have been decomissioned a while ago already, since apparently all our jobs get automatically upgraded to catalina. So let's update our YML script accordingly to avoid confusion.

---
 .cirrus.yml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Regards,
Daniel

Signature · 3 lines
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|