From owner-freebsd-arch@freebsd.org Tue Oct 31 00:56:29 2017 Return-Path: Delivered-To: freebsd-arch@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 A8E4DE3AEEB for ; Tue, 31 Oct 2017 00:56:29 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6F41F7E0A7 for ; Tue, 31 Oct 2017 00:56:29 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (unknown [127.0.1.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by freefall.freebsd.org (Postfix) with ESMTPS id 8C3631889C for ; Tue, 31 Oct 2017 00:56:28 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 8BD58A6DD for ; Tue, 31 Oct 2017 00:56:27 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id YKQ14E1RQ3bf for ; Tue, 31 Oct 2017 00:56:23 +0000 (UTC) Subject: Re: [Build] Enabling automatic object directory creation DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com EF113A6D8 From: Bryan Drewery To: "freebsd-arch@freebsd.org" References: <5e8f0d99-dab1-36a8-1aac-328de4490145@FreeBSD.org> Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: <47ac7412-2925-fc04-0759-ea854f464007@FreeBSD.org> Date: Mon, 30 Oct 2017 17:56:04 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <5e8f0d99-dab1-36a8-1aac-328de4490145@FreeBSD.org> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="iM3pBKMl9C07AugfumemG75qhaGOFIomg" X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Oct 2017 00:56:29 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --iM3pBKMl9C07AugfumemG75qhaGOFIomg Content-Type: multipart/mixed; boundary="LNEmv8FP0cgOhT9VgwhB0tXaVOBbiombl"; protected-headers="v1" From: Bryan Drewery To: "freebsd-arch@freebsd.org" Message-ID: <47ac7412-2925-fc04-0759-ea854f464007@FreeBSD.org> Subject: Re: [Build] Enabling automatic object directory creation References: <5e8f0d99-dab1-36a8-1aac-328de4490145@FreeBSD.org> In-Reply-To: <5e8f0d99-dab1-36a8-1aac-328de4490145@FreeBSD.org> --LNEmv8FP0cgOhT9VgwhB0tXaVOBbiombl Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 5/25/2016 11:20 AM, Bryan Drewery wrote: > For in-tree source builds only, I would like to make it so that 'make' > in a subdirectory would automatically create the object directory. Thi= s > would naturally extend to buildworld/buildkernel as well with some > tweaks. I already am nearly done with adding this in for buildworld an= d > was going to just make it happen since the 'make obj' tree-walk is a > waste of time. It is very error-prone to not automatically create an > object directory when building in a subdirectory as it may look for > files in the wrong place. So I would prefer to add it everywhere inste= ad. >=20 > What is the impact of this feature? >=20 > Keep in mind this would *only affect in-tree builds, not ports*. >=20 > We would need to move the 'default' MAKEOBJDIRPREFIX from > Makefile/Makefile.inc1 into share/mk/sys.mk. It would only be > overridable from environment and make argument, but also > /etc/src-env.conf (I think). This restriction is already in place. I > would have to move the assertion for this out of /Makefile and into > sys.mk. Now when I say sys.mk I really mean something like > src.sys.env.mk. which is hidden in a way to only impact in-tree builds.= >=20 > The feature is named 'WITH_AUTO_OBJ'. Enabling this by default means > that the only way to disable it is to add WITHOUT_AUTO_OBJ=3Dyes to > environment, make argument or /etc/src-env.conf. >=20 > There are times when building in a directory without an object directoy= > makes sense, but for the vast majority of people they likely have done = a > buildworld already and are trying to build in a subdirectory to test > something further. If they pulled down new revisions then it is > possible that this new directory did not get a 'make obj' tree-walk. >=20 > A side topic is changing the default MAKEOBJDIR such that it always use= s > ${MAKEOBJDIRPREFIX}/${SRCTOP}/${TARGET}.${TARGET_ARCH}/${RELDIR}. Doin= g > this is far simpler if I can just use WITH_AUTO_OBJ everywhere. This i= s > discussed a bit in https://reviews.freebsd.org/D3711. It would give > directories such as: /usr/obj/usr/src/amd64.amd64/bin/sh. It would kee= p > all universe/cross-builds inside of /usr/obj/usr/src and allow more > easily cleaning up object trees with multiple checkouts. This object > tree pattern is what the DIRDEPS_BUILD uses as well and has been quite > handy. I would extend the DIRDEPS_BUILD 'make destroy' and 'make > destroy-arch', to the normal build, to cleanup the entire object tree > for the object directory and the specified target.target_arch respectiv= ely. >=20 >=20 I have 2 reviews for this: Changing the default OBJDIR to be like: /usr/obj//./ is at https://reviews.freebsd.org/D12840 Enabling AUTO_OBJ if the wanted MAKEOBJDIR is writable is at https://reviews.freebsd.org/D12841 --=20 Regards, Bryan Drewery --LNEmv8FP0cgOhT9VgwhB0tXaVOBbiombl-- --iM3pBKMl9C07AugfumemG75qhaGOFIomg Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJZ98okAAoJEDXXcbtuRpfPKTYH+weLjDZHvIn9O/ZsafnCaZfB Nu342H3WTongJaln4VS9lWItvPBgWSGIj1x2CQsMgiDPyQkr4yPPrjgewIXTJy6C +0FEAGrFkuNyGHn76drceYtl1KpFuKr8S4tEvkZZJc3IXt1H+/S1V7dD4L+ljnz7 E0m4c3coudPXYMT7tuawQcveBaHq79cgfm4RxREUswMK/NhCUZcgn4o3bCqdKJRF LSZmlR4MdaupxaYQRRbpyU7oW6COMkVMRsPfA9e5RxiWKdxufOH7QL4Uv6INhDop hBF4zXFWOlbDrqtxEqPjyUOicPoDvz4pLzpdBSXrmGXeelaNf3d2MlkY0N6wXjk= =kfCQ -----END PGP SIGNATURE----- --iM3pBKMl9C07AugfumemG75qhaGOFIomg--