v0.12.0
This release fixes dozens of bugs in the new evaluator, enables the embed and toposort experiments by default, further improves JSON Schema support, and introduces cue exp gengotypes.
Changes which may break some users are marked below with: ⚠️
Evaluator
CL 1205861 enables the Embedding proposal via CUE_EXPERIMENT=embed by default, given that the proposal was accepted in late December.
Since v0.11.0, an experimental “topological sorting” of struct fields has been available via CUE_EXPERIMENT=toposort; this release enables the experiment by default. Topological sorting produces a more principled ordering of fields as produced by cue export and cue eval. The intent is to ensure the old and new evaluators order struct fields in the same way, in order to build confidence and ease the transition to the new evaluator.
We encourage all CUE users to update to this release and switch to topological sorting for their CUE outputs. An issue for gathering feedback is available, should you run into any issues.
A great deal of work has happened in the new evaluator, which can be used via CUE_EXPERIMENT=evalv3. Marcel also recently posted another update on performance progress. Below is a selection of particularly relevant changes in the new evaluator.
CLs 1204490, 1204669, and 1205368 resolve a number of significant performance issues spotted in the new evaluator.
CLs 1206123, 1206178, 1206284, 1206321, 1206385, and 1207910 fix a number of disjunction issues leading to incorrect behavior in the new evaluator.
CLs 1206327, 1206383, and 1206384 fix a number of cycle issues leading to incorrect errors in the new evaluator.
CLs 1206823, 1207237, 1207314, 1204365, 1205361, 1205363, and 1207714 fix a number of closedness issues which resulted in missing or incorrect errors in the new evaluator.
CL 1207912 fixes a regression which could cause “not properly initialized” errors in the new evaluator.
CLs 1206926, 1207169, 1207263, 1207545, and 1207715 fix panics which were recently discovered.
CL 1205862 sorts conjuncts in binary expressions to reduce ordering differences between evaluator versions.
CL 1207908 ensures that conversions of Go values to CUE respect struct field order, for the sake of topological sorting.
CL 1207907 ensures that converting Go arrays to CUE uses list.Repeat rather than the now-removed list arithmetic syntax.
CL 1204491 introduces CUE_DEBUG=openinline, enabled by default, which emulates the old evaluator’s incorrect closedness behavior in some edge cases. This should help the transition towards the new evaluator, and allow us to fix the behavior of these edge cases in future CUE releases.
CL 1204608 introduces CUE_DEBUG=sortfields which sorts all struct fields lexicographically. This replaces CUE_DEBUG_SORT_ARCS=1, which did not work with the new evaluator.
Go API
⚠️ CL 1205569 enables CUE_EXPERIMENT=decodeint64 by default, causing cue.Value.Decode to choose int64 rather than int as the default Go type for CUE integer values.
CL 1206368 adds a cue/token.Pos.Compare method to allow comparing two positions, for example to sort via slices.SortFunc.
CL 1207007 adds encoding/jsonschema.Config.AllowNonExistentRoot to prevent an error when no value is found at the Config.Root path.
Builtins
CL 1204378 teaches list.UniqueItems to handle incomplete values correctly, fixing a bug in JSON Schema.
CL 1204425 fixes list.MatchN so that it matches final values, like the matchN evaluator built-in, fixing a bug in JSON Schema.
⚠️ CL 1204920 removes the long-deprecated cue.Value.IsClosed method.
⚠️ CL 1205530 removes the long-deprecated cue.Instance.Doc method.
⚠️ CL 1205529 removes the long-deprecated cue/load.Config.BuildTags field.
cmd/cue
CL 1207142 adds the new command cue mod rename to aid in changing the module path of the current module.
⚠️ CL 1206950 fixes an issue where incomplete errors were not being reported by cue eval and cue vet.
CL 1204111 fixes some edge cases where CUE comments were lost or duplicated, particularly with cue def.
CL 1204874 re-enables command suggestions when a user makes a typo like cue exprot.
CL 1206784 fixes an issue where arguments and flags in cue cmd could not be interspersed, unlike other subcommands.
Encodings
The new experimental command cue exp gengotypes allows generating Go type definitions derived from exported CUE schemas. This can be a nice alternative to cue get go for projects developing both CUE and Go, if one wishes to maintain the source of truth for shared schemas in CUE. cue exp gengotypes is generally more reliable than cue get go, given that Go’s type system is not as powerful.
JSON Schema spec compatibility is improved further by fixing a number of bugs and adding missing features. Notably, it now supports arbitrary references to internal structure in $ref. JSON Schema’s spec test suite has gone from a “pass” rate of 75% to 79% thanks to these efforts.
⚠️ CL 1207146 tweaks JSON Schema to not generate defaults, given that they are annotations rather than constraints, and generating CUE defaults causes various issues.
All changes
270 changes since v0.11.0by area
all8
allenable toposort by defaultallswap sort for slices for []string valuesallmake more use of slices.SortFuncallmake more use of slices.Compare and slices.CompareFuncallsunset CUE_EXPERIMENT=modulesallCUE_EXPERIMENT=modules no longer needs to be set in testsallfix "a the", "the a", and "the the" mistakesallfix testdata remnants of cue/format indenting first lines
cmd29
cmd/cuestop help text implying support for globscmd/cuereject login --token=""cmd/cueadd test for 3646cmd/cuefix a regression withcue get godropping CUE filescmd/cueadd a test case to reproduce #3644cmd/cueadd gengotypes test cases overriding a pointer typecmd/cuenew command: cue mod renamecmd/cue/cmdfix referencecmd/cueaddcue exp gengotypescmd/cueremove mention of -p from cue help exportcmd/cueallow interspersed flags incue cmdcmd/cueadd a test case forcue cmd foo args -t tagcmd/cuefix find-files testscript builtin to use relative directory pathscmd/cuefix the only SA4004 errorcmd/cueallow tidy to add dependencies from any unqualified importcmd/cuetest whether tidy can add a dependency path with dashescmd/cueadd a regression test for anexport -ebug fixed by evalv3cmd/cueremove support for CUE_DEBUG_SORT_ARCScmd/cuefix spelling of CUE_EXPERIMENT for evalv2cmd/cueadd new CUE_EXPERIMENT and CUE_DEBUG flags tohelp environmentcmd/cueadd regression test for #3616cmd/cuededuplicate the use of CUE_EXPERIMENT=evalv3cmd/cueadd a testscript for CUE_DEBUG=sortfields working with the Go APIcmd/cueenable subcommand suggestions when a user makes a typocmd/cueadd a test case for a subcommand typocmd/cueadd tests for the loss of comments withcue defcmd/cueadd test for the loss of comments withcue defcmd/cuewire up CUE_DEBUG into the runtime for evalv2cmd/cueadd integration test for CUE_DEBUG=sortfields
core4
core/toposortCorrect CloseInfo Declcore/convertCorrect conversion of array typescore/convertEnsure Go -> CUE conversion respects struct field ordercore/toposortStop using RawString
cue33
cue/testdataupdate out/eval/stats after concurrent mergescueclean up how we marshal CUE numbers as JSONcue/tokenrevert to NoPos sorting last, and document itcueadd a benchmark regression test for issue 572cue/buildclean up the Instance docs a bitcue/scannerdrop support for //line commentscue/errorsuse cue/token.Pos.Comparecue/tokenNoPos is smaller than any valid positioncue/tokenadd Pos.Compare from toposortcueadd regression test for matchN of structs within listscueadd a regression test for invalid pattern matching syntax errorscue/loadassume that Config.Registry is set when SkipImports is falsecue/ast/astutilensure imports always start a new sectioncue/ast/astutiladd test for file-level comments joining with importscue/astremove outdated docscueenable CUE_EXPERIMENT=decodeint64 by defaultcueadd more godoc linkscueremove Instance.Doccue/loadremove Config.BuildTagscueuse embedding for UnifyAccept in V3cue/parseralways allow predeclared identifiers on RHScue/errorssimplify printErrorcueuse Value.ctx helper method consistentlycuerewrite away all uses of Iterator.Labelcuereenable Allows(AnyDefinition) test case with a TODOcueremove the deprecated and hidden Value.IsClosed methodcueuse cue/literal to parse integers out of attributescueadd an attribute test with a non-Go integer literalcuemake the tests non-chatty by defaultcuefix loss or duplication of commentscuefix the loss of comments inValue.Syntax()cue/loadsupport loading a CUE package whose directory ends with .cuecuefix Value.Unify closedness issues for evalv3
encoding26
encoding/jsonschemado not generate defaultsencoding/jsonschemafail on mismatched error messagesencoding/jsonschemaupdate error messagesencoding/jsonschemaadjust doc commentencoding/jsonschemaadd Config.AllowNonExistentRootencoding/openapirewrite uses of deprecated cue.Value methodsencoding/jsonschemarespect Config.PkgNameencoding/jsonschemaadd test for Config.PkgNameencoding/jsonschemaimplementConfig.DefineSchemaencoding/jsonschemaupdate external test errorsencoding/jsonschemarefactor reference handlingencoding/jsonschemaadd structBuilder typeencoding/openapifix updating golden files in testsencoding/jsonschemadefine isTop and isBottom functionsencoding/jsonschemado not use explicit phase for TODO constraintsencoding/jsonschemaremove isSchema fieldencoding/openapisimplify looping over CUE fieldsencoding/jsonschemasimplify ref logic without changing behaviourencoding/jsonschemado not return state from schemaStateencoding/jsonschemainclude doc comments for definitionsencoding/jsonschemaadd test for a doc comment on a definitionencoding/jsonschemafix oneOf with unconstrained elementsencoding/jsonschemaadd test case for issue 3586encoding/jsonschemaclose structs and mark fields as required in enum and constencoding/jsonschemaprevent invalid end position of id tagencoding/jsonschemaadd a test for panicking about invalid pos
internal145
internal/core/adtforce finalizing of shared valuesinternal/core/adtadd tests for 3648internal/core/adtfinalize disjunctions once knowninternal/core/adtadd test for issue 3699internal/core/adtfix completion-related counter issueinternal/core/adtfix sharing-related counter issueinternal/core/adtfix EVAL counter issueinternal/core/adtfix disjunction counter issueinternal/core/adtfix disjunction error counter issueinternal/core/adtremove closedness for ToDataAllinternal/core/adtadd tests for issue 3694internal/ciupdate pinned Go for the next releaseinternal/core/adtfix name of methodinternal/core/adtseveral logging improvementsinternal/core/depfix handling sharing in non-rooted nodesinternal/coresearch harder for BinExprs in toposortinternal/core/adtprevent early decrements in comprehensionsinternal/core/adtdecrement DEFER dependencies in overlayinternal/core/adtbreak notification dependency on structural cycleinternal/core/adtfix counter related to close builtininternal/cueexperimentkeep all past experiments aroundinternal/core/adthandle dependencies fully in overlayinternal/encoding/gotypesignore definitions or fields via@go(-)internal/encoding/gotypesbetter support for CUE versus Go package namesinternal/core/adthoist dependency codeinternal/core/adtsplit ccArcinternal/core/adtprepare to differentiate types of arcs and notifyinternal/core/adthoist dependency breaking codeinternal/core/adtrename cc to dstinternal/core/adtsplit addDependencyinternal/core/adthoist dependency-related code into dep.gointernal/core/adthoist closedness related codeinternal/core/adtmove block of codeinternal/core/adthoist dependency code from debuginternal/core/adtsplit closeContext.arcsinternal/core/adtsimplify linkNotifyinternal/core/adtfix EVAL counter issueinternal/core/adtfix counter issueinternal/core/adtadd disjunction info as blob to debug outputinternal/core/adtfix constraints deduplicationinternal/core/adtadd test for 3638internal/core/adtcopy sharedID across disjunctionsinternal/core/adtadd test for 3679internal/core/adtpropagate completion signal if disjunction is resolvedinternal/core/adtadd test for 3681internal/core/adtalways do decrement accountinginternal/core/adtadd tests for 3672 and 3606internal/core/adtadd disjunction information in log headerinternal/encoding/gotypesdisjunctions of many kinds are not TODOsinternal/encoding/gotypesgenerate disjunctions of structs as a mapinternal/core/adthoist logging-related code into separate fileinternal/core/adtinitialize erroneous optional fields in disjunctionsinternal/core/adtremove pattern optimizationinternal/core/adtadd test for 3670internal/core/adtfix validator closedness issueinternal/core/adtadd tests for 3639 and 3661internal/core/adtdo not free vertexinternal/core/adtreduce counter issuesinternal/core/adtdo not force externalDeps for disjunctionsinternal/core/adtuse explicit hole idinternal/encoding/gotypesobey@go(,type=)for optional fieldsinternal/core/validatedisallow incomplete errors in "Final" modeinternal/core/validateerror position now fixedinternal/core/validateadd test for issue 3651internal/ciset a custom default bash shell invocationinternal/core/adtfix issue 3599internal/core/adtadd tests for issue 3599internal/core/adtfix potential index mismatchinternal/core/adtfix index out of bound panicinternal/core/adtfix closedness issue related to sharinginternal/core/adtadd tests for two issuesinternal/core/adtremove todointernal/core/adtupdate error priority statusinternal/core/adtremove cycle check specifcally for dynamic verticesinternal/core/adtdo not proactively evaluate letinternal/cifix glob of files to deleteinternal/core/exportuse cue/token.Pos.Compareinternal/core/adtfix 2052 for eval v3internal/core/adtadd some smaller reducers for issue 2052internal/core/adtfix dropping arcs with double and deep pushdownsinternal/core/adtadd test for issue 3621internal/core/adtchange some constants in testinternal/core/adtfix resolving disjunctions in callsinternal/core/adtadd tests for Issue 3584internal/core/adtfix self reference issueinternal/core/adtadd test for issue 3178internal/core/adtrename state constants in sched_testinternal/core/adtpropagate child errorsinternal/core/adtadd tests for Issue 3576internal/core/adtfix disjunction error issueinternal/core/adtadd tests for issue 3581internal/core/adtfix let issue for eval v3internal/core/adtfix let issue for eval v2internal/core/adtadd tests for 3590 and 3591internal/core/adtdereference disjunct resultinternal/core/adtadd tests for Issue 3528internal/core/adtimprove disjunction of scalarsinternal/core/adtadd tests for issue 3415internal/core/exportsort conjuncts in binary expressionsinternal/ciupdate Go and goreleaser versions for the next releaseinternal/cueexperimentenable embed experiment by defaultinternal/astinternaladd IncludePointersinternal/mod/modloadsort module versions when adding a new dependencyinternal/core/adtremove resolved TODOinternal/core/adtmore pruning in partial disjunction checkinternal/core/adtsupport simplifying string boundsinternal/core/adtorder bound error messagesinternal/core/adtfix bug in bound simplificationinternal/core/adtrevert recent changeinternal/core/adtpatch performance issue related to error reportinginternal/core/adtalternative algorithm for splitting treesinternal/core/adtfix closedness bug with patternsinternal/core/adtpass closeContext to openDebugGraphinternal/core/adtalways create new closeContext on referenceinternal/core/adtadd various closedness testsinternal/core/adtcleanup some todosinternal/core/adtalso handle __no_sharing for V2internal/ciuse pull_request_target for PR CI jobsinternal/core/adtfix dropping of fieldinternal/core/adtmake Conjuncts type ConjunctGroupinternal/core/adtsimplify codeinternal/core/adtadd test for dropped field issueinternal/core/adtallow selectively turning off sharinginternal/core/runtimeconsistently follow CUE_DEBUG env var flagsinternal/core/adtclose previously fixed issueinternal/core/adtadd tests for Issue 3535internal/ciuse the new tipdeploy workflow in cuelang.orginternal/astinternalmake it easier to debug referencesinternal/cistart enforcing staticcheck in CIinternal/core/adtinlining simplificationinternal/cuedebugrename filesinternal/cueexperimentremove yamlv3experimentinternal/core/adtadd compatibility mode for issue 3534internal/core/adtadd tests for issue 3534internal/core/adtadd compatibiltiy mode for closedness issueinternal/core/adtimprove structure sharing in cyclesinternal/core/adtadd test for perfromance issue 3587internal/core/adtdisable prep for associative listsinternal/core/adtfix error checkinginternal/core/adtadd tests for disjunction eliminationinternal/core/toposortsupport sorting fields lexicographicallyinternal/cidelete completed TODO about the old registry tokensinternal/ciupdate Linux to ubuntu-24.04internal/tdtestmake compatible with cuetdtestinternal/cueversionbump LanguageVersion for v0.12
lsp5
lspassert that a WorkspaceFolder must correspond to a CUE modulelspfix implementation of protocol.DocumentURI.Dirlspadd simple workspace-based test for basic CUE modulelspremove various go logic/handlinglspremove notes .md file
pkg6
pkg/listadd more test cases for list.UniqueItemspkg/listadd a regression test for an invalid operand bug fixed in evalv3pkg/listMatchN matches in final modepkg/listadd tests for issue 3519pkg/listhandle incomplete values for UniqueItemspkg/listadd tests for UniqueItems
Other14
- enable one more staticcheck check
- update golang.org/x/...
- update testscript to drop the need for
func() int - update most dependencies ahead of v0.12.0-alpha.1
evaluatoradd regression test to lock in evalv3 wrt #3567READMEupdate version number in installation example- enable and fix "value never used" staticcheck rule
- enable and fix "non-generic receiver names" staticcheck rule
- add staticcheck config files to appease the linter
- Revert "cmd/cue: add test for the loss of comments with
cue def" - Revert "cue: fix the loss of comments in
Value.Syntax()" docdon't vendor a copy of DCO, as it is under another license- update txtpbfmt dependency
- update golang.org/x dependencies
Downloads
Every file this release published on GitHub, with its SHA-256. Most people install CUE as Installing CUE describes, which also shows how to check a download.
Archives
| Platform | File and SHA-256 |
|---|---|
| macOS, Intel | cue_8474e522a978ecadef49b06d706ff276cd07629b1aa107b88adfc1284d3f93cc |
| macOS, Apple silicon | cue_7055a6423f753c8ea763699d48d78d341e8543397399daee281c66ecdc9ec5a5 |
| Linux, x86-64 | cue_e55cd5abd98a592c110f87a7da9ef15bc72515200aecfe1bed04bf86311f5ba1 |
| Linux, Arm64 | cue_488012bb0e5c080e2a9694ef8765403dd1075a4ec373dda618efa2d37b47f14f |
| Windows, x86-64 | cue_268bf95f4767b37d5db01450d55ca9d10e9a8bd8a1417c31dff456b5f9775abf |
| Windows, Arm64 | cue_91ad090eb86b0d21186d8de0a7b985d235b27e67cd464f7738663e457b042505 |
SHA-256 checksums for all of these: checksums.txt