Skip to content

Adding msys2-based windows workflow #118

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
103 changes: 103 additions & 0 deletions .github/workflows/msys2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
# SPDX-FileCopyrightText: 2025 Ledger SAS
# SPDX-License-Identifier: Apache-2.0

name: Sentry kernel build on Windows

on:
workflow_dispatch:
push:
pull_request:
branches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

# using /home/build as home, as buildbot is using user build. Cache is still in /cache
# This allows the usage of automated ssh key installation step

jobs:
build:
name: build
defaults:
run:
shell: bash
runs-on: windows-latest
steps:
- name: install prerequisites pkg
uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
update: true
install: >-
base-devel
git
wget
curl
dtc
libssh2
cmake
gcc
ninja
brotli
libffi
libffi-devel
mingw-w64-x86_64-python
mingw-w64-x86_64-python-pip
mingw-w64-x86_64-python-lxml
mingw-w64-x86_64-python-lief
mingw-w64-x86_64-python-wheel
mingw-w64-x86_64-python-pillow
mingw-w64-x86_64-python-lief
mingw-w64-x86_64-python-cffi
- name: XXX git permission quirk XXX
run: |
git config --global --add safe.directory $GITHUB_WORKSPACE
- uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
set-safe-directory: true
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Clone cross-files
uses: actions/checkout@v4
with:
ref: 'main'
repository: 'outpost-os/meson-cross-files'
path: crossfiles
- name: Setup Rust toolchain
uses: dtolnay/rust-toolchain@v1
with:
toolchain: nightly
targets: thumbv7m-none-eabi,thumbv7em-none-eabi,thumbv7em-none-eabihf
components: clippy,rustfmt
- name: Setup C toolchain
uses: outpost-os/action-setup-compiler@v1
with:
compiler: gcc
triple: arm-none-eabi
ref: 13.2.Rel1
workspace: $GITHUB_WORKSPACE
- name: deploy local deps
run: |
pip config set global.break-system-packages true
pip install meson~=1.4.0 kconfiglib~=14.1.0 svd2json>=0.1.6 dts-utils>=0.3.0 jinja-cli GitPython>=3.1.0
shell: msys2 {0}
- name: defconfig
run: |
defconfig configs/nucleo_u5a5_autotest_defconfig
shell: msys2 {0}
- name: Meson Build
uses: outpost-os/action-meson@main
with:
cross_files: 'support/meson/msys2.ini'
actions: '["prefetch", "setup", "compile"]'
options: '-Dconfig=.config -Ddts=dts/examples/nucleo_u5a5_autotest.dts -Ddts-include-dirs=dts'
shell: msys2 {0}
- name: Meson postcheck
if: failure()
run: |
cat builddir/meson-logs/meson-log.txt
29 changes: 29 additions & 0 deletions support/meson/msys2.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
[constants]
# Gcc triple, no diff between various arm-none-eabi targets, using
# supplementary arguments to precise
cross_triple = 'arm-none-eabi'
# llvm triple, target-explicit, needed by Rust
cross_toolchain = 'C:\Users\runneradmin\gcc-arm-none-eabi-13.2.1-win32-x64\arm-gnu-toolchain-13.2.Rel1-mingw-w64-i686-arm-none-eabi\'
cross_compile = cross_toolchain + 'bin\' + cross_triple + '-'

[host_machine]
system = 'baremetal'
cpu_family = 'arm'
cpu = 'cortex-m4'
endian = 'little'
exe_wrapper = 'qemu-arm-static'

[binaries]
c = cross_compile + 'gcc'
cpp = cross_compile + 'g++'
ar = cross_compile + 'gcc-ar'
ranlib = cross_compile + 'gcc-ranlib'
strip = cross_compile + 'strip'
objcopy = cross_compile + 'objcopy'
clang = 'clang'
rust_ld = 'gcc'
rust = 'rustc'
pkg-config = 'pkg-config'

[properties]
sysroot = cross_toolchain + cross_triple
Loading