v0.12.0-alpha.2
This release fixes many bugs in the new evaluator, enables the toposort experiment by default, and introduces cue exp gengotypes.
Changes which may break some users are marked below with: ⚠️
Evaluator
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 1206123, 1206178, 1206284, 1206321, and 1206385 fix a number of disjunction issues leading to incorrect behavior.
CLs 1206327, 1206383, and 1206384 fix a number of cycle issues leading to incorrect errors.
CLs 1206823, 1207237, and 1207314 fix a number of closedness issues which resulted in missing or incorrect errors.
CLs 1206926, 1207169, 1207263, and 1207545 fix panics which were recently discovered.
CL 1205862 sorts conjuncts in binary expressions to reduce ordering differences between evaluator versions.
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, in preparation for v0.12.0. Topological sorting produces a more principled ordering of fields as produced by cue export and cue eval. The intention 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. An issue for gathering feedback is available.
Go API
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.
cmd/cue
CL 1207142 adds the new command cue mod rename to aid in changing the module path of the current module.
CL 1206784 fixes an issue where arguments and flags in cue cmd could not be interspersed, unlike other subcommands.
⚠️ CL 1206950 fixes an issue where incomplete errors were not being reported by cue eval and cue vet.
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.
⚠️ 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
132 changes since v0.12.0-alpha.1by area
all4
allenable toposort by defaultallswap sort for slices for []string valuesallmake more use of slices.SortFuncallmake more use of slices.Compare and slices.CompareFunc
cmd16
cmd/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 evalv3
cue9
cue/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 errors
encoding6
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 methods
internal88
internal/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 expressions
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
Other4
- update golang.org/x/...
- update testscript to drop the need for
func() int pkg/listadd more test cases for list.UniqueItemspkg/listadd a regression test for an invalid operand bug fixed in evalv3
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_67d5a5f73c6feea0980337bfe590663b4d52f01bc6bd3eafae232416ab811db6 |
| macOS, Apple silicon | cue_0804b240acfdfaaf5982e4844e2aea7a938e62ddcdc467dd5f1e1e7105245b12 |
| Linux, x86-64 | cue_03ac2d10e3c330235d41a020c978a48ffa7647fee54dbaa6273e86e1a6521770 |
| Linux, Arm64 | cue_24f5390781a0bf1f6cdbc69022f79f41db27cd6c03ed8bcc3569e70618c50ab5 |
| Windows, x86-64 | cue_aa2c8f390b86533487c90d88d7e8a9ca7e9d4480c25e73dd0368bcd3662fa33e |
| Windows, Arm64 | cue_32057ed0ab9094cd483a51c7c4f97175fb21b72c266856182025eb79f7a56bb9 |
SHA-256 checksums for all of these: checksums.txt