Skip to content

CI: add -Werror strict lane and an auto-discovered regression-test harness - #350

Merged
ViralBShah merged 2 commits into
masterfrom
ci-harden-werror-regression
Jun 22, 2026
Merged

ViralBShah merged 2 commits into
masterfrom
ci-harden-werror-regression

Conversation

@ViralBShah

Copy link
Copy Markdown
Member

Hardens CI per #315 and lays the test foundation the follow-up fix PRs build on.

1. -Werror strict lane (#315)

  • New WERROR opt-in in Make.inc (default off, so a compiler upgrade can never break a normal build).
  • New strict-werror CI job builds with -Werror under gcc and clang, pinned to ubuntu-24.04 so a future image/compiler bump shows up as one isolated failure instead of breaking the whole matrix.
  • Fixes the warnings this surfaces in openlibm's own code:
    • irint() is marked __unused — it lives in math_private.h but is only referenced by e_rem_pio2*.c, so it is unused in every other TU.
    • lgamma_r / lgammal_r: zero-init nadj, which is written and read under the same hx < 0 guard (a -Wmaybe-uninitialized false positive).
  • Two clang-only diagnostics are documented and suppressed for the lane: -Wimplicit-int-float-conversion (the intentional lround/llround boundary trick) and -Wignored-attributes (the pre-existing extern-inline fenv redeclarations — left for a separate change).

2. Auto-discovered regression harness

  • test/regression/*.c are self-contained programs (exit 0=pass, 77=skip, else=fail), built and run by make test from the repo root, so they locate the freshly built shared library the same way on every platform.
  • New files are picked up automatically — a future fix can add a regression test by dropping in one file, no Makefile edit.
  • The previously orphaned test-211.c (never built or run by anything) becomes the first test under this harness.

This is the base for the per-issue fix PRs that follow.

Two pieces of CI hardening (#315):

* WERROR opt-in (Make.inc) and a dedicated `strict-werror` CI job that
  builds with -Werror under both gcc and clang on a pinned ubuntu-24.04.
  It is off by default and pinned so a future compiler upgrade surfaces
  as one isolated failure rather than breaking the whole matrix. Fixes
  the warnings this surfaces in openlibm's own code:
    - irint(): mark the header-defined helper __unused (it is only used
      by e_rem_pio2*.c, so it is unused in every other TU).
    - lgamma_r/lgammal_r: zero-init nadj, which is written and read under
      the same hx<0 guard (-Wmaybe-uninitialized false positive).
  Clang-only -Wimplicit-int-float-conversion (intentional lround
  boundary trick) and -Wignored-attributes (pre-existing extern-inline
  fenv redeclarations) are documented and suppressed for the lane.

* Regression harness: test/regression/*.c are self-contained programs
  (exit 0=pass, 77=skip, else=fail) auto-discovered and run by
  `make test` from the repo root, so later fixes can land a regression
  test by dropping in one file with no Makefile changes. The previously
  orphaned test-211.c (never built or run) is moved in as the first one.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@codecov

codecov Bot commented Jun 22, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 72.12%. Comparing base (3329022) to head (d1957d2).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #350      +/-   ##
==========================================
+ Coverage   72.11%   72.12%   +0.01%     
==========================================
  Files         233      233              
  Lines        6132     6135       +3     
  Branches     1607     1607              
==========================================
+ Hits         4422     4425       +3     
  Misses       1417     1417              
  Partials      293      293              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

The strict lane surfaced more on the CI compilers than on older local
ones (verified against gcc 13 / clang 18):

* gcc: zero-init nadj in the float lgammaf_r too (same guarded
  false-positive as the double/long-double versions).
* clang 18 renamed the int->float conversion diagnostic to
  -Wimplicit-const-int-float-conversion; suppress that spelling as well.
* clang: suppress -Wdeprecated-non-prototype (C23) for the lane; the K&R
  definitions in w_cabs*.c and bsdsrc/b_*.c are left for a focused
  prototype-conversion follow-up.

Cross CI: build the regression programs with the cross toolchain in the
"Build tests" step and pass the toolchain vars to the qemu run, so the
foreign-arch regression binaries are produced by $TRIPLE-gcc instead of
the host compiler. Verified locally by cross-building for riscv64 and
running the regression test under qemu.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@ViralBShah
ViralBShah merged commit aeef4da into master Jun 22, 2026
24 checks passed
@ViralBShah
ViralBShah deleted the ci-harden-werror-regression branch June 22, 2026 23:30
social4hyq pushed a commit to social4hyq/homebrew-core that referenced this pull request Sep 20, 2026
openlibm 0.8.8

Created-by: HarmonybrewBot
Commit-by: HarmonybrewBot
Merged-by: HarmonybrewBot
Description: Created by `brew bump`

---

Created with `brew bump-formula-pr`.<details>
  <summary>release notes</summary>
  <pre>## What's Changed
* Update riscv64 fenv.c initialization to fix warnings by @ViralBShah in JuliaMath/openlibm#330
* Musl compatibility fixes for s390 and powerpc by @sertonix in JuliaMath/openlibm#331
* Fix cmake error for 4.x by @HIllya51 in JuliaMath/openlibm#333
* Bump actions/checkout from 4 to 5 by @dependabot[bot] in JuliaMath/openlibm#335
* Bump actions/upload-artifact from 4 to 5 by @dependabot[bot] in JuliaMath/openlibm#336
* Bump actions/checkout from 5 to 6 by @dependabot[bot] in JuliaMath/openlibm#338
* Bump actions/upload-artifact from 5 to 6 by @dependabot[bot] in JuliaMath/openlibm#339
* Bump actions/upload-artifact from 6 to 7 by @dependabot[bot] in JuliaMath/openlibm#341
* Bump codecov/codecov-action from 5 to 6 by @dependabot[bot] in JuliaMath/openlibm#342
* ci: add native ARM (Linux + Windows) and Intel macOS runners by @ViralBShah in JuliaMath/openlibm#345
* ci: workflow hygiene (concurrency, timeouts, loongarch fold, mips64, fork-safe codecov) by @ViralBShah in JuliaMath/openlibm#346
* riscv: Fix feholdexcept() by @AlekseyZhmulin in JuliaMath/openlibm#324
* CI: add -Werror strict lane and an auto-discovered regression-test harness by @ViralBShah in JuliaMath/openlibm#350
* ci: speed up Windows jobs by trimming the msys2 install by @ViralBShah in JuliaMath/openlibm#354
* ci: make codecov coverage status informational by @ViralBShah in JuliaMath/openlibm#358
* riscv: allow single-precision float ABI (lp64f / ilp32f) by @ViralBShah in JuliaMath/openlibm#349
* Fix powl() returning NaN instead of +0 on extreme underflow (#334) by @ViralBShah in JuliaMath/openlibm#351
* Make powl() thread-safe (#222) by @ViralBShah in JuliaMath/openlibm#355
* Bump codecov/codecov-action from 6 to 7 by @dependabot[bot] in JuliaMath/openlibm#359
* riscv64: Keep hard-float fenv functions private by @maleadt in JuliaMath/openlibm#360

## New Contributors
* @sertonix made their first contribution in JuliaMath/openlibm#331
* @HIllya51 made their first contribution in JuliaMath/openlibm#333
* @AlekseyZhmulin made their first contribution in JuliaMath/openlibm#324

**Full Changelog**: https://github.com/JuliaMath/openlibm/compare/v0.8.7...v0.8.8</pre>
  <p>View the full release notes at <a href="https://github.com/JuliaMath/openlibm/releases/tag/v0.8.8">https://github.com/JuliaMath/openlibm/releases/tag/v0.8.8</a>.</p>
</details>
<hr>

See merge request: Harmonybrew/homebrew-core!18388
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