cue-lang / cue

The home of the CUE language! Validate and define text-based and dynamic configuration
https://cuelang.org
Apache License 2.0
5.07k stars 288 forks source link

evalv3: export via api error regression with the new evaluator #3178

Open nxcc opened 4 months ago

nxcc commented 4 months ago

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

$ cue version
cue version v0.9.0-alpha.5

go version go1.22.3
      -buildmode exe
       -compiler gc
       -trimpath true
     CGO_ENABLED 0
          GOARCH amd64
            GOOS linux
         GOAMD64 v1
cue.lang.version v0.9.0

Does this issue reproduce with the latest stable release?

no

What did you do?

attachment: issue.txtar.txt

testscript issue.txtar

What did you expect to see?

PASS

What did you see instead?

failing execution of go run [...] adding field redis not allowed as field set was already referenced


updated txtar that just uses cue: issue2.txtar.txt

nxcc commented 4 months ago

Just realized this is an evaluator (default vs. v3) issue, not cue cmd vs. cue api. Removing cuecontext.EvaluatorVersion(cuecontext.EvalV3) in the go code makes this work. Please feel free to close this issue unless it's still valuable as evaluator issue.

mvdan commented 4 months ago

The issue is still valuable - we want to be aware of any unexpected errors or regressions with the new evaluator. Thanks!