hashicorp / packer

Packer is a tool for creating identical machine images for multiple platforms from a single source configuration.
http://www.packer.io
Other
15.11k stars 3.33k forks source link

go get all: module github.com/hashicorp/packer@latest found (v1.6.6), but does not contain package github.com/hashicorp/packer/common #10419

Closed NorseGaud closed 3 years ago

NorseGaud commented 3 years ago

Overview of the Issue

module github.com/veertuinc/packer-builder-veertu-anka

go 1.13

require (
    github.com/groob/plist v0.0.0-20200425180238-0f631f258c01
    github.com/hashicorp/hcl/v2 v2.8.1
    github.com/hashicorp/packer v1.6.6
    github.com/mitchellh/mapstructure v1.4.0
    github.com/zclconf/go-cty v1.7.1
)
go get all: module github.com/hashicorp/packer@latest found (v1.6.6), but does not contain package github.com/hashicorp/packer/common
❯ go get all
go: finding module for package github.com/hashicorp/packer/helper/config
go: finding module for package github.com/hashicorp/packer/helper/communicator
go: finding module for package github.com/hashicorp/packer/helper/multistep
go: finding module for package github.com/hashicorp/packer/template/interpolate
go: finding module for package github.com/hashicorp/packer/template
go: downloading github.com/stretchr/testify v1.5.1
go: finding module for package github.com/hashicorp/packer/common
go: downloading github.com/hashicorp/memberlist v0.2.2
go: downloading github.com/hashicorp/consul/sdk v0.4.0
go: downloading golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9
go: downloading github.com/davecgh/go-spew v1.1.1
go: downloading github.com/go-test/deep v1.0.3
go: downloading github.com/kr/pretty v0.2.0
go: downloading gopkg.in/cheggaaa/pb.v1 v1.0.27
go: downloading github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348
go: downloading github.com/hashicorp/go-msgpack v0.5.5
go: downloading github.com/apparentlymart/go-dump v0.0.0-20180507223929-23540a00eaa3
go: downloading github.com/pkg/errors v0.9.1
go: downloading github.com/pascaldekloe/goe v0.1.0
go: downloading github.com/kr/text v0.1.0
go: downloading github.com/pmezard/go-difflib v1.0.0
go: downloading github.com/miekg/dns v1.1.26
go: downloading github.com/google/btree v1.0.0
go: downloading gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15
go: downloading github.com/jmespath/go-jmespath/internal/testify v1.5.1
go: downloading github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529
go: downloading gopkg.in/yaml.v2 v2.3.0
go: downloading golang.org/x/tools v0.0.0-20201111133315-69daaf961d65
go: downloading github.com/google/martian v2.1.0+incompatible
go: downloading github.com/dylanmei/winrmtest v0.0.0-20170819153634-c2fbb09e6c08
go: downloading github.com/satori/go.uuid v1.2.0
go: downloading github.com/antchfx/xquery v0.0.0-20170730121040-eb8c3c172607
go: downloading github.com/google/martian/v3 v3.0.0
go: downloading github.com/antchfx/xpath v0.0.0-20170728053731-b5c552e1acbd
go get all: module github.com/hashicorp/packer@latest found (v1.6.6), but does not contain package github.com/hashicorp/packer/common
go get all: module github.com/hashicorp/packer@latest found (v1.6.6), but does not contain package github.com/hashicorp/packer/helper/communicator
go get all: module github.com/hashicorp/packer@latest found (v1.6.6), but does not contain package github.com/hashicorp/packer/helper/config
go get all: module github.com/hashicorp/packer@latest found (v1.6.6), but does not contain package github.com/hashicorp/packer/helper/multistep
go get all: module github.com/hashicorp/packer@latest found (v1.6.6), but does not contain package github.com/hashicorp/packer/template
go get all: module github.com/hashicorp/packer@latest found (v1.6.6), but does not contain package github.com/hashicorp/packer/template/interpolate

Old package has it:

Screen Shot 2020-12-22 at 8 54 58 AM

But the new one doesn't

Screen Shot 2020-12-22 at 8 55 07 AM

Reproduction Steps

See above go.mod

Packer version

1.6.6

Operating system and Environment details

❯ go version
go version go1.14.13 darwin/amd64
❯ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/nathanpierce/Library/Caches/go-build"
GOENV="/Users/nathanpierce/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/nathanpierce/go:/"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/Cellar/go@1.14/1.14.13/libexec"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go@1.14/1.14.13/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/nathanpierce/anka-packer/src/github.com/veertuinc/packer-builder-veertu-anka/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/cg/zwnjml252tv9d58337f_7xpm0000gn/T/go-build692292573=/tmp/go-build -gno-record-gcc-switches -fno-common"

Log Fragments and crash.log files

❯ make clean && make build                   
rm -f packer-builder-veertu-anka
GOOS=darwin GOBIN=/Users/nathanpierce/anka-packer/src/github.com/veertuinc/packer-builder-veertu-anka go install github.com/hashicorp/packer/cmd/mapstructure-to-hcl2
go: downloading github.com/fatih/structtag v1.0.0
go: downloading golang.org/x/tools v0.0.0-20201111133315-69daaf961d65
go: downloading golang.org/x/mod v0.3.0
go: downloading golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1
GOOS=darwin PATH="/Users/nathanpierce/anka-packer/src/github.com/veertuinc/packer-builder-veertu-anka:/Users/nathanpierce/anka-packer/tests/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/VMware Fusion.app/Contents/Public:/Library/Apple/usr/bin:/Users/nathanpierce/go://bin:/usr/local/sbin" go generate builder/anka/config.go
go: finding module for package github.com/hashicorp/packer/template/interpolate
go: finding module for package github.com/hashicorp/packer/helper/config
go: finding module for package github.com/hashicorp/packer/common
go: finding module for package github.com/hashicorp/packer/helper/communicator
mapstructure-to-hcl2: anka.[Config]: formatting err: config.hcl2spec.go:11:24: expected ';', found 'type' (and 1 more errors)
GOOS=darwin go build -ldflags="-X main.Version=7033018f596cb8994437663044563568ce852bf7" -o packer-builder-veertu-anka
go: finding module for package github.com/hashicorp/packer/helper/config
go: finding module for package github.com/hashicorp/packer/helper/multistep
go: finding module for package github.com/hashicorp/packer/common
go: finding module for package github.com/hashicorp/packer/template/interpolate
go: finding module for package github.com/hashicorp/packer/helper/communicator
builder/anka/builder.go:9:2: module github.com/hashicorp/packer@latest found (v1.6.6), but does not contain package github.com/hashicorp/packer/common
builder/anka/builder.go:10:2: module github.com/hashicorp/packer@latest found (v1.6.6), but does not contain package github.com/hashicorp/packer/helper/communicator
builder/anka/config.go:12:2: module github.com/hashicorp/packer@latest found (v1.6.6), but does not contain package github.com/hashicorp/packer/helper/config
builder/anka/builder.go:11:2: module github.com/hashicorp/packer@latest found (v1.6.6), but does not contain package github.com/hashicorp/packer/helper/multistep
builder/anka/config.go:14:2: module github.com/hashicorp/packer@latest found (v1.6.6), but does not contain package github.com/hashicorp/packer/template/interpolate
make: *** [packer-builder-veertu-anka] Error 1
jhawk28 commented 3 years ago

1.6.6 started the migration to extracting the plugin sdk to a separate repo. You need to update your imports to pull in the correct paths. In the next version, the sdk is in a different repo: https://github.com/hashicorp/packer-plugin-sdk

NorseGaud commented 3 years ago

From the CHANGELOG:

Future Scaffolding This release contains a large number of no-op refactoring changes. The Packer team at HashiCorp is preparing to split the plugins and core to make it easier for our third party maintainers and community members to release and maintain plugins, just like HashiCorp did with the Terraform Core-Provider split. The Packer team is committed to making sure that this split is seamless for our users and for our community maintainers -- if you are a community maintainer, you may want to follow along with some of the work by looking at the core-plugin-split github tag. No one needs to do anything, yet, but we felt it was worth calling out all the work that isn't making it into the changelog. We will be following up with lots of documentation and communication in early 2021 with more information.

The Packer team is committed to making sure that this split is seamless for our users

No one needs to do anything, yet, but we felt it was worth calling out all the work that isn't making it into the changelog. We will be following up with lots of documentation and communication in early 2021 with more information.

Just a little confusing. Thanks for the follow-up.

jhawk28 commented 3 years ago

this should fix it: https://github.com/veertuinc/packer-builder-veertu-anka/pull/55

SwampDragons commented 3 years ago

Ah, sorry for this -- we assumed incorrectly that maintainers of third party plugins wouldn't immediately rebuild trying to use the latest Packer version; if you build with the older packer version this still works and is compatible with the v1.6.6 core, but if you try to upgrade to use v1.6.6 as a module you'll need to use the new sdk repo.

sylviamoss commented 3 years ago

Hello! As v1.7.0 is released, you can upgrade your plugin to use our SDK and use the guide and scripts to help you with that. Here they are https://www.packer.io/guides/1.7-plugin-upgrade.

I'll close this issue. Let us know if you need any help upgrading your plugin.

ghost commented 3 years ago

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.