Bug 16229 - FTBFS on sparc64: heimdal crypto-headers.h shadowing depends on unstable -I order
Summary: FTBFS on sparc64: heimdal crypto-headers.h shadowing depends on unstable -I o...
Status: NEW
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: Build (show other bugs)
Version: 4.24.6
Hardware: Sparc Linux
: P5 normal (vote)
Target Milestone: ---
Assignee: Samba QA Contact
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2026-08-31 11:00 UTC by Stian Halseth
Modified: 2026-08-31 11:36 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stian Halseth 2026-08-31 11:00:29 UTC
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
Comment 1 Stian Halseth 2026-08-31 11:36:35 UTC
Merge request: https://gitlab.com/samba-team/samba/-/merge_requests/4684