From owner-svn-src-head@freebsd.org Thu Aug 30 20:05:56 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0B8E6EF790E; Thu, 30 Aug 2018 20:05:56 +0000 (UTC) (envelope-from arichardson.kde@gmail.com) Received: from mail-yw1-f43.google.com (mail-yw1-f43.google.com [209.85.161.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A792970B6A; Thu, 30 Aug 2018 20:05:55 +0000 (UTC) (envelope-from arichardson.kde@gmail.com) Received: by mail-yw1-f43.google.com with SMTP id w202-v6so4233968yww.3; Thu, 30 Aug 2018 13:05:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=x4ra/j2/TgDVebE7JOcjDJUxvo1MvPh+WKg37wXQzPc=; b=C1nF234xbRH6fmCfc4KX40gMX9Aa4ErUjHjsENxd/syY+4rqNRVmEvcal1iqGOYcmY 0TrfcElRkWArOwFLBZ6HpHr24J90MR3mTE/AVLi+I1q1xeOsVqNScfqoTFnHNF/crcJV 9V/nLq+vlJklfq3lZaib1vKizBngHx8Np9R+bUlRCLW3vdHzaWqCmMtmbygpYoBD+T7i WzXGI8eTymYzsuiPRxGpUIG88pNQ1sFL4Qd+tzoyX/RjwUO0Ric/CNwx4bstnvOqEQ9t qxJ7ftCLwx00uVmEAYmRDVD2mjLHI1fZJB/5bcRQ4Z5DchlHw7459i/BDuLLivuPVm+G Uktw== X-Gm-Message-State: APzg51Bfsfq3Y+XLlXvqP5LN8RNDVeuGRn/Cv1JgS2naGlXlSyInUhr8 2/0HIKF8+AYCrblDNPmTzk7qeu/sCxta/6cn X-Google-Smtp-Source: ANB0VdZx+YS7Sb0S+uioGJHr+Aj/ylaJUJIVegG31e8+KzFzQmIwDLuArXFOZwth9I02JvnFlwegqA== X-Received: by 2002:a81:7484:: with SMTP id p126-v6mr6869930ywc.287.1535659549546; Thu, 30 Aug 2018 13:05:49 -0700 (PDT) Received: from mail-yb1-f181.google.com (mail-yb1-f181.google.com. [209.85.219.181]) by smtp.gmail.com with ESMTPSA id i123-v6sm3820315ywe.14.2018.08.30.13.05.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Aug 2018 13:05:49 -0700 (PDT) Received: by mail-yb1-f181.google.com with SMTP id o17-v6so71699yba.2; Thu, 30 Aug 2018 13:05:49 -0700 (PDT) X-Received: by 2002:a25:9b82:: with SMTP id v2-v6mr6781768ybo.193.1535659548914; Thu, 30 Aug 2018 13:05:48 -0700 (PDT) MIME-Version: 1.0 References: <201808201039.w7KAdrMM079556@repo.freebsd.org> <201808291920.w7TJKhKs047018@slippy.cwsent.com> In-Reply-To: <201808291920.w7TJKhKs047018@slippy.cwsent.com> From: Alexander Richardson Date: Thu, 30 Aug 2018 21:05:37 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r338098 - in head: . tools/build To: Cy Schubert Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.27 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Aug 2018 20:05:56 -0000 On Wed, 29 Aug 2018 at 20:21 Cy Schubert wrote: > In message <201808201039.w7KAdrMM079556@repo.freebsd.org>, Alex > Richardson writ > es: > > Author: arichardson > > Date: Mon Aug 20 10:39:53 2018 > > New Revision: 338098 > > URL: https://svnweb.freebsd.org/changeset/base/338098 > > > > Log: > > Don't create directories in ${WORLDTMP}/legacy with mtree > > > > This has two advantages: > > 1) We no longer create lots of empty directories that are not needed > > 2) This is a requirement for building on non-FreeBSD hosts since mtree > will > > only exist after the bootstrap-tools phase there. > > > > Aproved By: jhb (mentor) > > Differential Revision: https://reviews.freebsd.org/D16773 > > > > Modified: > > head/Makefile.inc1 > > head/tools/build/Makefile > > > > Modified: head/Makefile.inc1 > > > ============================================================================= > > = > > --- head/Makefile.inc1 Mon Aug 20 10:39:48 2018 (r338097) > > +++ head/Makefile.inc1 Mon Aug 20 10:39:53 2018 (r338098) > > @@ -968,29 +968,10 @@ _worldtmp: .PHONY > > .endif # !defined(NO_CLEAN) > > @mkdir -p ${WORLDTMP} > > @touch ${WORLDTMP}/${.TARGET} > > - > > -.for _dir in \ > > - lib lib/casper lib/geom usr legacy/bin legacy/usr > > - mkdir -p ${WORLDTMP}/${_dir} > > -.endfor > > - ${WORLDTMP_MTREE} -f ${.CURDIR}/etc/mtree/BSD.usr.dist \ > > - -p ${WORLDTMP}/legacy/usr >/dev/null > > - ${WORLDTMP_MTREE} -f ${.CURDIR}/etc/mtree/BSD.include.dist \ > > - -p ${WORLDTMP}/legacy/usr/include >/dev/null > > - ${WORLDTMP_MTREE} -f ${.CURDIR}/etc/mtree/BSD.usr.dist \ > > - -p ${WORLDTMP}/usr >/dev/null > > - ${WORLDTMP_MTREE} -f ${.CURDIR}/etc/mtree/BSD.include.dist \ > > - -p ${WORLDTMP}/usr/include >/dev/null > > - ln -sf ${.CURDIR}/sys ${WORLDTMP} > > -.if ${MK_DEBUG_FILES} != "no" > > - ${WORLDTMP_MTREE} -f ${.CURDIR}/etc/mtree/BSD.debug.dist \ > > - -p ${WORLDTMP}/legacy/usr/lib >/dev/null > > - ${WORLDTMP_MTREE} -f ${.CURDIR}/etc/mtree/BSD.debug.dist \ > > - -p ${WORLDTMP}/usr/lib >/dev/null > > -.endif > > -.for _mtree in ${LOCAL_MTREE} > > - ${WORLDTMP_MTREE} -f ${.CURDIR}/${_mtree} -p ${WORLDTMP} > > /dev/null > > -.endfor > > +# We can't use mtree to create the worldtmp directories since it may > not be > > +# available on the target system (this happens e.g. when building on > non-Fre > > eBSD) > > + cd ${.CURDIR}/tools/build; \ > > + ${MAKE} DIRPRFX=tools/build/ DESTDIR=${WORLDTMP}/legacy > installdirs > > _legacy: > > @echo > > @echo > "--------------------------------------------------------------" > > @@ -1003,6 +984,19 @@ _bootstrap-tools: > > @echo ">>> stage 1.2: bootstrap tools" > > @echo > "--------------------------------------------------------------" > > ${_+_}cd ${.CURDIR}; ${BMAKE} bootstrap-tools > > + mkdir -p ${WORLDTMP}/usr ${WORLDTMP}/lib/casper > ${WORLDTMP}/lib/geom > > + ${WORLDTMP_MTREE} -f ${.CURDIR}/etc/mtree/BSD.usr.dist \ > > + -p ${WORLDTMP}/usr >/dev/null > > + ${WORLDTMP_MTREE} -f ${.CURDIR}/etc/mtree/BSD.include.dist \ > > + -p ${WORLDTMP}/usr/include >/dev/null > > + ln -sf ${.CURDIR}/sys ${WORLDTMP} > > +.if ${MK_DEBUG_FILES} != "no" > > + ${WORLDTMP_MTREE} -f ${.CURDIR}/etc/mtree/BSD.debug.dist \ > > + -p ${WORLDTMP}/usr/lib >/dev/null > > +.endif > > +.for _mtree in ${LOCAL_MTREE} > > + ${WORLDTMP_MTREE} -f ${.CURDIR}/${_mtree} -p ${WORLDTMP} > > /dev/null > > +.endfor > > _cleanobj: > > .if !defined(NO_CLEAN) > > @echo > > > > Modified: head/tools/build/Makefile > > > ============================================================================= > > = > > --- head/tools/build/Makefile Mon Aug 20 10:39:48 2018 (r338097) > > +++ head/tools/build/Makefile Mon Aug 20 10:39:53 2018 (r338098) > > @@ -59,4 +59,17 @@ SUBDIR= cross-build > > # Needed to build config (since it uses libnv) > > SYSINCS+= ${SRCTOP}/sys/sys/nv.h ${SRCTOP}/sys/sys/cnv.h > > > > + > > +# Create all the directories that are needed during the legacy, > bootstrap-to > > ols > > +# and cross-tools stages. We do this here using mkdir since mtree may > not ex > > ist > > +# yet (this happens if we are crossbuilding from Linux/Mac). > > +installdirs: > > +.for _dir in bin sbin usr/bin usr/sbin usr/lib usr/include lib/geom > lib/casp > > er > > + mkdir -p "${DESTDIR}/${_dir}" > > +.endfor > > + > > +.for _group in ${INCSGROUPS:NINCS} > > + mkdir -p "${DESTDIR}/${${_group}DIR}" > > +.endfor > > + > > .include > > > > This broke my krb5 project branch. The fix for me is easy but rather > inelegant, adding yet another for loop. Would it not be better to > guarantee that mtree is in $WORLDTEMP for platforms that don't have it > naturally or unconditionally? And, before we use it? With this change > it requires, depending on what any future patch changes, that etc/mtree > and this fragment be updated. To me it feels klunky. > > I'll work around this for now but IMO long term we should use a > different strategy and reduce redundancy. > > Thoughts? > > Sorry about the breakage. WORLDTMP is still populated using mtree, only the limited subset of directories needed in $WORLDTMP/legacy is created here. I wonder why you need a separate loop for krb5? What other directories are needed by the bootstrap tools? $WORLDTMP/legacy should only contain a few binaries + headers and libs for the bootstrap tools so I don't think we will add more directories very frequently. I think for now this is fine and long-term I was under the impression that creating directories with mtree would eventuall go away and be replaced with bsd.dirs.mk (added in r336640). It looks like all mtree calls are gone in https://github.com/brd/freebsd/blob/etc-DIR/Makefile.inc1 so it looks like this is possible. Alex