unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Pierre Neidhardt <mail@ambrevar.xyz>
To: Leo Famulari <leo@famulari.name>
Cc: Guix-devel <guix-devel@gnu.org>
Subject: Re: Packaging gx (for IPFS): Need to update default Go to 1.11?
Date: Sun, 11 Nov 2018 17:43:33 +0100	[thread overview]
Message-ID: <87wopjlg3u.fsf@ambrevar.xyz> (raw)
In-Reply-To: <20181107210309.GA30589@jasmine.lan>

[-- Attachment #1: Type: text/plain, Size: 2644 bytes --]

I've been studying the situation:

From https://golang.org/doc/go1.10#build:

> The go build command now maintains a cache of recently built packages,
> separate from the installed packages in $GOROOT/pkg or $GOPATH/pkg. The effect
> of the cache should be to speed builds that do not explicitly install packages
> or when switching between different copies of source code (for example, when
> changing back and forth between different branches in a version control system).

From https://golang.org/doc/go1.11:

> Go 1.11 will be the last release to support setting the environment variable
> GOCACHE=off to disable the build cache, introduced in Go 1.10. Starting in Go
> 1.12, the build cache will be required, as a step toward eliminating
> $GOPATH/pkg. The module and package loading support described above already
> require that the build cache be enabled

My understanding is that we cannot rely on the /pkg/ folder anymore, since Go
1.12 won't use it at all.

We could maintain a store-level Go cache, but I'm not sure that's doable and I
don't think it makes much sense.  Without a cache, it seems that it's
effectively impossible to re-use pre-built libraries when building Go packages.
From the user perspective, this would not be a big deal because the cache can be
used in this context.  Only the first build would be slower.

More importantly, that would mean that we no longer need to build Go libraries:
we should simply ship the source code in /src/.  The upside is that it saves
space in the store and makes for smaller substitutes.

For the other issue with flag forwarding, there might be a better solution. 
From https://golang.org/doc/go1.10#build:

> The go build -asmflags, -gcflags, -gccgoflags, and -ldflags options now apply by
> default only to the packages listed directly on the command line. For example,
> go build -gcflags=-m mypkg passes the compiler the -m flag when building mypkg
> but not its dependencies. The new, more general form -asmflags=pattern=flags
> (and similarly for the others) applies the flags only to the packages matching
> the pattern. For example: go install -ldflags=cmd/gofmt=-X=main.version=1.2.3
> cmd/... installs all the commands matching cmd/... but only applies the -X
> option to the linker flags for cmd/gofmt. For more details, see go help build.

I think it does not work for "-tags" however.  So we need to ask golua's
maintainer if there is a solution to build golua differently.
If not, then the best solution I can think of is to patch golua to build with
lua5.3 by default.

-- 
Pierre Neidhardt
https://ambrevar.xyz/

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

  reply	other threads:[~2018-11-11 16:43 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-24 11:40 Packaging gx (for IPFS): Need to update default Go to 1.11? Pierre Neidhardt
2018-10-24 11:42 ` Pierre Neidhardt
2018-10-24 13:55 ` Leo Famulari
2018-10-24 14:02   ` Pierre Neidhardt
2018-10-24 14:14     ` Leo Famulari
2018-11-06 11:56       ` Pierre Neidhardt
2018-11-06 12:03         ` Pierre Neidhardt
2018-11-06 17:04           ` Pierre Neidhardt
2018-11-06 17:31             ` Leo Famulari
2018-11-06 17:33               ` Pierre Neidhardt
2018-11-06 19:57                 ` Leo Famulari
2018-11-07  7:33                   ` Pierre Neidhardt
2018-11-07 16:22                     ` Pierre Neidhardt
2018-11-07 18:26                       ` Leo Famulari
2018-11-07 20:09                         ` Pierre Neidhardt
2018-11-07 20:40                           ` Leo Famulari
2018-11-07 20:48                             ` Pierre Neidhardt
2018-11-07 21:03                               ` Leo Famulari
2018-11-11 16:43                                 ` Pierre Neidhardt [this message]
2018-11-11 20:52                                   ` Pierre Neidhardt
2018-11-11 21:33                                     ` Pierre Neidhardt
2018-11-12  9:45                                       ` Pierre Neidhardt
2018-11-12 17:33                                         ` Leo Famulari

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=87wopjlg3u.fsf@ambrevar.xyz \
    --to=mail@ambrevar.xyz \
    --cc=guix-devel@gnu.org \
    --cc=leo@famulari.name \
    /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).