From owner-freebsd-stable@freebsd.org Sat Oct 8 18:13:53 2016 Return-Path: Delivered-To: freebsd-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D7C62C069E9 for ; Sat, 8 Oct 2016 18:13:53 +0000 (UTC) (envelope-from enslay@gmail.com) Received: from mail-it0-x232.google.com (mail-it0-x232.google.com [IPv6:2607:f8b0:4001:c0b::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A125288E for ; Sat, 8 Oct 2016 18:13:53 +0000 (UTC) (envelope-from enslay@gmail.com) Received: by mail-it0-x232.google.com with SMTP id z65so36063735itc.0 for ; Sat, 08 Oct 2016 11:13:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=e/ro801kQZa1Pp5B/GXmJ75oS1rPpCcr99G2+zx2zAU=; b=CDj2q1ust/AUjdz98SgA0/Wtm/zTrMeZRCGBDxTuBpYjPYHrbWgAnLOlYZtqw45LeS JLUhWsTR+cokWCWfnrZs++uPG6cBBbJq5CDyb5wOQeKEE5SnZg+nC0hmL6aMvtZPR08i jvcXxclyQ/gRONvbTMMVP1TASyEZGhWSnkiEiqHCC7WWm7o9V0vatfXZphPjai/5diGW MAxul9oPXa2M82zT7wMCbcs7bB7f72yy09+WJ6Q+mTK0q32I/PxW1xNexKWyRNAnGaBc crINACcpDxrTX+0hXLB2DekQhWwJlLPJOA+V1NrhnUJJ3wOzTj4D7wgv7IRd4YX+vdMa Lj6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=e/ro801kQZa1Pp5B/GXmJ75oS1rPpCcr99G2+zx2zAU=; b=fDV/TaXO7Fa1u9g9BJgtft42d0X930GhM900DvctDOaFQRW/Qk34CIWT9So92Hk2QI XpW226gCHLv6epJFx/cYc3Ff4H8x9tKQnXU5FEKtuCNXurFj6B1ujs9w+TdO0ltP3S9X o7o7lt3t1Mkd9i1arR/Tjrx5CQkhO3V4YFHcROV7/APQhctmLP3QnUlu2nEd/qGEcjSx rnAi/PlT0bweoLjvErN+xiWd5k+Zw8mCFfv3cQoOFrItCwzgHhb6WVw0eqbGYa0IIMPp aUDwkN1jaeopxraliWe9XCzgojjx9L0r0a2fkhJuVZJEpjc+a45r0cJ54J7E1J+U86Yw t67Q== X-Gm-Message-State: AA6/9RlG5iGemIr/SGf7U9d1qe8TSVP/Psj7t3YI5H/XjjYDH/4QvZ/JBg1yTFV2QLKwEl6oVve/nKlz6gA/4g== X-Received: by 10.36.73.23 with SMTP id z23mr3664590ita.32.1475950432755; Sat, 08 Oct 2016 11:13:52 -0700 (PDT) MIME-Version: 1.0 Received: by 10.36.14.71 with HTTP; Sat, 8 Oct 2016 11:13:52 -0700 (PDT) In-Reply-To: References: From: Nathan Lay Date: Sat, 8 Oct 2016 14:13:52 -0400 Message-ID: Subject: Re: Your buildworld system is pulling userland libraries/headers To: freebsd-stable@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Oct 2016 18:13:53 -0000 Hello FreeBSD-stable, Here's another example: --- begin snip --- ... /usr/src/usr.bin/nfsstat/nfsstat.c:262:22: error: use of undeclared identifier 'NFSSTATS_V1' ext_nfsstats.vers = NFSSTATS_V1; ^ /usr/src/usr.bin/nfsstat/nfsstat.c:272:27: error: incomplete definition of type 'struct nfsstatsv1' (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_GETATTR], ~~~~~~~~~~~~^ /usr/src/usr.bin/nfsstat/nfsstat.c:107:15: note: forward declaration of 'struct nfsstatsv1' static struct nfsstatsv1 ext_nfsstats; ^ /usr/src/usr.bin/nfsstat/nfsstat.c:273:27: error: incomplete definition of type 'struct nfsstatsv1' (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_SETATTR], ~~~~~~~~~~~~^ /usr/src/usr.bin/nfsstat/nfsstat.c:107:15: note: forward declaration of 'struct nfsstatsv1' static struct nfsstatsv1 ext_nfsstats; ^ /usr/src/usr.bin/nfsstat/nfsstat.c:274:27: error: incomplete definition of type 'struct nfsstatsv1' (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_LOOKUP], ... --- end snip --- Now why is this? Your build system is including userland headers. Look it's correct in /usr/src/sys/fs/nfs/nfsport.h root@RADIO:/usr/src/lib/libprocstat # grep -r NFSSTATS_V1 /usr/src/sys/ /usr/src/sys/fs/nfs/nfsport.h: * The vers field will be set to NFSSTATS_V1 by the caller. /usr/src/sys/fs/nfs/nfsport.h:#define NFSSTATS_V1 1 /usr/src/sys/fs/nfs/nfs_commonport.c: if (error == 0 && nfsstatver.vers != NFSSTATS_V1) ^C But nfsstats is including /usr/include/fs/nfs/nfsports.h. This is poisoning the build. root@RADIO:/usr/src/lib/libprocstat # diff /usr/include/fs/nfs/nfsport.h /usr/src/sys/fs/nfs/nfsport.h | less ... > #define NFSSTATS_V1 1 ... So I'll copy this and build nfsstat myself: cp /usr/src/sys/fs/nfs/nfsport.h /usr/include/fs/nfs/nfsport.h root@RADIO:/usr/src/usr.bin/nfsstat # make clang -O2 -pipe -DNFS -march=nocona -g -MD -MF.depend.nfsstat.o -MTnfsstat.o -std=gnu99 -fstack-protector-strong -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter -Wcast-align -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls -Wold-style-definition -Wno-pointer-sign -Wmissing-variable-declarations -Wthread-safety -Wno-empty-body -Wno-string-plus-int -Wno-unused-const-variable -Qunused-arguments -c /usr/src/usr.bin/nfsstat/nfsstat.c -o nfsstat.o clang -O2 -pipe -DNFS -march=nocona -g -std=gnu99 -fstack-protector-strong -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter -Wcast-align -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls -Wold-style-definition -Wno-pointer-sign -Wmissing-variable-declarations -Wthread-safety -Wno-empty-body -Wno-string-plus-int -Wno-unused-const-variable -Qunused-arguments -o nfsstat.full nfsstat.o -ldevstat objcopy --only-keep-debug nfsstat.full nfsstat.debug objcopy --strip-debug --add-gnu-debuglink=nfsstat.debug nfsstat.full nfsstat gzip -cn /usr/src/usr.bin/nfsstat/nfsstat.1 > nfsstat.1.gz This is very very disturbing. A build system that builds a self-contained operating system should not be pulling in the existing userland's headers and libraries. Best regards, Nathan Lay On Sat, Oct 8, 2016 at 12:26 AM, Nathan Lay wrote: > Hello once again FreeBSD-stable, > While upgrading from FreeBSD 10-STABLE and later updating my FreeBSD > 11-STABLE system, I noticed that your build system is pulling headers and > libraries from the userland rather than the /usr/src tree. This can't > possibly be intended. I kind of figured with recent news of delayed > released you might have realized this. After all, _FOR EXAMPLE_ (may not > reflect reality), who wants to accidentally include userland's older > version of OpenSSL headers and link with userland's older version of > OpenSSL? > > I can cope with this by manually copying headers from /usr/src/sys/sys and > /usr/src/include to their appropriate locations and/or installing the newer > library manually and then restarting the build. But others may not be so > familiar with FreeBSD. And I did manage to get FreeBSD 11-STABLE up and > running just fine eventually. > > But just a few days ago, I updated SVN to rebuild world and kernel > following the news of your delayed release and found libprocstat failing to > compile. And it failed to compile because it was including > /usr/include/ufs/ufs/extattr.h instead of /usr/src/sys/sys/ufs/ufs/extattr.h. > This is very disturbing to me. During the FreeBSD 10 updating phase, I saw > way more examples of this with even unresolved reference errors during > linking since the build system was trying to link with userland's FreeBSD > 10 libraries! I can think of two recurring examples: devctl and procstat. > > I also noticed your build system liked to now put modules in > /boot/modules. I was hacking if_ath and none of my changes were working. > Well, it was because kldload was loading the unchanged one in /boot/kernel > rather than the one now being installed in /boot/modules. That's a really > nasty surprise. I probably spent a couple hours figuring that out :) > > Best regards, > Nathan Lay > > P.S. FreeBSD 11 is running great! Great job! >