From owner-freebsd-current@freebsd.org Wed Sep 4 14:33:21 2019 Return-Path: Delivered-To: freebsd-current@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D05E5F36E2 for ; Wed, 4 Sep 2019 14:33:21 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mailman.nyi.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id 46NmX1594Vz4Ndr for ; Wed, 4 Sep 2019 14:33:21 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mailman.nyi.freebsd.org (Postfix) id B1269F36E1; Wed, 4 Sep 2019 14:33:21 +0000 (UTC) Delivered-To: current@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B0EDFF36E0 for ; Wed, 4 Sep 2019 14:33:21 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46NmX14GMCz4Ndq; Wed, 4 Sep 2019 14:33:21 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qt1-f178.google.com (mail-qt1-f178.google.com [209.85.160.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 6837614A07; Wed, 4 Sep 2019 14:33:21 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qt1-f178.google.com with SMTP id u40so16009081qth.11; Wed, 04 Sep 2019 07:33:21 -0700 (PDT) X-Gm-Message-State: APjAAAWIxAJjqbICGKZgOOckNWfC6l0ciKaON5UJl4WVDjfTtKMm2zQ5 WZFdngL7jvD37LVaT/K4WDRMEsbTfvNW42flCHk= X-Google-Smtp-Source: APXvYqzO2chaL8jQES47zXdXe79nOtjYCb8rzK1ipgWPnGvYa9OU4/nJRC5uG42niV++cj/TxVEPJe0o4LYaBv5Ygjk= X-Received: by 2002:ac8:74d5:: with SMTP id j21mr39011767qtr.60.1567607600947; Wed, 04 Sep 2019 07:33:20 -0700 (PDT) MIME-Version: 1.0 References: <3843.1567598344@critter.freebsd.dk> <969A062A-A52A-49E3-B4E3-CC9377B08C80@gmail.com> In-Reply-To: <969A062A-A52A-49E3-B4E3-CC9377B08C80@gmail.com> From: Kyle Evans Date: Wed, 4 Sep 2019 09:33:08 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: Weird goings on with make::empty() To: Enji Cooper Cc: Poul-Henning Kamp , current , Kyle Evans Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Sep 2019 14:33:21 -0000 On Wed, Sep 4, 2019 at 9:27 AM Enji Cooper wrote: > > > > On Sep 4, 2019, at 04:59, Poul-Henning Kamp wrote: > > > > On: > > > > Repository Root: svn+ssh://repo.freebsd.org/base > > Repository UUID: ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f > > Revision: 351809 > > > > I built a kernel, but drm-current-kmod did not get compiled > > from the new world order in /usr/local/sys/modules > > > > Debugging I ended up doing this to src/sys/conf/kern.post.mk: > > > > Index: sys/conf/kern.post.mk > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > --- sys/conf/kern.post.mk (revision 351809) > > +++ sys/conf/kern.post.mk (working copy) > > @@ -77,12 +77,14 @@ > > ${target:S/^reinstall$/install/:S/^clobber$/cleandir/} > > .endif > > .for module in ${LOCAL_MODULES} > > -.if !empty(module) > > + true "XXX A $(module) 2 ${LOCALBASE} 3 ${LOCAL_MODULES} 4 ${MOD= ULES_WITH_WORLD}" > > +#.if !empty(module) > > + true "XXX B $(module) 2 ${LOCALBASE} 3 ${LOCAL_MODULES} 4 ${MOD= ULES_WITH_WORLD}" > > @${ECHODIR} "=3D=3D=3D> ${module} (${target:S/^reinstall$/instal= l/:S/^clobber$/cleandir/})" > > @cd ${LOCAL_MODULES_DIR}/${module}; ${MKMODULESENV} ${MAKE} \ > > DIRPRFX=3D"${module}/" \ > > ${target:S/^reinstall$/install/:S/^clobber$/cleandir/} > > -.endif > > +#.endif > > .endfor > > .endif > > .endfor > > > > This gives me the expected output from buildkernel: > > > > true "XXX A drm-current-kmod 2 /usr/local 3 drm-current-kmod 4 " > > true "XXX B drm-current-kmod 2 /usr/local 3 drm-current-kmod 4 " > > > > If I leave in the ".if !empty(module)" line in, I only get: > > > > true "XXX A drm-current-kmod 2 /usr/local 3 drm-current-kmod 4 " > > > > suggestions welcome... > > (CCing Kyle) > > This behavior change is probably caused by r351799. > > I personally think the code before Kyle=E2=80=99s change and after it was= buggy. It=E2=80=99s not word splitting LOCAL_MODULES before iterating over= it. > I've backed out r351799 since it breaks usage of LOCAL_MODULES (though I really don't understand how empty works, apparently, and that makes me sad)... please advise on a correct path forward, because it's not clear to me. Thanks, Kyle Evans