matthieudelaro / nut

Nut: the development environment, containerized.
GNU General Public License v3.0
258 stars 16 forks source link

OSX install broken? #22

Closed brainstorm closed 8 years ago

brainstorm commented 8 years ago
$ docker run -i -t --rm -v $PWD:/go/src/github.com/matthieudelaro/nut -w /go/src/github.com/matthieudelaro/nut matthieudelaro/golang:1.6-cross env GOOS=darwin GOARCH=amd64 go build -o nut
# github.com/matthieudelaro/nut
./main.go:93: cannot use func literal (type func(*cli.Context) error) as type func(*cli.Context) in field value
./main.go:181: undefined: cli.NewExitError
./main.go:186: undefined: cli.NewExitError
./main.go:194: undefined: cli.NewExitError
./main.go:197: undefined: cli.HandleAction
./main.go:200: cannot use func literal (type func(*cli.Context) error) as type func(*cli.Context) in assignment
matthieudelaro commented 8 years ago

Hi just checked with a fresh clone of the repository, following up-to-date compilation instruction, and I wasn't able to reproduce the error that you got (see logs below). I think the dependencies that you have in vendor are outdated. github.com/codegangsta/cli changed a lot recently, and I updated main.go to match the recent modifications. Also, Nut used to declare dependencies as git submodules, but now it uses govendor.

If you can't start from a fresh repository, I suggest that you remove everything in vendor, except vendor/vendor.json, which contains the list of the dependencies with commit IDs. Then you can fetch the dependencies by running docker run --rm -v $PWD:/go/src/github.com/matthieudelaro/ -w /go/src/github.com/matthieudelaro/ matthieudelaro/golang:1.6-cross bash -c 'govendor fetch +missing'

nutfresh$ docker run --rm -v $PWD:/go/src/github.com/matthieudelar/go/src/github.com/matthieudelaro/ matthieudelaro/golang:1.6-cross bash -c 'git clone https://github.com/matthieudelaro/nut.git --progress && cd nut && govendor fetch +missing'
Cloning into 'nut'...
remote: Counting objects: 904, done.        
remote: Compressing objects: 100% (71/71), done.        
remote: Total 904 (delta 32), reused 0 (delta 0), pack-reused 829        
Receiving objects: 100% (904/904), 49.36 MiB | 1.81 MiB/s, done.
Resolving deltas: 100% (496/496), done.
Checking connectivity... done.

nutfresh$ cd nut

nutfresh/nut$ docker run -i -t --rm -v $PWD:/go/src/github.com/matthieudelaro/nut -w /go/src/github.com/matthieudelaro/nut matthieudelaro/golang:1.6-cross env GOOS=darwin GOARCH=amd64 go build -o nut

nutfresh/nut$ ./nut
NAME:
   nut - the development environment, containerized

USAGE:
   nut [global options] command [command options] [arguments...]

VERSION:
   0.1.4 dev

COMMANDS:
     build              macro: build the project
     build-all, ba      macro: build the project for linux, OSX, and for Windows
     build-linux, bl    macro: build the project for Linux
     build-osx, bo      macro: build the project for OSX
     build-windows, bw  macro: build the project for Windows
     code               macro: open this project in vscode
     run                macro: run the project in the container
     setup              macro: call after pulling the project, to install dependencies
     test               macro: test the project
     help, h            Shows a list of commands or help for one command

GLOBAL OPTIONS:
   --clean               clean all data stored in .nut
   --init                initialize a nut project
   --github value        Use with --init: provide a GitHub repository to initialize Nut.
   --logs                Use with --exec: display log messages. Useful for contributors and to report an issue
   --exec value          execute a command in a container.
   --macro value         Name of the macro to execute. Use with --logs.
   --extend-macro value  Use with --exec: name of the macro from which to inherite the configuration
   --dockercli           Use Docker CLI, instead of using Docker API to reach the host directly.
   --help, -h            show help
   --version, -v         print the version
brainstorm commented 8 years ago

Thanks @matthieudelaro for the hints! It worked now 👍 :)

matthieudelaro commented 8 years ago

Glad to hear :)