Gentoo Archives: gentoo-dev

From: "Rick \\\"Zero_Chaos\\\" Farina" <zerochaos@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] dev-lang/go
Date: Mon, 30 Dec 2013 21:20:37
Message-Id: 52C1E398.7000703@gentoo.org
In Reply to: [gentoo-dev] dev-lang/go by Emery Hemingway
1 -----BEGIN PGP SIGNED MESSAGE-----
2 Hash: SHA1
3
4 On 12/30/2013 03:48 PM, Emery Hemingway wrote:
5 > I really like working with Go, and would like to see a means of merging
6 > Go packages with Portage. In short I am asking if anyone else is
7 > interested in a Go project.
8 >
9 >
10 > For those who aren't familiar with Go, I will sumarise why Portage and
11 > Go do not play well together.
12
13 You can fine go-mtpfs in portage already. I packaged it, with a lot of
14 help. It's terrible. Worst part, it can't reinstall. You can install,
15 and uninstall, but if it is installed you can't install again (so emerge
16 - -e @world would fail).
17
18 By all means, have fun.
19
20 - -Zero
21
22 >
23 > Go is static linked by default.
24 > The Go compiler creates static libraries and binaries. Libraries
25 > compilied with different versions of Go (1.1/1.2) may not be linked
26 > into the same binary.
27 >
28 > It is possible to compile dynamicly and that may involve using the
29 > GCC frontend, which is probably less tested and less optimized.
30 >
31 >
32 > Go libraries are usually unversioned.
33 > Libraries outside the system library are resolved with an import
34 > statement that specifies a source code repository, such as a git or
35 > mecurial repository. Most often Go libraries are installed using the
36 > 'go get' tool that clones a repository, and simply assumes HEAD/tip is
37 > the best revision to build against. There is some support for using git
38 > tags but it is not well documented. Often these libraries are very
39 > small for the sake of reuse and to keep APIs simple.
40 >
41 > If all that sounds bad, thats because it is. Is it worth versioning
42 > many tiny libraries or do we simply cache the repositiories and blame
43 > upstream when things stop compiling?
44 >
45 >
46 > A have made an eclass for Go and an ebuild for the bitcoin node written
47 > in pure Go to atleast prove that all this is possible. These are in the
48 > 'emery' overlay:
49 > http://git.overlays.gentoo.org/gitweb/?p=user/emery.git;a=tree;f=eclass
50 > http://git.overlays.gentoo.org/gitweb/?p=user/emery.git;a=tree;f=dev-go
51 > http://git.overlays.gentoo.org/gitweb/?p=user/emery.git;a=tree;f=net-p2p/btcd
52 >
53 > The eclass it a bit of a mess but it works, having done that, I would
54 > say that making ebuilds for every go library is tedious, but can be
55 > done almost entirely with boilerplate, almost every time.
56 >
57 > The eclasss installs go source and static libraries
58 > to /usr/lib/go/gentoo (source code and .a library are required to link).
59 > The problem is when Go is updated, this folder may get wiped out, and
60 > if it isn't, those libraries will be incompatable with the new release
61 > anyway.
62 >
63 > The other solution I see is to make a Go directory in /var/cache or
64 > something like it and just manage it as a cache. Libraries may come and
65 > go but that is fine. Bare repositories may be cached in DISTDIR just
66 > like the git and mercurial eclasses do. Doing things this way may
67 > require a specific utility for Portage that wraps the Go toolchain,
68 > which I would be willing to create. This utility could probably
69 > automatically resolve and fetch the libraries that are required as
70 > opposed to making an ebuild for each library, but that raises the
71 > problem of assuming the developers of each library maintain consistant
72 > quality and security.
73 >
74 >
75 > The problem is Go makes it trivial to build from source, but it does
76 > that in a very different and less precise way than Gentoo. There is
77 > always the option of build bots and installing binaries to /opt...
78 >
79 >
80 > Emery
81 >
82 >
83
84 -----BEGIN PGP SIGNATURE-----
85 Version: GnuPG v2.0.22 (GNU/Linux)
86 Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
87
88 iQIcBAEBAgAGBQJSweOYAAoJEKXdFCfdEflKaf4QAK2JNcVGg4eSvVXpkkgdwKlO
89 xp3Dm8ao6Ly/DuqD1wSQUghsaCaw9yD0bzlnLOwGQkHhFhAxqj/wpyLdKAr6rQ64
90 YqtT5WIFdymuB/rSO+0D47zfyjQeFLUGbiiSLMTrTyqol2SexchlVu6mLKLDM0rX
91 pJctl4iERzHKHF7/xdQv90vBkUgQsRlN/YlGYUXO/6P5CDJU+T2+rGlps7yN/z+h
92 oaZrVJxNHExdTCbIhnpfKOVSiBisVG2dlwJKL0FFq9EhJph+hrxe9CaD8rMNKGkL
93 Suc/6rT4vFmBmb32/Lzy4x9dfxD6n12vwQBn8ZctJnoqfniVx96S4xmwrBtG3hNH
94 7JenDriuVUuIkUut45+okBUu829PDt0qs+LRRBQejf4DdnkFKJGg1W+97IwVGlTc
95 J/qz+sEdoLTD88zd145iMf79TonmDwDxGxoDEiGs69250TC0WWWnP0x799p0S7uq
96 +2iOunm2oRB2HAiGg/T/rC+C00/pE441ZWX/zXtDphVe3oOsQ8ieZOL/U62+vb6e
97 /VaUp9iTQrssRvRuIpvC0Oqt+2YGlUQHFEAHb/5HHTBFhrdZLyC3edai7+VNIEy3
98 UV6B82MY5sUDhHPY+b2RpVlrkuhN7AqZWebI7qapVzU3gg8liyE8LWW6uvgz7wTF
99 8BWuxvBPwaP/1RczKaeV
100 =Yv0m
101 -----END PGP SIGNATURE-----