v0.9.0-alpha.2

cue-lang/cue Pre-release Released

A release of CUE OSS · its page on GitHub

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.

All changes

95 changes since v0.9.0-alpha.1by area

all3

  • allreplace sort.Sort and sort.Slice with slices.SortFunc@mvdanb545df2
  • allremove a few uses of fmt.Sprint@mvdan65b948a
  • allremove manual work via //go:generate stringer@mvdan64c9b62

cmd14

  • cmd/cue/cmdexpose evalv3 experiment@mpvld65019d
  • cmd/cueadd global cpuprofile and memprofile flags@mvdan7e061f5
  • cmd/cueavoid calling os.Exit directly@mvdanf047aa0
  • cmd/cuemake fmt process each file exactly once@NoamTD943dd16
  • cmd/cueprint paths relative to the current directory in fmt --check@NoamTD79ded70
  • cmd/cueprint relative paths in fmt --check@NoamTDfc836b1
  • cmd/cuereplace MainTest entrypoint with testing.Testing@mvdanb40ccea
  • cmd/cuetest cue and cue cmd via testscript@mvdan39d2707
  • cmd/cuedisable the wasm interpreter by default for now@mvdanabeea94
  • cmd/cueget go: support time.Duration@gdvalle1b9b079
  • cmd/cueadd a fmt --check flag to list badly formatted files@NoamTD4db4481
  • cmd/cuelock the logins.json during an update@rustyx71a12cf
  • cmd/cueadd refresh tokens support@rustyx25ed954
  • cmd/cueuse fewer go/types.Type.String calls@mvdane4e6d68

cue14

  • cue/testdataadd variants of issue1684@mpvl517f611
  • cue/testdataadd benchmark for billion laughs@mpvl416eecf
  • cue/loadmake a note about importPkg redoing lots of work@mvdana220cfb
  • cue/loadensure load.Instances sorts instances deterministically@NoamTDf736827
  • cue/tokenadd a File.Lines getter method@mvdan637939e
  • cue/literalallow a leading positive sign in ParseNum@mvdan060645a
  • cue/testdatapolish test before implementing disjunctions@mpvl20b1c3a
  • cue/loadremove support for cue.mod files@mvdan2887786
  • cueadjust Environment for comprehensions@mpvl3e6a8be
  • cue/loadfix doc comment typo@rogpeppe9b83404
  • cue/loadtreat stdlib-like import on command line as error@rogpeppe2aec394
  • cue/loadconsistent error message quoting@rogpeppe4202a47
  • cue/loaddeprecate Config.StdRoot@rogpeppee675eb7
  • cue/loadchange stdlib import test case@rogpeppe09394f3

internal54

  • internal/cueversionbump for v0.9.0-alpha.2@mvdanf8d0998
  • internal/core/adtfail earlier on incompatible types@mpvl6728bb2
  • internal/core/adtintroduce structure sharing@mpvl4c7fe24
  • internal/core/adthacky alternative for cyclicReferences@mpvl80d681b
  • internal/core/adtpre-evaluate pattern constraints@mpvl25db081
  • internal/core/adtfinalize let value@mpvl4abbb53
  • internal/core/adtrecord stats for new evaluator@mpvld323ba5
  • internal/core/adtimplement pattern matching for new evaluator@mpvlca87216
  • internal/cueexperimentenable CUE_EXPERIMENT=yamlv3decoder by default@mvdanf03aaa1
  • internal/envflagadd support for key-values and defaults@mvdanb92ad55
  • internal/encoding/yamladd the new Decoder@mvdan9fba4fa
  • internal/encoding/yamladd even more test cases@mvdanb508b29
  • internal/core/adtfix default handling@mpvl5e896e0
  • internal/core/adtfix task completion across disjunction boundaries@mpvl8c6738a
  • internal/core/adtfix closedness issue with pattern constraints@mpvlb944429
  • internal/core/adtfix path in error messages@mpvl4cb3889
  • internal/core/adtpatch old status mechanism@mpvl709cdc5
  • internal/core/adtadd methods for accessing Conjuncts@mpvl4fcfdbf
  • internal/core/adtremove unnecessary code@mpvlbc2672f
  • internal/core/adttask is not always defined@mpvl4a5ba90
  • internal/core/adtinitialize nodeContext in two phases@mpvl149b248
  • internal/encoding/yamladd more decoder tests@mvdan21abb7f
  • internal/encoding/yamlcopy decode_test.go from internal/third_party/yaml@mvdanc8d4c3a
  • internal/core/adtremove unnecessary code@mpvl97daa8f
  • internal/core/adtadd task deprecation@mpvlbb20494
  • internal/core/adtset list type as soon as known@mpvl1e01bd6
  • internal/core/adtalso check closedness for list in Equal@mpvl30c5f27
  • internal/core/adtmatch patterns only if type matches@mpvl8e58091
  • internal/core/adtguard visual debugger from opening too many tabs@mpvl73611fd
  • internal/core/adtkeep arcTypes per closeContext@mpvl03de5ae
  • internal/core/adtforward cloned disjunct@mpvle4aae72
  • internal/core/adtcompute kind differently for new evaluator@mpvl87ad2e4
  • internal/core/adtvalidate alignment of closeContext@mpvlfe85022
  • internal/ciwe no longer need to set CUE_LONG=true@mvdan6e690fd
  • internal/core/adtfixed closedness issue for embeddings in files@mpvlbdba8ed
  • internal/core/adtdo not use NOTIFY arcs for closedness checking@mpvlc89d040
  • internal/core/adtallow definitions in structs@mpvlad9a305
  • internal/core/adtadd edge cases for disjunctions@mpvld42ee67
  • internal/core/adtcompare nodes based on underlying@mpvle1406c6
  • internal/cuetxtarautomatically clean up once diff is gone@mpvlf4aa801
  • internal/core/adtenable disjunction tests for alpha evaluator@mpvl87de98e
  • internal/core/adtfirst implementation of disjunctions@mpvlcfd4e37
  • internal/core/adtuse Vertex.Indirect in more places@mpvlcc2075b
  • internalteach ToFile to not drop StructLit comments@mvdanf9032a0
  • internal/registrytestensure that 401 errors have a Www-Authenticate header@rogpeppe41e8686
  • internal/core/adtadd benchmark for exponential behavior@mpvl9cdee62
  • internal/cibump to macos-14 and Go 1.22.2@mvdand8e6953
  • internal/filetypesreplace encoding/gocode with go:embed@mvdan3a9199f
  • internal/mod/mvsavoid using reflect.DeepEqual@mvdan338ab6e
  • internal/sourceadd Open, moving from internal/encoding@mvdan6c3c377
  • internal/third_party/yamlremove last bits of reflect@mvdan61db61c
  • internal/third_party/yamldeduplicate source.Read@mvdanb6516c5
  • internal/core/adtdetect permanent errors for undefined fields earlier@nickfiggins3c886e0
  • internal/core/adtadd a little more detail to Environment.up panics@mvdanabc8bb1

mod3

  • mod/modfileadd support for "source" field@rogpeppe8d043e7
  • mod/modregistrytreat "forbidden" as "not found"@rogpepped8067eb
  • mod/modconfigswap os.ReadFile and os.Rename with robustio@mvdanb0257fa

Other7

  • tools/trimupdate for new evaluator@mpvl416c163
  • pkg/listmake Sort work for new evaluator@mpvl50989f0
  • READMEfix broken links to tour and k8s tutorial@NoamTD924178c
  • docremove the kubernetes tutorial@myitcv8985d19
  • docremove the tour@myitcv7d10fbd
  • update github.com/google/uuid@mvdanda9e386
  • tools/flowreturn permanent errors from tasks@nickfiggins2137bea

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.9.0-alpha.2_darwin_amd64.tar.gz0e9f6a19175e53e895b5d1dca730e0c601639460951e09d62f858ead01f7f743
macOS, Apple siliconcue_v0.9.0-alpha.2_darwin_arm64.tar.gz1591770abba1d2ef1f35a9c1365d2c92f671c5546598eb962276e75598ba80ec
Linux, x86-64cue_v0.9.0-alpha.2_linux_amd64.tar.gz48e3596c3725a1cf216e2b0f6d6b033395a855ae1b1aa41eaba0065d696227b3
Linux, Arm64cue_v0.9.0-alpha.2_linux_arm64.tar.gz30d29e21c4df829b26937418a945324ee34227530dbc2eaf8ddeee50eda789a3
Windows, x86-64cue_v0.9.0-alpha.2_windows_amd64.zip113a7da382aa39d25e7e9209377ab0ebba3eddc749ff2cd555dc52b39c0e40ce
Windows, Arm64cue_v0.9.0-alpha.2_windows_arm64.zip967b9d3ac9a3cecf63d34e64dd5e3d6cc0b4a0ac50fe5b80b47de8e74c7082f1

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

Install CUE