From 468ac1220a89d9d6c83bc519fc95d304d8d2abd9 Mon Sep 17 00:00:00 2001 From: Sam Alba Date: Thu, 15 Apr 2021 12:34:15 -0700 Subject: [PATCH] added comment about `always` flag + cue fmt Signed-off-by: Sam Alba --- dagger/pipeline.go | 2 ++ stdlib/dagger/op/op.cue | 1 + tests/compute/success/exec-nocache/main.cue | 26 ++++++++++----------- 3 files changed, 16 insertions(+), 13 deletions(-) diff --git a/dagger/pipeline.go b/dagger/pipeline.go index e90b7f6d..ca1e6876 100644 --- a/dagger/pipeline.go +++ b/dagger/pipeline.go @@ -386,6 +386,8 @@ func (p *Pipeline) Exec(ctx context.Context, op *compiler.Value, st llb.State) ( // always? if cmd.Always { + // FIXME: also disables persistent cache directories + // There's an ongoing proposal that would fix this: https://github.com/moby/buildkit/issues/1213 opts = append(opts, llb.IgnoreCache) } // mounts diff --git a/stdlib/dagger/op/op.cue b/stdlib/dagger/op/op.cue index 6bdcc8a4..92ec4c53 100644 --- a/stdlib/dagger/op/op.cue +++ b/stdlib/dagger/op/op.cue @@ -45,6 +45,7 @@ package op do: "exec" args: [...string] env?: [string]: string + // `true` means also ignoring the mount cache volumes always?: true | *false dir: string | *"/" mount: [string]: "tmpfs" | "cache" | {from: _, path: string | *"/"} diff --git a/tests/compute/success/exec-nocache/main.cue b/tests/compute/success/exec-nocache/main.cue index 0a4152e8..fb9eef6b 100644 --- a/tests/compute/success/exec-nocache/main.cue +++ b/tests/compute/success/exec-nocache/main.cue @@ -1,23 +1,23 @@ package main import ( - "dagger.io/alpine" - "dagger.io/dagger/op" + "dagger.io/alpine" + "dagger.io/dagger/op" ) rand: { - string + string - #up: [ - op.#Load & {from: alpine.#Image}, - op.#Exec & { - always: true - args: ["sh", "-c", """ - tr -dc A-Za-z0-9 /id - """] - }, - op.#Export & {source: "/id"}, - ] + #up: [ + op.#Load & {from: alpine.#Image}, + op.#Exec & { + always: true + args: ["sh", "-c", """ + tr -dc A-Za-z0-9 /id + """] + }, + op.#Export & {source: "/id"}, + ] } // If rand is executed twice, cue won't validate