From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Bavier Subject: Re: [PATCH] Clean all .go in clean-go Date: Fri, 16 Sep 2016 00:15:40 -0500 Message-ID: <20160916001540.617d9a54@openmailbox.org> References: <20160831232034.13748-1-ericbavier@openmailbox.org> <8760qgjugu.fsf@gnu.org> <874m5zokwp.fsf@gnu.org> <20160901203035.1ea32dee@openmailbox.org> <8737limq18.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="MP_/mO6_x6Ul1IjjCJXq6V.qzy5" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:47280) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bklVE-0005Yz-3D for guix-devel@gnu.org; Fri, 16 Sep 2016 01:15:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bklV8-0004q0-Ve for guix-devel@gnu.org; Fri, 16 Sep 2016 01:15:55 -0400 Received: from smtp11.openmailbox.org ([62.4.1.45]:39583) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bklV8-0004pX-Li for guix-devel@gnu.org; Fri, 16 Sep 2016 01:15:50 -0400 In-Reply-To: <8737limq18.fsf@gnu.org> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: guix-devel@gnu.org --MP_/mO6_x6Ul1IjjCJXq6V.qzy5 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Fri, 02 Sep 2016 14:42:27 +0200 ludo@gnu.org (Ludovic Court=C3=A8s) wrote: > Eric Bavier skribis: >=20 > > On Thu, 01 Sep 2016 14:37:58 +0200 > > ludo@gnu.org (Ludovic Court=C3=A8s) wrote: =20 >=20 > [...] >=20 > >> > In regards of the .go files remaining in the build directory, I agree > >> > that this is not good, however I don't think it is worth trying to f= ix > >> > this issue which equally applies to every file generated by Make. U= sing > >> > wildcards can be tempting in such cases but it can lead to accidental > >> > file deletions which is worse IMO. As a consequence I would prefer > >> > keeping the current 'clean-go' rule. =20 > >>=20 > >> I sympathize with that. =20 > > > > How about simply printing a warning if there are any .go files laying > > around after a `make clean` or `make clean-go`? =20 >=20 > Sure, why not. So, with the attached patch, I get the following output after `make clean-go`: warning: stray .go files: ./guix/scripts/import/cpan.go ./gnu/services/dmd.= go ./gnu/system/linux.go ./gnu/packages/yasm.go ./gnu/packages/cursynth.go=20 ./gnu/packages/lightning.go ./gnu/packages/doxygen.go ./gnu/packages/tre.go= =20 ./gnu/packages/asciidoc.go ./gnu/packages/texlive.go ./gnu/packages/i3.go=20 ./gnu/packages/fish.go ./gnu/packages/slim.go ./gnu/packages/tcsh.go=20 ./gnu/packages/zsh.go ./gnu/packages/lsh.go ./gnu/packages/rc.go=20 ./gnu/packages/openssl.go ./gnu/packages/aria2.go ./gnu/packages/gdbm.go=20 ./gnu/packages/gnutls.go ./gnu/packages/grue-hunter.go ./gnu/packages/aardd= ict.go Maybe this means that I've not been doing due diligence in keeping my builddir clean, or maybe its just the result of developing on guix for so long. Another issue that I thought of that's posed by these stray .go files, which isn't only a problem when acting as a wizard: introducing a new module import when adding a package, only to have that module moved/renamed before pushing your change. I suppose it is a corner case, but it did happen to me recently, in 2e3f18511, which =E5=AE=8B=E6=96= =87=E6=AD=A6 kindly fixed in 19b2ea1b6. The problem was that between the time I originally packaged tomb and the time I pushed the commit, gnu/packages/zsh.scm was consolidated into gnu/packages/shells.scm. I had done a `make clean-go && make` before pushing, as I always do, but since clean-go didn't remove gnu/packages/zsh.go the subsequent `make` didn't complain of a missing module. `~Eric --MP_/mO6_x6Ul1IjjCJXq6V.qzy5 Content-Type: text/x-patch Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename=0001-build-clean-go-warn-about-stray-.go-files.patch =46rom ffe1710d5a91cd9906f2419d21944b1375b1b842 Mon Sep 17 00:00:00 2001 From: Eric Bavier Date: Thu, 15 Sep 2016 23:31:41 -0500 Subject: [PATCH] build: clean-go: warn about stray .go files. * Makefile.am (clean-go): Warn of .go files remaining in builddir. --- Makefile.am | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Makefile.am b/Makefile.am index f9fe141..43a33c8 100644 --- a/Makefile.am +++ b/Makefile.am @@ -208,6 +208,12 @@ endif INSTALL_SRFI_37 # Handy way to remove the .go files without removing all the rest. clean-go: -$(RM) -f $(GOBJECTS) + @find . -name '*.go' -print | \ + if test -t 1; then \ + xargs -r echo -e "\033[31mwarning:\033[0m stray .go files:"; \ + else \ + xargs -r echo "warning: stray .go files:"; \ + fi =20 =20 # Test extensions; has to be unconditional. --=20 2.9.2 --MP_/mO6_x6Ul1IjjCJXq6V.qzy5--