]> www.infradead.org Git - users/sagi/libnvme.git/commitdiff
github workflows: Add an armhf cross build
authorJeremy Kerr <jk@codeconstruct.com.au>
Sat, 24 Sep 2022 02:49:16 +0000 (10:49 +0800)
committerJeremy Kerr <jk@codeconstruct.com.au>
Sat, 24 Sep 2022 05:08:21 +0000 (13:08 +0800)
This RFC change adds a github workflow for a cross-compile of libnvme on
armhf. We use a similar setup to the build-distro job, but install a
suitable cross compiler and provide a cross config to meson.

We currently setup with -Dpython=false, as the setup-python@v4 seems to
assume a native python build. We may be able to remove this later.

The suitability of this will depend on the resources available for
actions; doing some test runs on a private repo shows an execution time
of about 1 min 15 sec - a little less than the build-static job.

Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
.github/cross/ubuntu-armhf.txt [new file with mode: 0644]
.github/workflows/meson.yml

diff --git a/.github/cross/ubuntu-armhf.txt b/.github/cross/ubuntu-armhf.txt
new file mode 100644 (file)
index 0000000..2eee70b
--- /dev/null
@@ -0,0 +1,17 @@
+[binaries]
+c = '/usr/bin/arm-linux-gnueabihf-gcc'
+ar = '/usr/arm-linux-gnueabihf/bin/ar'
+strip = '/usr/arm-linux-gnueabihf/bin/strip'
+pkgconfig = '/usr/bin/arm-linux-gnueabihf-pkg-config'
+ld = '/usr/bin/arm-linux/gnueabihf-ld'
+
+[properties]
+root = '/usr/arm-linux-gnueabihf'
+has_function_printf = true
+skip_sanity_check = true
+
+[host_machine]
+system = 'linux'
+cpu_family = 'arm'
+cpu = 'armv7'
+endian = 'little'
index 9006eaec3048953b48ec3e6f9fbb68970bdadec0..e0d0cef542e9994f17a2ec461b6f4e6df9433e79 100644 (file)
@@ -30,6 +30,36 @@ jobs:
           name: Linux_Meson_Testlog
           path: build/meson-logs/testlog.txt
 
+  build-cross-armhf:
+    runs-on: ubuntu-latest
+    steps:
+      - name: set up arm architecture
+        run: |
+          export release=$(lsb_release -c -s)
+          sudo dpkg --add-architecture armhf
+          sudo sed -i -e 's/deb http/deb [arch=amd64] http/g' /etc/apt/sources.list
+          sudo dd of=/etc/apt/sources.list.d/armhf.list <<EOF
+          deb [arch=armhf] http://ports.ubuntu.com/ $release main universe restricted"
+          deb [arch=armhf] http://ports.ubuntu.com/ $release-updates main universe restricted"
+          EOF
+          sudo apt update
+      - name: install armhf compiler
+        run: sudo apt install gcc-arm-linux-gnueabihf pkg-config
+      - name: install libraries
+        run: sudo apt install uuid-dev:armhf libjson-c-dev:armhf
+      - uses: actions/checkout@v3
+      - uses: BSFishy/meson-build@v1.0.3
+        with:
+          # suppress python for now; the python headers currently assume native
+          setup-options: --werror --cross-file=.github/cross/ubuntu-armhf.txt --wrap-mode=nofallback -Dpython=false
+          options: --verbose
+          action: build
+      - uses: actions/upload-artifact@v3
+        if: failure()
+        with:
+          name: Linux_Meson_Testlog
+          path: build/meson-logs/testlog.txt
+
   build-fallback:
     runs-on: ubuntu-latest
     steps: