From patchwork Tue Jan 28 21:54:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Maja_K=C4=85dzio=C5=82ka?= X-Patchwork-Id: 20021 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 002FF16389; Tue, 28 Jan 2020 21:55:08 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id A953C1637D for ; Tue, 28 Jan 2020 21:55:08 +0000 (GMT) Received: from localhost ([::1]:37946 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iwYpA-0005Fh-7y for patchwork@mira.cbaines.net; Tue, 28 Jan 2020 16:55:08 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:60471) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iwYp5-0005Fa-3G for guix-patches@gnu.org; Tue, 28 Jan 2020 16:55:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iwYp3-0005o5-U7 for guix-patches@gnu.org; Tue, 28 Jan 2020 16:55:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:55242) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iwYp3-0005nv-QF for guix-patches@gnu.org; Tue, 28 Jan 2020 16:55:01 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iwYp3-0008Gn-Nk for guix-patches@gnu.org; Tue, 28 Jan 2020 16:55:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#39021] [PATCH 1/2 v2] build-system/go: Allow providing additional build flags References: <20200107200039.jga75muq7excgpqu@zdrowyportier.kadziolka.net> In-Reply-To: <20200107200039.jga75muq7excgpqu@zdrowyportier.kadziolka.net> Resent-From: Jakub =?utf-8?b?S8SFZHppb8WCa2E=?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 28 Jan 2020 21:55:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 39021 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 39021@debbugs.gnu.org Received: via spool by 39021-submit@debbugs.gnu.org id=B39021.158024845131719 (code B ref 39021); Tue, 28 Jan 2020 21:55:01 +0000 Received: (at 39021) by debbugs.gnu.org; 28 Jan 2020 21:54:11 +0000 Received: from localhost ([127.0.0.1]:32982 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iwYoF-0008FX-Bg for submit@debbugs.gnu.org; Tue, 28 Jan 2020 16:54:11 -0500 Received: from pat.zlotemysli.pl ([37.59.186.212]:59996) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iwYoC-0008FL-W3 for 39021@debbugs.gnu.org; Tue, 28 Jan 2020 16:54:09 -0500 Received: (qmail 6603 invoked by uid 1009); 28 Jan 2020 22:54:06 +0100 Received: from 188.123.215.55 (kuba@kadziolka.net@188.123.215.55) by pat (envelope-from , uid 1002) with qmail-scanner-2.08st (clamdscan: 0.98.6/25708. spamassassin: 3.4.0. perlscan: 2.08st. Clear:RC:1(188.123.215.55):. Processed in 0.008669 secs); 28 Jan 2020 21:54:06 -0000 Received: from unknown (HELO zdrowyportier.kadziolka.net) (kuba@kadziolka.net@188.123.215.55) by pat.zlotemysli.pl with SMTP; 28 Jan 2020 22:54:06 +0100 Date: Tue, 28 Jan 2020 22:54:05 +0100 From: Jakub =?utf-8?b?S8SFZHppb8WCa2E=?= Message-ID: <20200128215405.b5nyh4tiewzxrjjq@zdrowyportier.kadziolka.net> MIME-Version: 1.0 Content-Disposition: inline X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * guix/build-system/go.scm (build-flags): New argument. * guix/build/go-build-system.scm (build): Use apply to pass the additional arguments to invoke. --- I have discovered a bug when testing v1 of this patch locally - some Go packages have been failing to build due to a quoting mishap. This is now fixed. Diff between patches: - (build-flags '()) + (build-flags ''()) [this note should be automatically removed by git am] --- guix/build-system/go.scm | 3 +++ guix/build/go-build-system.scm | 7 ++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/guix/build-system/go.scm b/guix/build-system/go.scm index 1b916af8f9..f8ebaefb27 100644 --- a/guix/build-system/go.scm +++ b/guix/build-system/go.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2016 Petter ;;; Copyright © 2017 Leo Famulari +;;; Copyright © 2020 Jakub Kądziołka ;;; ;;; This file is part of GNU Guix. ;;; @@ -82,6 +83,7 @@ (install-source? #t) (import-path "") (unpack-path "") + (build-flags ''()) (tests? #t) (allow-go-reference? #f) (system (%current-system)) @@ -109,6 +111,7 @@ #:install-source? ,install-source? #:import-path ,import-path #:unpack-path ,unpack-path + #:build-flags ,build-flags #:tests? ,tests? #:allow-go-reference? ,allow-go-reference? #:inputs %build-inputs))) diff --git a/guix/build/go-build-system.scm b/guix/build/go-build-system.scm index 4bc0156a88..49887848f6 100644 --- a/guix/build/go-build-system.scm +++ b/guix/build/go-build-system.scm @@ -2,6 +2,7 @@ ;;; Copyright © 2016 Petter ;;; Copyright © 2017, 2019 Leo Famulari ;;; Copyright © 2019 Maxim Cournoyer +;;; Copyright © 2020 Jakub Kądziołka ;;; ;;; This file is part of GNU Guix. ;;; @@ -209,18 +210,18 @@ unpacking." (_ #f)) inputs)))) -(define* (build #:key import-path #:allow-other-keys) +(define* (build #:key import-path build-flags #:allow-other-keys) "Build the package named by IMPORT-PATH." (with-throw-handler #t (lambda _ - (invoke "go" "install" + (apply invoke "go" "install" "-v" ; print the name of packages as they are compiled "-x" ; print each command as it is invoked ;; Respectively, strip the symbol table and debug ;; information, and the DWARF symbol table. "-ldflags=-s -w" - import-path)) + `(,@build-flags ,import-path))) (lambda (key . args) (display (string-append "Building '" import-path "' failed.\n" "Here are the results of `go env`:\n"))