Skip to content

test(ffi): run .NET binding tests on net48 and debug native builds - #539

Draft
irvingouj@Devolutions (irvingoujAtDevolution) wants to merge 3 commits into
ffi/diplomat-0.16.1-devo.2from
ffi/dotnet-net48-tests
Draft

irvingouj@Devolutions (irvingoujAtDevolution) wants to merge 3 commits into
ffi/diplomat-0.16.1-devo.2from
ffi/dotnet-net48-tests

Conversation

@irvingoujAtDevolution

@irvingoujAtDevolution irvingouj@Devolutions (irvingoujAtDevolution) commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Top of the Diplomat devo.2 stack (#536):

  • dotnet-tests runs against both debug and release native builds. Debug keeps Rust's std precondition checks on, which is where FFI mistakes show up.
  • new Devolutions.Picky.Net48Tests: 17 marshalling tests on .NET Framework 4.8 (strings, results, enums, errors, disposal, iterators), wired into CI and just test.
  • why net48 at all: the Gateway PowerShell module loads Picky on Windows PowerShell 5.1. It's the only shipping consumer on .NET Framework, so 3 of the tests follow what it calls: PFX + SafeBag iterator, Cert.FromDer / PrivateKey.FromPkcs8, GenerateRsa(2048).
  • drops the stale ci.yml comments about the CBenoit fork, including the one saying netstandard2.0 goes away with it.

Tested: 26/26 on debug and release, 17/17 on net48 against both native builds locally.

Debug builds tripped std's precondition checks at the FFI boundary with
the old Diplomat fork, so only release was tested. They pass with the new
bindings, and debug is the build that runs those checks.

Also drop the note about removing netstandard2.0 together with the old
fork: the new backend marshals fine on .NET Framework.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The shipped netstandard2.0 assembly also loads on .NET Framework, where
by-value Result structs used to break. Compile the generated sources
against net48 and check each shape that crosses the boundary: object,
void, scalar and string Results, Option returns, enums, the error arm,
and the hand-written byte[] addons. Runs in CI and through `just test`.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@irvingoujAtDevolution irvingouj@Devolutions (irvingoujAtDevolution) changed the title ffi/dotnet net48 tests test(ffi): run .NET binding tests on net48 and debug native builds Sep 29, 2026
The Gateway PowerShell module is the one shipping consumer that loads
Devolutions.Picky on .NET Framework (Windows PowerShell 5.1). Add net48
tests for what it actually calls: PFX parsing + the SafeBag iterator,
Cert.FromDer, PrivateKey.FromPkcs8 and GenerateRsa(nuint).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant