unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Leo Famulari <leo@famulari.name>
To: Petter <petter@mykolab.ch>
Cc: guix-devel@gnu.org
Subject: Re: gnu: Add Go build system.
Date: Thu, 15 Dec 2016 21:05:26 -0500	[thread overview]
Message-ID: <20161216020526.GA8672@jasmine> (raw)
In-Reply-To: <be699c5369f72192efbe175516b2afd6@mykolab.ch>

On Sun, Dec 11, 2016 at 01:17:48AM +0100, Petter wrote:
> I've made an attempt at making a build system for Go. It seems to
> work, but it's not pretty. My Guix/Guile skills are bad, so keep your
> expectations to a minimum. Consider it something where there was
> nothing.

Thank you for working on this!

> I started with a copy of the GNU build system, removed code I felt
> wasn't necessary, then adapted to Go's needs. Note, comments and those
> first text string after a (define) have not been updated. Unnecessary
> #:use-modules have not been removed. In short, it's bad and there's a
> lot to do make it ok-ish. That's where you come in :)

I haven't contributed or carefully studied the other build systems yet,
so my feedback will be rather superficial. I hope somebody with some
more knowledge will jump in :)

> Subject: [PATCH] gnu: Add Go build system.
> 
> * guix/build-system/go.scm: New file
> * guix/build/go-build-system.scm: New file.

> diff --git a/guix/build/go-build-system.scm b/guix/build/go-build-system.scm

> +(define* (build #:key import-path #:allow-other-keys)
> +  (system* "go" "install" import-path))
> +
> +(define* (install #:key inputs outputs #:allow-other-keys)
> +  (copy-recursively "bin" (string-append (assoc-ref outputs "out") "/bin"))
> +  (copy-recursively "pkg" (string-append (assoc-ref outputs "out") "/pkg"))
> +  (copy-recursively "src" (string-append (assoc-ref outputs "out") "/src")))

It looks like `go install` knows "where" to install the files, but
installs them in the wrong place, and then we copy them into place in
the install phase. I think it's inefficient to move the files twice.

Can the build phase use something like `go build`, followed by the
install phase using `go install` to move the files directly to the
package's output directory in /gnu/store?

  reply	other threads:[~2016-12-16  2:05 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-11  0:17 gnu: Add Go build system Petter
2016-12-16  2:05 ` Leo Famulari [this message]
2016-12-16  4:49 ` Leo Famulari
2016-12-16  9:57   ` Petter

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=20161216020526.GA8672@jasmine \
    --to=leo@famulari.name \
    --cc=guix-devel@gnu.org \
    --cc=petter@mykolab.ch \
    /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).