This release adds further fixes to the new evaluator, and speeds up the CLI when there are many inputs.
Changes which may break some users are marked below with: ⚠️
Evaluator
The new evaluator is improved to fix more regressions which led to incorrect errors. Since the last alpha release, two newly added projects to Unity now succeed with evalv3
, and we have resolved eight issues reported on GitHub.
We also fix a bug where anonymous CUE files, such as those without a package
clause, did not properly report unused import errors.
cmd/cue
The cue help filetypes
logic, written itself in CUE, no longer requires using the evaluator to parse CLI arguments or load CUE packages. This results in significant speed-ups when using the CLI with many inputs.
Fix a bug where some errors shown to the user did not use relative paths to CUE files or directories as expected.
Go API
⚠️ CUE_EXPERIMENT=decodeint64
can no longer be disabled as we consider the experiment finished, having been introduced in CUE v0.11.0.
Fix a recent regression where using os.Getwd
alongside the ./cmd/cue/cmd
API had stopped working as it did before.
Encodings
cue exp gengotypes
now allows control over how to generate optional CUE fields via e.g. @(,optional=nullable)
, where the default now is not to use pointers.
⚠️ cue exp gengotypes
tweaks how it parses @(,type=)
options to support composite types such as slices and maps. Note that this means package paths with slashes must be quoted now.
Full list of changes since v0.13.0-alpha.4
- cmd/cue: add CUE_EXPERIMENT=cmdreferencepkg by @mvdan in 5548932
- pkg: make $id in tasks a reference to a hidden field by @mvdan in 1c27bdb
- cmd/cue: add testscript showing input unmarshal behavior with
cue cmd
by @mvdan in eebcefc
- internal/core/adt: fix disjunction state management by @mpvl in e145a14
- internal/core/adt: add tests for Issue 3925 and 3905 by @mpvl in 38357b7
- Revert "internal/core/adt: carry over enclosing scope" by @mvdan in a6daeb9
- cue/testdata: add test cases for #3924 by @mvdan in 2740b68
- internal/core/adt: avoid finalizing too early by @mpvl in f87800d
- internal/core/adt: add tests for issue 3919 by @mpvl in 47c9e99
- internal/filetypes: remove version from TODO by @rogpeppe in c456d08
- cmd/cue: document that embedding is limited to files in the same module by @mvdan in 3559578
- cmd/cue: update which experiments are on by default by @mvdan in cfe1783
- cue/load: make MultiplePackageError support relative dir paths by @mvdan in a8f9383
- cmd/cue: test the "found packages $X and $Y in $DIR" error message by @mvdan in 4f3a215
- internal/core/adt: fix some embedding issues with closedness by @mpvl in 2597621
- internal/core/adt: add tests for 3921 by @mpvl in b3caad3
- internal/encoding/gotypes: handle cyclic types out of the box by @mvdan in 61e0d7f
- cmd/cue: don't use os.Getwd at init time by @mvdan in e7d687f
- internal/core/adt: carry over enclosing scope by @mpvl in 7de64e8
- internal/core/adt: add tests for 3920 by @mpvl in 0f26957
- encoding/jsonschema: fix x-kubernetes-group-version-kind by @rogpeppe in 9752c3a
- internal/core/adt: update environment for disjunctions by @mpvl in e231c49
- internal/core/adt: add tests for issue 3891 by @mpvl in bb2204f
- all: cue fmt by @mvdan in 5c33e24
- internal/golangorgx: cuelsp: load cue by @cuematthew in 8ca0f5b
- internal/golangorgx: cuelsp: remove Go-specific analysis by @cuematthew in b9acd04
- internal/core/adt: handle vertices properly for comprehensions spanning disjunctions by @mpvl in 56a915b
- internal/core/adt: add tests for issue 3899 by @mpvl in b17be30
- encoding/jsonschema: recognize date-time too by @rogpeppe in 398e8be
- encoding/jsonschema: update format support by @rogpeppe in 59e82a7
- encoding/jsonschema: add numeric format to CRD test by @rogpeppe in 4e8dc78
- cmd/cue: move CUE_DEBUG_PARSER_TRACE to CUE_DEBUG=parsertrace by @mvdan in 8fb5fea
- cmd/cue: add testscript for CUE_DEBUG_PARSER_TRACE by @mvdan in a95cfa8
- tools/flow: move CUE_DEBUG_TOOLS_FLOW=1 to CUE_DEBUG=toolsflow=1 by @mvdan in 38b8955
- internal/cueexperiment: phase out DecodeInt64 by @mvdan in 3be8e48
- cue/testdata: add regression test for issue 2310 by @mvdan in 8fa1079
- cue/errors: use slices.CompactFunc to deduplicate errors by @mvdan in a1a53e5
- encoding/jsonschema: avoid adding unnecessary ellipses by @rogpeppe in 68dad74
- encoding/jsonschema: implement x-kubernetes-group-version-kind by @rogpeppe in 2c01ee5
- encoding/jsonschema: add VersionKubernetesAPI by @rogpeppe in a918c8b
- internal/encoding/gotypes: implement optional=nillable by @mvdan in 9ef3b70
- cmd/cue: add more gengotypes test cases for optional=nillable by @mvdan in defc384
- internal/encoding/gotypes: parse type options as Go expressions by @mvdan in f2e0b7e
- encoding/jsonschema: CRD metadata field is not required by @rogpeppe in d0f10ea
- internal/filetypes: remove dependency on CUE evaluator by @rogpeppe in 050844f
- internal/filetypes: generate FromFile by @rogpeppe in f37ff95
- internal/filetypes: generate toFile implementation by @rogpeppe in 6454acb
- internal/filetypes/internal/genfunc: CUE to Go translation by @rogpeppe in b3e8da8
- internal/filetypes/internal/genfunc: CUE expression simplification by @rogpeppe in 9c267d8
- internal/filetypes/internal/genstruct: new package by @rogpeppe in c65ecb4
- internal/filetypes: remove special cases by @rogpeppe in c7a63ad
- internal/core/adt: allow stack-based unrolling of blocking by @mpvl in 5c22dc8
- internal/core/adt: add tests for 3899 by @mpvl in e65a5e0
- encoding/jsonschema: CRDs always define resources by @rogpeppe in dbe2611
- encoding/jsonschema: add metadata field to CRD test case by @rogpeppe in f712e19
- cmd/cue: add a testscript for --inject-vars by @mvdan in aeb0747
- encoding/openapi: add regression test for issue 1643 by @mvdan in 8e4c818
- cue/errors: print relative positions when used as arguments too by @mvdan in 80ff2bd
- internal/ci/goreleaser: adjust after evalv3 fix for #3908 by @mvdan in 6fd7ee4
- internal/core/adt: fix default handling by @mpvl in db98b5f
- internal/core/runtime: validate imports in package-less files too by @mvdan in 45bcd34
- cmd/cue: add testscript to ensure we report unused imports by @mvdan in 21d4ba7
- cue/testdata: add regression tests for issue 2337 by @mvdan in 4154968
- pkg/list: add a regression test for issue 3416 by @mvdan in b0a5318
- cue/testdata: add a regression test for issue 2241 by @mvdan in 17e198c
- cue/testdata: add a regression test for issue 2229 by @mvdan in 1048634
- pkg/list: add regression test for issue 2594 by @mvdan in f93b6b9
- cue/testdata: add regression test for issue 1867 by @mvdan in aacdc3b
- cue/testdata: remove resolve/002.txtar by @mvdan in 89d1313
- all: clean up a number of txtar test skips by @mvdan in ebf4e65
- cue/testdata: add regression test for issue 2209 by @mvdan in 5db678d
- cue/testdata: add a regression test for issue 1640 by @mvdan in 09dee80
- cmd/cue: mention vet-c's three behaviours by @jpluscplusm in 8f552be
- cue/testdata: add a regression test for issue 2526 by @mvdan in 0be3c85
- internal/cuetxtar: support matrix name skips like #skip-v2 by @mvdan in 6204a0a
- cue: fix two godoc links by @mvdan in 2aee339
- encoding/xml/koala: update koala header comments by @matts85 in 8a134a3
- encoding/jsonschema: fix the tests on Go tip by @mvdan in 3ba376f
- cmd/cue: fix up xml+koala testscript to actually test stdin by @mvdan in a1db0ad
- cue/format: add test case for formatting empty and near-empty files by @mvdan in 17317ca
- internal/golangorgx: stub out gcimporter by @mvdan in 4b194d7
- internal/golangorgx: drop testenv APIs we won't need by @mvdan in 0e10ed9
- internal/golangorgx: remove the goroot package by @mvdan in d3ae2ca
- internal/golangorgx: remove the aliases package by @mvdan in 4598c91
- internal/golangorgx: remove refactor/inline by @mvdan in 8e2dd0c
- internal/golangorgx: drop util/slices in favor of slices by @mvdan in 4a580ad
- internal/encoding/gotypes: don't drop docs for top-level definitions by @mvdan in 4c0c780
- cmd/cue: test that gengotypes keeps top-level definition docs by @mvdan in daaba58
- internal/filetypes: strict separation of tags vs subsidiary tags logic by @rogpeppe in cb7a48c
- internal/filetypes: regularize Default by @rogpeppe in ae4ac04
- internal/filetypes: clarify FromFile by @rogpeppe in 7701a87
- internal/filetypes: refactor parseType to parseScope by @rogpeppe in 8240e3c
- internal/filetypes: add evaluator mutex by @rogpeppe in 737cd20
- internal/filetypes: consolidation by @rogpeppe in 667575a
- encoding/jsonschema: add OpenOnlyWhenExplicit option by @rogpeppe in d1baad4
- internal/encoding/gotypes: analyze all CUE definitions first by @mvdan in 1753350
- internal/encoding/gotypes: control optional types via attributes by @mvdan in 8e82e47
- cmd/cue: add gengotypes test cases for the optional attribute option by @mvdan in a164970
- internal/encoding/gotypes: handle quoted CUE fields correctly by @mvdan in efd4ad1
- internal/core/adt: fix expression comments in SimplifyBounds by @mvdan in e77a582
- internal/core/adt: avoid apd.Decimal errors in SimplifyBounds by @mvdan in 4a1805a
- internal/core/adt: reuse a slice to make copies of the required reqSets by @mvdan in d3a3b16
- cue/ast/astutil: refactor walkVisitor away by @mvdan in 66cf387
- cmd/cue: add CUE_BENCH to benchmark CLI invocations with Go allocs by @mvdan in 2e8d5a7
- internal/ci: flip to using the official curated cue.dev schemas by @myitcv in a7e97fe
- internal/golangorgx: cuelsp: view definitions for cue by @cuematthew in 3478e43