v0.8.0-alpha.1

cue-lang/cue Pre-release Released

A release of CUE OSS · its page on GitHub

This release includes experimental support for CUE Modules (more details below), as well as a number of improvements and fixes.

More CLs and refactors have also landed for the core evaluator’s performance work; they aren’t enabled yet as the work isn’t complete.

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 terms of performance. It continues to catch multiple issues with each release. Adding your project to Unity not only guarantees that we will not break your tests (if we do, we will work with you to fix your CUE code), 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.

Thank you to @4ad, @cedricgc, @jpluscplusm, @martingreber, @mpvl, @mvdan, @myitcv, @nickfiggins, @nnnkkk7, @rogpeppe, and @vikstrous for contributing to this release!

Modules

This release includes experimental support for CUE modules in cmd/cue, as outlined in the Modules and package management proposal. We are also working on v3 of the modules proposal docs to coincide with the release of v0.8.0.

Alongside this release, we have published a tutorial on the new website which shows how to publish and fetch modules with a custom module registry.

We have also published the first version of the Modules reference documentation, the canonical documentation page describing how CUE modules work in detail.

Note that support for CUE modules is still experimental and subject to change, and needs to be explicitly enabled via CUE_EXPERIMENT=modules. See cue help environment for more information on the environment variables used below.

The cue mod tidy command is introduced, which rewrites cue.mod/module.cue in its canonical format, adds any missing module dependency requirements, and removes unused ones.

The cue mod publish command is also added. This publishes a version of the current module to a module registry.

When running commands like cue export with CUE_EXPERIMENT=modules, dependencies are automatically fetched from module registries following $CUE_REGISTRY and cached on disk.

Note that support for fetching modules from OCI registries via cue/load isn’t ready yet; support for Go library users will be announced at a later time.

Go API

Note that this version of CUE requires Go 1.21 or later, following our policy to support the latest two stable Go releases just like upstream.

CL 1173271 drops support for legacy pkg directories, which have been deprecated since the transition to a cue.mod directory in 2019.

CL 1174069 replaces a few more uses of the deprecated cue.Instance type with cue.InstanceOrValue.

CL 1175779 deprecates the FileOffset and File.Base APIs in cue/token, which were inherited from go/token but never had any effect.

Language

There are no changes to the language in this version.

Spec

CL 1173197 makes the use of the term “builtin function” consistent across the document.

Core Evaluator

CL 1173262 fixed a regression introduced by v0.7.0’s upgrade to github.com/cockroachdb/apd/v3 where some arithmetic operations would result in an extra 0 digit.

Encoders

CL 1173689 fixed the YAML encoder so that strings looking like hexadecimal numbers are properly quoted.

Builtins

CL 1173735 replaces the uses of Go’s net package with net/netip when dealing with IP addresses, which makes them immutable, comparable, and take less memory.

CL 1173926 adds an IPv6 API to net to check that a value is a valid IPv6 address, mirroring IPv4 and taking advantage of the switch to the Go net/netip package.

CL 1174339 fixes tool/exec so that it correctly applies env defaults in CUE values.

CL 1174623 fixes tool/exec so that it accepts env list values as documented.

cmd/cue

CL 1173892 adds a cue help environment section to document the environment variables used by the CLI, such as CUE_EXPERIMENT and CUE_REGISTRY.

CL 1176665 fixes cue cmd so that legacy commands always get the corresponding CUE schema unified.

CL 1176194 starts adding a language.version field to cue.mod/module.cue, to start tracking what CUE language version a module’s config files were written for. This will become necessary to make future language changes as smooth as possible for CUE users. For example, running cue mod init or cue mod tidy with the future CUE v0.8.0 release should add language: version: "v0.8.0" when the field isn’t present.

All changes

143 changes since v0.7.1by area

cmd22

  • cmd/cue,pkg/tool/execrely on cue schema for exec.Run defaults@nickfigginsb460e71
  • cmd/cueunhide mod tidy and mod publish@myitcvd37ea66
  • cmd/cueadd testscript for registry auth via logins.json@mvdan64c5656
  • cmd/cuefix registry client race@rogpeppe3d1c0cb
  • cmd/cueadd mod registry server command@rogpeppe649c7f6
  • cmd/cuesimplify exec trimming in TestX@nnnkkk7eafeb11
  • cmd/cueadd test for self import in modules mode@rogpeppe707c6d7
  • cmd/cuemake the config directory configurable@mvdan22b1ca3
  • cmd/cueadd version to module.cue file@rogpeppe9ceec10
  • cmd/cue/cmdsupport major versions in module path@rogpeppee8efa7e
  • cmd/cue/cmdadd (failing) submodule test@rogpeppe8889d6a
  • cmd/cueuse tokens from "cue login" before docker's config.json@mvdan0e4ec67
  • cmd/cuestore tokens once "cue login" succeeds@mvdan786095f
  • cmd/cmdadd environment help@rogpeppeed4fcdc
  • cmd/cueadd hidden login command@mvdan0a5e225
  • cmd/cue/cmdamend the default for CUE_REGISTRY@mvdanb01d129
  • cmd/cuerename mod upload to mod publish@rogpeppecc1eaf0
  • cmd/cueallow cue mod tidy in non-module root@rogpeppef260855
  • cmd/cueuse cached registry for cue mod tidy@rogpeppe400f829
  • cmd/cueremove a stale TODO on marshaler types@mvdana567677
  • cmd/cueprevent failures if /tmp/cue.mod exists@mvdanc8073f4
  • cmd/cuecue mod tidy command@rogpeppe2635119

cue18

  • cue/interpreter/wasmrework the way we test Wasm@4ad41b9e66
  • cue/interpreter/wasmremove Wazero global state@4ad6d68b3a
  • cue/interpreter/wasmadd support for Wasm functions that take and return structs@4ad2ce1036
  • cue/interpreter/wasmadd support for arbitrary types in extern attributes@4adc896078
  • cue/loadallow conversion of module-local paths to OS paths@rogpeppe20451a6
  • cue/loadmake the tests less noisy@mvdan079532c
  • cue/loaduse fewer absolute paths in tests@mvdana25c24b
  • cue/parsermake the example self-contained@mvdanfc77363
  • cue/loadfix crash when there is no module file@rogpeppeec7ca0a
  • cue/tokendeprecate base offset@rogpeppeb0358a6
  • cue/loaduse modpkgload to resolve dependencies@rogpeppefa12218
  • cue/loadimplement io/fs.FS for overlay filesystem@rogpeppe83a70c6
  • cue/loadremove unused code@rogpeppe2be5931
  • cue/loaduse module.ParseImportPath@rogpeppe36a4ce4
  • cue/errorsremove unused field@rogpeppe693cc0e
  • cuereplace Instance.value with Instance.Value@mvdan20a4505
  • cue/loaduse cached registry@rogpeppe7dc80ff
  • cue/loaddrop support for legacy pkg directories@mvdane81d181

internal82

  • internal/core/runtimeexpand runtime.Compile signature to accomodate non-builtins@4ad063b8c1
  • internal/cirun the end-to-end tests with -race@mvdana948eb5
  • internal/ciupgrade Go matrix include go1.22.0@myitcv63dbc2d
  • internal/ciuse node.js 20-compatible action versions@myitcv15a4b3e
  • internal/e2eswitch all tests to cue mod publish@mvdan2930a8e
  • internal/mod/modloadfix panic on error in tidy@rogpeppe3146f22
  • internal/modfix tidy in the presence of local code@rogpeppe2a56875
  • internal/e2estart using cue mod tidy@mvdan34db9eb
  • internal/e2estart using cue mod init modpath@version@mvdan7855e15
  • internal/mod/modloadsupport adding language version@rogpeppe2120803
  • internal/mod/modpkgloadsupport gen directories@rogpeppec6e4adf
  • internal/e2etweak expected error string after the cue/load changes@mvdanb67300b
  • internal/modtrack dependencies at package level@rogpeppeaf405f0
  • internal/mod/moduleadd ParseImportPath@rogpeppe22cf402
  • internal/mod/modpkgloadadd test for package-level dependencies@rogpeppeb6032be
  • internal/core/adtuse ConjunctGroup in fields@mpvla849212
  • internal/mod/modresolveallow other forms of IPv6 localhost@rogpeppe522eb97
  • internal/modremove TODOs that have been done@rogpeppe1fff098
  • internal/core/adtremove disallowedField@mpvl657ae6b
  • internal/core/adtuse OpContext instead of nodeContext for decDependant@mpvl1df027b
  • internal/e2ewrite the rest of an inline comment@mvdan97826df
  • internal/ciadd a TODO about "goreleaser test"@mvdan21086d0
  • internal/cisupport co-authors in the signed-off-by check@mvdan87a2e5c
  • internal/core/adtimplement checks for closedness counters@mpvl928ff3e
  • internal/core/adtreorganize for field checks@mpvl2b483d7
  • internal/core/adtmove rootCloseContext to Vertex@mpvl596adda
  • internal/core/adtcopy node method for comprehensions@mpvl122b11f
  • internal/core/adtonly show stats for old evaluator@mpvlce798a7
  • internal/core/adtpass flags needed for new evaluator@mpvl7fcc936
  • internal/core/adtfix typo in insertion.txtar@mpvl409ab1e
  • internal/core/adtadd positions of ConjunctGroup@mpvld06d126
  • internal/core/adthandle comprehension cycle errors@mpvl0b90ccc
  • internal/core/adtadd tests to pass for new evaluator@mpvl7453a50
  • internal/code/adthoist position to different line@mpvl106ce1a
  • internal/core/adtbail out early from resolve upon error@mpvl6ead06a
  • internal/core/adthoist hasConjuncts@mpvlcbcabcf
  • internal/core/adtdon't match patters for non-regular fields@mpvlca725a8
  • internal/core/runtimemove EvaluatorVersion to Runtime@mpvl53ed0f6
  • internal/core/adtmove OpContext out of nodeContext@mpvl200c994
  • internal/core/adtadd scheduler implementation@mpvl9728b7d
  • internal/cliimprove error message on parse issue@cedricgcb55e471
  • internal/core/adthoist getNonCyclicCount@mpvl4cc7bc7
  • internal/cuetxtaruse go-internal diff@mpvl54e1699
  • internal/core/adtinclude ConjunctGroup in addPositions@mpvld5431b2
  • internal/core/adtmodify some tests@mpvl82e4cef
  • internal/core/adtprep for new evaluator@mpvl8146191
  • internal/core/adtintroduce ConjunctGroup@mpvlafed6ae
  • internal/core/adtunroll Evaluate in OpContext.concrete@mpvl8933b8c
  • internal/core/adtadd String implementation for ArcType@mpvlcc76012
  • internal/coreremove unused argument@mpvlda0eab4
  • internal/e2euse cue mod publish@rogpeppe3d09a4a
  • internal/registrytestupload deterministically@rogpeppec4c064d
  • internal/mod/modfileavoid unnecessary braces@rogpeppe7bcfd0b
  • internal/mod/modregistryadd Module.Version method@rogpeppe72766c2
  • internal/registrytestadd Upload function@rogpeppe414695f
  • internal/mod/modregistryadd GetModuleWithManifest method@rogpeppe76298d4
  • internal/cmdadd cue-ast-print to visualize syntax trees@mvdanbf94b66
  • internal/encoding/yamlquote hexadecimal-looking strings@vikstrous0b3455c
  • internal/e2eset CUE_MODCACHE in TestScript's Setup@mvdandb98219
  • internal/mod/modfileguard against cue.Value race@rogpeppe53d036a
  • internal/mod/modcacheuse robustio@rogpeppec5e1342
  • internal/mod/modcachenew package@rogpeppec3ec30c
  • internal/mod/modregistryavoid round trip@rogpeppee090abf
  • internal/mod/moduleadd support for escaping@rogpeppe576c564
  • internal/mod/modregistryadd ManifestDigest@rogpeppe3c187c5
  • internal/mod/modloadsupport major version defaults@rogpeppeac248f4
  • internal/mapsnew package@rogpeppe1958c32
  • internal/mod/modpkgloadsupport packages without major versions@rogpeppe3cfb6e2
  • internal/mod/modrequirementssupport major version defaults@rogpeppe7afd472
  • internal/mod/modregistrysupport cross-major-version queries@rogpeppe4773bf6
  • internal/mod/modloadnew package@rogpeppe6bd89dc
  • internal/mod/modpkgloadnew package@rogpeppe3632c1f
  • internal/coreuse precise apd.Decimal@myitcv8271724
  • internal/mod/modrequirementsadd GraphIsLoaded and RootModules@rogpeppe74d7664
  • internal/mod/moduleadd Version.IsValid@rogpeppe71ab88a
  • internal/mod/modregistryreturn no tags for non-existent repo@rogpeppe0c2c730
  • internal/mod/modfileadd Format@rogpeppe7d588b9
  • internal/mod/modimportsdiscard package qualifier in import paths@rogpeppe4edbf9d
  • internal/slicesadd Equal@rogpeppe4f4f718
  • internal/mod/modimportssupport scanning single directory@rogpeppe413d0d5
  • internal/mod/modrequirementsnew package@rogpeppe0e0d638
  • internal/cilimit goreleaser to doing release drafts@mvdanf3411b4

pkg6

  • pkg/pathfix package comment@jpluscplusm4818cf7
  • pkg/tool/execupdate env spec to support lists@nickfiggins92d99d0
  • pkgfix CUE source escaping TODO@mvdan1dda25a
  • pkg/tool/execsupport defaults in env values@nickfigginse7c2ede
  • pkg/netadd IPv6 check@martingreberbc91ca7
  • pkg/netreplace net with net/netip@martingreber87a3b17

README5

  • READMEbriefly document that we support two Go versions@mvdane69d893
  • READMEsimplify "install from source" instructions@mvdan5037afc
  • READMEadd Docker badge and instructions@mvdanb6a6f67
  • READMEremove obsolete mention of Google@jpluscplusm64a117c
  • READMEdrop golangci badge@mvdan967c9c6

Other10

  • clarify that we require Go 1.21 or later now@mvdanbef7c4e
  • bump cuelabs.dev/go/oci/ociregistry dependency@mvdan0eb0106
  • tools/flowuse atomic.Bool@mvdanfefadfc
  • encoding/gocodereplace cue.Instance with InstanceOrValue@mvdandbf2b75
  • allupdate Wazero to 1.6.0@4ad5c5d291
  • depsupgrade to latest cuelabs.dev/go/oci/ociregistry@myitcvc84175b
  • go.modbump non-user-facing dependencies@mvdan3594d13
  • doc/refuse builtin instead of built-in@jpluscplusm7ed1bca
  • modfilesupport major version defaults@rogpeppefaf7cd5
  • update ociregistry dependency@rogpeppee07c4b8

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.8.0-alpha.1_darwin_amd64.tar.gz5c174a0895a6c9378cffbffd40195b998a0ac399060fc24327d608ff1a2666a6
macOS, Apple siliconcue_v0.8.0-alpha.1_darwin_arm64.tar.gz622b92fec866e9da4bb644a4b3f40b6cbfa6566ae8462bf6bdfe95dc919974e4
Linux, x86-64cue_v0.8.0-alpha.1_linux_amd64.tar.gzf0d22e11f078077f69a4286f0f73c46a71e2073611cb162548cb78ef78b90266
Linux, Arm64cue_v0.8.0-alpha.1_linux_arm64.tar.gz1a57cd38da718167b363e58c7f8dc1ec1535de09ea0eb93305a7a388294f7d99
Windows, x86-64cue_v0.8.0-alpha.1_windows_amd64.zip93d9ee5ab3104b256dc14f652b851e4f253706aaefb544fcbf41d922e7654088
Windows, Arm64cue_v0.8.0-alpha.1_windows_arm64.zipa57739cc340736b27125c19a677dfc78fd4ad33a7f80426654da5ac36ba373c2

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

Install CUE