Skip to content

Commit 28c90ea

Browse files
authored
Merge pull request #3116 from crazy-max/v0.23-picks-0.23.0
[v0.23] cherry-picks for v0.23.0
2 parents f58f022 + fddd21c commit 28c90ea

File tree

7 files changed

+7
-108
lines changed

7 files changed

+7
-108
lines changed

bake/hclparser/hclparser.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ type variableValidation struct {
4242
type functionDef struct {
4343
Name string `json:"-" hcl:"name,label"`
4444
Params *hcl.Attribute `json:"params,omitempty" hcl:"params"`
45-
Variadic *hcl.Attribute `json:"variadic_param,omitempty" hcl:"variadic_params"`
45+
Variadic *hcl.Attribute `json:"variadic_params,omitempty" hcl:"variadic_params"`
4646
Result *hcl.Attribute `json:"result,omitempty" hcl:"result"`
4747
}
4848

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ require (
2929
github.com/hashicorp/hcl/v2 v2.23.0
3030
github.com/in-toto/in-toto-golang v0.5.0
3131
github.com/mitchellh/hashstructure/v2 v2.0.2
32-
github.com/moby/buildkit v0.21.0-rc2
32+
github.com/moby/buildkit v0.21.0
3333
github.com/moby/sys/mountinfo v0.7.2
3434
github.com/moby/sys/signal v0.7.1
3535
github.com/morikuni/aec v1.0.0

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,8 +279,8 @@ github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7/go.mod h1:ZX
279279
github.com/mitchellh/hashstructure/v2 v2.0.2 h1:vGKWl0YJqUNxE8d+h8f6NJLcCJrgbhC4NcD46KavDd4=
280280
github.com/mitchellh/hashstructure/v2 v2.0.2/go.mod h1:MG3aRVU/N29oo/V/IhBX8GR/zz4kQkprJgF2EVszyDE=
281281
github.com/mitchellh/mapstructure v0.0.0-20150613213606-2caf8efc9366/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
282-
github.com/moby/buildkit v0.21.0-rc2 h1:JxocuYzqoGLPzftFiDi/Afb85RbXWqt3ObEADRdFFE0=
283-
github.com/moby/buildkit v0.21.0-rc2/go.mod h1:mBq0D44uCyz2PdX8T/qym5LBbkBO3GGv0wqgX9ABYYw=
282+
github.com/moby/buildkit v0.21.0 h1:+z4vVqgt0spLrOSxi4DLedRbIh2gbNVlZ5q4rsnNp60=
283+
github.com/moby/buildkit v0.21.0/go.mod h1:mBq0D44uCyz2PdX8T/qym5LBbkBO3GGv0wqgX9ABYYw=
284284
github.com/moby/docker-image-spec v1.3.1 h1:jMKff3w6PgbfSa69GfNg+zN/XLhfXJGnEx3Nl2EsFP0=
285285
github.com/moby/docker-image-spec v1.3.1/go.mod h1:eKmb5VW8vQEh/BAr2yvVNvuiJuY6UIocYsFu/DxxRpo=
286286
github.com/moby/locker v1.0.1 h1:fOXqR41zeveg4fFODix+1Ch4mj/gT0NE1XJbp/epuBg=

util/userfunc/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ function "add" {
1313
1414
function "list" {
1515
params = []
16-
variadic_param = items
16+
variadic_params = items
1717
result = items
1818
}
1919
```

util/userfunc/decode.go

Lines changed: 0 additions & 79 deletions
This file was deleted.

util/userfunc/public.go

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -20,28 +20,6 @@ import (
2020
// structure a function declaration is found, etc.
2121
type ContextFunc func() *hcl.EvalContext
2222

23-
// DecodeUserFunctions looks for blocks of the given type in the given body
24-
// and, for each one found, interprets it as a custom function definition.
25-
//
26-
// On success, the result is a mapping of function names to implementations,
27-
// along with a new body that represents the remaining content of the given
28-
// body which can be used for further processing.
29-
//
30-
// The result expression of each function is parsed during decoding but not
31-
// evaluated until the function is called.
32-
//
33-
// If the given ContextFunc is non-nil, it will be called to obtain the
34-
// context in which the function result expressions will be evaluated. If nil,
35-
// or if it returns nil, the result expression will have access only to
36-
// variables named after the declared parameters. A non-nil context turns
37-
// the returned functions into closures, bound to the given context.
38-
//
39-
// If the returned diagnostics set has errors then the function map and
40-
// remain body may be nil or incomplete.
41-
func DecodeUserFunctions(body hcl.Body, blockType string, context ContextFunc) (funcs map[string]function.Function, remain hcl.Body, diags hcl.Diagnostics) {
42-
return decodeUserFunctions(body, blockType, context)
43-
}
44-
4523
// NewFunction creates a new function instance from preparsed HCL expressions.
4624
func NewFunction(paramsExpr, varParamExpr, resultExpr hcl.Expression, getBaseCtx func() *hcl.EvalContext) (function.Function, hcl.Diagnostics) {
4725
var params []string
@@ -69,7 +47,7 @@ func NewFunction(paramsExpr, varParamExpr, resultExpr hcl.Expression, getBaseCtx
6947
if varParam == "" {
7048
return function.Function{}, hcl.Diagnostics{{
7149
Severity: hcl.DiagError,
72-
Summary: "Invalid variadic_param",
50+
Summary: "Invalid variadic_params",
7351
Detail: "The variadic parameter name must be an identifier.",
7452
Subject: varParamExpr.Range().Ptr(),
7553
}}

vendor/modules.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,7 @@ github.com/mitchellh/go-wordwrap
479479
# github.com/mitchellh/hashstructure/v2 v2.0.2
480480
## explicit; go 1.14
481481
github.com/mitchellh/hashstructure/v2
482-
# github.com/moby/buildkit v0.21.0-rc2
482+
# github.com/moby/buildkit v0.21.0
483483
## explicit; go 1.23.0
484484
github.com/moby/buildkit/api/services/control
485485
github.com/moby/buildkit/api/types

0 commit comments

Comments
 (0)