Skip to content

[v0.19.0] bake: Unsuitable value: EOF #2822

@crazy-max

Description

@crazy-max
variable "DESTDIR" {
  default = ""
}

target "default" {
  output = [DESTDIR]
}
$ docker buildx bake --print
#1 [internal] load local bake definitions
#1 reading docker-bake.hcl 81B / 81B done
#1 DONE 0.0s
docker-bake.hcl:6
--------------------
   4 |
   5 |     target "default" {
   6 | >>>   output = [DESTDIR]
   7 |     }
   8 |
--------------------
ERROR: docker-bake.hcl:6,12-13: Unsuitable value type; Unsuitable value: EOF

Done some debugging and seems related to changes in gohcl fork. This error is triggered at

srcVal, err = o.Convert(srcVal, convTy)
if err != nil {
diags = append(diags, &hcl.Diagnostic{
Severity: hcl.DiagError,
Summary: "Unsuitable value type",
Detail: fmt.Sprintf("Unsuitable value: %s", err.Error()),
Subject: expr.StartRange().Ptr(),
Context: expr.Range().Ptr(),
})
return diags
}

Image

As we are using our own decode options for implied types in

dec := gohcl.DecodeOptions{ImpliedType: ImpliedType}
, the bug might be around: https://github.com/docker/buildx/blob/master/bake/hclparser/type_implied.go

With previous release:

$ docker buildx bake --print
#1 [internal] load local bake definitions
#1 reading docker-bake.hcl 81B / 81B done
#1 DONE 0.0s
{
  "target": {
    "default": {
      "context": ".",
      "dockerfile": "Dockerfile"
    }
  }
}

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions