nix-community / vgo2nix

Convert go.mod files to nixpkgs buildGoPackage compatible deps.nix files [maintainer=@adisbladis]
MIT License
90 stars 21 forks source link

vgo2nix fails on darwin: cannot connect to daemon at '/nix/var/nix/daemon-socket/socket' #49

Open jtacoma opened 3 years ago

jtacoma commented 3 years ago
$ mkdir vgo2nix.test && cd vgo2nix.test && go mod init github.com/$USER/vgo2nix.test && go get github.com/nix-community/vgo2nix && $(go env GOPATH)/bin/vgo2nix
go: creating new go.mod: module github.com/$USER/vgo2nix.test
go: github.com/nix-community/vgo2nix upgrade => v0.0.0-20201107053101-4546d8056ab0
goPackagePath github.com/alecthomas/assert has rev: 405dbfeb8e38, module: 
goPackagePath github.com/alecthomas/colour has rev: 60882d9e2721, module: 
goPackagePath github.com/alecthomas/kingpin has rev: v2.2.6, module: 
goPackagePath github.com/alecthomas/repr has rev: 117648cd9897, module: 
goPackagePath github.com/alecthomas/template has rev: a0175ee3bccc, module: 
goPackagePath github.com/alecthomas/units has rev: 2efee857e7cf, module: 
goPackagePath github.com/davecgh/go-spew has rev: v1.1.1, module: 
goPackagePath github.com/mattn/go-isatty has rev: v0.0.3, module: 
goPackagePath github.com/nix-community/vgo2nix has rev: 4546d8056ab0, module: 
goPackagePath github.com/orivej/e has rev: ac3492690fda, module: 
goPackagePath github.com/orivej/go-nix has rev: dae45d921a44, module: 
goPackagePath github.com/pkg/profile has rev: v1.2.1, module: 
goPackagePath github.com/pmezard/go-difflib has rev: v1.0.0, module: 
goPackagePath github.com/sergi/go-diff has rev: v1.0.0, module: 
goPackagePath github.com/stretchr/testify has rev: v1.2.2, module: 
goPackagePath github.com/yuin/goldmark has rev: v1.2.1, module: 
goPackagePath golang.org/x/crypto has rev: 75b288015ac9, module: 
goPackagePath golang.org/x/mod has rev: v0.3.0, module: 
goPackagePath golang.org/x/net has rev: c89045814202, module: 
goPackagePath golang.org/x/sync has rev: 6e8e738ad208, module: 
goPackagePath golang.org/x/sys has rev: 85ca7c5b95cd, module: 
goPackagePath golang.org/x/text has rev: v0.3.0, module: 
goPackagePath golang.org/x/tools has rev: 39188db58858, module: 
goPackagePath golang.org/x/xerrors has rev: 5ec99f83aff1, module: 
Fetching github.com/pkg/profile https://github.com/pkg/profile
Fetching github.com/pmezard/go-difflib https://github.com/pmezard/go-difflib
Fetching github.com/alecthomas/units https://github.com/alecthomas/units
Fetching github.com/sergi/go-diff https://github.com/sergi/go-diff
Fetching github.com/alecthomas/colour https://github.com/alecthomas/colour
Fetching github.com/alecthomas/kingpin https://github.com/alecthomas/kingpin
Fetching github.com/mattn/go-isatty https://github.com/mattn/go-isatty
Fetching golang.org/x/crypto https://go.googlesource.com/crypto
Fetching github.com/alecthomas/repr https://github.com/alecthomas/repr
Fetching github.com/stretchr/testify https://github.com/stretchr/testify
Fetching golang.org/x/net https://go.googlesource.com/net
Fetching github.com/yuin/goldmark https://github.com/yuin/goldmark
Fetching golang.org/x/mod https://go.googlesource.com/mod
Fetching github.com/davecgh/go-spew https://github.com/davecgh/go-spew
Fetching github.com/alecthomas/template https://github.com/alecthomas/template
Fetching github.com/orivej/e https://github.com/orivej/e
Fetching github.com/nix-community/vgo2nix https://github.com/nix-community/vgo2nix
Fetching golang.org/x/sync https://go.googlesource.com/sync
Fetching github.com/orivej/go-nix https://github.com/orivej/go-nix
Fetching github.com/alecthomas/assert https://github.com/alecthomas/assert
Fetching golang.org/x/sys https://go.googlesource.com/sys
panic: Error processing import path "github.com/pkg/profile": nix-prefetch-git --fetch-submodules --no-deepClone --url https://github.com/pkg/profile --rev v1.2.1 failed:
Initialized empty Git repository in /private/var/folders/hw/c8yk4yy52jl7hj646r_dt44m0000gn/T/git-checkout-tmp-r1qCi9Km/profile/.git/
From https://github.com/pkg/profile
 * tag               v1.2.1     -> FETCH_HEAD
Switched to a new branch 'fetchgit'
removing `.git'...
error: cannot connect to daemon at '/nix/var/nix/daemon-socket/socket': Connection refused

goroutine 1 [running]:
main.main()
    /Users/$USER/go/pkg/mod/github.com/nix-community/vgo2nix@v0.0.0-20201107053101-4546d8056ab0/main.go:291 +0x712

I was able to work around this running the same command on Linux.

SuperSandro2000 commented 3 years ago

Make sure nix-build works on your machine. This is likely unrelated to vgo2nix.