v0.9.0-alpha.3

cue-lang/cue Pre-release Released

A release of CUE OSS · its page on GitHub

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 modules@rogpeppeb7c5800
  • cmd/cuerip out cue.Instance and cue.Merge from 'cue cmd'@mvdan7422d00
  • cmd/cueadd regression test for 'cue cmd' with many packages@mvdan994a15d
  • cmd/cueensure 'get go' with time.Duration is compatible with encoding/json@mvdan1c3f536
  • cmd/cuecorrectly extract transitive dependencies in 'get go'@mvdanb90a5eb
  • cmd/cueadd failing tests for 'cue get go' transitive deps regression@mvdan81f5a20
  • cmd/cueimplement cue mod init --source@rogpeppe2ff5afa
  • cmd/cuefactor cue mod init source to its own file@rogpeppe891a8a0
  • cmd/cuemore resilient mod init version@rogpeppea1dec7d
  • cmd/cuefix mod edit --source self@rogpeppe4997dff
  • cmd/cueadd mod edit command@rogpeppeb7c1a0d
  • cmd/cue/cmdrequire source when running cue mod publish@rogpeppe0616149

cue9

  • cue/loadavoid repeatedly loading parent directories by caching@NoamTDd9c6c75
  • cueremove Merge@mvdan1864214
  • cue/testdatareorder files in txtar@mpvla16a054
  • cueadd IsNull for Decode@mvdan6169eed
  • cue/formatfix comments formatting in lists@NoamTDfdbd563
  • cue/formatdon't indent fields on same line as lbrace@NoamTD0177234
  • cue/formatadd test for incorrect formatting@NoamTD9839112
  • cue/formatfix string literal replacement in labels@NoamTD2d72477
  • cuefix small typo in function documentation@NoamTD731b2af

internal32

  • internal/cueversionbump fallbackVersion for v0.9.0-alpha.3@mvdan797d6f4
  • internal/mod/modloadretain source field when tidying@rogpeppef2980b7
  • internal/core/adtunshare once Pending arc is known@mpvl61c1814
  • internal/core/adtenable comprehension.txtar@mpvlb3cb6e0
  • internal/core/adtadd tests for structure sharing@mpvl3a90b84
  • internal/core/adtcatch nil parent@mpvl8087ff7
  • internal/core/adtmatch decrement for nested comprehension arcs@mpvledda26d
  • internal/core/adtadd Sharing option in CUE_DEBUG@mpvld900867
  • internal/cuedebugusurp some evaluator debug flags@mpvl4280d65
  • internal/cuedebugdefine type for debug flags@mpvl9c5c3c0
  • internal/core/adtprepare to move DebugFlags to cuedebug@mpvlf2e17b1
  • internal/core/adtmove debug flags into struct@mpvlcb96718
  • internal/core/adtweave OpContext to more operations@mpvl7ada2dd
  • internal/filetypeslazily load types.cue@mvdan2cc7b65
  • internal/filetypesdiscard unknown file extensions quickly@mvdanf891103
  • internal/filetypesfill build.File.Filename in toFile in Go@mvdan4da59d6
  • internal/filetypessimplify some of the CUE logic@mvdana21e2df
  • internalremove MakeInstance@mvdan25e8713
  • internal/filetypesadd test coverage for FromFile unifying forms@mvdanc16bac7
  • internal/filetypesFile.Default is indeed not unused@mvdan7b2f27e
  • internal/filetypesuse cue.Value.LookupPath@mvdanf912da6
  • internal/encodingresolve all deprecation warnings@mvdan6f8cbb0
  • internal/_e2eactually add source field in e2e tests@rogpeppe5ea4e50
  • internal/pkgmake CallCtxt.Decimal support *adt.Vertex@NoamTD243df63
  • internal/_e2efix end to end tests to set source@rogpeppe7f3e9cf
  • internal/vcsuse limited environment when executing git in tests@rogpeppedc78c66
  • internal/cisupport running e2e tests on pushes to ci/test@rogpeppef0f56f8
  • internal/vcsnew package@rogpeppe87352e8
  • internal/encoding/yamlreject trailing input in Unmarshal@mvdan25af2e8
  • internal/encoding/yamluse cue/literal to quote string scalars@mvdan16edd40
  • internal/filetypesavoid unifying with the top-level value@mvdanff533f4
  • internal/cueconfigvalidate logins.json on load@rustyxaadc5ad

Other7

  • Revert "cmd/cue: rip out cue.Instance and cue.Merge from 'cue cmd'"@mvdan3519740
  • Revert "cue: remove Merge"@mvdan7195817
  • mod/modregistrymetadata support@rogpeppecf2551f
  • allcue fmt@mvdan058ab7c
  • modresolvesupport special registry "none"@rogpepped1068c4
  • mod/modfileparse module.cue according to language.version@rogpeppe73b3df2
  • pkg/encodingadd tests that Unmarshal rejects trailing input@mvdane063155

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.3_darwin_amd64.tar.gz47a1ea6ccd53c28fc9e9981ec23522a52b0c3f32d09938e715e1d0ad3b578177
macOS, Apple siliconcue_v0.9.0-alpha.3_darwin_arm64.tar.gzf7986cd90fcedea3f25b4cbc7466bbb74aece275ad662b064e37295349945e0e
Linux, x86-64cue_v0.9.0-alpha.3_linux_amd64.tar.gz60c830434eda61e6b26e5b8f223f999e004546c8a8d8e5be60d75a015db29473
Linux, Arm64cue_v0.9.0-alpha.3_linux_arm64.tar.gza7e8c0ea666fb440861b0198fd54dd5be5931f994a345d0ad66763f0bff049bc
Windows, x86-64cue_v0.9.0-alpha.3_windows_amd64.zipac66ecddb9134050a297f723adddb7ee43600c889ac624c78156c21a9b2d3f6a
Windows, Arm64cue_v0.9.0-alpha.3_windows_arm64.zip8fde8c116b91bd94fee543bb460b2c8ea88e8a52f4ff56641060a7344d3b98a5

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

Install CUE