Merge pull request #313 from fkautz/pr_out_variables_shouldn_t_shadow_packages
variables shouldn't shadow packages
This commit is contained in:
commit
b8a4837bcd
@ -672,8 +672,8 @@ func (p *Pipeline) FetchGit(ctx context.Context, op *compiler.Value, st llb.Stat
|
|||||||
|
|
||||||
func (p *Pipeline) DockerBuild(ctx context.Context, op *compiler.Value, st llb.State) (llb.State, error) {
|
func (p *Pipeline) DockerBuild(ctx context.Context, op *compiler.Value, st llb.State) (llb.State, error) {
|
||||||
var (
|
var (
|
||||||
context = op.Lookup("context")
|
dockerContext = op.Lookup("context")
|
||||||
dockerfile = op.Lookup("dockerfile")
|
dockerfile = op.Lookup("dockerfile")
|
||||||
|
|
||||||
contextDef *bkpb.Definition
|
contextDef *bkpb.Definition
|
||||||
dockerfileDef *bkpb.Definition
|
dockerfileDef *bkpb.Definition
|
||||||
@ -681,15 +681,15 @@ func (p *Pipeline) DockerBuild(ctx context.Context, op *compiler.Value, st llb.S
|
|||||||
err error
|
err error
|
||||||
)
|
)
|
||||||
|
|
||||||
if !context.Exists() && !dockerfile.Exists() {
|
if !dockerContext.Exists() && !dockerfile.Exists() {
|
||||||
return st, errors.New("context or dockerfile required")
|
return st, errors.New("context or dockerfile required")
|
||||||
}
|
}
|
||||||
|
|
||||||
// docker build context. This can come from another component, so we need to
|
// docker build context. This can come from another component, so we need to
|
||||||
// compute it first.
|
// compute it first.
|
||||||
if context.Exists() {
|
if dockerContext.Exists() {
|
||||||
from := NewPipeline(op.Lookup("context").Path().String(), p.s)
|
from := NewPipeline(op.Lookup("context").Path().String(), p.s)
|
||||||
if err := from.Do(ctx, context); err != nil {
|
if err := from.Do(ctx, dockerContext); err != nil {
|
||||||
return st, err
|
return st, err
|
||||||
}
|
}
|
||||||
fromResult, err := from.Result()
|
fromResult, err := from.Result()
|
||||||
@ -820,7 +820,7 @@ func (p *Pipeline) WriteFile(ctx context.Context, op *compiler.Value, st llb.Sta
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (p *Pipeline) Mkdir(ctx context.Context, op *compiler.Value, st llb.State) (llb.State, error) {
|
func (p *Pipeline) Mkdir(ctx context.Context, op *compiler.Value, st llb.State) (llb.State, error) {
|
||||||
path, err := op.Lookup("path").String()
|
pathString, err := op.Lookup("path").String()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return st, err
|
return st, err
|
||||||
}
|
}
|
||||||
@ -836,7 +836,7 @@ func (p *Pipeline) Mkdir(ctx context.Context, op *compiler.Value, st llb.State)
|
|||||||
}
|
}
|
||||||
|
|
||||||
return st.Dir(dir).File(
|
return st.Dir(dir).File(
|
||||||
llb.Mkdir(path, fs.FileMode(mode)),
|
llb.Mkdir(pathString, fs.FileMode(mode)),
|
||||||
llb.WithCustomName(p.vertexNamef("Mkdir %s", path)),
|
llb.WithCustomName(p.vertexNamef("Mkdir %s", pathString)),
|
||||||
), nil
|
), nil
|
||||||
}
|
}
|
||||||
|
@ -81,7 +81,7 @@ func (s Solver) Solve(ctx context.Context, st llb.State) (bkgw.Reference, error)
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
llb, err := dumpLLB(def)
|
jsonLLB, err := dumpLLB(def)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -89,7 +89,7 @@ func (s Solver) Solve(ctx context.Context, st llb.State) (bkgw.Reference, error)
|
|||||||
log.
|
log.
|
||||||
Ctx(ctx).
|
Ctx(ctx).
|
||||||
Trace().
|
Trace().
|
||||||
RawJSON("llb", llb).
|
RawJSON("llb", jsonLLB).
|
||||||
Msg("solving")
|
Msg("solving")
|
||||||
|
|
||||||
// call solve
|
// call solve
|
||||||
|
Reference in New Issue
Block a user