[Bug 259787] sched.h: unknown type name 'cpu_set_t' after 160b4b922b6021848b6b48afc894d16b879b7af2

From: <bugzilla-noreply_at_freebsd.org>
Date: Tue, 28 Jun 2022 18:59:19 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=259787

--- Comment #47 from Stefan E├čer <se@FreeBSD.org> ---
(In reply to Eugene Grosbein from comment #44)

Thank you for providing the build log and options.

I have just rebuilt squid-5.6 on -CURRENT/amd64 with default options and then
with the options provided in comment 46.

Both builds succeeded without issue, as did the "poudriere testport" builds in 
my 3 test jails:

 amd64/12.3
 amd64/13.1
 i386/13.0

The 12.3 and 13.0 releases did not have the GLIBC compatible CPU_SET functions,
13.1 and -CURRENT do. I'm using this mix of releases in order to cover
different compilers and system headers of the currently supported releases.

There are packages of squid-5.6 for many releases and architectures, see:

 https://www.freshports.org/www/squid/

And this is near the end of the successful "poudriere testport" run on
amd/13.1:

> gmake[3]: Leaving directory '/wrkdirs/usr/ports/www/squid/work/squid-5.6'
> gmake[2]: Leaving directory '/wrkdirs/usr/ports/www/squid/work/squid-5.6'
> gmake[1]: Leaving directory '/wrkdirs/usr/ports/www/squid/work/squid-5.6'
> install  -m 0644 /wrkdirs/usr/ports/www/squid/work/squid-5.6/src/auth/basic/DB/passwd.sql  /wrkdirs/usr/ports/www/squid/work/stage/usr/local/share/examples/squid
> (cd /wrkdirs/usr/ports/www/squid/work/squid-5.6 && install  -m 0644 QUICKSTART README RELEASENOTES.html doc/debug-sections.txt /wrkdirs/usr/ports/www/squid/work/stage/usr/local/share/doc/squid)
> ====> Compressing man pages (compress-man)
> ===> Staging rc.d startup script(s)
> ===========================================================================
> ====> Running Q/A tests (stage-qa)
> ====> Checking for pkg-plist issues (check-plist)
> ===> Parsing plist
> ===> Checking for items in STAGEDIR missing from pkg-plist
> ===> Checking for items in pkg-plist which are not in STAGEDIR
> ===> No pkg-plist issues found (check-plist)
> =>> Checking for staging violations... done
> =======================<phase: package        >============================
> ===== env: DEVELOPER_MODE=yes PACKAGES=/tmp/pkgs PKGREPOSITORY=/tmp/pkgs PKGLATESTREPOSITORY=/tmp/pkgs/Latest 'PKG_NOTES=build_timestamp built_by' 'PKG_NOTE_build_timestamp=2022-06-28T18:09:38+0000' 'PKG_NOTE_built_by=poudriere-git-3.3.99.20220617' STRICT_DEPENDS=yes USER=root UID=0 GID=0
> ===>  Building package for squid-5.6
> ===========================================================================
> =>> Recording filesystem state for preinst... done
> =======================<phase: install        >============================
> ===== env: DEVELOPER_MODE=yes STRICT_DEPENDS=yes USER=root UID=0 GID=0
> ===>  Installing for squid-5.6
> ===>  Checking if squid is already installed

The build log on other architectures and releases differs in the order of
execution of the compiler due to the parallel make, but not in other aspects.

One thing that I noticed is that the compiler is invoked with different options
in my successful tests and your log file.

Your failed compilation:

> depbase=`echo CpuAffinity.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
> c++ -DHAVE_CONFIG_H -DDEFAULT_CONFIG_FILE=\"/usr/local/etc/squid/squid.conf\" -DDEFAULT_SQUID_DATA_DIR=\"/usr/local/etc/squid\" -DDEFAULT_SQUID_CONFIG_DIR=\"/usr/local/etc/squid\"   -I.. -I../include -I../lib -I../src -I../include   -I../libltdl -I../src -I../libltdl  -isystem /usr/local/include -D_REENTRANT -O2 -pipe -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing  -isystem /usr/local/include  -I/usr/local/include -MT CpuAffinity.o -MD -MP -MF $depbase.Tpo -c -o CpuAffinity.o CpuAffinity.cc &&\
> mv -f $depbase.Tpo $depbase.Po
> In file included from CpuAffinity.cc:15:
> In file included from ../src/CpuAffinitySet.h:12:
> ../compat/cpu.h:42:31: error: unknown type name 'cpu_set_t'; did you mean 'cpusetid_t'?
> inline void CpuSet(int, const cpu_set_t *) {}
>                               ^~~~~~~~~
>                               cpusetid_t
> /usr/include/sys/types.h:86:22: note: 'cpusetid_t' declared here
> typedef __cpusetid_t    cpusetid_t;
> 			^

My successful invocation explicitly includes /usr/include:

> depbase=`echo CpuAffinity.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
> c++ -DHAVE_CONFIG_H -DDEFAULT_CONFIG_FILE=\"/usr/local/etc/squid/squid.conf\" -DDEFAULT_SQUID_DATA_DIR=\"/usr/local/etc/squid\" -DDEFAULT_SQUID_CONFIG_DIR=\"/usr/local/etc/squid\"   -I.. -I../include -I../lib -I../src -I../include  -I/usr/include  -I/usr/include  -I../libltdl -I../src -I../libltdl -I/usr/include  -I/usr/include  -I/usr/include -isystem /usr/local/include -D_REENTRANT -I/usr/include -I/usr/include -O2 -pipe -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing  -isystem /usr/local/include  -I/usr/local/include -MT CpuAffinity.o -MD -MP -MF $depbase.Tpo -c -o CpuAffinity.o CpuAffinity.cc &&\
> mv -f $depbase.Tpo $depbase.Po

That's the only difference that I could spot.

Since this issue does not seem to exist on the official package builders and
has not been reported by anybody else, it seems mostly likely that there is a
local issue on your build host ...

-- 
You are receiving this mail because:
You are on the CC list for the bug.