v0.8.0
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. These aren’t enabled yet as the work isn’t complete; subscribe to the performance umbrella issue to read regular updates.
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.
Modules
This release includes experimental support for CUE modules in cmd/cue, as outlined in the updated Modules and package management proposal v3.
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.
CUE maps modules to registries via $CUE_REGISTRY, which supports a simple string configuration format as well as a more detailed CUE configuration format which can be read from disk. See cue help registryconfig for more details.
The new cue mod tidy command rewrites cue.mod/module.cue in its canonical format, adds any missing module dependency requirements, and removes unused ones.
The new cue mod publish command publishes the current module to a module registry.
The new cue mod get command can add a new module dependency, update an existing one, or downgrade an existing one as long as it does not cause any conflict.
When running commands like cue export with CUE_EXPERIMENT=modules, dependencies are automatically fetched from module registries following $CUE_REGISTRY and cached on disk inside $CUE_CACHE_DIR.
CUE Language Server Protocol Implementation
This release includes the first early version of an experimental Language Server Protocol (LSP) implementation for CUE. Whilst it remains experimental, the cmd/cuepls binary is separate from cmd/cue. However at a later date it will most likely to become a subcommand of cmd/cue like cue lsp serve.
We are working on updating the VSCode plugin to use cmd/cuepls, as well as supporting an initial version of a plugin for Neovim. For JetBrains users, we are working with the author of the CUE plugin to understand how best to integrate cmd/cuepls with JetBrains.
We will share announcements once the editor integrations are ready for use, and once more LSP features beyond formatting files are available. Subscribe to the LSP announce discussion, or join us in #cuepls on CUE Slack.
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.
The cue/load package supports the CUE Modules experiment out of the box with the environment variable CUE_EXPERIMENT=modules. Alternatively, a custom registry and authorizer can be configured with the Config.Registry field via the modconfig.NewRegistry API.
cue/load also has a new Config.Env struct field to provide the environment variables used to load CUE modules from registries. It defaults to using os.Environ.
We have also added new Go examples to the cue/load package, including an example demonstrating the use of a CUE modules registry.
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 fixes 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 fixes 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 1176194 adds a language.version field to cue.mod/module.cue to track what CUE language version a module was 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 v0.8.0 release should add language: version: "v0.8.0" when the field isn’t present.
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 1177330 fixes a bug where some evaluation errors in tools/flow and cue cmd were omitted, causing unintended results.
CL 1177546 tweaks cmd/cue so that it obeys the --package flag when the output format is CUE.
All changes
254 changes since v0.7.1by area
all5
allprevent tests from using the host's docker/config.jsonallreplace uses of deprecated ioutil APIsallreplace mpvl/unique with slices.Compactallstart taking advantage of Go 1.21+allupdate Wazero to 1.6.0
cmd48
cmd/cuemod init should only add@v0with the experimentcmd/cuerepurpose modinit test for language.versioncmd/cuemention CUE_DEBUG in cue help environmentcmd/cueuse CUE_VERSION_OVERRIDE in script tests to avoid churncmd/cuefix "login" on a clean environment, and add testscmd/cue,mod/modconfigsend User-Agent headercmd/cueenable HTTP logging for cue logincmd/cueimplement cue mod tidy --checkcmd/cueimplement support for HTTP loggingcmd/cueuse fallbackVersion when built via a directory replacecmd/cuehard-code a fallback CUE semver versioncmd/cueimplement cue mod getcmd/cuefix bad variable referencecmd/cueadd registryconfig helpcmd/cuesupport --package flag when output is CUEcmd/cuestop trying to set $HOME in script_test.gocmd/cueskip the logins.json authorizer if no file is foundcmd/cueimprove error message when modules experiment not enabledcmd/cueclarify prefix matching semanticscmd/cueadd language version in "mod init"cmd/cueuse CUE_CACHE_DIR instead of CUE_MODCACHEcmd/cuesupport registry file configurationcmd/cueupdate mod docscmd/cueuse single implementation of CUE_REGISTRY logiccmd/cuefix other commands to work with modulescmd/cueuse immutable tags in cue mod registrycmd/cue,pkg/tool/execrely on cue schema for exec.Run defaultscmd/cueunhide mod tidy and mod publishcmd/cueadd testscript for registry auth via logins.jsoncmd/cuefix registry client racecmd/cueadd mod registry server commandcmd/cuesimplify exec trimming in TestXcmd/cueadd test for self import in modules modecmd/cuemake the config directory configurablecmd/cueadd version to module.cue filecmd/cue/cmdsupport major versions in module pathcmd/cue/cmdadd (failing) submodule testcmd/cueuse tokens from "cue login" before docker's config.jsoncmd/cuestore tokens once "cue login" succeedscmd/cmdadd environment helpcmd/cueadd hidden login commandcmd/cue/cmdamend the default for CUE_REGISTRYcmd/cuerename mod upload to mod publishcmd/cueallow cue mod tidy in non-module rootcmd/cueuse cached registry for cue mod tidycmd/cueremove a stale TODO on marshaler typescmd/cueprevent failures if /tmp/cue.mod existscmd/cuecue mod tidy command
cue27
cue/loadmake packages specified as args work correctlycue/loadfix race in testingcue/loadimplement UpdateRequirementscue/load,mod/modconfigsupport custom environment variablescue/loaddelete unexported funcs only used in testscue/loadremove unused code from the modules refactorscue/loadadd runnable example for external modulescuefix typos in the Hid function documentationcue/loadadd a runnable package examplecue/interpreter/wasmrework the way we test Wasmcue/interpreter/wasmremove Wazero global statecue/interpreter/wasmadd support for Wasm functions that take and return structscue/interpreter/wasmadd support for arbitrary types in extern attributescue/loadallow conversion of module-local paths to OS pathscue/loadmake the tests less noisycue/loaduse fewer absolute paths in testscue/parsermake the example self-containedcue/loadfix crash when there is no module filecue/tokendeprecate base offsetcue/loaduse modpkgload to resolve dependenciescue/loadimplement io/fs.FS for overlay filesystemcue/loadremove unused codecue/loaduse module.ParseImportPathcue/errorsremove unused fieldcuereplace Instance.value with Instance.Valuecue/loaduse cached registrycue/loaddrop support for legacy pkg directories
cuepls12
cueplssupport formatting of CUE filescueplssupport .cue filetypecueplsremove more server implementationcueplsfirst integration testcueplsrenaming gopls -> cueplscueplsinitial version of cmd/cueplscueplsslim down to single format commandcueplsremove any mention of vulnerability analysiscueplsminimal changes to telemetrycueplsremove gopls hookscueplsrun internal/golangorgx/revendorToolsInternal.shcueplsinitial version of "vendor" script
doc3
doc/tutorialskip module.cue as a golden file to avoid churndoc/tutorialfix broken install.md linkdoc/refuse builtin instead of built-in
internal118
internal/cueversionbump fallbackVersion for v0.8.0internal/mod/modresolvedo not use regular field in registry config schemainternal/mod/modresolvefix stripPrefix for exact matchinternal/_e2eremove cleanup.go and tools.gointernal/e2ejoin into the root Go moduleinternal/e2etest that we can't replace published versionsinternal/e2estop creating GitHub repositoriesinternal/cueversionbump fallbackVersion for v0.8.0-rc.1internal/cueversionconvert spaces to underscore in Go versioninternal/cueversionnew packageinternal/modloadimplement tidiness checkerinternal/mod/modloadsplit Tidy from UpdateVersionsinternal/httplognew packageinternal/ciupdate the pinned Go version for v0.8internal/cuedebugnew packageinternal/core/adtset nonRootedinternal/core/debugmore state in formationinternal/core/adtmake runner a struct instead of funcinternal/core/adtfix conjunct indexinternal/core/adtimplement new evaluatorinternal/core/adtonly error if inspected node missed countersinternal/core/adtclosedness improvementsinternal/core/adtadd lifetime check for closednessinternal/core/adtmark functions only used in old evaluatorinternal/core/adtexclude tests with disjunctionsinternal/core/adtpropagate closedness upinternal/core/adtintroduce visual CUE debuggerinternal/strremove as it only had one trivial useinternal/e2epartially revert usingcue mod init modpath@versioninternal/parmove from internal/mod/internal/parinternal/cifix reference to tool/file.RemoveAllinternal/cifix goreleaser when using gomod.proxyinternal/ciprint goreleaser config yaml before using itinternal/mod/modresolveuse same registry representation as CUE_REGISTRYinternal/mod/modresolveadd config file functionalityinternal/ciadd cuepls to goreleaser configinternal/core/runtimeexpand runtime.Compile signature to accomodate non-builtinsinternal/cirun the end-to-end tests with -raceinternal/ciupgrade Go matrix include go1.22.0internal/ciuse node.js 20-compatible action versionsinternal/e2eswitch all tests tocue mod publishinternal/mod/modloadfix panic on error in tidyinternal/modfix tidy in the presence of local codeinternal/e2estart usingcue mod tidyinternal/e2estart usingcue mod init modpath@versioninternal/mod/modloadsupport adding language versioninternal/mod/modpkgloadsupport gen directoriesinternal/e2etweak expected error string after the cue/load changesinternal/modtrack dependencies at package levelinternal/mod/moduleadd ParseImportPathinternal/mod/modpkgloadadd test for package-level dependenciesinternal/core/adtuse ConjunctGroup in fieldsinternal/mod/modresolveallow other forms of IPv6 localhostinternal/modremove TODOs that have been doneinternal/core/adtremove disallowedFieldinternal/core/adtuse OpContext instead of nodeContext for decDependantinternal/e2ewrite the rest of an inline commentinternal/ciadd a TODO about "goreleaser test"internal/cisupport co-authors in the signed-off-by checkinternal/core/adtimplement checks for closedness countersinternal/core/adtreorganize for field checksinternal/core/adtmove rootCloseContext to Vertexinternal/core/adtcopy node method for comprehensionsinternal/core/adtonly show stats for old evaluatorinternal/core/adtpass flags needed for new evaluatorinternal/core/adtfix typo in insertion.txtarinternal/core/adtadd positions of ConjunctGroupinternal/core/adthandle comprehension cycle errorsinternal/core/adtadd tests to pass for new evaluatorinternal/code/adthoist position to different lineinternal/core/adtbail out early from resolve upon errorinternal/core/adthoist hasConjunctsinternal/core/adtdon't match patters for non-regular fieldsinternal/core/runtimemove EvaluatorVersion to Runtimeinternal/core/adtmove OpContext out of nodeContextinternal/core/adtadd scheduler implementationinternal/cliimprove error message on parse issueinternal/core/adthoist getNonCyclicCountinternal/cuetxtaruse go-internal diffinternal/core/adtinclude ConjunctGroup in addPositionsinternal/core/adtmodify some testsinternal/core/adtprep for new evaluatorinternal/core/adtintroduce ConjunctGroupinternal/core/adtunroll Evaluate in OpContext.concreteinternal/core/adtadd String implementation for ArcTypeinternal/coreremove unused argumentinternal/e2euse cue mod publishinternal/registrytestupload deterministicallyinternal/mod/modfileavoid unnecessary bracesinternal/mod/modregistryadd Module.Version methodinternal/registrytestadd Upload functioninternal/mod/modregistryadd GetModuleWithManifest methodinternal/cmdadd cue-ast-print to visualize syntax treesinternal/encoding/yamlquote hexadecimal-looking stringsinternal/e2eset CUE_MODCACHE in TestScript's Setupinternal/mod/modfileguard against cue.Value raceinternal/mod/modcacheuse robustiointernal/mod/modcachenew packageinternal/mod/modregistryavoid round tripinternal/mod/moduleadd support for escapinginternal/mod/modregistryadd ManifestDigestinternal/mod/modloadsupport major version defaultsinternal/mapsnew packageinternal/mod/modpkgloadsupport packages without major versionsinternal/mod/modrequirementssupport major version defaultsinternal/mod/modregistrysupport cross-major-version queriesinternal/mod/modloadnew packageinternal/mod/modpkgloadnew packageinternal/coreuse precise apd.Decimalinternal/mod/modrequirementsadd GraphIsLoaded and RootModulesinternal/mod/moduleadd Version.IsValidinternal/mod/modregistryreturn no tags for non-existent repointernal/mod/modfileadd Formatinternal/mod/modimportsdiscard package qualifier in import pathsinternal/slicesadd Equalinternal/mod/modimportssupport scanning single directoryinternal/mod/modrequirementsnew packageinternal/cilimit goreleaser to doing release drafts
mod11
mod/modfilecheck canonical language versionmod/modconfigmake http transport configurablemod/...API tweaksmod/...remove three somewhat unnecessary APIsmod/moduleassume Go 1.21 or latermod/modconfigfactor out from cmd/cuemod/...mark as experimentalmod/modcachemove from internal/mod/modcachemod/modregistrymove from internal/mod/modregistrymod/modfilemove from internal/mod/modfilemod/modulemove from internal/mod/module
pkg6
pkg/pathfix package commentpkg/tool/execupdate env spec to support listspkgfix CUE source escaping TODOpkg/tool/execsupport defaults in env valuespkg/netadd IPv6 checkpkg/netreplace net with net/netip
README5
READMEbriefly document that we support two Go versionsREADMEsimplify "install from source" instructionsREADMEadd Docker badge and instructionsREADMEremove obsolete mention of GoogleREADMEdrop golangci badge
Other19
- update cuelabs.dev/oci/ociregistry to pull in fix for #2934
- bump ociregistry dependency to pull in a panic fix
- Revert "internal/e2e: partially revert using
cue mod init modpath@version" - update golang.org/x/... dependencies for v0.8.0
- bump ociregistry dependency
tools/flowcheck and return errors from task values- bump ociregistry module version
- bump ociregistry dependency
- hide testdata cue files to allow
cue mod tidyto pass cue.modadd language.version to the root module- bump golang.org/x dependencies for v0.8
- clarify that we require Go 1.21 or later now
- bump cuelabs.dev/go/oci/ociregistry dependency
tools/flowuse atomic.Boolencoding/gocodereplace cue.Instance with InstanceOrValuedepsupgrade to latest cuelabs.dev/go/oci/ociregistrygo.modbump non-user-facing dependenciesmodfilesupport major version defaults- update ociregistry dependency
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_d416cb4ea07a93094c71876c4757371e7f606095ee5861abdaa3cc71e4109ab7 |
| macOS, Apple silicon | cue_1fac4b7df251b517f75969603f2bf47f683fe8072c2e4f54ef92559db80fc5ed |
| Linux, x86-64 | cue_e471126dc5e5e55a203066a4a4b1fb08d4cb027cf42517dfadc94c4e1b097767 |
| Linux, Arm64 | cue_37027c826e6900a86d5d55803c64f1a28f063d5db600a807f6911f4d87213fe0 |
| Windows, x86-64 | cue_8e3ced001982f10581dc1a6eeb82e08adee1b1e2abe5b7e837a35401895c6ba7 |
| Windows, Arm64 | cue_f5e5d9d3c7d0649d16afdbc21bde51ebc558fe64ac51ae89085037363dd658fc |
SHA-256 checksums for all of these: checksums.txt