git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v2 2/3] ci: add build checking for side-effects in assert() calls

From
Taylor Blau <me@ttaylorr.com>
Date
Mar 19, 2025, 22:26 UTC
Message-ID
<Z9tEilK0OOEBX/JQ@nand.local>
In-Reply-To
<CABPp-BHxYec4LBTrhg+Bq9NrpyGXkt8fBgofuy=D3X2ArM6wiQ@mail.gmail.com>
On Wed, Mar 19, 2025 at 09:21:59AM -0700, Elijah Newren wrote:
Show 21 quoted lines
> > I wonder if it might be useful to explain this in
> > Documentation/CodingGuidelines as a follow-up to this series. I was
> > thinking of a scenario where someone either writes a side-effecting
> > assert(), or a non-side-effecting one that is too complicated to prove
> > otherwise.
> >
> > If that person runs 'make test' locally, they might not see any
> > failures, but then be surprised when CI fails on the new step. It may be
> > worth mentioning that we have such a check, and that we expect all
> > assert() statements to be side effect-free, and that developers can
> > verify this by ci/check-unsafe-assertions.sh.
>
> The same could be said for coccinelle patches, hdr-check, check-pot,
> fuzz tests, asan/ubsan, GIT_TEST_SPLIT_INDEX, pedantic build, osx, vs.
> windows vs. linux, and perhaps others, which users won't catch on
> 'make test' locally but can result in failed CI builds and aren't
> mentioned in CodingGuidelines.  I usually think of CodingGuidelines as
> being the place for documenting things that can't be tested in an
> automated fashion, and a brief mention that both cross platform and
> additional more thorough but non-default tests can go in
> SubmittingPatches.
Fair enough ;-).

Thanks, Taylor

Previous: Elijah NewrenNext: Junio C Hamano
Message 20 of 30 in “Add a static analysis job to prevent assertions with side effects”
  1. 0/3 Add a static analysis job to prevent assertions with side effectsElijah Newren via GitGitGadget, Mar 14, 2025
  2. 1/3 git-compat-util: introduce BUG_IF_NOT() macroElijah Newren via GitGitGadget, Mar 14, 2025
  3. 2/3 ci: add build checking for side-effects in assert() callsElijah Newren via GitGitGadget, Mar 14, 2025
  4. Junio C HamanoMar 14, 2025
  5. brian m. carlsonMar 14, 2025
  6. Junio C HamanoMar 14, 2025
  7. Elijah NewrenMar 14, 2025
  8. Junio C HamanoMar 14, 2025
  9. Elijah NewrenMar 16, 2025
  10. Elijah NewrenMar 17, 2025
  11. Junio C HamanoMar 17, 2025
  12. 3/3 treewide: replace assert() with BUG_IF_NOT() in special casesElijah Newren via GitGitGadget, Mar 14, 2025
  13. 0/3 Add a static analysis job to prevent assertions with side effectsElijah Newren via GitGitGadget, Mar 16, 2025
  14. 1/3 git-compat-util: introduce BUG_IF_NOT() macroElijah Newren via GitGitGadget, Mar 16, 2025
  15. Junio C HamanoMar 17, 2025
  16. Taylor BlauMar 17, 2025
  17. 2/3 ci: add build checking for side-effects in assert() callsElijah Newren via GitGitGadget, Mar 16, 2025
  18. Taylor BlauMar 17, 2025
  19. Elijah NewrenMar 19, 2025
  20. Taylor BlauMar 19, 2025
  21. Junio C HamanoMar 17, 2025
  22. 3/3 treewide: replace assert() with BUG_IF_NOT() in special casesElijah Newren via GitGitGadget, Mar 16, 2025
  23. Taylor BlauMar 17, 2025
  24. Taylor BlauMar 17, 2025
  25. 0/3 Add a static analysis job to prevent assertions with side effectsElijah Newren via GitGitGadget, Mar 19, 2025
  26. 1/3 git-compat-util: introduce ASSERT() macroElijah Newren via GitGitGadget, Mar 19, 2025
  27. 2/3 ci: add build checking for side-effects in assert() callsElijah Newren via GitGitGadget, Mar 19, 2025
  28. 3/3 treewide: replace assert() with ASSERT() in special casesElijah Newren via GitGitGadget, Mar 19, 2025
  29. Taylor BlauMar 19, 2025
  30. Taylor BlauMar 19, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.