Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
crazy-max opened this issue Nov 27, 2024 · 0 comments · Fixed by #2814
Closed

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

crazy-max opened this issue Nov 27, 2024 · 0 comments · Fixed by #2814
Assignees
Labels
area/bake kind/bug Something isn't working
Milestone

Comments

@crazy-max
Copy link
Member

crazy-max commented Nov 27, 2024

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"
    }
  }
}
@crazy-max crazy-max added area/bake kind/bug Something isn't working labels Nov 27, 2024
@crazy-max crazy-max added this to the v0.19.1 milestone Nov 27, 2024
@crazy-max crazy-max changed the title bake: Unsuitable value: EOF since Buildx 0.19.0 [v0.19.0] bake: Unsuitable value: EOF Nov 27, 2024
@thompson-shaun thompson-shaun modified the milestones: v0.19.1, v0.20.0 Nov 27, 2024
This was referenced Nov 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/bake kind/bug Something isn't working
Projects
None yet
3 participants