cue icon indicating copy to clipboard operation
cue copied to clipboard

cmd/cue: nested workflow command structs can't use struct.MinFields

Open jpluscplusm opened this issue 8 months ago • 1 comments

What version of CUE are you using (cue version)?

$ cue version
cue version v0.12.1

go version go1.24.0
      -buildmode exe
       -compiler gc
  DefaultGODEBUG asynctimerchan=1,gotestjsonbuildtext=1,gotypesalias=0,httpservecontentkeepheaders=1,multipathtcp=0,randseednop=0,rsa1024min=0,tls3des=1,tlsmlkem=0,x509keypairleaf=0,x509negativeserial=1,x509rsacrt=0,x509usepolicies=0
     CGO_ENABLED 1
          GOARCH amd64
            GOOS linux
         GOAMD64 v1
cue.lang.version v0.12.0

Does this issue reproduce with the latest stable release?

v0.12.1 is latest.

What did you do?

# unnested
! exec cue cmd unnested
stderr 'command\.unnested:.*does not satisfy struct.MinFields'

# nested
! exec cue cmd nested
stderr 'command\.unnested:.*does not satisfy struct.MinFields'
-- a_tool.cue --
package p

import (
        "tool/cli"
        "struct"
)

let cmd = { "print": cli.Print & {text: "hello"} }

command: unnested: cmd
command: unnested: struct.MinFields(100)

command: nested: inner: cmd
command: nested: inner: struct.MinFields(100)

What did you expect to see?

A passing test, indicating that both workflow command invocations failed.

What did you see instead?

# unnested (0.016s)
# nested (0.014s)
> ! exec cue cmd nested
[stdout]
hello
FAIL: repro.txtar:6: unexpected command success

jpluscplusm avatar Apr 24 '25 15:04 jpluscplusm

I've updated the description with a more precise repro, but yes, this does appear to be a case of a task not being validated correctly.

Noting this is different from what we observed and fixed in https://github.com/cue-lang/cue/issues/3897

myitcv avatar Apr 29 '25 09:04 myitcv