Skip to content

Packer sdc generation commands fails when executed using Go 1.18 #103

@nywilken

Description

@nywilken

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

  1. Run git clone git@github.com:hashicorp/packer-plugin-amazon
  2. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions