v0.12.0-alpha.2
Pre-releaseThis 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.
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.
Full list of changes since v0.12.0-alpha.1
- update golang.org/x/... by @mvdan in 2efb244
- internal/ci: update pinned Go for the next release by @mvdan in 775ce67
- internal/core/adt: fix name of method by @mpvl in ac4c7d0
- internal/core/adt: several logging improvements by @mpvl in 62b3005
- internal/core/dep: fix handling sharing in non-rooted nodes by @mpvl in c8170aa
- all: enable toposort by default by @cuematthew in f8defbb
- internal/core: search harder for BinExprs in toposort by @cuematthew in 9caec6f
- cmd/cue: reject login --token="" by @mvdan in 6ada21c
- cmd/cue: add test for 3646 by @mpvl in 18f0ae8
- internal/core/adt: prevent early decrements in comprehensions by @mpvl in bdc2929
- internal/core/adt: decrement DEFER dependencies in overlay by @mpvl in 6b292d4
- internal/core/adt: break notification dependency on structural cycle by @mpvl in ae730eb
- internal/core/adt: fix counter related to close builtin by @mpvl in aa6781f
- internal/cueexperiment: keep all past experiments around by @mvdan in 74c12e0
- internal/core/adt: handle dependencies fully in overlay by @mpvl in e34f770
- internal/encoding/gotypes: ignore definitions or fields via
@go(-)
by @mvdan in 58a8351 - internal/encoding/gotypes: better support for CUE versus Go package names by @mvdan in a1d8099
- internal/core/adt: hoist dependency code by @mpvl in 7d159b3
- internal/core/adt: split ccArc by @mpvl in 4d3eafa
- internal/core/adt: prepare to differentiate types of arcs and notify by @mpvl in 44a2e75
- internal/core/adt: hoist dependency breaking code by @mpvl in ba0639e
- internal/core/adt: rename cc to dst by @mpvl in 43a313a
- internal/core/adt: split addDependency by @mpvl in 06f5289
- internal/core/adt: hoist dependency-related code into dep.go by @mpvl in f3d367a
- internal/core/adt: hoist closedness related code by @mpvl in db6a8b9
- internal/core/adt: move block of code by @mpvl in 6a60de5
- internal/core/adt: hoist dependency code from debug by @mpvl in fc9720c
- internal/core/adt: split closeContext.arcs by @mpvl in c2ebfdb
- internal/core/adt: simplify linkNotify by @mpvl in 13f38c9
- internal/core/adt: fix EVAL counter issue by @mpvl in 9f913e0
- internal/core/adt: fix counter issue by @mpvl in 0efb5e8
- internal/core/adt: add disjunction info as blob to debug output by @mpvl in c880efb
- internal/core/adt: fix constraints deduplication by @mpvl in 053f47b
- internal/core/adt: add test for 3638 by @mpvl in b1eaedd
- internal/core/adt: copy sharedID across disjunctions by @mpvl in 635d23b
- internal/core/adt: add test for 3679 by @mpvl in bdebb8a
- internal/core/adt: propagate completion signal if disjunction is resolved by @mpvl in 5ce7ba4
- internal/core/adt: add test for 3681 by @mpvl in 682462a
- internal/core/adt: always do decrement accounting by @mpvl in 8a73d2b
- internal/core/adt: add tests for 3672 and 3606 by @mpvl in d57d885
- internal/core/adt: add disjunction information in log header by @mpvl in fbfff68
- cmd/cue: fix a regression with
cue get go
dropping CUE files by @mvdan in b193af0 - cmd/cue: add a test case to reproduce #3644 by @mvdan in c94fd55
- internal/encoding/gotypes: disjunctions of many kinds are not TODOs by @mvdan in 4d852c8
- internal/encoding/gotypes: generate disjunctions of structs as a map by @mvdan in 97b24b2
- internal/core/adt: hoist logging-related code into separate file by @mpvl in d113c59
- internal/core/adt: initialize erroneous optional fields in disjunctions by @mpvl in 0ad6826
- internal/core/adt: remove pattern optimization by @mpvl in 05f5d76
- internal/core/adt: add test for 3670 by @mpvl in 9ee56f7
- internal/core/adt: fix validator closedness issue by @mpvl in 9e85cd7
- internal/core/adt: add tests for 3639 and 3661 by @mpvl in d0564de
- internal/core/adt: do not free vertex by @mpvl in 393e9fa
- internal/core/adt: reduce counter issues by @mpvl in ed235a8
- internal/core/adt: do not force externalDeps for disjunctions by @mpvl in 12437a2
- internal/core/adt: use explicit hole id by @mpvl in 681ec9f
- internal/encoding/gotypes: obey
@go(,type=)
for optional fields by @mvdan in f62bb36 - cmd/cue: add gengotypes test cases overriding a pointer type by @mvdan in 1b787cd
- cmd/cue: new command: cue mod rename by @rogpeppe in 416adfc
- encoding/jsonschema: do not generate defaults by @rogpeppe in fdf92d1
- encoding/jsonschema: fail on mismatched error messages by @rogpeppe in 09c9cca
- encoding/jsonschema: update error messages by @rogpeppe in 90396e5
- cue/token: revert to NoPos sorting last, and document it by @mvdan in 7ef4b6a
- internal/core/validate: disallow incomplete errors in "Final" mode by @mpvl in 3251b5c
- cmd/cue/cmd: fix reference by @mpvl in 85e8a7e
- internal/core/validate: error position now fixed by @mpvl in 583af47
- cmd/cue: add
cue exp gengotypes
by @mvdan in 51c5fdf - cmd/cue: remove mention of -p from cue help export by @jpluscplusm in 413bb17
- encoding/jsonschema: adjust doc comment by @rogpeppe in 59b0f46
- update testscript to drop the need for
func() int
by @mvdan in 07ff0b5 - all: swap sort for slices for []string values by @mvdan in b91f874
- all: make more use of slices.SortFunc by @mvdan in efcf06d
- all: make more use of slices.Compare and slices.CompareFunc by @mvdan in ebe2298
- encoding/jsonschema: add Config.AllowNonExistentRoot by @rogpeppe in 15f243b
- internal/core/validate: add test for issue 3651 by @mpvl in dfe3ae0
- internal/ci: set a custom default bash shell invocation by @myitcv in bbb2452
- internal/core/adt: fix issue 3599 by @mpvl in 211b2a2
- internal/core/adt: add tests for issue 3599 by @mpvl in 9da90de
- internal/core/adt: fix potential index mismatch by @mpvl in bf6965e
- internal/core/adt: fix index out of bound panic by @mpvl in 96cff7c
- internal/core/adt: fix closedness issue related to sharing by @mpvl in fddb432
- internal/core/adt: add tests for two issues by @mpvl in b1e7012
- internal/core/adt: remove todo by @mpvl in 640d9b3
- internal/core/adt: update error priority status by @mpvl in 09654c6
- internal/core/adt: remove cycle check specifcally for dynamic vertices by @mpvl in 5014742
- cmd/cue: allow interspersed flags in
cue cmd
by @mvdan in e41efd5 - cmd/cue: add a test case for
cue cmd foo args -t tag
by @mvdan in d182fc2 - internal/core/adt: do not proactively evaluate let by @mpvl in d8fabe1
- lsp: assert that a WorkspaceFolder must correspond to a CUE module by @myitcv in 3f4e72d
- lsp: fix implementation of protocol.DocumentURI.Dir by @myitcv in 5a56848
- lsp: add simple workspace-based test for basic CUE module by @myitcv in 5747d91
- lsp: remove various go logic/handling by @myitcv in 9d9632a
- lsp: remove notes .md file by @myitcv in 8210970
- pkg/list: add more test cases for list.UniqueItems by @myitcv in 74a0c9d
- cue: add a benchmark regression test for issue 572 by @mvdan in b5e1647
- encoding/openapi: rewrite uses of deprecated cue.Value methods by @mvdan in 7373f67
- cue/build: clean up the Instance docs a bit by @mvdan in e44b17d
- cmd/cue: fix find-files testscript builtin to use relative directory paths by @mvdan in 41d0797
- cmd/cue: fix the only SA4004 error by @mvdan in 7da6f24
- internal/ci: fix glob of files to delete by @myitcv in 46fc54a
- cmd/cue: allow tidy to add dependencies from any unqualified import by @mvdan in d55208c
- cmd/cue: test whether tidy can add a dependency path with dashes by @mvdan in 82ebb11
- cue/scanner: drop support for //line comments by @mvdan in 901604a
- cue/errors: use cue/token.Pos.Compare by @mvdan in ae8ee75
- cue/token: NoPos is smaller than any valid position by @mvdan in 5e89f6b
- internal/core/export: use cue/token.Pos.Compare by @mvdan in b51d7b9
- cue/token: add Pos.Compare from toposort by @mvdan in 5c2ce05
- cue: add regression test for matchN of structs within lists by @mvdan in 22bec0c
- cue: add a regression test for invalid pattern matching syntax errors by @mvdan in d50dcf6
- cmd/cue: add a regression test for an
export -e
bug fixed by evalv3 by @mvdan in 2589f7f - pkg/list: add a regression test for an invalid operand bug fixed in evalv3 by @mvdan in b0c6204
- internal/core/adt: fix 2052 for eval v3 by @mpvl in e3359f5
- internal/core/adt: add some smaller reducers for issue 2052 by @mpvl in a9f4f20
- internal/core/adt: fix dropping arcs with double and deep pushdowns by @mpvl in c905888
- internal/core/adt: add test for issue 3621 by @mpvl in 4a76cb8
- internal/core/adt: change some constants in test by @mpvl in 00cfb22
- internal/core/adt: fix resolving disjunctions in calls by @mpvl in 3ee8b07
- internal/core/adt: add tests for Issue 3584 by @mpvl in b1803fa
- internal/core/adt: fix self reference issue by @mpvl in db3a7c9
- internal/core/adt: add test for issue 3178 by @mpvl in 0b6a4e8
- internal/core/adt: rename state constants in sched_test by @mpvl in 962f60b
- internal/core/adt: propagate child errors by @mpvl in f2c38f8
- internal/core/adt: add tests for Issue 3576 by @mpvl in 2491cac
- internal/core/adt: fix disjunction error issue by @mpvl in c21e546
- internal/core/adt: add tests for issue 3581 by @mpvl in 8288686
- internal/core/adt: fix let issue for eval v3 by @mpvl in e6cb9b3
- internal/core/adt: fix let issue for eval v2 by @mpvl in 2702426
- internal/core/adt: add tests for 3590 and 3591 by @mpvl in 06f41bc
- internal/core/adt: dereference disjunct result by @mpvl in e4c4b8e
- internal/core/adt: add tests for Issue 3528 by @mpvl in 8f55942
- internal/core/adt: improve disjunction of scalars by @mpvl in 80743ca
- internal/core/adt: add tests for issue 3415 by @mpvl in 3dbf61a
- internal/core/export: sort conjuncts in binary expressions by @mpvl in 6aa0277