Fix failing GitHub Actions jobs in maui-build workflow#1
Merged
Conversation
…tests, sample, docs, CI
…path, CI permissions
Copilot
AI
changed the title
[WIP] Set up repository structure and native build pipeline
Scaffold Ferrum: domain-agnostic native-compute framework for .NET MAUI
Jun 19, 2026
…matrix, use android workload for Android job
Copilot
AI
changed the title
Scaffold Ferrum: domain-agnostic native-compute framework for .NET MAUI
Fix failing GitHub Actions jobs in maui-build workflow
Jun 19, 2026
There was a problem hiding this comment.
Pull request overview
This PR introduces a full initial Ferrum scaffold (framework library, codegen tool, native build pipeline, docs, samples) and updates CI workflows—despite the PR title/description focusing only on fixing MAUI workload installation failures in maui-build.yml.
Changes:
- Added a
ferrum-codegen.NET tool (regex-based header parser +[LibraryImport]emitter) with unit tests and a smoke-test workflow. - Added
Ferrum.Framework(includingNativeBuffer<T>and interop constants) plus a minimal MAUI demo app. - Added native CMake + scripts for building iOS XCFramework and Android
.soartifacts, along with GitHub Actions workflows to build them.
Reviewed changes
Copilot reviewed 39 out of 39 changed files in this pull request and generated 13 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/codegen/Program.cs | CLI entrypoint for header→bindings generation. |
| tools/codegen/Parser/HeaderParser.cs | Regex-based C header parser for functions/structs. |
| tools/codegen/Parser/CTypeMapping.cs | C primitive→blittable C# type mapping with loud failures. |
| tools/codegen/Models/ParsedDeclarations.cs | Parsed declaration models used by parser/emitter. |
| tools/codegen/Ferrum.Codegen.csproj | Codegen tool project + pack-as-tool metadata. |
| tools/codegen/Emitter/BindingEmitter.cs | Emits [LibraryImport] bindings and blittable structs. |
| tools/codegen/CodegenException.cs | Exception type for “fail loudly” codegen behavior. |
| src/Framework/Interop/InteropConstants.cs | Centralized library-name constant for [LibraryImport]. |
| src/Framework/Ferrum.Framework.csproj | Multi-targeted framework library packaging metadata. |
| src/Framework/Buffers/NativeBuffer.cs | Pinned zero-copy managed buffer abstraction. |
| src/Framework.Tests/Ferrum.Framework.Tests.csproj | Test project wiring + skip-mobile build properties. |
| src/Framework.Tests/Codegen/HeaderParserTests.cs | Unit tests for header parsing/type mapping behavior. |
| src/Framework.Tests/Buffers/NativeBufferTests.cs | Unit tests for NativeBuffer<T> semantics. |
| samples/MinimalDemo/Platforms/iOS/AppDelegate.cs | iOS platform bootstrap for demo app. |
| samples/MinimalDemo/Platforms/Android/MainActivity.cs | Android platform bootstrap for demo app. |
| samples/MinimalDemo/MinimalDemo.csproj | MAUI demo project targeting iOS + Android. |
| samples/MinimalDemo/MauiProgram.cs | MAUI app builder for demo. |
| samples/MinimalDemo/MainPage.xaml.cs | Demo UI logic calling native stub + buffer demo. |
| samples/MinimalDemo/MainPage.xaml | Demo UI layout. |
| samples/MinimalDemo/Interop/AddInterop.cs | Demo [LibraryImport] binding for ferrum_add. |
| samples/MinimalDemo/App.xaml.cs | Demo app root initialization. |
| samples/MinimalDemo/App.xaml | Demo app resources. |
| README.md | Expanded repo overview, quick start, layout, constraints. |
| native/test_stub/src/add.c | Trivial native implementation for end-to-end smoke testing. |
| native/test_stub/include/add.h | Header for native stub (codegen input). |
| native/test_stub/CMakeLists.txt | Builds/install rules for the native stub lib. |
| native/scripts/build_ios.sh | Builds slices + assembles XCFramework on macOS. |
| native/scripts/build_android.sh | Builds .so per ABI via NDK toolchain. |
| native/CMakeLists.txt | Top-level native build entrypoint + option for test stub. |
| native/cmake/ios.toolchain.cmake | Minimal iOS CMake toolchain configuration. |
| native/cmake/ferrum_helpers.cmake | Shared CMake helper macros for Ferrum-style libs. |
| Ferrum.sln | Solution wiring for framework, tool, tests, sample. |
| docs/open-questions.md | Captures unresolved architecture/product decisions. |
| docs/getting-started.md | End-to-end integration walkthrough for consumers. |
| docs/architecture.md | High-level architecture + supported type mapping. |
| Directory.Build.props | Repo-wide MSBuild defaults (incl. warnings-as-errors). |
| .github/workflows/native-build.yml | CI to build iOS slices/XCFramework + Android .so artifacts. |
| .github/workflows/maui-build.yml | CI to build framework + MAUI sample (macOS + ubuntu). |
| .github/workflows/codegen-tests.yml | Linux CI for tool/framework tests + codegen smoke run. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| private static readonly Regex BlockCommentRe = new(@"/\*.*?\*/", RegexOptions.Compiled | RegexOptions.Singleline); | ||
| private static readonly Regex PreprocessorRe = new(@"^\s*#[^\n]*", RegexOptions.Compiled | RegexOptions.Multiline); | ||
| private static readonly Regex ExternCBlockRe = new(@"extern\s+""C""\s*\{", RegexOptions.Compiled); | ||
| private static readonly Regex WhitespaceNormRe = new(@"\s+", RegexOptions.Compiled); |
Comment on lines
+100
to
+104
| private static string StripComments(string src) | ||
| { | ||
| string noBlock = BlockCommentRe.Replace(src, " "); | ||
| return LineCommentRe.Replace(noBlock, ""); | ||
| } |
Comment on lines
+54
to
+57
| // ── Function-pointer detection (fail loudly) | ||
| private static readonly Regex FuncPtrRe = new( | ||
| @"\(\s*\*", | ||
| RegexOptions.Compiled); |
Comment on lines
+1
to
+2
| using System.Buffers; | ||
| using System.Runtime.InteropServices; |
| @@ -0,0 +1,40 @@ | |||
| using System.Runtime.InteropServices; | |||
Comment on lines
+12
to
+16
| <!-- | ||
| Publish as a dotnet global/local tool. | ||
| Install: dotnet tool install -g Ferrum.Codegen | ||
| Invoke: ferrum-codegen -input add.h -output AddBindings.cs | ||
| --> |
| | Tool | Minimum version | | ||
| |---|---| | ||
| | .NET SDK | 9.0 | | ||
| | .NET MAUI workload | 9.0 (`dotnet workload install maui`) | |
Comment on lines
+96
to
+97
| - name: Install Android workload | ||
| run: dotnet workload install android |
| @@ -0,0 +1,106 @@ | |||
| name: MAUI Build | |||
Comment on lines
+24
to
+28
| target_compile_options(${TARGET_NAME} PRIVATE | ||
| -fvisibility=hidden | ||
| -fno-exceptions # Keep the ABI surface minimal | ||
| $<$<COMPILE_LANGUAGE:CXX>:-fno-rtti> | ||
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes two related CI failures in
.github/workflows/maui-build.ymlcaused bydotnet workload install mauinot being supported on Linux.Root Cause
The
mauiworkload requires macOS (it includes iOS tooling) and cannot be installed on Linux runners. This caused theFramework (ubuntu-24.04)job to fail immediately, and would also have caused theMAUI Android buildjob to fail for the same reason.Changes Made
frameworkjob matrix: Removedubuntu-24.04, keeping onlymacos-15. The Framework library build requires MAUI workloads to compile all TFMs (net9.0-ios,net9.0-android), which is only supported on macOS. Linux framework builds are already covered bycodegen-tests.ymlusingFerrumSkipMobile=true.android-mauijob: Replaceddotnet workload install mauiwithdotnet workload install android. Theandroidworkload is supported on Linux and is sufficient for buildingnet9.0-androidtargets.Original prompt