all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [go-build-system] How to access properties or keys of a package on the build side?
@ 2017-08-29 12:54 Frederick Muriithi
  2017-08-31 12:17 ` [go-build-system] Leo Famulari
  0 siblings, 1 reply; 3+ messages in thread
From: Frederick Muriithi @ 2017-08-29 12:54 UTC (permalink / raw)
  To: guix-devel

Maybe the following will help clarify the issue:

The package being built needs the sources of the dependenc(y/ies) to
be available in its GOPATH.

The build system needs to set the GOPATH such that the Go build system
will find the the dependencies and build against them.

I have a repository[1] where I'm currently working on definitions for
IPFS before translating them for mainline guix.
If you checkout commit f7f97edc635381384c3532eb8a2bd92cf10a5ac9 and
look at the code there, you can see that I manually set up GOPATH in
the build of go-log so that it can find go-logging (the modified
version[2]).

Now, when building, you need to lay out the code such that go is able
to find everything, and in my code, I do that manually in the
"setup-go-workspace" phase.

I hope this will help clarify issues a bit.

[1] (https://github.com/fredmanglis/guix-ipfs)
[1] (https://github.com/whyrusleeping/go-logging)

-- 
Frederick M. Muriithi

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [go-build-system]
  2017-08-29 12:54 [go-build-system] How to access properties or keys of a package on the build side? Frederick Muriithi
@ 2017-08-31 12:17 ` Leo Famulari
  2017-09-02 17:00   ` [go-build-system] Leo Famulari
  0 siblings, 1 reply; 3+ messages in thread
From: Leo Famulari @ 2017-08-31 12:17 UTC (permalink / raw)
  To: Frederick Muriithi; +Cc: guix-devel

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

On Tue, Aug 29, 2017 at 03:54:40PM +0300, Frederick Muriithi wrote:
> Maybe the following will help clarify the issue:
> 
> The package being built needs the sources of the dependenc(y/ies) to
> be available in its GOPATH.
> 
> The build system needs to set the GOPATH such that the Go build system
> will find the the dependencies and build against them.

Right.

> I have a repository[1] where I'm currently working on definitions for
> IPFS before translating them for mainline guix.
> If you checkout commit f7f97edc635381384c3532eb8a2bd92cf10a5ac9 and
> look at the code there, you can see that I manually set up GOPATH in
> the build of go-log so that it can find go-logging (the modified
> version[2]).

IPFS is interesting. I hope we can get it in Guix.

I have a work-in-progress of a go-build-system with packages for
Syncthing up here:

https://github.com/lfam/guix/tree/wip-syncthing

It seems to work until the Syncthing build fails like this:

------
/gnu/store/wr8r001nxr8ryfnw1kkgrmbij4yqldxi-golang-org-x-net-0.0.0-0.ffcf1be/src/golang.org/x/net/internal/netreflect/socket_19.go:15:2: errInvalidType redeclared in this block
        previous declaration at /gnu/store/wr8r001nxr8ryfnw1kkgrmbij4yqldxi-golang-org-x-net-0.0.0-0.ffcf1be/src/golang.org/x/net/internal/netreflect/socket.go:15:2
/gnu/store/wr8r001nxr8ryfnw1kkgrmbij4yqldxi-golang-org-x-net-0.0.0-0.ffcf1be/src/golang.org/x/net/internal/netreflect/socket_19.go:16:2: errOpNoSupport redeclared in this block
        previous declaration at /gnu/store/wr8r001nxr8ryfnw1kkgrmbij4yqldxi-golang-org-x-net-0.0.0-0.ffcf1be/src/golang.org/x/net/internal/netreflect/socket.go:16:2
/gnu/store/wr8r001nxr8ryfnw1kkgrmbij4yqldxi-golang-org-x-net-0.0.0-0.ffcf1be/src/golang.org/x/net/internal/netreflect/socket_19.go:20:37: SocketOf redeclared in this block
        previous declaration at /gnu/store/wr8r001nxr8ryfnw1kkgrmbij4yqldxi-golang-org-x-net-0.0.0-0.ffcf1be/src/golang.org/x/net/internal/netreflect/socket.go:20:37
/gnu/store/wr8r001nxr8ryfnw1kkgrmbij4yqldxi-golang-org-x-net-0.0.0-0.ffcf1be/src/golang.org/x/net/internal/netreflect/socket_19.go:30:49: PacketSocketOf redeclared in this block
        previous declaration at /gnu/store/wr8r001nxr8ryfnw1kkgrmbij4yqldxi-golang-org-x-net-0.0.0-0.ffcf1be/src/golang.org/x/net/internal/netreflect/socket.go:30:49
------

I have a hunch about what might be wrong [0] but do any Go programmers
have some guidance?

[0] It could be related to the use of these package unions:
https://github.com/lfam/guix/blob/wip-syncthing/gnu/packages/syncthing.scm#L1105
The affected package is part of a group of packages that uses a union
like that:
https://github.com/lfam/guix/blob/wip-syncthing/gnu/packages/syncthing.scm#L1845

I wonder if we should instead make a union of all the Go inputs so that
GOPATH has a single entry, rather than just using unions for selected
packages and letting GOPATH be a list of directories.

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [go-build-system]
  2017-08-31 12:17 ` [go-build-system] Leo Famulari
@ 2017-09-02 17:00   ` Leo Famulari
  0 siblings, 0 replies; 3+ messages in thread
From: Leo Famulari @ 2017-09-02 17:00 UTC (permalink / raw)
  To: Frederick Muriithi; +Cc: guix-devel

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

On Thu, Aug 31, 2017 at 08:17:15AM -0400, Leo Famulari wrote:
> I have a work-in-progress of a go-build-system with packages for
> Syncthing up here:
> 
> https://github.com/lfam/guix/tree/wip-syncthing
> 
> It seems to work until the Syncthing build fails like this:

I'm *very* happy to report that these issues are resolved. The problem
was caused by the lack of a unique file-name for some of the Syncthing
dependencies source code checkouts. [0]

I'll push an updated branch to my tree on GitHub shortly.

[0] I think there are some dragons there... if not bugs. Report to
follow.

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-09-02 17:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-29 12:54 [go-build-system] How to access properties or keys of a package on the build side? Frederick Muriithi
2017-08-31 12:17 ` [go-build-system] Leo Famulari
2017-09-02 17:00   ` [go-build-system] Leo Famulari

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.