From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andy Wingo Subject: Re: [Patch] go@1.4 Updated patch Date: Mon, 06 Jun 2016 10:23:16 +0200 Message-ID: <871t4a7mkr.fsf@igalia.com> References: <87fusuh52h.fsf@mailerver.i-did-not-set--mail-host-address--so-tickle-me> <1464968435.2613720.627094929.3FEBB927@webmail.messagingengine.com> <87d1nygoiq.fsf@mailerver.i-did-not-set--mail-host-address--so-tickle-me> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:51210) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b9ppO-00040R-7E for guix-devel@gnu.org; Mon, 06 Jun 2016 04:24:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b9ppI-0006mr-7d for guix-devel@gnu.org; Mon, 06 Jun 2016 04:24:05 -0400 Received: from pb-sasl1.pobox.com ([64.147.108.66]:52561 helo=sasl.smtp.pobox.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b9ppI-0006WM-1l for guix-devel@gnu.org; Mon, 06 Jun 2016 04:24:00 -0400 In-Reply-To: <87d1nygoiq.fsf@mailerver.i-did-not-set--mail-host-address--so-tickle-me> (Matthew Jordan's message of "Fri, 03 Jun 2016 13:39:41 -0400") 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: Matthew Jordan Cc: guix-devel@gnu.org Hi :) Looking good! I have some style nits :) On Fri 03 Jun 2016 19:39, Matthew Jordan writes: > + ;; Removing net/ tests > + (for-each > + (lambda (srcfile) > + (let ((srcfile (string-append "net/" srcfile))) > + (if (file-exists? srcfile) > + (delete-file srcfile)))) > + '("multicast_test.go" "parse_test.go" "port_test.go")) Either these files exist or they do not. Better to just have three unconditional delete-file invocations. > + > + ;; Add libgcc to runpath > + (substitute* "cmd/go/build.go" > + (("cgoldflags := \\[\\]string\\{\\}") > + (string-append "cgoldflags := []string{" > + "\"-rpath=" gcclib "\"" > + "}")) > + (("ldflags := buildLdflags") > + (string-append > + "ldflags := buildLdflags\n" > + "ldflags = append(ldflags, \"-r\")\n" > + "ldflags = append(ldflags, \"" gcclib "\")\n"))) > + > + (substitute* "os/os_test.go" > + (("/usr/bin") (getcwd)) > + (("/bin/pwd") (which "pwd"))) > + > + ;; Disable failing tests > + (for-each > + (lambda (srcfile) > + (substitute* (car srcfile) > + (((cdr srcfile) all) (string-append all "return\n")))) Is this a nice way to disable tests? I dunno. Why not change the test name from TestFoo to DisabledTestFoo ? Then it would not get run. Also let's avoid car and cdr, and instead use match-lambda: (match-lambda ((file . pattern) ...)) But let's also avoid dotted pairs in bigger literal data structures; it's ugly when there's lots of punctuation around. So if you change the lines to be like ("net/net_test.go" ".+TestShutdownUnix.+") you can (match-lambda ((file pattern) ...)) Note the lack of " . ". > + (list > + '("net/net_test.go" . ".+TestShutdownUnix.+") > + '("net/dial_test.go" . ".+TestDialTimeout.+") Here make the whole list a literal instead of calling `list' on a list of quoted datums: '(("net/net_test.go" ".+TestHostname.+") ...) Cheers, Andy