Skip to content

build: Clear the last warning and build with -warnaserror - #34

Merged
henrikottesorensen merged 2 commits into
Notalib:mainfrom
henrikottesorensen:fix/ca1861-heap-tests
Oct 9, 2026
Merged

henrikottesorensen merged 2 commits into
Notalib:mainfrom
henrikottesorensen:fix/ca1861-heap-tests

Conversation

@henrikottesorensen

@henrikottesorensen henrikottesorensen commented Oct 9, 2026 •

Copy link
Copy Markdown
Collaborator

Makes the managed build warning free and keeps it that way.

Changes

  • Fix the last warning. CA1861 fired on the inline new[] { "msvcrt.dll", "ucrtbase.dll" } in LiblouisHeapTests.FindImport_FindsFreeInTheLiblouisWeShip, once per target framework. It came in with Fix/pinvoke review feedback #33. The array moves to a static readonly field, with a comment saying which runtime belongs to which toolchain. There's no behaviour change.
  • Build with -warnaserror. Two places now fail on any warning:
    • the CI test job's dotnet test
    • build/build_managed_packages.sh's dotnet build, which builds the packages that get published
  • Native runtime packages are unchanged. Their dotnet pack only wraps prebuilt binaries, and its NuGet "missing readme" warnings would fail it for no benefit.

Testing

  • Release builds with -warnaserror succeed with 0 warnings, for both LibLouis.NET.slnx (including the library's pack-on-build) and the test project.
  • 80/80 tests passing on net8.0 and net10.0 against liblouis 3.39.0.

Effect on open PRs

#20 to #22 had no other warnings when I last built them on top of #32. Once this merges they'll need a rebase, and any warning they add will fail CI.

🤖 Generated with Claude Code

henrikottesorensen and others added 2 commits October 9, 2026 16:17
CA1861 flagged the inline array in FindImport_FindsFreeInTheLiblouisWeShip,
the only analyzer warning left in the build (once per target framework).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With the CA1861 warning gone the build is warning free, so keep it that
way: the CI test job and build_managed_packages.sh, which builds what
gets packed and published, now fail on any warning.

The native runtime packages are left alone. Their dotnet pack only
wraps prebuilt binaries, and its NuGet warnings (no readme) would fail
it for nothing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@henrikottesorensen henrikottesorensen changed the title test: Hoist the Windows runtime list to a static field build: Clear the last warning and build with -warnaserror Oct 9, 2026
@henrikottesorensen
henrikottesorensen merged commit 115c306 into Notalib:main Oct 9, 2026
7 checks passed
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