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

Re: clar unit testing framework FTBFS on uclibc systems (wchar_t unsupported)

From
Jeff King <peff@peff.net>
Date
Oct 18, 2024, 04:51 UTC
Message-ID
<20241018045155.GC2408674@coredump.intra.peff.net>
In-Reply-To
<ZxGN9zzt55GcL4Qj@tapette.crustytoothpaste.net>
On Thu, Oct 17, 2024 at 10:21:43PM +0000, brian m. carlson wrote:
Show 16 quoted lines
> > We unconditionally include <wchar.h>, and your system does not seem to
> > have support for it built in. So why doesn't the `#error` trigger? It's
> > also not like this is a recent error, it has been added with 581deed72
> > (The obligatory forgotten files..., 2002-05-06).
> > 
> > We can do something like the below patch in clar, but I'd first like to
> > understand why your platform seems to be broken in such a way.
> 
> Yeah, this is definitely broken.  We require ISO C99, and according to
> the draft preceding the ratification[0], `wchar.h` and its contents are not
> optional.  The similar draft for C11 also doesn't appear to make these
> optional.
> 
> I think users of uclibc will need to compile it with full ISO C99
> support.  I expect that a wide variety of other software will be
> similarly broken without that.

Perhaps, but...don't the current releases of Git work just fine on such a wchar-less uclibc system now? We don't use wchar or include wchar.h ourselves, except on Windows or via compat/regex (though it is even conditional there). This is a new portability problem introduced by the clar test harness. And even there I doubt it is something we care about (it looks like it's for allowing "%ls" in assertions).

Our approach to portability has traditionally been a cost/benefit for individual features. Standards are a nice guideline, but the real world does not always follow them. Sometimes accommodating platforms that don't strictly follow the standard is cheap enough that it's worth doing.

I think more recent discussions have trended to looking at standards in a bit stronger way: giving minimum requirements and sticking to them. Certainly I'm sympathetic to that viewpoint, as it can reduce noise.

But IMHO this is a good example of where the flexibility of the first approach shines. We could accommodate this platform without any real cost (and indeed, we should be able to _drop_ some clar code).

-Peff
Previous: brian m. carlsonNext: Patrick Steinhardt
Message 6 of 18 in “clar unit testing framework FTBFS on uclibc systems (wchar_t unsupported)”
  1. Bagas SanjayaOct 17, 2024
  2. Patrick SteinhardtOct 17, 2024
  3. Patrick SteinhardtOct 17, 2024
  4. Taylor BlauOct 17, 2024
  5. brian m. carlsonOct 17, 2024
  6. Jeff KingOct 18, 2024
  7. Patrick SteinhardtOct 18, 2024
  8. Jeff KingOct 18, 2024
  9. Patrick SteinhardtOct 18, 2024
  10. Taylor BlauOct 18, 2024
  11. Patrick SteinhardtOct 21, 2024
  12. Jeff KingOct 21, 2024
  13. Taylor BlauOct 21, 2024
  14. brian m. carlsonOct 18, 2024
  15. Jeff KingOct 21, 2024
  16. Jeff KingOct 21, 2024
  17. Bagas SanjayaOct 18, 2024
  18. Patrick SteinhardtOct 21, 2024

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.