From owner-freebsd-current@freebsd.org Sat Aug 31 06:24:49 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 420A7E5A6D for ; Sat, 31 Aug 2019 06:24:49 +0000 (UTC) (envelope-from gljennjohn@gmail.com) Received: from mailman.nyi.freebsd.org (mailman.nyi.freebsd.org [IPv6:2610:1c1:1:606c::50:13]) by mx1.freebsd.org (Postfix) with ESMTP id 46L5t869YWz457X for ; Sat, 31 Aug 2019 06:24:48 +0000 (UTC) (envelope-from gljennjohn@gmail.com) Received: by mailman.nyi.freebsd.org (Postfix) id D3CF8E5A6B; Sat, 31 Aug 2019 06:24:48 +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 D3940E5A6A for ; Sat, 31 Aug 2019 06:24:48 +0000 (UTC) (envelope-from gljennjohn@gmail.com) Received: from mail-wm1-x344.google.com (mail-wm1-x344.google.com [IPv6:2a00:1450:4864:20::344]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46L5t85GJ6z457W; Sat, 31 Aug 2019 06:24:48 +0000 (UTC) (envelope-from gljennjohn@gmail.com) Received: by mail-wm1-x344.google.com with SMTP id r17so7872897wme.0; Fri, 30 Aug 2019 23:24:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:in-reply-to:references:reply-to :mime-version:content-transfer-encoding; bh=1+FpmgZBFE/+U54KN0YubFW8xMbJwASnSpFIpB3AOyg=; b=kCRsAh+kP0oe+2NnTf6DUSDECmBThy7Ldxsd5eyWzxydM43aLJPzFAzbBNlA6rnhsA O1ioXR0kd71dxeWwSNP1vLVV4WXuw01hb4FCxcdrBSwlzhMG1NJiVts/CQ+LSEtlnqab kxsBiqBUH5aEYsheutN50pXCcutJnhkCDKFYk13+wg0BZSujoNpsnMskOVuTiqsdd85Q ECCNqt6Ce41Sk49c0jrpzt99Vd4/Tsjx2hSbWheY3tHhbIQVWNnScvBEMjxD/5viDSrt m/GwO7xlHIPX5XBR6v+5LPGzFX/o+5agX7nGyERwZwJESdwkNpBbj6F3wOnjYOssZ0fS s+fw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:reply-to:mime-version:content-transfer-encoding; bh=1+FpmgZBFE/+U54KN0YubFW8xMbJwASnSpFIpB3AOyg=; b=ASuUjDnoREZPIYC5Dr96t4eMjF9aqGZ0LwoLEEVG49IOhSkY9BcMdA+YMuOcZgK2Yw exMnXlqC03e0kwLhpJUlAE4tGgpOxPsuUiN0p0Nu8pQJXXZYK01Una4dcYIehQXu9T8o 4qu8Y67ggWAJU6gd3qd7PtOd2UDKu1oWTtoWtm0FLn/awvP5/mrOUGIET8MOPnyoNKfC O3E8vL48UFMN8Dgxh6VFgekKNzvx4OYrgXeXbICyuMJs3ogyruVz2ukoBq5jDDlIwfi/ We8XLELh13aqCwGpBaH4fpz4aL67Dui3WfQGeMXSUeZGdhiziI8Eoo5IgA9bJ/QleHUO ccVg== X-Gm-Message-State: APjAAAXoZQVXHsw1MSsEOabLQWrZumsI8DZ6ia8jldY767X/x8e9uyzs pc//6D5jBv0TmLYF24P7Ta3IxfxTON8= X-Google-Smtp-Source: APXvYqwd6XUXgvaUCqYjpqJSUVy97pKagh3fxrHcQO2oSN8qs0XKwmH9WhAWJQXCFeXC0mxS5hnWZA== X-Received: by 2002:a7b:c303:: with SMTP id k3mr9146590wmj.47.1567232687462; Fri, 30 Aug 2019 23:24:47 -0700 (PDT) Received: from ernst.home (pD9E239A5.dip0.t-ipconnect.de. [217.226.57.165]) by smtp.gmail.com with ESMTPSA id c18sm1983882wrr.11.2019.08.30.23.24.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Aug 2019 23:24:47 -0700 (PDT) Date: Sat, 31 Aug 2019 08:24:46 +0200 From: Gary Jennejohn To: Kyle Evans Cc: John Baldwin , current Subject: Re: problem with LOCAL_MODULES Message-ID: <20190831082446.2a8de0f0@ernst.home> In-Reply-To: References: <20190816120524.21b7fd19@ernst.home> <7b46b0a5-903f-5d8d-c7df-9eafda504445@FreeBSD.org> Reply-To: gljennjohn@gmail.com X-Mailer: Claws Mail 3.17.4 (GTK+ 2.24.32; amd64-portbld-freebsd13.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 46L5t85GJ6z457W X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] 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: Sat, 31 Aug 2019 06:24:49 -0000 On Fri, 30 Aug 2019 14:33:06 -0500 Kyle Evans wrote: > On Fri, Aug 30, 2019 at 2:26 PM Kyle Evans wrote: > > > > On Fri, Aug 30, 2019 at 2:11 PM John Baldwin wrote: > > > > > > On 8/30/19 10:42 AM, Kyle Evans wrote: > > > > On Fri, Aug 16, 2019 at 7:38 PM John Baldwin wrote: > > > >> > > > >> On 8/16/19 3:05 AM, Gary Jennejohn wrote: > > > >>> I tried to build a kernel today and it failed in modules-all even > > > >>> though I had LOCAL_MODULES="" in /etc/src.conf, as recommended by > > > >>> jhb. > > > >>> > > > >>> That's wrong. It has to be LOCAL_MODULES=, otherwise > > > >>> /sys/conf/kern.post.mk seems to conclude that there should be a > > > >>> module under /usr/local/sys/modules with the name "". > > > >> > > > >> I think this will permit both versions to work: > > > >> > > > >> Index: sys/conf/kern.post.mk > > > >> =================================================================== > > > >> --- kern.post.mk (revision 351151) > > > >> +++ kern.post.mk (working copy) > > > >> @@ -76,6 +76,7 @@ modules-${target}: > > > >> cd $S/modules; ${MKMODULESENV} ${MAKE} \ > > > >> ${target:S/^reinstall$/install/:S/^clobber$/cleandir/} > > > >> .endif > > > >> +.if !empty(LOCAL_MODULES) > > > >> .for module in ${LOCAL_MODULES} > > > >> @${ECHODIR} "===> ${module} (${target:S/^reinstall$/install/:S/^clobber$/cleandir/})" > > > >> @cd ${LOCAL_MODULES_DIR}/${module}; ${MKMODULESENV} ${MAKE} \ > > > >> @@ -83,6 +84,7 @@ modules-${target}: > > > >> ${target:S/^reinstall$/install/:S/^clobber$/cleandir/} > > > >> .endfor > > > >> .endif > > > >> +.endif > > > >> .endfor > > > >> > > > >> # Handle ports (as defined by the user) that build kernel modules > > > >> > > > > > > > > I think I'd like to see this with !empty(LOCAL_MODULES) && > > > > EXISTS(${LOCAL_MODULES_DIR}) or maybe just the latter condition to > > > > prevent accidental foot-shooting... I was testing a problem with doing > > > > this stuff in a poudriere build for swills@ and set LOCAL_MODULES="" > > > > only to get an error because LOCAL_MODULES_DIR doesn't yet exist on > > > > the machine I was testing with -- which we can trivially avoid. > > > > > > Did this work for you? Gary said in a followup that it didn't work, > > > so that's why I hadn't committed it. > > > > > > > Hmm... I went back and tested his exact scenario, and no- > > LOCAL_MODULES isn't empty at this point because word processing that > > leaves us with an empty string hasn't yet been done. An .if > > !empty(module) inside the loop is much happier- I'm not seeing any > > modifiers that would give us the behavior we wanted for figuring this > > out before entering the loop. > > It turns out I'm silly... this is sufficient for both of our problems > (because it's the same problem) and hopefully my mail client doesn't > goof this up: > > diff --git a/sys/conf/kern.post.mk b/sys/conf/kern.post.mk > index ff10daf1a0a..09bfffad095 100644 > --- a/sys/conf/kern.post.mk > +++ b/sys/conf/kern.post.mk > @@ -77,10 +77,12 @@ modules-${target}: > ${target:S/^reinstall$/install/:S/^clobber$/cleandir/} > .endif > .for module in ${LOCAL_MODULES} > +.if !empty(module) > @${ECHODIR} "===> ${module} > (${target:S/^reinstall$/install/:S/^clobber$/cleandir/})" > @cd ${LOCAL_MODULES_DIR}/${module}; ${MKMODULESENV} ${MAKE} \ > DIRPRFX="${module}/" \ > ${target:S/^reinstall$/install/:S/^clobber$/cleandir/} > +.endif > .endfor > .endif > .endfor Yes, this patch works correctly. -- Gary Jennejohn