Overview of the Issue
When running make generate in a Packer plugin directory using Go1.18 the command exits with one or more internal errors pertaining to packer imports. This issue only occurs when using Go 1.18.
Reproduction Steps
- Run
git clone git@github.com:hashicorp/packer-plugin-amazon
- Run
make generate
Steps to reproduce this issue
Packer Plugin SDK version
v0.2.11
Darwin/amd64
Log Fragments and crash.log files
~> make generate
mapstructure-to-hcl2: chroot.[Config BlockDevices BlockDevice]: internal error: package "context" without types was imported from "github.com/hashicorp/packer-plugin-amazon/builder/chroot"
builder/chroot/builder.go:2: running "packer-sdc": exit status 1
mapstructure-to-hcl2: common.[VaultAWSEngineOptions AssumeRoleConfig]: internal error: package "crypto/tls" without types was imported from "github.com/hashicorp/packer-plugin-amazon/builder/common"
builder/common/access_config.go:2: running "packer-sdc": exit status 1
mapstructure-to-hcl2: ebs.[Config]: internal error: package "context" without types was imported from "github.com/hashicorp/packer-plugin-amazon/builder/ebs"
builder/ebs/builder.go:2: running "packer-sdc": exit status 1
mapstructure-to-hcl2: ebssurrogate.[Config RootBlockDevice BlockDevice]: internal error: package "github.com/aws/aws-sdk-go/service/ec2" without types was imported from "github.com/hashicorp/packer-plugin-amazon/builder/ebssurrogate"
builder/ebssurrogate/builder.go:2: running "packer-sdc": exit status 1
mapstructure-to-hcl2: ebsvolume.[Config BlockDevice]: internal error: package "fmt" without types was imported from "github.com/hashicorp/packer-plugin-amazon/builder/ebsvolume"
builder/ebsvolume/builder.go:2: running "packer-sdc": exit status 1
mapstructure-to-hcl2: instance.[Config]: internal error: package "context" without types was imported from "github.com/hashicorp/packer-plugin-amazon/builder/instance"
builder/instance/builder.go:2: running "packer-sdc": exit status 1
mapstructure-to-hcl2: ami.[DatasourceOutput Config]: internal error: package "fmt" without types was imported from "github.com/hashicorp/packer-plugin-amazon/datasource/ami"
datasource/ami/data.go:2: running "packer-sdc": exit status 1
mapstructure-to-hcl2: parameterstore.[DatasourceOutput Config]: internal error: package "fmt" without types was imported from "github.com/hashicorp/packer-plugin-amazon/datasource/parameterstore"
datasource/parameterstore/data.go:2: running "packer-sdc": exit status 1
mapstructure-to-hcl2: secretsmanager.[DatasourceOutput Config]: internal error: package "encoding/json" without types was imported from "github.com/hashicorp/packer-plugin-amazon/datasource/secretsmanager"
datasource/secretsmanager/data.go:2: running "packer-sdc": exit status 1
mapstructure-to-hcl2: amazonimport.[Config]: internal error: package "context" without types was imported from "github.com/hashicorp/packer-plugin-amazon/post-processor/import"
post-processor/import/post-processor.go:1: running "packer-sdc": exit status 1
make: *** [generate] Error 1
Overview of the Issue
When running
make generatein a Packer plugin directory using Go1.18 the command exits with one or more internal errors pertaining to packer imports. This issue only occurs when using Go 1.18.Reproduction Steps
git clone git@github.com:hashicorp/packer-plugin-amazonmake generateSteps to reproduce this issue
Packer Plugin SDK version
v0.2.11
Darwin/amd64
Log Fragments and crash.log files