Samba fails to build on sparc64, 4.24.6 and master, while compiling source4/kdc/sdb_to_hdb.c: third_party/heimdal/include/crypto-headers.h:5:2: error: #error "need config.h" Two files answer to #include "crypto-headers.h": the vendored third_party/heimdal/include/crypto-headers.h, and Samba's replacement in third_party/heimdal_build/. Both directories are on the include path, so which one is used depends on whether -Ithird_party/heimdal_build precedes -Ithird_party/heimdal/include. The vendored copy requires PACKAGE_NAME, which nothing in a Samba build defines, so it can never compile here: a build succeeds only when the -I order happens to select the replacement. That order comes from build_includes() in buildtools/wafsamba/samba_deps.py, which iterates an unordered set of target names and appends each dependency's own directory after the directories that dependency declares in includes=. Nine heimdal targets declare ../heimdal/include, so whichever one the set yields first decides whether the tree builds. This is the same root cause as bug 15080, with a different symptom. It is not sparc64-specific. On amd64 against master (Ubuntu 24.04, python 3.12), relax the PYTHONHASHSEED guard at buildtools/wafsamba/wscript:18, delete the dependency cache bin/c4che/sambadeps, then: $ PYTHONHASHSEED=5 ./buildtools/bin/waf build -j20 In file included from ../../third_party/heimdal/lib/krb5/krb5_locl.h:123, from ../../source4/kdc/wdc-samba4.c:32: ../../third_party/heimdal/include/crypto-headers.h:5:2: error: #error "need config.h" -> task in 'WDC_SAMBA4' failed with exit status 1 which is the only distinct error in the build. Of the 1025 targets that have both directories on their include path, the number searching heimdal/include first is 0 at seeds 1, 2, 4, 8 and 9, and 891 at seed 5. A seed showing 0 cannot hit this failure; a seed above 0 fails only if one of the flipped targets actually reaches crypto-headers.h, which is why the failing file differs per architecture. Pinning the seed, which that guard already does, does not pin the order: with PYTHONHASHSEED=1, hash('HEIMDAL_KRB5') is -5777948353383250625 on amd64 and 7800708043191837418 on a sparc64 T4. Failing build, Debian sparc64 2:4.24.6+dfsg-1: https://buildd.debian.org/status/fetch.php?pkg=samba&arch=sparc64&ver=2%3A4.24.6%2Bdfsg-1&stamp=1787532390&raw=0 Working build, same version, amd64: https://buildd.debian.org/status/fetch.php?pkg=samba&arch=amd64&ver=2%3A4.24.6%2Bdfsg-1&stamp=1786643697&raw=0 Earlier reports: https://lists.samba.org/archive/samba-technical/2026-February/140625.html https://lists.samba.org/archive/samba-technical/2022-November/137788.html
Merge request: https://gitlab.com/samba-team/samba/-/merge_requests/4684