From: "Jakub Kądziołka" <kuba@kadziolka.net>
To: 39021@debbugs.gnu.org
Subject: [bug#39021] [PATCH 1/2 v2] build-system/go: Allow providing additional build flags
Date: Tue, 28 Jan 2020 22:54:05 +0100 [thread overview]
Message-ID: <20200128215405.b5nyh4tiewzxrjjq@zdrowyportier.kadziolka.net> (raw)
In-Reply-To: <20200107200039.jga75muq7excgpqu@zdrowyportier.kadziolka.net>
* 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 <petter@mykolab.ch>
;;; Copyright © 2017 Leo Famulari <leo@famulari.name>
+;;; Copyright © 2020 Jakub Kądziołka <kuba@kadziolka.net>
;;;
;;; 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 <petter@mykolab.ch>
;;; Copyright © 2017, 2019 Leo Famulari <leo@famulari.name>
;;; Copyright © 2019 Maxim Cournoyer <maxim.cournoyer@gmail.com>
+;;; Copyright © 2020 Jakub Kądziołka <kuba@kadziolka.net>
;;;
;;; 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"))
--
2.25.0
next prev parent reply other threads:[~2020-01-28 21:55 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-07 20:00 [bug#39021] [PATCH] Add Keybase Jakub Kądziołka
2020-01-24 18:34 ` [bug#39021] go package rebuilds Jakub Kądziołka
2020-01-28 21:54 ` Jakub Kądziołka [this message]
2020-02-08 0:20 ` [bug#39021] [PATCH] Add Keybase Leo Famulari
2020-02-11 16:36 ` Jakub Kądziołka
2020-02-11 17:36 ` Leo Famulari
2020-05-31 7:09 ` Efraim Flashner
2020-05-31 21:47 ` Jakub Kądziołka
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200128215405.b5nyh4tiewzxrjjq@zdrowyportier.kadziolka.net \
--to=kuba@kadziolka.net \
--cc=39021@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).