From cd19a4228adfa7b56911a9b073b640212d763c82 Mon Sep 17 00:00:00 2001 From: Paul Jolly Date: Tue, 25 May 2021 10:39:33 +0100 Subject: [PATCH] stdlib: put full definition of #Op behind a build attribute This allows dagger.io/dagger/op.#Op to be maintained in regular uncommented CUE, but not participate by default in normal dagger evaluation (given the performance problems it currently introduces). The "full" #Op can be enabled by passing the "-t fullop" flag: cue eval -t fullop ./examples/react (which currently triggers the performance issue). Signed-off-by: Paul Jolly --- stdlib/dagger/op/op.cue | 21 +++++---------------- stdlib/dagger/op/op_fullop.cue | 17 +++++++++++++++++ 2 files changed, 22 insertions(+), 16 deletions(-) create mode 100644 stdlib/dagger/op/op_fullop.cue diff --git a/stdlib/dagger/op/op.cue b/stdlib/dagger/op/op.cue index 18f1e3ee..322b008a 100644 --- a/stdlib/dagger/op/op.cue +++ b/stdlib/dagger/op/op.cue @@ -3,27 +3,16 @@ package op // One operation in a pipeline // -// #Op does not enforce the op spec at full resolution, to avoid triggering performance issues. -// See https://github.com/dagger/dagger/issues/445 +// #Op does not current enforce the op spec at full resolution, to avoid +// triggering performance issues. See +// https://github.com/dagger/dagger/issues/445 +// +// To enforce the full #Op spec (see op_fullop.cue), run with "-t fullop" #Op: { do: string ... } -// Full resolution schema enforciong the complete op spec -#OpFull: #Export | - #FetchContainer | - #PushContainer | - #FetchGit | - #Exec | - #Local | - #Copy | - #Load | - #Subdir | - #WriteFile | - #Mkdir | - #DockerBuild - // Export a value from fs state to cue #Export: { do: "export" diff --git a/stdlib/dagger/op/op_fullop.cue b/stdlib/dagger/op/op_fullop.cue new file mode 100644 index 00000000..fc763832 --- /dev/null +++ b/stdlib/dagger/op/op_fullop.cue @@ -0,0 +1,17 @@ +@if(fullop) + +package op + +// Full resolution schema enforciong the complete op spec +#Op: (#Export | + #FetchContainer | + #PushContainer | + #FetchGit | + #Exec | + #Local | + #Copy | + #Load | + #Subdir | + #WriteFile | + #Mkdir | + #DockerBuild) & {do: string}