axsh / wakame-vdc

Datacenter Hypervisor - Open Source Cloud Computing / IaaS
http://wakame-vdc.org
109 stars 28 forks source link

Unable to build packer plugin #786

Open akry opened 8 years ago

akry commented 8 years ago

Since the latest commit on packer-builder branch it is unable to do go build. Here is the error message:

[root@packer packer-builder-wakamevdc]# go get
# github.com/axsh/wakame-vdc/client/packer-builder-wakamevdc/wakamevdc
/root/newgo/src/github.com/axsh/wakame-vdc/client/packer-builder-wakamevdc/wakamevdc/builder.go:56: cannot use commHost (type func("github.com/mitchellh/multistep".StateBag) (string, error)) as type func("github.com/mitchellh/packer/vendor/github.com/mitchellh/multistep".StateBag) (string, error) in field value
/root/newgo/src/github.com/axsh/wakame-vdc/client/packer-builder-wakamevdc/wakamevdc/builder.go:57: cannot use sshConfig (type func("github.com/mitchellh/multistep".StateBag) (*"golang.org/x/crypto/ssh".ClientConfig, error)) as type func("github.com/mitchellh/packer/vendor/github.com/mitchellh/multistep".StateBag) (*"github.com/mitchellh/packer/vendor/golang.org/x/crypto/ssh".ClientConfig, error) in field value
/root/newgo/src/github.com/axsh/wakame-vdc/client/packer-builder-wakamevdc/wakamevdc/builder.go:59: cannot use new(common.StepProvision) (type *common.StepProvision) as type "github.com/mitchellh/multistep".Step in array or slice literal:
        *common.StepProvision does not implement "github.com/mitchellh/multistep".Step (wrong type for Cleanup method)
                have Cleanup("github.com/mitchellh/packer/vendor/github.com/mitchellh/multistep".StateBag)
                want Cleanup("github.com/mitchellh/multistep".StateBag)
/root/newgo/src/github.com/axsh/wakame-vdc/client/packer-builder-wakamevdc/wakamevdc/builder.go:69: cannot use common.MultistepDebugFn(ui) (type "github.com/mitchellh/packer/vendor/github.com/mitchellh/multistep".DebugPauseFn) as type "github.com/mitchellh/multistep".DebugPauseFn in field value
/root/newgo/src/github.com/axsh/wakame-vdc/client/packer-builder-wakamevdc/wakamevdc/config.go:46: cannot use &md (type *"github.com/mitchellh/mapstructure".Metadata) as type *"github.com/mitchellh/packer/vendor/github.com/mitchellh/mapstructure".Metadata in field value

This is due to the source code is already obsoleted. Some interfaces used in the code base must be referenced by different import path. Simply replacing the old import paths to the latest ones does not work at all because go does not allow users to import packages directly from vendor directory of the dependency.

akry commented 8 years ago

Seems like it's known issue.

go get github.com/mitchellh/packer
cd $GOPATH/src/github.com/mitchellh/packer
godep restore

then build your own go project.

akry commented 8 years ago
$ godep restore
...
godep: Downloading dependency (if needed): gopkg.in/fsnotify.v1

resolving this dependency take soooo long time...

akry commented 8 years ago

The solution does not solve anything unfortunately... :(

ghost commented 8 years ago

@akry Have you fixed the issue? any solution ?

akry commented 8 years ago

@thatcabbage @unakatsuo solved this issue. The building procedure is written on the another page.

https://github.com/axsh/wakame-vdc/tree/packer-builder/client/packer-builder-wakamevdc