Skip to content

Releases: cue-lang/cue

v0.14.0-rc.1

23 Jul 08:56
Compare
Choose a tag to compare
v0.14.0-rc.1 Pre-release
Pre-release

This release brings another significant speed-up for the new evaluator, as well as other fixes aiming for the final release.

Evaluator

A portion of the new closedness algorithm, which was observed to cause significant slowness and memory usage for some users, has been rewritten with a new data structure. A few larger projects have seen reductions of up to 50% in CPU and memory usage as a result.

A small change which unintentionally affected the old evaluator has been reverted, to fix a "field not allowed" regression.

cmd/cue

A bug has been fixed in the new cue trim algorithm where some disjunctions could be incorrectly treated as ambiguous.

Encodings

The JSON Schema decoder has gained support for dependencies, bringing the pass rate for the official JSON Schema test suite up from 79% to 81%.

Full list of changes since v0.14.0-alpha.2
  • internal/ci: allow gerritHubHostname to be overridden by @myitcv in 5cc6d81
  • internal/core/adt: new data structure for reqSets by @mpvl in 3f23e12
  • internal/core/adt: add generation tracking to closedness info by @mpvl in 5077511
  • internal/core/adt: add generation tracking to prevent stale context usage by @mpvl in 19e2c74
  • tools/flow: avoid looking like we're using go run for real by @mvdan in 5f4bd37
  • update dependencies for v0.14.0-rc.1 by @mvdan in 0c84f96
  • cue/stats: remove unused CloseIDElems counter by @mpvl in 930a98b
  • internal/core/adt: fix notification CloseInfo by @mpvl in 0ccf38c
  • cmd/cue/cmd: add tests for 3981 by @mpvl in 840ff27
  • internal/core/adt: add tests for 3981 by @mpvl in 78e1a11
  • internal/core/adt: ToDataAll rewrite by @mpvl in 2804f1d
  • internal/ci: allow additional cache modes by @jpluscplusm in 9afca73
  • encoding/jsonschema: implement dependencies by @rogpeppe in 9620eae
  • internal/cmd/cue-ast: use cue/load with SkipImports=true by @mvdan in 45ab65e
  • gopls/cache: add test for imports of non-ambiguous non-default modules by @cuematthew in e4cdcd3
  • internal/core/adt: remove CloseIDElems counter by @mpvl in 9033834
  • internal/core/adt: add counters before rewrite by @mpvl in c8256cd
  • internal/core/adt: hoist loop by @mpvl in 24cc414
  • internal/core/adt: change signature by @mpvl in 5ee4254
  • internal/core/adt: remove replaceID.add field by @mpvl in d987d88
  • gopls/cache: rework normalizeImportPath by @cuematthew in f309265
  • internal/ci: start publishing the module by @mvdan in 05a3d64
  • internal/ci: carve out into a separate module to be published by @mvdan in 17177e9
  • internal/ci: do a little bit more for trybot jobs in the base package by @mvdan in 1004c32
  • internal/ci: apply the top-level githubactions.#Workflow schema by @mvdan in d9aaac0
  • gopls/cache: ignore imports of stdlib by @cuematthew in eac9728
  • internal/core/adt: revert CL 1208898 for evalv2 by @mvdan in 1789dd4
  • tools/trim: Work harder to discover disjunction branches by @cuematthew in 7f38bb8
  • internal/golangorgx: remove the unused tools/facts package by @mvdan in 60c36a5
  • internal/golangorgx/vendoring: remove by @mvdan in 4d66634
  • cmd/cue/cmd: speed up use of sleeps to test concurrent commands by @mvdan in 13461f1
  • internal/ci: rename "ubuntu" runner to "linux" by @mvdan in 8250c1f
  • internal/golangorgx: delete unused and Go-specific packages by @mvdan in dbed9a3
  • internal/golangorgx: remove unused gopls/util packages by @mvdan in 9ca9609
  • internal/gopls: rewrite gopls/cuelsp by @cuematthew in a23afdf
  • gopls/lsprpc: Adjust gopls to cuelsp and simplify by @cuematthew in ca86fb0
  • internal/gopls: remove unnecessary old command alias by @cuematthew in 4752c04
  • internal/gopls: renaming of gopls to cuelsp by @cuematthew in 8935ee3
  • internal/gopls: delete a lot of code by @cuematthew in 3fb3043
  • all: make some txtar table tests parallel by @mvdan in 2d182a5
  • internal/golangorgx: remove gopls re-vendoring script by @mvdan in 3114a2f
  • update all direct dependencies by @mvdan in 2df1b5a

v0.14.0-alpha.2

10 Jul 16:24
Compare
Choose a tag to compare
v0.14.0-alpha.2 Pre-release
Pre-release

This release brings many evaluator performance improvements, as well as initial support for Kubernetes CRDs.

Evaluator

Further performance improvements were made to the new closedness implementation, giving speed-ups of up to 50% for some projects with heavy use of definitions.

Significant progress has been made to the new evaluator's memory usage; a few large projects experiencing high memory usage on the previous alpha release now see reductions of up to 80%.

Various other optimizations and performance bug fixes have been made to the new evaluator, yielding speed-ups of 5-20% on a variety of CUE projects.

Encodings

cue get crd introduces support for extracting Kubernetes Custom Resource Definitions (CRDs) as CUE definitions; see cue help get crd.

The new encoding/jsonschema.ExtractCRDs Go API exposes the extractor used by cue get crd.

Full list of changes since v0.14.0-alpha.1
  • internal/core/adt: filter notifications by @mpvl in 971ee4f
  • internal/core/adt: keep track of notification counts by @mpvl in 18b7df0
  • internal/core/adt: run evaluator tests in parallel by @mvdan in 991e549
  • internal/pkg: fix a race when contexts concurrently load std imports by @mvdan in 79798ca
  • internal/core/adt: clean up orphaned arcs by @mpvl in a397974
  • internal/core/adt: mark inlined nodes for cleanup by @mpvl in e92f16e
  • internal/core/adt: prune parent processing by @mpvl in 1b7a71c
  • internal/core/adt: trigger more diffs in stats by @mpvl in f389502
  • internal/core/adt: clean up use of Vertex.state by @mpvl in fb4f507
  • internal/core/adt: basic memory management for evalv3 by @mpvl in 4ebd05f
  • internal/core/adt: check for nil state in parent disjunction by @mpvl in 4638be0
  • internal/core/adt: delay processing of pattern constraints by @mpvl in ab40e7f
  • internal/core/adt: handle equal disjuncts by @mpvl in 654008d
  • internal/core/adt: do not set error for nil task state by @mpvl in 495f602
  • internal/core/adt: reuse more lets by @mpvl in b96ed2c
  • tools/trim: handle error cases in API by @mpvl in bd237a2
  • internal/core/adt: allow unprocessed by @mpvl in 4d894fa
  • internal/core/adt: remove filter for let sharing by @mpvl in 521d442
  • internal/core/adt: rearrange newNodeContext by @mpvl in f42b369
  • internal/core/adt: mark nodeContext.clone as v2 by @mpvl in b7d9b69
  • internal/core/adt: add benchmark for Issue 3334 by @mpvl in 99494a6
  • internal/core/adt: more eagerly update stats in tests by @mpvl in 2862a10
  • internal/ci: skip "check git tags" when testing CLs by @mvdan in 5100525
  • internal/ci: use shorter Namespace runner profile aliases by @mvdan in 6f50798
  • internal/ci: run tests with GOARCH=386 on protected branches only by @mvdan in 673b49f
  • internal/robustio: add stub js/wasm getFileID implementation by @cuematthew in c13484f
  • internal/core/adt: normalize how the tests configure the runtime by @mvdan in a6abf3b
  • internal/cuetxtar: do not load the root cuelang.org/go CUE module by @mvdan in 7a237eb
  • cue/load: deduplicate handling missing files for ad-hoc packages by @mvdan in 4cb33de
  • cue/load: reject unsupported cue.mod files by inspecting open errors by @mvdan in c80fdaf
  • internal/robustio: Copy from upstream and consolidate use by @cuematthew in 4544972
  • internal/core/adt: remove unused test code by @mvdan in ee299f0
  • internal/modpkgload: Make Package keep its set of files by @cuematthew in 6405ce0
  • internal/core: remove a few unnecessary trailing Fprintln calls in tests by @mvdan in c2f57e3
  • internal/lsp/fscache: Create CUECacheFS and OverlayFS by @cuematthew in 955e7f4
  • encoding/jsonschema: parallelize vendor_external.go a bit by @mvdan in 3b10030
  • internal/ci: drop "evict caches" nightly cron job by @mvdan in 206e824
  • cmd/cue: implement cue get crd by @rogpeppe in a6df86a
  • internal/ci: cache staticcheck via nscloud-cache-action by @mvdan in ff4639c
  • encoding/jsonschema: implement ExtractCRDs by @rogpeppe in e2835d9
  • internal/ci: assume the CI machines are reasonably modern by @mvdan in 7bddda5
  • cmd/cue: skip tests using sleeps in short mode by @mvdan in f7e5f80
  • internal/ci: skip the test cache via GOFLAGS=-count=1 by @mvdan in d3da405
  • internal/ci: switch to Namespace GitHub Actions runners by @mvdan in f615383
  • internal/core/adt: delay stringifying nodes in errors via fmt.Stringer by @mvdan in 7e4dff2
  • internal/core/adt: ensure emptyNode is inert by @mpvl in 2adf5e9
  • mod/modfiledata: rename File.ModulePath() to File.ModuleRootPath() by @cuematthew in b8a14de
  • mod/modpkgload: correct calculation of pkg.fromExternal by @cuematthew in a8ba684
  • mod/modpkgload: capture faulty behaviour of pkg.fromExternal by @cuematthew in c237083
  • cue/ast: Ensure ImportPath.Canonical copes with host-only paths by @cuematthew in 703c22c
  • mod/modpkgload: Make LoadPackages support nil shouldIncludePkgFile by @cuematthew in 19d3abc
  • internal/core/adt: use custom int set implementation for visited by @rogpeppe in 12ec0ec

v0.14.0-alpha.1

26 Jun 11:27
Compare
Choose a tag to compare
v0.14.0-alpha.1 Pre-release
Pre-release

This release introduces a new error builtin, two language changes, and many fixes and optimizations for the new closedness algorithm.

Changes which may break some users are marked below with: ⚠️

Evaluator

error builtin

A new error builtin is added to the language, which allows users to create custom error values with a specified message.

Don't simplify validators into concrete values

A new CUE_EXPERIMENT=keepvalidators experiment is introduced, already on by default, which prevents validators from being simplified into concrete values.

X == Y and == X

Firstly, there were several bug fixes related to ==. Most notably, [int] == [int] incorrectly resolved to true. It now correctly resolves to an error.

All other changes are enabled using the @experiment(structcmp) file-level attribute.
Enabling thix experiment allows all CUE values to be compared for equality. This includes comparing structs.

The same experiment also allows a unary == to enforce that a value is a specific concrete value.

Documentation and examples will be available for the v0.14.0 release.

Other changes

⚠️ The file embedding experiment can no longer be disabled via CUE_EXPERIMENT=embed=0, having been introduced in CUE v0.10.0.

File embedding is now enabled when using the cue/cuecontext or cue/load APIs; earlier versions could not expose it via the Go API due to an import cycle.

⚠️ The topological field sorting experiment can no longer be disabled via CUE_EXPERIMENT=toposort=0, having been introduced in CUE v0.11.0.

⚠️ CUE_EXPERIMENT=cmdreferencepkg, introduced in v0.13.0 to require referencing tool packages to declare cue cmd tasks, is now on by default.

The new closedness algorithm has been adjusted to fix a number of "field not allowed" bugs, particularly in the form of regressions compared to the old evaluator.

A particularly slow part of the new closedness algorithm has been optimized, resulting in improvements of up to 10x in wall times for some projects.

cmd/cue

⚠️ cue def --strict jsonschema:, deprecated in favor of cue def jsonschema+strict: in v0.11.0, is no longer supported.

Go API

cue/load now provides module information via the new Instance.ModuleFile field.

⚠️ In order to support the above change, the mod/modfile.File.Format method has been moved to the function mod/modfile.Format: an API-breaking change but necessary to avoid a cyclic package dependency.

cue/parser gains a new Config API, which allows other packages like cue/load to properly apply the right parser options such as the CUE language version.

⚠️ In order to support the above change, the cue/parser.Config.ParseFile and cue/build.ParseFile signatures have now changed (incompatibly) to add a parser.Config argument, enabling the CUE language version to be passed through.

Fix an issue where cue.Value.Decode did not work with *math/big.Float types.

Full list of changes since v0.13.0
  • all: simplify three iterator uses with range-over-func by @mvdan in bb2494b
  • internal/core/adt: remove cycle check by @mpvl in d92e916
  • internal/core/adt: add tests for 3978 by @mpvl in 81795ac
  • internal/core/adt: revert 1217228 by @mpvl in 47912fc
  • cmd/cue/cmd: fix versiontest test by @rogpeppe in 2bbc359
  • doc/ref/spec.md: support struct and list for equality by @mpvl in d58d1f5
  • internal/core/compile: add version check for builtins by @mpvl in 985e693
  • internal/core/adt: add builtin for user-defined errors by @mpvl in 3ad8663
  • internal/core/adt: rename CallContext.Expr by @mpvl in 64ffd0d
  • doc/ref/spec.md: document error builtin by @mpvl in be18b05
  • internal/ci: update Go and goreleaser versions by @mvdan in 8d463da
  • update golang.org/x/... dependencies by @mvdan in e88d161
  • internal/core/adt: support unary == and != for all types by @mpvl in 030658e
  • internal/core/adt: comparison of values of different types by @mpvl in 34faddf
  • internal/core/adt: consider required fields for final values in Equal by @mpvl in 64d5789
  • internal/core/adt: support comparsion of structs by @mpvl in 2b7dfbd
  • internal/core/adt: fix error gobbling of internal nodes by @mpvl in 665f697
  • internal/core/adt: add tests for Issue 3977 by @mpvl in 996e8b0
  • cue/load: pass language version down to parser by @rogpeppe in d567750
  • cue/load: use error registry in SkipImports mode by @rogpeppe in 5a04616
  • cue/parser: enable cueexperiment.File throughout by @mpvl in 86f7a64
  • internal/cueexperiment: support for per-file experiments by @mpvl in 52988e0
  • internal/core/adt: simplify recursive getReqSets calls by @mvdan in 2d4263e
  • cmd/cue: remove CUE_SYNTAX_OVERRIDE support by @rogpeppe in 450ba7f
  • internal/core/adt: do not repeat replaceIDs calls by @mvdan in 8241d9c
  • cue/load: actually populate build.Instance.ModuleFile correctly by @rogpeppe in 48ec278
  • internal/core/adt: handle incomplete values in comparators by @mpvl in c925040
  • internal/core/adt: use replaceIDs incrementally in checkTypos by @mvdan in 16c782a
  • internal/core/adt: rewrite replaceIDs to scale better by @mvdan in b4212a3
  • internal/core/adt: Equal should take defaults when appropriate by @mpvl in 361384c
  • internal/core/adt: limit closedness check in Equal by @mpvl in e8e8682
  • internal/core/adt: merge validate package with adt by @mpvl in 26e1596
  • internal/core/adt: add tests for incomplete lists comparison by @mpvl in e67898f
  • cue/parser: add Config type by @rogpeppe in 211309c
  • cue/load: include module file in build.Instance by @rogpeppe in ab9ac54
  • internal/core/adt: use pointers for snapshot and result in nodeContext by @mvdan in 1a2d2e7
  • internal/core/adt: add tests for Issue 3929 by @mpvl in 7777230
  • internal/core/adt: handle yields in Resolve by @mpvl in 81e88ee
  • internal/core/adt: add tests for Issue 3972 by @mpvl in 0ac3913
  • internal/core/adt: make small iota enums consistently uint8 by @mvdan in ce44cfb
  • internal/core/adt: allow lookup across disjunction boundary by @mpvl in 20afefd
  • internal/core/adt: apply vertex rewriting to blocked tasks by @mpvl in d713052
  • internal/core/adt: add tests for 3967 by @mpvl in 5c5f970
  • cuecontext: revert support for CUE_EXPERIMENT by @mpvl in 2a70935
  • internal/pkg: only use %s with stringifiable builtin errors by @mvdan in fc4ca40
  • cue/parser: prohibit definition identifiers for package names by @rogpeppe in 548c23c
  • internal/core/export: avoid panic on non-regular identifiers for packages by @rogpeppe in 8bbf9b4
  • cmd/cue: add test cases for issue 3968 by @rogpeppe in e0010dd
  • cmd/cue: add testscript for exp gengotypes output filenames by @mvdan in b20d1a4
  • all: swap math/rand for math/rand/v2 where it affects behavior by @mvdan in 82ff070
  • all: remove a bit of dead code by @mvdan in ab546cf
  • cmd/cue: properly document the keepvalidators experiment by @mvdan in 398cdac
  • all: swap math/rand for math/rand/v2 where it doesn't affect behavior by @mvdan in db84c62
  • cmd/cue: fix error on cue mod rename with a bad module by @rogpeppe in 9f9ebac
  • cmd/cue: add test case for modrename with a bad module by @rogpeppe in 90d9b04
  • internal/core/adt: also create embed scope for disjunctions by @mpvl in c925902
  • internal/core/adt: add tests for 3964 by @mpvl in 2597e9e
  • internal/core/adt: fix default logic by @mpvl in 8dc494c
  • cueexperiment: export Config type and use it by @mpvl in 33a1792
  • internal/core/adt: add tests for 3958 by @mpvl in 5d162df
  • README: minor updates by @jpluscplusm in eb54082
  • internal/core: start removing pre-toposort field ordering code by @mvdan in 6fd9f7d...
Read more

v0.13.2

24 Jun 17:02
Compare
Choose a tag to compare

Evaluator

Fix a regression causing odd number of disjuncts to misbehave in some cases.

Full list of changes since v0.13.1

v0.13.1

10 Jun 15:48
Compare
Choose a tag to compare

Evaluator

The evaluator's core packages no longer depend on the golang.org/x/mod module, which was only used to format version strings.

Fix a regression causing "cyclic field to reference" in some cases.

Fix a regression causing closedness rules to not apply in some cases.

Disable a minor optimization which was also causing closedness rules to not apply in some cases.

cmd/cue

Fix a build error triggered by changes in the upcoming Go 1.25 version, allowing v0.13 to be used further into the future.

cue mod mirror --dry-run now works as documented; it had been left unimplemented by accident.

Full list of changes since v0.13.0
  • internal/ci: bump Go version for v0.13.1 by @mvdan in 65a5178
  • internal/core/adt: also typo check disjuncts by @mpvl in 72bf578
  • internal/core/adt: add tests for Issue 3957 by @mpvl in ea56b5a
  • internal/golangorgx/tools/tokeninternal: remove by @mvdan in e316125
  • internal/core/adt: partially revert CL 1214950 by @mpvl in 0f896f6
  • internal/core/adt: add tests for 3946 by @mpvl in a7ab473
  • internal/cueversion: avoid dependency on golang.org/x/mod by @rogpeppe in 85e1230
  • internal/core/adt: do not always filter disjuncts by @mpvl in c5bc992
  • internal/core/adt: add tests for 3947 by @mpvl in 8350f89
  • cmd/cue: implement mirror --dry-run by @rogpeppe in 8e68892

v0.13.0

22 May 15:35
Compare
Choose a tag to compare

This release finally enables the new evaluator by default -- the culmination of over a year's worth of work!

It also packs in lots of new features, such as support for absolute module packages, dozens of JSON Schema improvements, and a new experimental XML encoding.

Changes which may break some users are marked below with: ⚠️

Evaluator

The new evaluator first introduced in v0.9.0 via CUE_EXPERIMENT=evalv3 is now enabled by default! There are no remaining substantial regressions in our test suite, and the Unity corpus is almost entirely working now. Given that the new evaluator fixes dozens of bugs for many users, and is already significantly faster for the majority of CUE users, we believe it is time to turn it on by default.

We will continue to track any remaining issues for the new evaluator via the evalv3 label. If you encounter any regressions, please file a bug report. You can also revert to the old evaluator to temporarily work around bugs via CUE_EXPERIMENT=evalv3=0. See this FAQ page for more information.

We aim to resolve many of these remaining bugs in an upcoming v0.13.1 bugfix release.

An entirely new algorithm for cue trim and tools/trim has been implemented for evalv3, which resolves all known bugs when trimming CUE.

Closedness in evalv3 has been revisited to match the semantics of evalv2 much more closely, while at the same time reducing its overhead for larger configurations. This fixes most "field not allowed" regressions and improves the performance of some configurations by up to 5x. As a result, CUE_DEBUG=openinline is now removed as it is unnecessary.

Performance work for the new evaluator is ongoing; a number of changes in this release led to performance improvements of between 5% and 80% for a variety of projects. For more details, see Marcel's performance update last month.

⚠️ The new topological sort algorithm for field ordering has been tweaked to avoid becoming too slow in some cases. This may result in some ordering changes, but we expect them to be relatively small. See the change for more details.

The parser now correctly allows keywords as required field labels, such as if!: _, fixing a discrepancy with the spec.

Filenames beginning with a dot can now be embedded as long as the glob pattern uses an explicit dot, such as @embed(glob="dir/.data_*.json").

⚠️ @embed(glob="pattern...") directives whose file globbing results in zero files now result in an error, to avoid situations where a glob pattern silently stops working as intended.

cmd/cue

Initial support for absolute packages is introduced, which allow specifying a remote package at a particular version such as cue export foo.com/data@v1.2.3 or cue vet foo.com/schema@v1.2.3 -d '#schema' data.yaml without requiring a CUE module file locally.

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.

The new cue refactor imports command rewrites import paths, making it easy to migrate between module locations and major versions.

The new cue mod mirror command copies modules from one registry to another.

cue mod tidy now preserves the top-level custom field as intended.

Hidden files, and files with build tags, should now be correctly filtered when loading a single CUE package.

cue get go should no longer attempt to import types from the Go standard library as CUE, which caused errors.

cue get go no longer fails on Go strings containing certain character escape sequences or non-UTF8 bytes.

cue get go now interprets Go fields with the new json:",omitzero" struct tag as CUE optional fields.

cue cmd now fails if no tasks were actually defined, to avoid situations where a user is misled into thinking a task was defined when it was not.

Encodings

The XML "Koala" encoding proposed in February is now available via an experimental implementation. Try it out via the CLI like cue export xml+koala: data.xml, or via its Go API.

The encoding/jsonschema package gains better support for Kubernetes schemas (CRDs and the core API) although these improvements are as yet only available via the Go API.

⚠️ The JSON Schema decoder now imports schema descriptions as CUE doc comments, which required a change to encoding/jsonschema.Config.DefineSchema.

Empty YAML files are now decoded as *null | _ rather than null, allowing them to be unified with struct schemas as if they were an empty struct.

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.

Builtins

⚠️ The uuid.ToString function is removed, given that it never did anything useful and could mislead users into thinking it did.

tool/http gained a followRedirects option to let the user disable HTTP redirection.

Go API

⚠️ CUE_EXPERIMENT=decodeint64 can no longer be disabled as we consider the experiment finished, having been introduced in CUE v0.11.0.

⚠️ The long-deprecated cue.Runtime methods Parse, FromExpr, CompileFile, and CompileExpr are now removed.

cuecontext.EvalDefault still pointed to the old evaluator; it now correctly points to the new evaluator, and follows the CUE_EXPERIMENT=evalv3 flag just like cmd/cue and the rest of the Go API.

Mirroring cuecontext.EvalExperiment, the new cuecontext.EvalStable constant is added to track the latest stable version of the evaluator.

module.SplitPathVersion and module.ParseImportPath have been deprecated in favor of cue/ast.SplitPackageVersion and cue/ast.ParseImportPath package to consolidate the API.

The new mod/modfile.File.ModuleForImportPath function allows resolving a module and default major version for a package without consulting a registry.

The new mod/modregistry.Client.Mirror method implements the logic behind the new cue mod mirror command.

The new mod/module.Version.Compare method is added in favor of module.Sort, which is now deprecated.

Full list of changes since v0.12.0
  • internal/ci: bump the pinned Go version for releases by @mvdan in 5ca3b8f
  • internal/encoding/yaml: drop use of kr/pretty in a test by @mvdan in e769e47
  • internal/core/adt: prevent superfluous circular reference by @mpvl in 9418bb0
  • internal/core/adt: add tests for Issue 3941 by @mpvl in 938d270
  • encoding/json: clarify how to encode a cue.Value to JSON by @mvdan in 3bc5784
  • internal/core/adt: allow sharing of lets by @mpvl in 9a44314
  • internal/core/adt: add tests for Issue 3938 by @mpvl in 3045a88
  • internal/core/adt: treat for loop values as non-cyclic by @mpvl in e15f6e4
  • internal/core/adt: relax inline cycles by @mpvl in 4a4d9ef
  • internal/core/adt: disable setting Inline for evalv3 by @mpvl in 406f64c
  • internal/core/adt: add tests for 3903 by @mpvl in eb61a84
  • internal/core/adt: rewrite comprehension structs for disjuncts by @mpvl in 7a0906e
  • internal/core/adt: dereference overlay by @mpvl in 894205c
  • internal/core/adt: add tests for Issue 3935 by @mpvl in 1a2e80e
  • cue/testdata: add a regression test for #3570 by @mvdan in 5a99880
  • internal/core/adt: mark conjunct for incomplete disjunct by @mpvl in a3db8b8
  • internal/core/adt: add tests for 3934 by @mpvl in d9bfe59
  • pkg/encoding/json: fix validator by @mpvl in 17caa72
  • pkg/encoding/json: add tests for issue 3932 by @mpvl in 5d863b6
  • cue: fix path representation for shared nodes by @mpvl in af81550
  • internal/core/adt: partial revert of fixes for 3919 by @mpvl in e12d544
  • internal/core/adt: add tests for 3931 by @mpvl in cff2d7e
  • cue/format: port format tests to cuetxtar by @mvdan in 8f841ee...
Read more

v0.13.0-rc.1

16 May 14:07
Compare
Choose a tag to compare
v0.13.0-rc.1 Pre-release
Pre-release

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 comm...
Read more

v0.13.0-alpha.4

25 Apr 09:02
Compare
Choose a tag to compare
v0.13.0-alpha.4 Pre-release
Pre-release

This release adds further fixes and optimizations to the new evaluator, and introduces an experimental XML encoding for CUE.

Changes which may break some users are marked below with: ⚠️

Evaluator

The new evaluator is improved to fix a few more regressions which led to incorrect errors. Since the last alpha release, one more project in Unity is fully working with evalv3, and just one remains with a breakage compared to evalv2.

Performance work for the new evaluator is ongoing; a number of changes in this release led to performance improvements of between 5% and 70% for a variety of projects. For more details, see Marcel's last performance update.

As a reminder, the old evaluator is still accessible via CUE_EXPERIMENT=evalv3=0. If you encounter any errors or other problems, please file an issue with details.

Filenames beginning with a dot can now be embedded as long as the glob pattern uses an explicit dot, such as @embed(glob="dir/.data_*.json").

⚠️ @embed(glob="pattern...") directives whose file globbing results in zero files now result in an error, to avoid situations where a glob pattern silently stops working as intended.

⚠️ The CUE_DEBUG=openinline evaluator debug flag is removed, now that evalv3's closedness implementation closely matches the semantics of evalv2.

cmd/cue

cue mod tidy now preserves the top-level custom field as intended.

cue get go now interprets Go fields with the new json:",omitzero" struct tag as CUE optional fields.

cue cmd now fails if no tasks were actually defined, to avoid situations where a user is misled into thinking a task was defined when it was not.

Builtins

⚠️ The uuid.ToString function is removed, given that it never did anything useful and could mislead users into thinking it did.

tool/http gained a followRedirects option to let the user disable HTTP redirection.

Encodings

The XML "Koala" encoding proposed in February is now available via an experimental implementation. Try it out via the CLI like cue export xml+koala: data.xml, or via its Go API.

Full list of changes since v0.13.0-alpha.3
  • internal/ci: bump Go and goreleaser for the next alpha release by @mvdan in d1fb074
  • internal/golangorgx: cuelsp: remove unneeded code by @cuematthew in e223de9
  • cue/interpreter/embed: fix "glob" typo by @mvdan in 2666081
  • cue/interpreter/embed: fail when glob pattern has no matches by @rogpeppe in b6d7332
  • interpreter/embed: allow glob to match explicit dot files by @rogpeppe in 6741c90
  • cmd/cue/cmd: add test case for embedding a pattern with an explicit dot file by @rogpeppe in 572a6cc
  • pkg/tool/http: allow configuration of following redirects by @myitcv in acc06c5
  • cmd/cue: error on useless commands by @myitcv in 4b5dd6b
  • cmd/cue: remove test files related to old old closedness by @myitcv in 93e82f2
  • internal/core/adt: cache reqSets in nodeContext by @mpvl in fac9a30
  • internal/core/adt: add benchmark for 3881 by @mpvl in 3eef4dd
  • internal/core/adt: add stats for new closedness algo by @mpvl in 5f329ce
  • internal/core/adt: fix Vertex dereferencing for disjunctions by @mpvl in 96e0ebc
  • internal/core/adt: add tests for 3850 and 3875 by @mpvl in 7cfe774
  • internal/core/adt: fix test names by @mpvl in 5dcc768
  • internal/core/topsort: prevent duplicates in nodeToStructMeta by @mvdan in a753c37
  • internal/core/adt: remove unused nodeContext fields by @mvdan in b12e201
  • internal/core/adt: show correct path for incomplete values by @mpvl in e714489
  • internal/core/adt: skip work in checkTypos when a vertex has no arcs by @mvdan in 3c149f1
  • internal/core/adt: reuse a local buffer in checkTypos by @mvdan in ab8bd45
  • internal/golangorgx/gopls: Use the correct error. by @alingse in 19403a4
  • internal/core/adt: avoid more allocations when LogEval is disabled by @mvdan in 34a512f
  • internal/core/adt: remove unused code low-hanging fruit by @mvdan in 8fef4d3
  • cmd/cue: convert examples to 'cue vet -c' by @myitcv in 08c3542
  • internal/golangorgx/gopls: Get cue lsp to initialize with emacs lsp by @cuematthew in c54251d
  • internal/core/adt: do not activate ids for non-definitions by @mpvl in 2824405
  • internal/core/adt: add tests for 3858 by @mpvl in eec6a2a
  • internal/core/adt: reuse reqSets slices via OpContext by @mvdan in 1d028fc
  • internal/core/adt: prevent logging overhead when disabled by @mvdan in e778137
  • internal/cuedebug: drop openinline flag by @mvdan in a09a38b
  • pkg/uuid: remove ToString by @mvdan in f836184
  • cmd/cue: go get Go fields with the json omitempty tag as optional by @mvdan in d9da212
  • cmd/cue: add get go test case with the new omitzero json tag by @mvdan in be6c3db
  • internal/encoding/yaml: support alias to scalars as map keys by @OmriSteiner in a6fff27
  • cmd/cue: actually update the _gen.go.want gengotypes testscript files by @mvdan in 52d9689
  • update golang.org/x/... dependencies by @mvdan in 433ac2c
  • update pelletier/go-toml to drop testify by @mvdan in 9b5b10f
  • cmd/cue: wire up xml+koala via encoding/xml/koala by @mvdan in 096a114
  • internal/encoding/gotypes: generate valid json tags for quoted fields by @trumant in 93c1421
  • internal/mod/modload: preserve custom struct in module when tidying requirements by @snuxoll in e058014
  • encoding/xml/koala: introduce the first experimental XML encoder by @matts85 in ebf42e5

v0.12.1

03 Apr 19:51
Compare
Choose a tag to compare

Evaluator

Embedding binary files like @embed(file="foo", type=binary) no longer interprets the files as Unicode text, which mangled invalid UTF-8 bytes.

cmd/cue

The release archives are now built with Go 1.24, which should fix cue get go when used with Go installed at version 1.24.

Full list of changes since v0.12.0

v0.13.0-alpha.3

31 Mar 14:38
Compare
Choose a tag to compare
v0.13.0-alpha.3 Pre-release
Pre-release

This release fixes a handful of bugs in the new evaluator and its Go API.

Evaluator

The new evaluator, now enabled by default since v0.13.0-alpha.2, is improved to fix regressions in OpenAPI, our CUE Go API, two panics, and a few other bugs which could lead to incorrect errors. Since the last alpha release, two more projects in Unity are fully working with the new evaluator.

As a reminder, the old evaluator is still accessible via CUE_EXPERIMENT=evalv3=0. If you encounter any errors or other problems, please file an issue with details.

Go API

cuecontext.EvalDefault still pointed to the old evaluator; it now correctly points to the new evaluator, and follows the CUE_EXPERIMENT=evalv3 flag just like cmd/cue and the rest of the Go API.

Mirroring cuecontext.EvalExperiment, the new cuecontext.EvalStable constant is added to track the latest stable version of the evaluator.

Full list of changes since v0.13.0-alpha.2
  • update golang.org/x dependencies by @mvdan in c565c1d
  • cue/cuecontext: fix EvalDefault to follow the default, add EvalStable by @mvdan in ad0442b
  • internal/core/runtime: select evaluator version with specific constants by @mvdan in 1ec46e7
  • all: do not use Default/Dev/Experiment evaluator versions in tests by @mvdan in 07bccba
  • cue/cuecontext: expand TestEvalVersion to test more combinations by @mvdan in 965e7b1
  • internal/core/adt: fix disjunction corruption issue by @mpvl in 917ae0d
  • cue/cuecontext: evalv3 is no longer experimental by @myitcv in 8080ec5
  • internal/core/adt: fix panic due to envDisjunct corruption by @mpvl in 721ca5d
  • internal/core/adt: disable structure sharing for pending arcs by @mpvl in 4fc579c
  • internal/core/adt: add tests for Issue 3849 by @mpvl in 6ade302
  • internal/core/adt: remove insertArcCC by @mpvl in 6654071
  • internal/core/adt: inline structs in schema are not closed by default by @mpvl in 4e7564e
  • internal/core/adt: add test for Issue 3853 by @mpvl in 5348d04
  • pkg/internal/builtintest: remove "and X more errors" stripping for evalv3 by @mvdan in 32d0400
  • internal/core/adt: support Ellipsis in MatchAndInsert by @mpvl in de69f12
  • internal/core/adt: eliminate recursive processing on bottom by @mpvl in 447e98d
  • internal/core/adt: add test for Issue 3851 by @mpvl in d58c804
  • cmd/cue: re-enable cue exp gengotypes testscript by @mvdan in 18b4ba9
  • internal/core/adt: add missing dereference by @mpvl in e22ea96
  • cue: do not unify "accept" schema with result in UnifyAccept by @mpvl in ff654dc
  • cue: prepare TestConjunctDedup for more cases by @mpvl in 2b82584
  • cue: use fmt instead of MarhalJSON in TestUnifyAccept by @mpvl in 6912a11
  • internal/tdtest: support cuetest.Run by @mpvl in 2402ef3
  • internal/ci: simplify login to Central Registry by @myitcv in f4a2424
  • encoding/jsonschema: clean up TestExtX by @mpvl in c0fc59b
  • internal/core/adt: remove diff/todo for fixed issues by @mpvl in 773741f
  • cue: add missing finalization by @mpvl in 4cbb180