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

git no longer builds on SunOS 5.10, a report

From
Alejandro R. Sedeño <asedeno@mit.edu>
Date
Oct 12, 2024, 02:10 UTC
Message-ID
<CAOO-Oz3KsyeSjxbRpU-SdPgU5K+mPDcntT6Y4s46Mg_0ko9e_w@mail.gmail.com>
Hi all,

I've spent the entire day trying to fix the build for SunOS 5.10, as I've done a few times over the years out of sheer stubbornness, but this time I'm throwing in the towel. I figured I would at least relay what I found though, in case anyone else came looking.

First, clar.suite was generated as broken because clar-decls.h was generated as empty. Tweaking the sed one-liner in Makefile that is used to generate clar-decls.h fixed that (move the end-of-line marker outside of the capture group, `$$\)` -> `\)$$`), which I would submit as a patch, but (a) that only fixed part of the problem and (b) I'm not entirely sure why it helped. If someone else wants to apply this change, which would align the end-of-line marker placement with the start-of-line marker placement, have at it.

The next issue was that clar/sandbox.h uses mkdtemp, which I don't have here. Git has solved this in compat/mkdtemp.c via git-compat-util.h, but clar is not using it. Adding git-compat-util.h to clar/sandbox.h feels weird, but does get us further along. That change introduced banned.h into clar, which exposed the use of strncpy and localtime, both otherwise banned in git.

Including git-compat-util.h in clar/sandbox.h (bringing in mkdtemp, and replacing strncpy with strlcpy) and clar/summary.h (replacing localtime with localtime_r) leads to our next issue: a redefinition of _FILE_OFFSET_BITS, which is defined unconditionally in git-compat-util.h, because clar.c imports system headers that define it first. git-compat-util.h is meant to be included first, so, I added git-compat-util.h to the top of clar.c. That caused system includes via <wchar.h> to no longer compile due to syntax errors. This is where I gave up.

I'm sad that I can no longer build git on this old version of SunOS, and that it's the newly-imported unit-testing framework and not git itself that is preventing me from building it. Given the talk of adding rust to git, and of bumping the perl requirements to 5.26.0 (I have a system 5.8.3, and a 5.10.1 for building openssl), this moment was inevitable. On the plus side, this was the slowest platform I built git on, so perhaps I should be happy about my new free time.

Please note that this should not be read as opposition to the new unit-testing framework in any way. Building git (and curl, and gmake, and zlib, and openssl, and perl, all for git) for SunOS was a hobby for me, and not anything I personally need, and besides, it's not like my previous builds have disappeared.

The last successful build for me was 2.45.2. I've built or tried to build most versions since 1.6.6. Some of my build infrastructure was unavailable since sometime after 2.45.2, so I have not tried 2.46.x, but it lacks clar, so I expect it would build fine.

Cheers, -Alejandro

Next: Patrick Steinhardt
Message 1 of 30 in “git no longer builds on SunOS 5.10, a report”
  1. Alejandro R. SedeñoOct 12, 2024
  2. Patrick SteinhardtOct 12, 2024
  3. Alejandro R. SedeñoOct 12, 2024
  4. Makefile: adjust sed command for generating "clar-decls.h"Alejandro R. Sedeño, Oct 12, 2024
  5. Alejandro R. SedeñoOct 12, 2024
  6. Patrick SteinhardtOct 13, 2024
  7. Alejandro R. SedeñoOct 13, 2024
  8. Patrick SteinhardtOct 14, 2024
  9. 0/2 t/unit-tests: improve clar platform compatibilityPatrick Steinhardt, Oct 14, 2024
  10. 1/2 t/unit-tests: update clar to 0810a36Patrick Steinhardt, Oct 14, 2024
  11. 2/2 Makefile: adjust sed command for generating "clar-decls.h"Patrick Steinhardt, Oct 14, 2024
  12. Toon ClaesOct 18, 2024
  13. Taylor BlauOct 18, 2024
  14. Patrick SteinhardtOct 21, 2024
  15. 0/5 t/unit-tests: improve clar platform compatibilityPatrick Steinhardt, Oct 21, 2024
  16. 1/5 t/unit-tests: update clar to 206accbPatrick Steinhardt, Oct 21, 2024
  17. 2/5 Makefile: adjust sed command for generating "clar-decls.h"Patrick Steinhardt, Oct 21, 2024
  18. Kristoffer HaugsbakkOct 21, 2024
  19. Patrick SteinhardtOct 21, 2024
  20. 3/5 Makefile: extract script to generate clar declarationsPatrick Steinhardt, Oct 21, 2024
  21. 4/5 cmake: fix compilation of clar-based unit testsPatrick Steinhardt, Oct 21, 2024
  22. 5/5 cmake: set up proper dependencies for generated clar headersPatrick Steinhardt, Oct 21, 2024
  23. Johannes SchindelinNov 5, 2024
  24. Phillip WoodNov 6, 2024
  25. Patrick SteinhardtNov 8, 2024
  26. Taylor BlauOct 21, 2024
  27. karthik nayakOct 25, 2024
  28. Bagas SanjayaOct 26, 2024
  29. Patrick SteinhardtOct 27, 2024
  30. Taylor BlauOct 27, 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.