v0.9.0-alpha.3
This release includes changes to the evaluator and modules experiments, as well as a number of other improvements and fixes. A special thanks to Noam Dolovich for numerous contributions to this release!
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
Following the introduction of the new evaluator experiment in the last alpha release via CUE_EXPERIMENT=evalv3, this release includes a few fixes to known bugs and panics in the new evaluator.
Subscribe to the Performance umbrella issue for updates, and see the Evaluator Roadmap project for the planned work ahead.
Modules
cue mod publish now requires source to publish a module, as described in Proposal 3017. The cue mod init --source flag is added to create a new module with this field.
The cue mod edit command is added, which allows some automatic editing of cue.mod/module.cue from the command line.
The CUE schema for cue.mod/module.cue is now dictated by the declared language.version value, which is now mandatory. This allows us to change or tighten the schema with future CUE versions without breaking existing users.
CLs 1193705 and 1193706 teach cue mod publish to include VCS metadata in published module versions, as described in Proposal 3057.
CL 1193289 teaches $CUE_REGISTRY about a special none registry, causing any matching modules to refuse to fetch or resolve.
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
CLs 1193257, 1193394, 1193576, and 1193577 greatly speed up internal/filetypes, used when loading files from disk in cue/load or when encoding/decoding files in cmd/cue.
CL 1193678 teaches cue/load to cache loading files from directories, which avoids repeated work when loading parent directories to form instances.
The changes above, plus cue.Value.IsNull below, should result in a significant speed-up for any cmd/cue command involving many CUE packages or directories. For example, on the main CUE repository, cue fmt ./... went from ~14s to ~0.1s, and cue vet ./... went from ~5s to ~2s.
CL 1193639 teaches internal/filetypes to only load its embedded CUE on first use, allowing any Go programs to skip the ~6ms load time until the first call to a cue/load API, if any.
As a reminder, the ongoing and planned work can be seen in the Encodings Roadmap, and we also use the #encodings channel on Slack.
Go API
CL 1193405 adds a cue.Value.IsNull method to mirror cue.Value.Null without constructing error values, making cue.Value.Decode faster in many scenarios, including its use in cue/load via internal/filetypes.
CL 1193585 fixes a bug where cue/format would print trailing commas for list elements after any inline comments, causing broken syntax.
CL 1193515 fixes an edge case where cue/format would vertically align fields at different struct levels.
Builtins
CL 1193242 teaches encoding/yaml.Unmarshal to reject trailing input, just like encoding/json.Unmarshal already did.
CL 1184631 fixes using math.MultipleOf as a validator function.
cmd/cue
CL 1193699 fixes a regression introduced in cue get go in v0.8.0-alpha.1 which caused transitive package dependencies to no longer be generated.
CL 1193702 ensures that cue get go always generates CUE code from Go time.Duration types and values in a way that is fully compatible with Go’s encoding/json library.
CL 1193386 fixes cue fmt --simplify to no longer break complex labels by unquoting string literals within them.
All changes
60 changes since v0.9.0-alpha.2by area
cmd12
cmd/cueinclude metadata when publishing modulescmd/cuerip out cue.Instance and cue.Merge from 'cue cmd'cmd/cueadd regression test for 'cue cmd' with many packagescmd/cueensure 'get go' with time.Duration is compatible with encoding/jsoncmd/cuecorrectly extract transitive dependencies in 'get go'cmd/cueadd failing tests for 'cue get go' transitive deps regressioncmd/cueimplement cue mod init --sourcecmd/cuefactor cue mod init source to its own filecmd/cuemore resilient mod init versioncmd/cuefix mod edit --source selfcmd/cueadd mod edit commandcmd/cue/cmdrequire source when running cue mod publish
cue9
cue/loadavoid repeatedly loading parent directories by cachingcueremove Mergecue/testdatareorder files in txtarcueadd IsNull for Decodecue/formatfix comments formatting in listscue/formatdon't indent fields on same line as lbracecue/formatadd test for incorrect formattingcue/formatfix string literal replacement in labelscuefix small typo in function documentation
internal32
internal/cueversionbump fallbackVersion for v0.9.0-alpha.3internal/mod/modloadretain source field when tidyinginternal/core/adtunshare once Pending arc is knowninternal/core/adtenable comprehension.txtarinternal/core/adtadd tests for structure sharinginternal/core/adtcatch nil parentinternal/core/adtmatch decrement for nested comprehension arcsinternal/core/adtadd Sharing option in CUE_DEBUGinternal/cuedebugusurp some evaluator debug flagsinternal/cuedebugdefine type for debug flagsinternal/core/adtprepare to move DebugFlags to cuedebuginternal/core/adtmove debug flags into structinternal/core/adtweave OpContext to more operationsinternal/filetypeslazily load types.cueinternal/filetypesdiscard unknown file extensions quicklyinternal/filetypesfill build.File.Filename in toFile in Gointernal/filetypessimplify some of the CUE logicinternalremove MakeInstanceinternal/filetypesadd test coverage for FromFile unifying formsinternal/filetypesFile.Default is indeed not unusedinternal/filetypesuse cue.Value.LookupPathinternal/encodingresolve all deprecation warningsinternal/_e2eactually add source field in e2e testsinternal/pkgmake CallCtxt.Decimal support *adt.Vertexinternal/_e2efix end to end tests to set sourceinternal/vcsuse limited environment when executing git in testsinternal/cisupport running e2e tests on pushes to ci/testinternal/vcsnew packageinternal/encoding/yamlreject trailing input in Unmarshalinternal/encoding/yamluse cue/literal to quote string scalarsinternal/filetypesavoid unifying with the top-level valueinternal/cueconfigvalidate logins.json on load
Other7
- Revert "cmd/cue: rip out cue.Instance and cue.Merge from 'cue cmd'"
- Revert "cue: remove Merge"
mod/modregistrymetadata supportallcue fmtmodresolvesupport special registry "none"mod/modfileparse module.cue according to language.versionpkg/encodingadd tests that Unmarshal rejects trailing input
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
| Platform | File and SHA-256 |
|---|---|
| macOS, Intel | cue_47a1ea6ccd53c28fc9e9981ec23522a52b0c3f32d09938e715e1d0ad3b578177 |
| macOS, Apple silicon | cue_f7986cd90fcedea3f25b4cbc7466bbb74aece275ad662b064e37295349945e0e |
| Linux, x86-64 | cue_60c830434eda61e6b26e5b8f223f999e004546c8a8d8e5be60d75a015db29473 |
| Linux, Arm64 | cue_a7e8c0ea666fb440861b0198fd54dd5be5931f994a345d0ad66763f0bff049bc |
| Windows, x86-64 | cue_ac66ecddb9134050a297f723adddb7ee43600c889ac624c78156c21a9b2d3f6a |
| Windows, Arm64 | cue_8fde8c116b91bd94fee543bb460b2c8ea88e8a52f4ff56641060a7344d3b98a5 |
SHA-256 checksums for all of these: checksums.txt