Skip to content

Commit efaebc7

Browse files
committed
github workflows: Add an armhf cross build
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 <[email protected]>
1 parent 901bd0a commit efaebc7

2 files changed

Lines changed: 47 additions & 0 deletions

File tree

.github/cross/ubuntu-armhf.txt

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
[binaries]
2+
c = '/usr/bin/arm-linux-gnueabihf-gcc'
3+
ar = '/usr/arm-linux-gnueabihf/bin/ar'
4+
strip = '/usr/arm-linux-gnueabihf/bin/strip'
5+
pkgconfig = '/usr/bin/arm-linux-gnueabihf-pkg-config'
6+
ld = '/usr/bin/arm-linux/gnueabihf-ld'
7+
8+
[properties]
9+
root = '/usr/arm-linux-gnueabihf'
10+
has_function_printf = true
11+
skip_sanity_check = true
12+
13+
[host_machine]
14+
system = 'linux'
15+
cpu_family = 'arm'
16+
cpu = 'armv7'
17+
endian = 'little'

.github/workflows/meson.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,36 @@ jobs:
3030
name: Linux_Meson_Testlog
3131
path: build/meson-logs/testlog.txt
3232

33+
build-cross-armhf:
34+
runs-on: ubuntu-latest
35+
steps:
36+
- name: set up arm architecture
37+
run: |
38+
export release=$(lsb_release -c -s)
39+
sudo dpkg --add-architecture armhf
40+
sudo sed -i -e 's/deb http/deb [arch=amd64] http/g' /etc/apt/sources.list
41+
sudo dd of=/etc/apt/sources.list.d/armhf.list <<EOF
42+
deb [arch=armhf] http://ports.ubuntu.com/ $release main universe restricted"
43+
deb [arch=armhf] http://ports.ubuntu.com/ $release-updates main universe restricted"
44+
EOF
45+
sudo apt update
46+
- name: install armhf compiler
47+
run: sudo apt install gcc-arm-linux-gnueabihf pkg-config
48+
- name: install libraries
49+
run: sudo apt install uuid-dev:armhf libjson-c-dev:armhf
50+
- uses: actions/checkout@v3
51+
- uses: BSFishy/[email protected]
52+
with:
53+
# suppress python for now; the python headers currently assume native
54+
setup-options: --werror --cross-file=.github/cross/ubuntu-armhf.txt --wrap-mode=nofallback -Dpython=false
55+
options: --verbose
56+
action: build
57+
- uses: actions/upload-artifact@v3
58+
if: failure()
59+
with:
60+
name: Linux_Meson_Testlog
61+
path: build/meson-logs/testlog.txt
62+
3363
build-fallback:
3464
runs-on: ubuntu-latest
3565
steps:

0 commit comments

Comments
 (0)