Skip to content

Native dataflash log core, phase 1: vendored Rust workspace and build plumbing - #34

Open
userepo wants to merge 2 commits into
Rouniy:masterfrom
Poholos:feature/dflog-native-log-core
Open

Native dataflash log core, phase 1: vendored Rust workspace and build plumbing#34
userepo wants to merge 2 commits into
Rouniy:masterfrom
Poholos:feature/dflog-native-log-core

Conversation

@userepo

@userepo userepo commented Sep 1, 2026

Copy link
Copy Markdown

@Rouniy, this is the first of 4 planned PRs porting the dflog native log parser into MissionPlanner10, as offered in #24.
Phase 1 vendors the parser source and wires it into the build; it deliberately changes no runtime behavior; nothing consumes the library yet.
The follow-up phases add the P/Invoke bindings and DFLogBuffer fast paths (phase 2), the log-viewer/FFT/expression consumers (phase 3), and CI coverage for all four RIDs (phase 4), each as its own reviewable PR stacked on this one.

What's included

  • rust/ workspace: dflog-core (parser, index, columnar access: written to be bug-for-bug compatible with DFLogBuffer/BinaryLog, including malformed-log handling) and dflog-ffi (dflog_ffi cdylib, C ABI v5, panic-safe boundary), vendored from userepo/MissionPlanner branch rust/dflog-core at crate version 0.7.1 (release dflog-v0.7.1). The CLI, Python bindings, and fuzz targets stay upstream; parser changes land there first and are re-vendored.
  • rust/testdata/: four SITL-generated .bin logs (~5 MB total) that the golden characterization tests pin exact values against. These are test fixtures, not build artifacts.
  • Build plumbing in MissionPlanner.csproj: a BuildDflogNative target (before PrepareForBuild, on the FetchMacSimpleBle pattern) that builds the cdylib from source, when cargo is on the PATH, RID-mapped --target triples for win-x64 / linux-x64 / osx-x64 / osx-arm64, host-native build when no RID is set. Output goes under obj/dflog/ and rust/target/ is gitignored, so neither MSBuild nor manual cargo runs can dirty the build-identity check. The built library is injected as Content before AssignTargetPaths, so it flows into output, publish, and every package payload.
  • LICENSES/dflog-NOTICE.txt: third-party notice (memmap2 and the Rust standard library, Apache-2.0).

What happens without cargo

The build prints a single notice and produces today's app unchanged — no failure, no missing-file surprises later. The managed parser remains the runtime path either way until phase 2 lands, and stays the permanent fallback after it.

Verification

  • cargo test (24 + 2), cargo fmt --check, and cargo clippy --workspace --all-targets are clean in the vendored tree.
  • check-project-artifacts.sh, check-binary-artifacts.sh, and check-native-surface.sh all pass unchanged; no prebuilt binaries are checked in and no new project files exist.
  • End-to-end win-x64 self-contained publish carries dflog_ffi.dll (191 KB; strip = true release profile for the lintian gate).
  • Full C# suite on this branch (master merged through 1cbe17b): 1569/1581, the 12 failures being the known environment-dependent set, unchanged from master.

Vendors the dflog Rust workspace (dflog-core parser + dflog-ffi C ABI
cdylib, crates 0.7.1) from the upstream fork, with the SITL corpus its
golden characterization tests pin against. MissionPlanner.csproj builds
the library when cargo is on the PATH - RID-mapped targets for all four
release platforms, output under obj/ so the build-identity check stays
clean - and injects it into output and publish payloads as Content.
Without a Rust toolchain the build prints a notice and the app is
unchanged; the managed parser remains the runtime fallback.

No binaries are checked in and no project files are added; the porting
audit gates pass unchanged. Third-party crate notice in LICENSES/.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant