v0.12.0-alpha.2

cue-lang/cue Pre-release Released

A release of CUE OSS · its page on GitHub

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 default@cuematthewf8defbb
  • allswap sort for slices for []string values@mvdanb91f874
  • allmake more use of slices.SortFunc@mvdanefcf06d
  • allmake more use of slices.Compare and slices.CompareFunc@mvdanebe2298

cmd16

  • cmd/cuereject login --token=""@mvdan6ada21c
  • cmd/cueadd test for 3646@mpvl18f0ae8
  • cmd/cuefix a regression with cue get go dropping CUE files@mvdanb193af0
  • cmd/cueadd a test case to reproduce #3644@mvdanc94fd55
  • cmd/cueadd gengotypes test cases overriding a pointer type@mvdan1b787cd
  • cmd/cuenew command: cue mod rename@rogpeppe416adfc
  • cmd/cue/cmdfix reference@mpvl85e8a7e
  • cmd/cueadd cue exp gengotypes@mvdan51c5fdf
  • cmd/cueremove mention of -p from cue help export@jpluscplusm413bb17
  • cmd/cueallow interspersed flags in cue cmd@mvdane41efd5
  • cmd/cueadd a test case for cue cmd foo args -t tag@mvdand182fc2
  • cmd/cuefix find-files testscript builtin to use relative directory paths@mvdan41d0797
  • cmd/cuefix the only SA4004 error@mvdan7da6f24
  • cmd/cueallow tidy to add dependencies from any unqualified import@mvdand55208c
  • cmd/cuetest whether tidy can add a dependency path with dashes@mvdan82ebb11
  • cmd/cueadd a regression test for an export -e bug fixed by evalv3@mvdan2589f7f

cue9

  • cue/tokenrevert to NoPos sorting last, and document it@mvdan7ef4b6a
  • cueadd a benchmark regression test for issue 572@mvdanb5e1647
  • cue/buildclean up the Instance docs a bit@mvdane44b17d
  • cue/scannerdrop support for //line comments@mvdan901604a
  • cue/errorsuse cue/token.Pos.Compare@mvdanae8ee75
  • cue/tokenNoPos is smaller than any valid position@mvdan5e89f6b
  • cue/tokenadd Pos.Compare from toposort@mvdan5c2ce05
  • cueadd regression test for matchN of structs within lists@mvdan22bec0c
  • cueadd a regression test for invalid pattern matching syntax errors@mvdand50dcf6

encoding6

  • encoding/jsonschemado not generate defaults@rogpeppefdf92d1
  • encoding/jsonschemafail on mismatched error messages@rogpeppe09c9cca
  • encoding/jsonschemaupdate error messages@rogpeppe90396e5
  • encoding/jsonschemaadjust doc comment@rogpeppe59b0f46
  • encoding/jsonschemaadd Config.AllowNonExistentRoot@rogpeppe15f243b
  • encoding/openapirewrite uses of deprecated cue.Value methods@mvdan7373f67

internal88

  • internal/ciupdate pinned Go for the next release@mvdan775ce67
  • internal/core/adtfix name of method@mpvlac4c7d0
  • internal/core/adtseveral logging improvements@mpvl62b3005
  • internal/core/depfix handling sharing in non-rooted nodes@mpvlc8170aa
  • internal/coresearch harder for BinExprs in toposort@cuematthew9caec6f
  • internal/core/adtprevent early decrements in comprehensions@mpvlbdc2929
  • internal/core/adtdecrement DEFER dependencies in overlay@mpvl6b292d4
  • internal/core/adtbreak notification dependency on structural cycle@mpvlae730eb
  • internal/core/adtfix counter related to close builtin@mpvlaa6781f
  • internal/cueexperimentkeep all past experiments around@mvdan74c12e0
  • internal/core/adthandle dependencies fully in overlay@mpvle34f770
  • internal/encoding/gotypesignore definitions or fields via @go(-)@mvdan58a8351
  • internal/encoding/gotypesbetter support for CUE versus Go package names@mvdana1d8099
  • internal/core/adthoist dependency code@mpvl7d159b3
  • internal/core/adtsplit ccArc@mpvl4d3eafa
  • internal/core/adtprepare to differentiate types of arcs and notify@mpvl44a2e75
  • internal/core/adthoist dependency breaking code@mpvlba0639e
  • internal/core/adtrename cc to dst@mpvl43a313a
  • internal/core/adtsplit addDependency@mpvl06f5289
  • internal/core/adthoist dependency-related code into dep.go@mpvlf3d367a
  • internal/core/adthoist closedness related code@mpvldb6a8b9
  • internal/core/adtmove block of code@mpvl6a60de5
  • internal/core/adthoist dependency code from debug@mpvlfc9720c
  • internal/core/adtsplit closeContext.arcs@mpvlc2ebfdb
  • internal/core/adtsimplify linkNotify@mpvl13f38c9
  • internal/core/adtfix EVAL counter issue@mpvl9f913e0
  • internal/core/adtfix counter issue@mpvl0efb5e8
  • internal/core/adtadd disjunction info as blob to debug output@mpvlc880efb
  • internal/core/adtfix constraints deduplication@mpvl053f47b
  • internal/core/adtadd test for 3638@mpvlb1eaedd
  • internal/core/adtcopy sharedID across disjunctions@mpvl635d23b
  • internal/core/adtadd test for 3679@mpvlbdebb8a
  • internal/core/adtpropagate completion signal if disjunction is resolved@mpvl5ce7ba4
  • internal/core/adtadd test for 3681@mpvl682462a
  • internal/core/adtalways do decrement accounting@mpvl8a73d2b
  • internal/core/adtadd tests for 3672 and 3606@mpvld57d885
  • internal/core/adtadd disjunction information in log header@mpvlfbfff68
  • internal/encoding/gotypesdisjunctions of many kinds are not TODOs@mvdan4d852c8
  • internal/encoding/gotypesgenerate disjunctions of structs as a map@mvdan97b24b2
  • internal/core/adthoist logging-related code into separate file@mpvld113c59
  • internal/core/adtinitialize erroneous optional fields in disjunctions@mpvl0ad6826
  • internal/core/adtremove pattern optimization@mpvl05f5d76
  • internal/core/adtadd test for 3670@mpvl9ee56f7
  • internal/core/adtfix validator closedness issue@mpvl9e85cd7
  • internal/core/adtadd tests for 3639 and 3661@mpvld0564de
  • internal/core/adtdo not free vertex@mpvl393e9fa
  • internal/core/adtreduce counter issues@mpvled235a8
  • internal/core/adtdo not force externalDeps for disjunctions@mpvl12437a2
  • internal/core/adtuse explicit hole id@mpvl681ec9f
  • internal/encoding/gotypesobey @go(,type=) for optional fields@mvdanf62bb36
  • internal/core/validatedisallow incomplete errors in "Final" mode@mpvl3251b5c
  • internal/core/validateerror position now fixed@mpvl583af47
  • internal/core/validateadd test for issue 3651@mpvldfe3ae0
  • internal/ciset a custom default bash shell invocation@myitcvbbb2452
  • internal/core/adtfix issue 3599@mpvl211b2a2
  • internal/core/adtadd tests for issue 3599@mpvl9da90de
  • internal/core/adtfix potential index mismatch@mpvlbf6965e
  • internal/core/adtfix index out of bound panic@mpvl96cff7c
  • internal/core/adtfix closedness issue related to sharing@mpvlfddb432
  • internal/core/adtadd tests for two issues@mpvlb1e7012
  • internal/core/adtremove todo@mpvl640d9b3
  • internal/core/adtupdate error priority status@mpvl09654c6
  • internal/core/adtremove cycle check specifcally for dynamic vertices@mpvl5014742
  • internal/core/adtdo not proactively evaluate let@mpvld8fabe1
  • internal/cifix glob of files to delete@myitcv46fc54a
  • internal/core/exportuse cue/token.Pos.Compare@mvdanb51d7b9
  • internal/core/adtfix 2052 for eval v3@mpvle3359f5
  • internal/core/adtadd some smaller reducers for issue 2052@mpvla9f4f20
  • internal/core/adtfix dropping arcs with double and deep pushdowns@mpvlc905888
  • internal/core/adtadd test for issue 3621@mpvl4a76cb8
  • internal/core/adtchange some constants in test@mpvl00cfb22
  • internal/core/adtfix resolving disjunctions in calls@mpvl3ee8b07
  • internal/core/adtadd tests for Issue 3584@mpvlb1803fa
  • internal/core/adtfix self reference issue@mpvldb3a7c9
  • internal/core/adtadd test for issue 3178@mpvl0b6a4e8
  • internal/core/adtrename state constants in sched_test@mpvl962f60b
  • internal/core/adtpropagate child errors@mpvlf2c38f8
  • internal/core/adtadd tests for Issue 3576@mpvl2491cac
  • internal/core/adtfix disjunction error issue@mpvlc21e546
  • internal/core/adtadd tests for issue 3581@mpvl8288686
  • internal/core/adtfix let issue for eval v3@mpvle6cb9b3
  • internal/core/adtfix let issue for eval v2@mpvl2702426
  • internal/core/adtadd tests for 3590 and 3591@mpvl06f41bc
  • internal/core/adtdereference disjunct result@mpvle4c4b8e
  • internal/core/adtadd tests for Issue 3528@mpvl8f55942
  • internal/core/adtimprove disjunction of scalars@mpvl80743ca
  • internal/core/adtadd tests for issue 3415@mpvl3dbf61a
  • internal/core/exportsort conjuncts in binary expressions@mpvl6aa0277

lsp5

  • lspassert that a WorkspaceFolder must correspond to a CUE module@myitcv3f4e72d
  • lspfix implementation of protocol.DocumentURI.Dir@myitcv5a56848
  • lspadd simple workspace-based test for basic CUE module@myitcv5747d91
  • lspremove various go logic/handling@myitcv9d9632a
  • lspremove notes .md file@myitcv8210970

Other4

  • update golang.org/x/...@mvdan2efb244
  • update testscript to drop the need for func() int@mvdan07ff0b5
  • pkg/listadd more test cases for list.UniqueItems@myitcv74a0c9d
  • pkg/listadd a regression test for an invalid operand bug fixed in evalv3@mvdanb0c6204

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

PlatformFile and SHA-256
macOS, Intelcue_v0.12.0-alpha.2_darwin_amd64.tar.gz67d5a5f73c6feea0980337bfe590663b4d52f01bc6bd3eafae232416ab811db6
macOS, Apple siliconcue_v0.12.0-alpha.2_darwin_arm64.tar.gz0804b240acfdfaaf5982e4844e2aea7a938e62ddcdc467dd5f1e1e7105245b12
Linux, x86-64cue_v0.12.0-alpha.2_linux_amd64.tar.gz03ac2d10e3c330235d41a020c978a48ffa7647fee54dbaa6273e86e1a6521770
Linux, Arm64cue_v0.12.0-alpha.2_linux_arm64.tar.gz24f5390781a0bf1f6cdbc69022f79f41db27cd6c03ed8bcc3569e70618c50ab5
Windows, x86-64cue_v0.12.0-alpha.2_windows_amd64.zipaa2c8f390b86533487c90d88d7e8a9ca7e9d4480c25e73dd0368bcd3662fa33e
Windows, Arm64cue_v0.12.0-alpha.2_windows_arm64.zip32057ed0ab9094cd483a51c7c4f97175fb21b72c266856182025eb79f7a56bb9

SHA-256 checksums for all of these: checksums.txt

Install CUE