From fd9a7493eb9a602b88e3a2586bed5e4531e2de5d Mon Sep 17 00:00:00 2001
From: Brent Huisman <brenthuisman@users.noreply.github.com>
Date: Thu, 15 Dec 2022 16:19:45 +0100
Subject: [PATCH] CI fixes for wheel building, prep for musllinux, Spack
 (#2069)

* Python Wheel workflow uses `ubuntu-20.04` to fix the build
  * In #2058 I forgot to update `ciwheel.yml`
* Why this is necessarily: still have not figured it out. `cibuildwheel`
builds and tests in it's own container...
  * [x] https://github.com/brenthuisman/arbor/actions/runs/3704419712
* Small change to make `musllinux` wheels build. They don't pass testing
yet, so I don't add them to the workflow but that can be solved/added
[later](https://github.com/pypa/cibuildwheel/issues/1376)
* The reason for using `ubuntu-20.04` in the Spack workflow should [no
longer exist](https://github.com/actions/runner-images/issues/6724).
---
 .github/workflows/ciwheel.yml | 8 ++++----
 .github/workflows/spack.yml   | 2 +-
 arbor/hardware/memory.cpp     | 4 ++--
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/.github/workflows/ciwheel.yml b/.github/workflows/ciwheel.yml
index 7a8c54b1..809c978e 100644
--- a/.github/workflows/ciwheel.yml
+++ b/.github/workflows/ciwheel.yml
@@ -14,7 +14,7 @@ on:
 jobs:
   get_timestamp:
     name: Prep VERSION
-    runs-on: ubuntu-latest
+    runs-on: ubuntu-20.04
 
     steps:
       - name: Get Arbor
@@ -35,7 +35,7 @@ jobs:
     runs-on: ${{ matrix.os }}
     strategy:
       matrix:
-        os: [ubuntu-latest, macos-latest]
+        os: [ubuntu-20.04, macos-latest]
 
     steps:
       - name: Get Arbor
@@ -62,7 +62,7 @@ jobs:
   build_sdist:
     name: Build sdist
     needs: get_timestamp
-    runs-on: ubuntu-latest
+    runs-on: ubuntu-20.04
 
     steps:
       - name: Get packages
@@ -94,7 +94,7 @@ jobs:
 
   upload_test_pypi:
     name: upload to test pypi
-    runs-on: ubuntu-latest
+    runs-on: ubuntu-20.04
     needs: [build_binary_wheels, build_sdist]
     steps:
       - uses: actions/download-artifact@v3
diff --git a/.github/workflows/spack.yml b/.github/workflows/spack.yml
index a9c5bdd8..db8aa52e 100644
--- a/.github/workflows/spack.yml
+++ b/.github/workflows/spack.yml
@@ -11,7 +11,7 @@ jobs:
     runs-on: ${{ matrix.os }}
     strategy:
       matrix:
-        os: [ubuntu-20.04]
+        os: [ubuntu-22.04]
         python-version: [3.8]
     steps:
       - name: Checkout
diff --git a/arbor/hardware/memory.cpp b/arbor/hardware/memory.cpp
index f2370a68..ba3fce67 100644
--- a/arbor/hardware/memory.cpp
+++ b/arbor/hardware/memory.cpp
@@ -14,9 +14,9 @@ extern "C" {
 namespace arb {
 namespace hw {
 
-#if defined(__linux__)
+#if defined(__linux__) && defined(__GLIBC__)
 memory_size_type allocated_memory() {
-#if defined(__GLIBC__) && (__GLIBC__ > 2 || ((__GLIBC__ == 2) && (__GLIBC_MINOR__ >= 33)))
+#if __GLIBC__ > 2 || ((__GLIBC__ == 2) && (__GLIBC_MINOR__ >= 33))
     auto m = mallinfo2();
 #else
     auto m = mallinfo();
-- 
GitLab