gostor / gotgt

Simple Golang iSCSI Target framework
Apache License 2.0
261 stars 49 forks source link

Build instructions in README don't work. #59

Closed taherv closed 7 years ago

taherv commented 7 years ago

I figured out how to build this code, but the build instructions are incomplete. I had to run additional commands to "go get" a bunch of packages, I discovered the missing packages by running make after getting each package that make complained on.

It would be nice if the instructions had the steps to "go get" what was needed. Better still, consider "vendoring" any needed packages.

carmark commented 7 years ago

Hello @taherv ,

All of vendor packages are managed by godep and stored in Godeps directory, the file tree is follow. Which platform or environment do you build? I just did build it from git clone on Centos and it works well.

[root@10-19-48-152 src]# tree -d .
.
└── github.com
    └── gostor
        └── gotgt
            ├── autom4te.cache
            ├── cmd
            ├── examples
            ├── Godeps
            │   └── _workspace
            │       └── src
            │           ├── github.com
            │           │   ├── coreos
            │           │   │   └── go-systemd
            │           │   │       └── activation
            │           │   ├── docker
            │           │   │   ├── docker
            │           │   │   └── go-connections
            │           │   │       └── sockets
            │           │   ├── gorilla
            │           │   │   ├── context
            │           │   │   └── mux
            │           │   ├── inconshreveable
            │           │   │   └── mousetrap
            │           │   ├── Microsoft
            │           │   │   └── go-winio
            │           │   ├── opencontainers
            │           │   │   └── runc
            │           │   │       └── libcontainer
            │           │   │           └── user
            │           │   ├── satori
            │           │   │   └── go.uuid
            │           │   ├── Sirupsen
            │           │   │   └── logrus
            │           │   │       ├── examples
            │           │   │       │   ├── basic
            │           │   │       │   └── hook
            │           │   │       ├── formatters
            │           │   │       │   └── logstash
            │           │   │       └── hooks
            │           │   │           ├── syslog
            │           │   │           └── test
            │           │   └── spf13
            │           │       ├── cobra
            │           │       │   ├── cobra
            │           │       │   │   └── cmd
            │           │       │   └── doc
            │           │       └── pflag
            │           │           └── verify
            │           └── golang.org
            │               └── x
            │                   └── net
            │                       ├── context
            │                       └── proxy
            ├── hack
            └── pkg
                ├── api
                │   └── client
                │       └── transport
                │           └── cancellable
                ├── apiserver
                │   ├── httputils
                │   └── router
                │       ├── discovery
                │       ├── lu
                │       └── target
                ├── config
                ├── homedir
                ├── port
                │   └── iscsit
                ├── scsi
                │   └── backingstore
                ├── util
                └── version
taherv commented 7 years ago

You are right, I do have the Godeps/_workspace directory with all the required packages. But I get this error :

os76@vm-taher:~/gostor/src/github.com/gostor/gotgt$ make
go build gotgt.go
pkg/apiserver/apiserver.go:29:2: cannot find package "github.com/coreos/go-systemd/activation" in any of:
    /usr/local/go/src/github.com/coreos/go-systemd/activation (from $GOROOT)
    /home/os76/gostor/gotgt/Godeps/_workspace/src/github.com/coreos/go-systemd/activation (from $GOPATH)
    /home/os76/gostor/src/github.com/coreos/go-systemd/activation

Here is my GOPATH, FYI:

os76@vm-taher:~/gostor/src/github.com/gostor/gotgt$ set | grep GOPATH
GOPATH=/home/os76/gostor/
os76@vm-taher:~/gostor/src/github.com/gostor/gotgt$ pwd
/home/os76/gostor/src/github.com/gostor/gotgt

Interestingly, it is looking in /home/os76/gostor/gotgt/Godeps/_workspace. Some more info on my go installation

os76@vm-taher:~/gostor/src/github.com/gostor/gotgt$ uname -a
Linux vm-taher 4.4.0-72-generic #93-Ubuntu SMP Fri Mar 31 14:07:41 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
os76@vm-taher:~/gostor/src/github.com/gostor/gotgt$ go version
go version go1.7.1 linux/amd64
taherv commented 7 years ago

I figured out my problem. I had first checked out my git clone in GOPATH/gotgt, and did a ./autogen.sh and ./configure. Then I realized the directory structure was wrong, so I moved the gotgt folder into GOPATH/src. But the makefile was incorrect.

Deleting this directory and then recreating by following the instructions exactly, I was able to compile successfully.

Sorry for the false alarm. A suggestion is, since this is golang code, if possible, get rid of autogen and configure :)

I'll close this bug, since it was user error. Sorry for the inconvenience ! Thanks !

carmark commented 7 years ago

Thanks, will consider that.

And another issue found recently, this project only works on local system or virtual machines in signal system. I did not get two systems to test before so this issue was ignored, I will fix it ASAP.

carmark commented 7 years ago

fixed the issue over network.