github cue-lang/cue v0.9.0-alpha.2

pre-release5 months ago

This release includes the first experimental version of the new evaluator, as well as many other changes including the ongoing modules experiment. More details below.

As a reminder: users can register their projects with Unity, our regression and performance testing setup. Unity is used to ensure that a project's CUE evaluations do not unexpectedly stop working or regress in performance. Adding your project to Unity not only guarantees that we will not break your tests unexpectedly, but it also helps to improve the quality of each CUE release. Follow this link to learn more about Unity, install it, or get in touch with any questions.

Evaluator

The new evaluator can now be enabled via CUE_EXPERIMENT=evalv3. It is not yet complete, and some known bugs remain, but over 95% of the existing tests are passing and the performance already looks promising. Disjunctions and initial structure sharing are now implemented as well.

Work on this new evaluator will continue during the v0.9 release cycle. We will only turn on the new evaluator by default once we are reasonably confident that there are no significant regressions, which may happen in a future release cycle like v0.10. In the meantime, testing via CUE_EXPERIMENT=evalv3 and bug reports are welcome.

We have also published a more detailed update on the performance umbrella issue, which you can subscribe to for updates. You can also take a look at the Evaluator Roadmap project to see the planned work remaining.

CL 1186144 fixes a number of Environment.up panics involving calls to Value.Expr, which affected users of the Go API as well as the openapi encoding.

CL 1185458 ensures we detect permanent errors for undefined fields earlier, necessary for the permanent errors fix in tools/flow below.

Modules

cmd/cue now supports OAuth2 refresh tokens when interacting with $CUE_REGISTRY, so that the user doesn't have to re-run cue login once their access token expires.

CL 1191618 changes the modules client to treat "forbidden" errors as "not found" when finding which OCI repository contains a CUE module. This should resolve some unexpected "forbidden" failures when dealing with certain OCI registry services.

CL 1192905 adds initial support for the source field in cue.mod/module.cue files, which will soon be used as part of the proposal to determine what files go into a CUE module.

As a reminder, the ongoing and planned work can be seen in the Modules Roadmap, and we continue to hold regular Modules feedback sessions.

Encodings

The Encodings project was kicked off at the last CUE Community Update call. As part of this, we now have an #encodings channel on Slack, as well as an Encodings Roadmap project on GitHub where the ongoing and planned work can be seen.

In this release, the new YAML decoder is available in experimental form and enabled by default, given that all of our tests are already passing. You can disable it via CUE_EXPERIMENT=yamlv3decoder=0. The old YAML decoder will be removed in a future release once we're reasonably confident that no significant regressions are present.

Go API

CL 1187452 teaches tools/flow to fail when a task encounters a permanent error, which were being ignored before.

CL 1191227 adds a cue/token.File.Lines getter method, much like go/token.File.Lines was added in Go 1.21.

CL 1191226 teaches cue/literal.ParseNum to support both positive and negative signs for consistency.

CL 1193030 ensures that cue/load.Instances always returns instances in a deterministic order, in particular when multiple instances share the same directory.

CL 1185361 deprecates cue/load.Config.StdRoot, which has not worked as advertised for some time.

cmd/cue

CL 1189314 adds a cue fmt --check flag to list badly formatted files rather than modifying them directly.

CL 1192180 speeds up cue fmt by ensuring that it only processes each CUE file once, rather than formatting files from parent directories as well.

Full list of changes since v0.9.0-alpha.1
  • internal/cueversion: bump for v0.9.0-alpha.2 by @mvdan in f8d0998
  • internal/core/adt: fail earlier on incompatible types by @mpvl in 6728bb2
  • cue/testdata: add variants of issue1684 by @mpvl in 517f611
  • mod/modfile: add support for "source" field by @rogpeppe in 8d043e7
  • internal/core/adt: introduce structure sharing by @mpvl in 4c7fe24
  • internal/core/adt: hacky alternative for cyclicReferences by @mpvl in 80d681b
  • internal/core/adt: pre-evaluate pattern constraints by @mpvl in 25db081
  • internal/core/adt: finalize let value by @mpvl in 4abbb53
  • internal/core/adt: record stats for new evaluator by @mpvl in d323ba5
  • cue/testdata: add benchmark for billion laughs by @mpvl in 416eecf
  • cmd/cue/cmd: expose evalv3 experiment by @mpvl in d65019d
  • internal/core/adt: implement pattern matching for new evaluator by @mpvl in ca87216
  • internal/cueexperiment: enable CUE_EXPERIMENT=yamlv3decoder by default by @mvdan in f03aaa1
  • internal/envflag: add support for key-values and defaults by @mvdan in b92ad55
  • internal/encoding/yaml: add the new Decoder by @mvdan in 9fba4fa
  • internal/encoding/yaml: add even more test cases by @mvdan in b508b29
  • internal/core/adt: fix default handling by @mpvl in 5e896e0
  • internal/core/adt: fix task completion across disjunction boundaries by @mpvl in 8c6738a
  • internal/core/adt: fix closedness issue with pattern constraints by @mpvl in b944429
  • internal/core/adt: fix path in error messages by @mpvl in 4cb3889
  • internal/core/adt: patch old status mechanism by @mpvl in 709cdc5
  • tools/trim: update for new evaluator by @mpvl in 416c163
  • internal/core/adt: add methods for accessing Conjuncts by @mpvl in 4fcfdbf
  • internal/core/adt: remove unnecessary code by @mpvl in bc2672f
  • internal/core/adt: task is not always defined by @mpvl in 4a5ba90
  • internal/core/adt: initialize nodeContext in two phases by @mpvl in 149b248
  • internal/encoding/yaml: add more decoder tests by @mvdan in 21abb7f
  • internal/encoding/yaml: copy decode_test.go from internal/third_party/yaml by @mvdan in c8d4c3a
  • internal/core/adt: remove unnecessary code by @mpvl in 97daa8f
  • cue/load: make a note about importPkg redoing lots of work by @mvdan in a220cfb
  • cmd/cue: add global cpuprofile and memprofile flags by @mvdan in 7e061f5
  • cue/load: ensure load.Instances sorts instances deterministically by @NoamTD in f736827
  • internal/core/adt: add task deprecation by @mpvl in bb20494
  • internal/core/adt: set list type as soon as known by @mpvl in 1e01bd6
  • internal/core/adt: also check closedness for list in Equal by @mpvl in 30c5f27
  • internal/core/adt: match patterns only if type matches by @mpvl in 8e58091
  • pkg/list: make Sort work for new evaluator by @mpvl in 50989f0
  • internal/core/adt: guard visual debugger from opening too many tabs by @mpvl in 73611fd
  • internal/core/adt: keep arcTypes per closeContext by @mpvl in 03de5ae
  • internal/core/adt: forward cloned disjunct by @mpvl in e4aae72
  • cmd/cue: avoid calling os.Exit directly by @mvdan in f047aa0
  • internal/core/adt: compute kind differently for new evaluator by @mpvl in 87ad2e4
  • internal/core/adt: validate alignment of closeContext by @mpvl in fe85022
  • internal/ci: we no longer need to set CUE_LONG=true by @mvdan in 6e690fd
  • cmd/cue: make fmt process each file exactly once by @NoamTD in 943dd16
  • internal/core/adt: fixed closedness issue for embeddings in files by @mpvl in bdba8ed
  • internal/core/adt: do not use NOTIFY arcs for closedness checking by @mpvl in c89d040
  • internal/core/adt: allow definitions in structs by @mpvl in ad9a305
  • internal/core/adt: add edge cases for disjunctions by @mpvl in d42ee67
  • internal/core/adt: compare nodes based on underlying by @mpvl in e1406c6
  • internal/cuetxtar: automatically clean up once diff is gone by @mpvl in f4aa801
  • internal/core/adt: enable disjunction tests for alpha evaluator by @mpvl in 87de98e
  • internal/core/adt: first implementation of disjunctions by @mpvl in cfd4e37
  • internal/core/adt: use Vertex.Indirect in more places by @mpvl in cc2075b
  • README: fix broken links to tour and k8s tutorial by @NoamTD in 924178c
  • internal: teach ToFile to not drop StructLit comments by @mvdan in f9032a0
  • cue/token: add a File.Lines getter method by @mvdan in 637939e
  • cue/literal: allow a leading positive sign in ParseNum by @mvdan in 060645a
  • internal/registrytest: ensure that 401 errors have a Www-Authenticate header by @rogpeppe in 41e8686
  • cue/testdata: polish test before implementing disjunctions by @mpvl in 20b1c3a
  • internal/core/adt: add benchmark for exponential behavior by @mpvl in 9cdee62
  • internal/ci: bump to macos-14 and Go 1.22.2 by @mvdan in d8e6953
  • doc: remove the kubernetes tutorial by @myitcv in 8985d19
  • doc: remove the tour by @myitcv in 7d10fbd
  • mod/modregistry: treat "forbidden" as "not found" by @rogpeppe in d8067eb
  • cmd/cue: print paths relative to the current directory in fmt --check by @NoamTD in 79ded70
  • cmd/cue: print relative paths in fmt --check by @NoamTD in fc836b1
  • cmd/cue: replace MainTest entrypoint with testing.Testing by @mvdan in b40ccea
  • update github.com/google/uuid by @mvdan in da9e386
  • cmd/cue: test cue and cue cmd via testscript by @mvdan in 39d2707
  • all: replace sort.Sort and sort.Slice with slices.SortFunc by @mvdan in b545df2
  • cmd/cue: disable the wasm interpreter by default for now by @mvdan in abeea94
  • internal/filetypes: replace encoding/gocode with go:embed by @mvdan in 3a9199f
  • cmd/cue: get go: support time.Duration by @gdvalle in 1b9b079
  • cmd/cue: add a fmt --check flag to list badly formatted files by @NoamTD in 4db4481
  • cue/load: remove support for cue.mod files by @mvdan in 2887786
  • all: remove a few uses of fmt.Sprint by @mvdan in 65b948a
  • internal/mod/mvs: avoid using reflect.DeepEqual by @mvdan in 338ab6e
  • internal/source: add Open, moving from internal/encoding by @mvdan in 6c3c377
  • internal/third_party/yaml: remove last bits of reflect by @mvdan in 61db61c
  • internal/third_party/yaml: deduplicate source.Read by @mvdan in b6516c5
  • mod/modconfig: swap os.ReadFile and os.Rename with robustio by @mvdan in b0257fa
  • cmd/cue: lock the logins.json during an update by @rustyx in 71a12cf
  • all: remove manual work via //go:generate stringer by @mvdan in 64c9b62
  • tools/flow: return permanent errors from tasks by @nickfiggins in 2137bea
  • internal/core/adt: detect permanent errors for undefined fields earlier by @nickfiggins in 3c886e0
  • cue: adjust Environment for comprehensions by @mpvl in 3e6a8be
  • cue/load: fix doc comment typo by @rogpeppe in 9b83404
  • cue/load: treat stdlib-like import on command line as error by @rogpeppe in 2aec394
  • cue/load: consistent error message quoting by @rogpeppe in 4202a47
  • cue/load: deprecate Config.StdRoot by @rogpeppe in e675eb7
  • cue/load: change stdlib import test case by @rogpeppe in 09394f3
  • cmd/cue: add refresh tokens support by @rustyx in 25ed954
  • cmd/cue: use fewer go/types.Type.String calls by @mvdan in e4e6d68
  • internal/core/adt: add a little more detail to Environment.up panics by @mvdan in abc8bb1

Don't miss a new cue release

NewReleases is sending notifications on new releases.