Skip to content
This repository has been archived by the owner on Aug 26, 2021. It is now read-only.

go2nix seems overly greedy #24

Closed
rushmorem opened this issue Sep 21, 2016 · 4 comments
Closed

go2nix seems overly greedy #24

rushmorem opened this issue Sep 21, 2016 · 4 comments
Labels

Comments

@rushmorem
Copy link
Contributor

Sometimes go2nix requires additional packages beyond those required by go build to actually build. For example, if you are packaging coredns, a go get -d ./ is sufficient to fetch all its dependancies for building their main package. However, running go2nix save requires some other packages before it can successfully compile the Nix expressions.

I ran into this a number of times while packaging for Nix, I ended up creating a script that downloads these extra requirements while go2nix saveing:-

#!/bin/sh

while true; do
    missing_package=$(go2nix save 2>&1 | awk -F'"' '{print $2}')
    [[ -z $missing_package ]] && exit 0
    go get -d -v $missing_package
    echo "Finished downloading $missing_package"
done
@kamilchm
Copy link
Owner

Thx for reporting this.
I plan to write tests for go2nix with few packages (i will look at coredns too) as a examples to address #21.
I'll come back to this next week.

@kamilchm kamilchm added the bug label Sep 22, 2016
@kamilchm
Copy link
Owner

kamilchm commented Sep 26, 2016

I found the problem with coredns - unused imports in https://github.com/miekg/coredns/blob/master/core/coredns.go
go get and go build won't go as deep as go2nix into these dependencies but I don't know where is the right place to stop going deeper :/
Go package management in it's glory :(

@kamilchm
Copy link
Owner

kamilchm commented Sep 26, 2016

Got it, go2nix doesn't look for packages provided in vendor of dependent packages, eg. k8s.io/kubernetes/vendor in this case.
I need to implement test cases from https://www.youtube.com/watch?v=6gdVhHMxNTo and then do it right.

kamilchm added a commit that referenced this issue Sep 27, 2016
FIX and E2E test for leaps and coredns #21 #24
@kamilchm
Copy link
Owner

qknight pushed a commit to nixcloud/go2nix that referenced this issue Oct 30, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants