Skip to content

build: gate the Native AOT smoke test in CI with a real dotnet publish -r #2230

Closed

Description

@glennawatson

Summary

Split out of #1389 (which is being closed as substantially delivered). src/Refit.NativeAotSmoke is part of Refit.slnx, so CI builds it - and because it promotes the trim/AOT analyzer codes to errors (WarningsAsErrors ...IL2026;IL2055;IL3050;..., PublishAot=true, TrimMode=full), a build catches analyzer-level IL warnings. But a plain dotnet build/dotnet test does not invoke the Native AOT compiler (ILC); only dotnet publish -r <rid> does. So the end-to-end ILC guarantee is not demonstrably gated in CI.

Confirmed locally: dotnet publish src/Refit.NativeAotSmoke -c Release -r linux-x64 produces a clean stripped native binary (0 IL warnings) that runs and prints the smoke pass. This just needs to run in CI to be regression-proof.

Proposal

  • Verify whether the reusable CI workflow (reactiveui/actions-common/.github/workflows/workflow-common-setup-and-build.yml) already runs a Native AOT publish of the smoke project; if not, add an explicit dotnet publish src/Refit.NativeAotSmoke -c Release -r <rid> step to .github/workflows/ci-build.yml and fail the job on IL warnings/errors.
  • Optional: extend the smoke coverage to the AddRefitGeneratedClient / IHttpClientFactory DI registration path (the smoke currently uses RestService.ForGenerated<T> directly), so the DI path is also under ILC.

Considerations

  • Runner RID selection (linux-x64 at minimum; ideally the matrix already in use).
  • Complexity: S.

Activity

  1. added
    🪶 area: aot-trimming
    on Jul 14, 2026
  2. glennawatson commented on Jul 15, 2026

    @glennawatson
    ContributorAuthor

    This is addressed in the Refit 14 beta, now available on NuGet: https://www.nuget.org/packages/Refit/14.0.0-beta.1

    Please give it a try - feedback ahead of the stable 14.0.0 release is very welcome.

    Type-safe REST API clients for .NET, generated from annotated interfaces with build-time source generation, direct request construction, System.Text.Json defaults, and support for trimming and AOT.
  3. github-actions commented on Jul 30, 2026

    @github-actions

    This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

  4. locked as resolved and limited conversation to collaborators on Jul 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ✨ enhancement🪶 area: aot-trimming

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions