Skip to content

Commit 8ce44c3

Browse files
ci: adding macos build (#7)
Add MacOS dedicated build of Sentry kernel. No matrix build by now, yet validate that the Sentry kernel can be built on MacOS X operating system. The workflow requires some python fixes associated to homebrew usage (see actions/setup-python#58) due to Github actions constraints, in the same way mesonbuild does in its macos workflow. This part is left to the MacOS X user on a standard development host. The parseelf.py script is also fixed to user normalized `/usr/bin/env python3` as shebang
2 parents e0c3642 + fe5b5d0 commit 8ce44c3

File tree

5 files changed

+113
-22
lines changed

5 files changed

+113
-22
lines changed

.github/workflows/build.yml renamed to .github/workflows/gnulinux.yml

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Sentry kernel build
1+
name: Sentry kernel build on GNU/Linux distros
22

33
on:
44
push:
@@ -59,6 +59,11 @@ jobs:
5959
container:
6060
image: ${{ matrix.operating_system }}
6161
steps:
62+
- uses: actions/checkout@v4
63+
with:
64+
fetch-depth: 0
65+
fetch-tags: true
66+
set-safe-directory: true
6267
- name: Clone cross-files
6368
uses: actions/checkout@v4
6469
with:
@@ -96,11 +101,7 @@ jobs:
96101
compiler: ${{ env.compiler }}
97102
triple: arm-none-eabi
98103
ref: ${{ env.compiler_version }}
99-
- uses: actions/checkout@v4
100-
with:
101-
fetch-depth: 0
102-
fetch-tags: true
103-
set-safe-directory: true
104+
workspace: $GITHUB_WORKSPACE
104105
- name: set safe dir for dunami (to be removed)
105106
run: |
106107
git config --global --add safe.directory '*'
@@ -132,6 +133,11 @@ jobs:
132133
container:
133134
image: 'mesonbuild/ubuntu-rolling'
134135
steps:
136+
- uses: actions/checkout@v4
137+
with:
138+
fetch-depth: 0
139+
fetch-tags: true
140+
set-safe-directory: true
135141
- name: Clone cross-files
136142
uses: actions/checkout@v4
137143
with:
@@ -154,17 +160,13 @@ jobs:
154160
compiler: gcc
155161
triple: arm-none-eabi
156162
ref: '12.3.Rel1'
163+
workspace: $GITHUB_WORKSPACE
157164
- name: Setup Rust toolchain
158165
uses: dtolnay/rust-toolchain@v1
159166
with:
160167
toolchain: nightly
161168
targets: thumbv7m-none-eabi,thumbv7em-none-eabi,thumbv7em-none-eabihf
162169
components: clippy,rustfmt
163-
- uses: actions/checkout@v4
164-
with:
165-
fetch-depth: 0
166-
fetch-tags: true
167-
set-safe-directory: true
168170
- name: set safe dir for dunami (to be removed)
169171
run: |
170172
git config --global --add safe.directory '*'
@@ -196,6 +198,11 @@ jobs:
196198
container:
197199
image: 'mesonbuild/ubuntu-rolling'
198200
steps:
201+
- uses: actions/checkout@v4
202+
with:
203+
fetch-depth: 0
204+
fetch-tags: true
205+
set-safe-directory: true
199206
- name: Clone cross-files
200207
uses: actions/checkout@v4
201208
with:
@@ -216,11 +223,6 @@ jobs:
216223
uses: dtolnay/rust-toolchain@v1
217224
with:
218225
toolchain: nightly
219-
- uses: actions/checkout@v4
220-
with:
221-
fetch-depth: 0
222-
fetch-tags: true
223-
set-safe-directory: true
224226
- name: deploy local deps
225227
run: |
226228
pip install -r requirements.txt

.github/workflows/macos.yml

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
name: Sentry kernel build on MacOS X
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
pull_request:
7+
branches:
8+
- main
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
14+
# using /home/build as home, as buildbot is using user build. Cache is still in /cache
15+
# This allows the usage of automated ssh key installation step
16+
17+
jobs:
18+
build_u5_macosX:
19+
defaults:
20+
run:
21+
shell: bash
22+
runs-on: macos-latest
23+
steps:
24+
- uses: actions/checkout@v4
25+
with:
26+
fetch-depth: 0
27+
fetch-tags: true
28+
set-safe-directory: true
29+
- name: unbreak python in github actions
30+
run: |
31+
find /usr/local/bin -lname '*/Library/Frameworks/Python.framework/*' -delete
32+
sudo rm -rf /Library/Frameworks/Python.framework/
33+
brew install --force python3 && brew unlink python3 && brew unlink python3 && brew link --overwrite python3
34+
# Delete nonsensical PEP 668 breakage. It is the wrong solution to the problem and isn't designed to be
35+
# productive -- only victim blaming -- however it bites particularly badly because this is a container/VM
36+
# See commit 5c479d7a13a518c18ccb4dc3b6bdd7bfc2a9bdb5 for a more thorough analysis.
37+
find /opt/homebrew/Cellar/python* -name EXTERNALLY-MANAGED -print0 | xargs -0 rm -vf
38+
# use python3 from homebrew because it is a valid framework, unlike the actions one:
39+
# https://github.com/actions/setup-python/issues/58
40+
- run: brew install dtc libssh2 curl srecord rustup
41+
- name: Clone cross-files
42+
uses: actions/checkout@v4
43+
with:
44+
ref: 'using-local-dirs'
45+
repository: 'outpost-os/meson-cross-files'
46+
path: crossfiles
47+
- name: Deploy cross-files
48+
run: |
49+
mkdir -p $HOME/.local/share/meson/cross
50+
cp -a $GITHUB_WORKSPACE/crossfiles/*.ini $HOME/.local/share/meson/cross
51+
echo "MESON_CROSS_FILES=$HOME/.local/share/meson/cross" >> $GITHUB_ENV
52+
shell: bash
53+
- name: Setup Rust toolchain
54+
uses: dtolnay/rust-toolchain@v1
55+
with:
56+
toolchain: nightly
57+
targets: thumbv7m-none-eabi,thumbv7em-none-eabi,thumbv7em-none-eabihf
58+
components: clippy,rustfmt
59+
- name: Setup C toolchain
60+
uses: outpost-os/action-setup-compiler@v1
61+
with:
62+
compiler: gcc
63+
triple: arm-none-eabi
64+
ref: 13.2.Rel1
65+
workspace: ${{ github.workspace }}
66+
- name: set safe dir for dunami (to be removed)
67+
run: |
68+
git config --global --add safe.directory '*'
69+
shell: bash
70+
- name: deploy local deps
71+
run: |
72+
python3 -m pip install --upgrade pip
73+
python3 -m pip install -r requirements.txt
74+
echo '$HOME/Library/Python/3.12/bin' >> $GITHUB_PATH
75+
- name: defconfig
76+
run: |
77+
defconfig configs/nucleo_u5a5_autotest_defconfig
78+
- name: Meson Build
79+
uses: outpost-os/action-meson@v1
80+
with:
81+
cross_files: ${{ format('{0}/{1}', env.MESON_CROSS_FILES, 'arm-none-eabi-gcc.ini') }}
82+
actions: '["prefetch", "setup", "compile"]'
83+
options: '-Dconfig=.config -Ddts=dts/examples/nucleo_u5a5_autotest.dts -Ddts-include-dirs=dts'
84+
- name: Meson postcheck
85+
if: failure()
86+
run: |
87+
cat builddir/meson-logs/meson-log.txt

.github/workflows/proof.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Sentry kernel proof
1+
name: Sentry kernel proof with Frama-C
22

33
on:
44
push:
@@ -20,11 +20,10 @@ jobs:
2020
container: 'pthierry38/framac-runner:29'
2121
timeout-minutes: 60
2222
steps:
23-
- name: checkout repo
24-
uses: actions/checkout@v4
23+
- uses: actions/checkout@v4
2524
with:
26-
ref: ${{ github.ref }}
2725
fetch-depth: 0
26+
fetch-tags: true
2827
set-safe-directory: true
2928
- name: install prerequisites pkg
3029
uses: outpost-os/action-install-pkg@v1
@@ -57,6 +56,7 @@ jobs:
5756
with:
5857
compiler: gcc
5958
triple: arm-none-eabi
59+
workspace: $GITHUB_WORKSPACE
6060
- name: Install local deps
6161
run: |
6262
pip3 install -r requirements.txt

meson.build

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@ fs = import('fs')
3737
pymod = import('python')
3838
ssmod = import('sourceset')
3939

40-
py3 = pymod.find_installation('python3', modules: ['dunamai'])
40+
41+
dunamai = find_program('dunamai', required: true)
42+
py3 = pymod.find_installation('python3')
4143

4244
kconfig_file = meson.current_source_dir() / 'Kconfig'
4345
kconfig_proj = subproject('kconfig', default_options: ['kconfig=@0@'.format(kconfig_file)])

tools/parseelf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/python3
1+
#!/usr/bin/env python3
22

33
import os
44
import sys

0 commit comments

Comments
 (0)