Skip to content

Releases: cue-lang/cue

v0.9.0-alpha.3

24 Apr 13:00
Compare
Choose a tag to compare
v0.9.0-alpha.3 Pre-release
Pre-release

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.

Full list of changes since v0.9.0-alpha.2
  • internal/cueversion: bump fallbackVersion for v0.9.0-alpha.3 by @mvdan in 797d6f4
  • Revert "cmd/cue: rip out cue.Instance and cue.Merge from 'cue cmd'" by @mvdan in 3519740
  • Revert "cue: remove Merge" by @mvdan in 7195817
  • cue/load: avoid repeatedly loading parent directories by caching by @NoamTD in d9c6c75
  • cmd/cue: include metadata when publishing modules by @rogpeppe in b7c5800
  • mod/modregistry: metadata support by @rogpeppe in cf2551f
  • internal/mod/modload: retain source field when tidying by @rogpeppe in f2980b7
  • cue: remove Merge by @mvdan in 1864214
  • cmd/cue: rip out cue.Instance and cue.Merge from 'cue cmd' by @mvdan in 7422d00
  • cmd/cue: add regression test for 'cue cmd' with many packages by @mvdan in 994a15d
  • cue/testdata: reorder files in txtar by @mpvl in a16a054
  • internal/core/adt: unshare once Pending arc is known by @mpvl in 61c1814
  • internal/core/adt: enable comprehension.txtar by @mpvl in b3cb6e0
  • cmd/cue: ensure 'get go' with time.Duration is compatible with encoding/json by @mvdan in 1c3f536
  • cmd/cue: correctly extract transitive dependencies in 'get go' by @mvdan in b90a5eb
  • cmd/cue: add failing tests for 'cue get go' transitive deps regression by @mvdan in 81f5a20
  • internal/core/adt: add tests for structure sharing by @mpvl in 3a90b84
  • internal/core/adt: catch nil parent by @mpvl in 8087ff7
  • cmd/cue: implement cue mod init --source by @rogpeppe in 2ff5afa
  • internal/core/adt: match decrement for nested comprehension arcs by @mpvl in edda26d
  • internal/core/adt: add Sharing option in CUE_DEBUG by @mpvl in d900867
  • cmd/cue: factor cue mod init source to its own file by @rogpeppe in 891a8a0
  • internal/cuedebug: usurp some evaluator debug flags by @mpvl in 4280d65
  • internal/cuedebug: define type for debug flags by @mpvl in 9c5c3c0
  • internal/core/adt: prepare to move DebugFlags to cuedebug by @mpvl in f2e17b1
  • internal/core/adt: move debug flags into struct by @mpvl in cb96718
  • internal/core/adt: weave OpContext to more operations by @mpvl in 7ada2dd
  • internal/filetypes: lazily load types.cue by @mvdan in 2cc7b65
  • internal/filetypes: discard unknown file extensions quickly by @mvdan in f891103
  • internal/filetypes: fill build.File.Filename in toFile in Go by @mvdan in 4da59d6
  • internal/filetypes: simplify some of the CUE logic by @mvdan in a21e2df
  • internal: remove MakeInstance by @mvdan in 25e8713
  • internal/filetypes: add test coverage for FromFile unifying forms by @mvdan in c16bac7
  • internal/filetypes: File.Default is indeed not unused by @mvdan in 7b2f27e
  • cue: add IsNull for Decode by @mvdan in 6169eed
  • cue/format: fix comments formatting in lists by @NoamTD in fdbd563
  • internal/filetypes: use cue.Value.LookupPath by @mvdan in f912da6
  • all: cue fmt by @mvdan in 058ab7c
  • internal/encoding: resolve all deprecation warnings by @mvdan in 6f8cbb0
  • cue/format: don't indent fields on same line as lbrace by @NoamTD in 0177234
  • cue/format: add test for incorrect formatting by @NoamTD in 9839112
  • cue/format: fix string literal replacement in labels by @NoamTD in 2d72477
  • internal/_e2e: actually add source field in e2e tests by @rogpeppe in 5ea4e50
  • internal/pkg: make CallCtxt.Decimal support *adt.Vertex by @NoamTD in 243df63...
Read more

v0.9.0-alpha.2

18 Apr 13:28
Compare
Choose a tag to compare
v0.9.0-alpha.2 Pre-release
Pre-release

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.

Full list of changes since v0.9.0-alpha.1
  • internal/cueversion: bump for v0.9.0-alpha.2 by @mvdan in f8d0998
  • internal/core/adt: fail earlier on incompatible types by @mpvl in 6728bb2
  • cue/testdata: add variants of issue1684 by @mpvl in 517f611
  • mod/modfile: add support for "source" field by @rogpeppe in 8d043e7
  • internal/core/adt: introduce structure sharing by @mpvl in 4c7fe24
  • internal/core/adt: hacky alternative for cyclicReferences by @mpvl in 80d681b
  • internal/core/adt: pre-evaluate pattern constraints by @mpvl in 25db081
  • internal/core/adt: finalize let value by @mpvl in 4abbb53
  • internal/core/adt: record stats for new evaluator by @mpvl in d323ba5
  • cue/testdata: add benchmark for billion laughs by @mpvl in 416eecf
  • cmd/cue/cmd: expose evalv3 experiment by @mpvl in d65019d
  • internal/core/adt: implement pattern matching for new evaluator by @mpvl in ca87216
  • internal/cueexperiment: enable CUE_EXPERIMENT=yamlv3decoder by default by @mvdan in f03aaa1
  • internal/envflag: add support for key-values and defaults by @mvdan in b92ad55
  • internal/encoding/yaml: add the new Decoder by @mvdan in 9fba4fa
  • internal/encoding/yaml: add even more test cases by @mvdan in b508b29
  • internal/core/adt: fix default handling by @mpvl in 5e896e0
  • internal/core/adt: fix task completion across disjunction boundaries by @mpvl in 8c6738a
  • internal/core/adt: fix closedness issue with pattern constraints by @mpvl in b944429
  • internal/core/adt: fix path in error messages by @mpvl in 4cb3889
  • internal/core/adt: patch old status mechanism by @mpvl in 709cdc5
  • tools/trim: update for new evaluator by @mpvl in 416c163
  • internal/core/adt: add methods for accessing Conjuncts by @mpvl in 4fcfdbf
  • internal/core/adt: remove unnecessary code by @mpvl in bc2672f
  • internal/core/adt: task is not always defined by @mpvl in 4a5ba90
  • internal/core/adt: initialize nodeContext in two phases by @mpvl in 149b248
  • internal/encoding/yaml: add more decoder tests by @mvdan in 21abb7f
  • internal/encoding/yaml: copy decode_test.go from internal/third_party/yaml by @mvdan in c8d4c3a
  • internal/core/adt: remove unnecessary code by @mpvl in 97daa8f
  • cue/load: make a note about importPkg redoing lots of work by @mvdan in a220cfb
  • cmd/cue: add global cpuprofile and memprofile flags by @mvdan in 7e061f5
  • cue/load: ensure load.Instances sorts instances deterministically by @NoamTD in f736827
  • internal/core/adt: add task deprecation by @mpvl in bb20494
  • internal/core/adt: set list type as soon as known by @mpvl in 1e01bd6
  • internal/core/adt: also check closedness for list in Equal by @mpvl in 30c5f27
  • internal/core/adt: match patterns only if type matches by @mpvl in 8e58091
  • pkg/list: make Sort work for new evaluator by @mpvl in 50989f0
  • internal/core/adt: guard visual debugger from opening too many tabs by @mpvl in 73611fd
  • internal/core/adt: keep arcTypes per closeContext by @mpvl in 03de5ae
  • internal/core/adt: forward cloned disjunct by @mpvl in e4aae72
  • cmd/cue: avoid calling os.Exit directly by @mvdan in f047aa0
  • internal/core/adt: compute kind differently for new evaluator by @mpvl in 87ad2e4
  • internal/core/adt: validate alignment of closeContext by @mpvl in fe85022
  • internal/ci: we no longer need to set CUE_LONG=true by @mvdan in 6e690fd
  • cmd/cue: make fmt process each file exactly once by @NoamTD in 943dd16
  • internal/core/adt: fixed closedness issue for embeddings in files ...
Read more

v0.8.1

03 Apr 08:34
Compare
Choose a tag to compare

This release includes a number of fixes detailed below:

CL 1186144 fixes a number of evaluator panics which could be triggered by calling the cue.Value.Expr method, which also happened when using the OpenAPI encoder.

CL 1173100 fixes cue get go panics which might occur when any Go packages are vendored or use imported alias declarations.

CL 1185281 fixes a regression introduced in v0.8.0 which led to some incorrect failures in tools/flow and cue cmd.

Full list of changes since v0.8.0

v0.9.0-alpha.1

21 Mar 11:04
Compare
Choose a tag to compare
v0.9.0-alpha.1 Pre-release
Pre-release

This release adds initial support for the CUE Central Registry (details below) and includes a number of fixes and improvements.

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 the CUE Central Registry at registry.cue.works. We have added a cue login command to log into the Central Registry via a GitHub account, and other commands know how to use these credentials when talking to the registry.

We will share more details about the Central Registry and support for other login mechanisms in the future. For now, we are looking to get early feedback.

To get started with the Central Registry, we have published a tutorial on working with modules and the central registry as well.

CL 1185280 adds cue help modules as a high-level overview of CUE modules as well.

Go API

CL 1185281 reverts a change in v0.8.0 to fix valid uses of tools/flow involving task inputs derived from the evaluation of other tasks.

CL 1185684 removes the last remaining bits of API which supported quoted identifiers, which had already been deprecated and largely unsupported for years.

cmd/cue

CL 1173100 fixes cue get go to avoid panics when dealing with vendored packages or any type aliases which refer to indirectly imported packages.

CL 1185356 tweaks cue/load so that cue fmt is able to format CUE files given directly as arguments even when they belong to different packages.

CL 1185473 deprecates the short-form cue somecmd in favor of cue cmd somecmd, as the former caused a number of bugs and slowness when working out which subcommand to execute.

Full list of changes since v0.8.0
  • internal/cueversion: bump fallbackVersion for v0.9.0-alpha.1 by @mvdan in 74fb5cf
  • cue/ast: remove ParseIdent and support for quoted identifiers by @mvdan in f8ec1f4
  • cue/ast/astutil: stop using the deprecated ast.ParseIdent by @mvdan in 35acbf4
  • cmd/cue: deprecate cue somecmd in favor of cue cmd somecmd by @mvdan in e8ecf23
  • internal/_e2e: rename CUE_LOGINS to CUE_TEST_LOGINS by @myitcv in ec655a5
  • cue/load: obey "all packages" mode when loading files by @mvdan in 623b6a8
  • cmd/cue: ignore errors on empty package directories in fmt by @mvdan in 7fcae93
  • Revert "tools/flow: check and return errors from task values" by @rogpeppe in ea385fd
  • cmd/cue: more modules help by @rogpeppe in cb121f5
  • cmd/cue: un-hide login command and update docs by @mvdan in 50ed912
  • internal/ci: do not trigger build of tip.cuelang.org by @myitcv in 4aaa2db
  • cmd/cue: find packages by canonical path in get go by @uhthomas in b648cf4
  • remove unneeded dockerignore file by @mvdan in 5489392
  • cmd/cue: various minor cleanups by @mvdan in c248f4e
  • cue: remove op type and op-token maps by @mvdan in 93b1a79
  • internal/cueversion: bump to v0.9.0-0.dev by @mvdan in a2d2085

v0.8.0

15 Mar 12:33
Compare
Choose a tag to compare

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.

Full list of changes since v0.7.1
  • internal/cueversion: bump fallbackVersion for v0.8.0 by @mvdan in 7d75741
  • cue/load: make packages specified as args work correctly by @rogpeppe in c399d88
  • internal/mod/modresolve: do not use regular field in registry config schema by @rogpeppe in d272140
  • update cuelabs.dev/oci/ociregistry to pull in fix for #2934 by @mvdan in 0e33883
  • cmd/cue: mod init should only add @v0 with the experiment by @mvdan in 24f93c9
  • cmd/cue: repurpose modinit test for language.version by @mvdan in 77741ff
  • cmd/cue: mention CUE_DEBUG in cue help environment by @rogpeppe in d5ecd6c
  • internal/mod/modresolve: fix stripPrefix for exact match by @rogpeppe in fa65317
  • internal/_e2e: remove cleanup.go and tools.go by @mvdan in ec6cc09
  • internal/e2e: join into the root Go module by @mvdan in 31e47e2
  • internal/e2e: test that we can't replace published versions by @mvdan in d1104bd
  • internal/e2e: stop creating GitHub repositories by @mvdan in ba698de
  • all: prevent tests from using the host's docker/config.json by @mvdan in d48dcbe
  • internal/cueversion: bump fallbackVersion for v0.8.0-rc.1 by @mvdan in ccb64b1
  • doc/tutorial: skip module.cue as a golden file to avoid churn by @mvdan in d97e914
  • cmd/cue: use CUE_VERSION_OVERRIDE in script tests to avoid churn by @mvdan in e529ce6
  • cmd/cue: fix "login" on a clean environment, and add tests by @mvdan in f6238e5
  • internal/cueversion: convert spaces to underscore in Go version by @rogpeppe in 0b7c434
  • cmd/cue,mod/modconfig: send Use...
Read more

v0.8.0-rc.1

13 Mar 10:18
Compare
Choose a tag to compare
v0.8.0-rc.1 Pre-release
Pre-release

This release includes a number of fixes and improvements for the experimental support for CUE modules first released in v0.8.0-alpha.1.

Modules

cue mod tidy gained a --check flag, which succeeds only if the module file contains exactly the required dependencies and also contains a canonical CUE language version.

cmd/cue and cue/load now send a detailed HTTP User-Agent string to CUE registries when sending HTTP requests, including the CUE and Go versions, rather than Go's default net/http user agent string.

cmd/cue now supports CUE_DEBUG=http to print HTTP logging information to stderr in JSON format.

Local builds of cmd/cue, such as running go install ./cmd/cue, now include a proper CUE version, allowing cue mod init and cue mod tidy to insert language.version as expected.

Full list of changes since v0.8.0-alpha.5
  • internal/cueversion: bump fallbackVersion for v0.8.0-rc.1 by @mvdan in ccb64b1
  • doc/tutorial: skip module.cue as a golden file to avoid churn by @mvdan in d97e914
  • cmd/cue: use CUE_VERSION_OVERRIDE in script tests to avoid churn by @mvdan in e529ce6
  • cmd/cue: fix "login" on a clean environment, and add tests by @mvdan in f6238e5
  • internal/cueversion: convert spaces to underscore in Go version by @rogpeppe in 0b7c434
  • cmd/cue,mod/modconfig: send User-Agent header by @rogpeppe in 6db0b7f
  • internal/cueversion: new package by @rogpeppe in 5dbbbcb
  • cmd/cue: enable HTTP logging for cue login by @rogpeppe in 9f556fe
  • cmd/cue: implement cue mod tidy --check by @rogpeppe in 9789ee6
  • internal/modload: implement tidiness checker by @rogpeppe in 405511d
  • mod/modfile: check canonical language version by @rogpeppe in 2e503e0
  • internal/mod/modload: split Tidy from UpdateVersions by @rogpeppe in 0a23647
  • bump ociregistry dependency to pull in a panic fix by @mvdan in 382ea51
  • cmd/cue: implement support for HTTP logging by @rogpeppe in 9c8b09a
  • internal/httplog: new package by @rogpeppe in 893798b
  • Revert "internal/e2e: partially revert using cue mod init modpath@version" by @mvdan in b1e40ae
  • cmd/cue: use fallbackVersion when built via a directory replace by @mvdan in e54fb85
  • cmd/cue: hard-code a fallback CUE semver version by @mvdan in fc7038a
  • update golang.org/x/... dependencies for v0.8.0 by @mvdan in 6afa3ef
  • internal/ci: update the pinned Go version for v0.8 by @mvdan in a1e8429
  • internal/cuedebug: new package by @rogpeppe in 6ad495d
  • cue/load: fix race in testing by @rogpeppe in ee26ee2
  • mod/modconfig: make http transport configurable by @rogpeppe in 0ef11fc
  • internal/core/adt: set nonRooted by @mpvl in 28ae97d
  • internal/core/debug: more state in formation by @mpvl in 2273c7d
  • internal/core/adt: make runner a struct instead of func by @mpvl in 0651453
  • internal/core/adt: fix conjunct index by @mpvl in 2554094
  • internal/core/adt: implement new evaluator by @mpvl in 5f55954
  • internal/core/adt: only error if inspected node missed counters by @mpvl in c547590
  • internal/core/adt: closedness improvements by @mpvl in b7f76be
  • internal/core/adt: add lifetime check for closedness by @mpvl in cdcb6fa
  • internal/core/adt: mark functions only used in old evaluator by @mpvl in f55405b
  • internal/core/adt: exclude tests with disjunctions by @mpvl in 145b436
  • internal/core/adt: propagate closedness up by @mpvl in 9d951f6
  • internal/core/adt: introduce visual CUE debugger by @mpvl in 37c0260

v0.8.0-alpha.5

05 Mar 16:06
Compare
Choose a tag to compare
v0.8.0-alpha.5 Pre-release
Pre-release

This release includes a number of fixes and improvements for the experimental support for CUE modules first released in v0.8.0-alpha.1.

Modules

A new cue mod get command is added, which can add a new module dependency, update an existing one, or downgrade an existing one as long as it does not cause any conflict.

The cue/load package has a new Config.Env struct field to provide the environment variables used to load CUE modules from registries.

A new cue help registryconfig documentation section has been added, explaining how $CUE_REGISTRY works as well as the configuration file schema it supports.

Full list of changes since v0.8.0-alpha.4

v0.8.0-alpha.4

29 Feb 15:53
Compare
Choose a tag to compare
v0.8.0-alpha.4 Pre-release
Pre-release

This release includes a number of fixes and improvements for the experimental support for CUE modules first released in v0.8.0-alpha.1.

Thank you to @kharf, @mvdan, @myitcv, @nickfiggins, and @rogpeppe for contributing to this release!

Modules

The cue/load package now supports loading CUE instances using the CUE Modules experiment, which was first added to cmd/cue in v0.8.0-alpha.1.

cue/load 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.

We have also added new Go examples to the cue/load package, including an example demonstrating the use of a CUE modules registry.

Other changes

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.

Full list of changes since v0.8.0-alpha.3

v0.8.0-alpha.3

21 Feb 13:17
Compare
Choose a tag to compare
v0.8.0-alpha.3 Pre-release
Pre-release

This release includes a number of fixes and improvements for the experimental support for CUE modules first released in v0.8.0-alpha.1.

Note that we skipped over v0.8.0-alpha.2 due to a minor release automation issue.

Modules

CUE_REGISTRY now supports a CUE configuration file in addition to the simple string form, which allows greater control over how to publish CUE modules as artifacts on OCI registries. This is useful when publishing to OCI registries which do not support arbitrary repository names, for example. This is not fully documented yet, but the schema for the file is available here and setting CUE_REGISTRY=file:path/to/file enables its use.

All cue subcommands should now support the modules experiment when it is enabled via CUE_EXPERIMENT=modules.

cue mod init now adds the language.version field as needed, to ensure that running cue mod tidy immediately after results in no changes.

CUE_MODCACHE has been replaced with CUE_CACHE_DIR, a parent directory to hold all cache files, much like how CUE_CONFIG_DIR already works for configuration files.

cue mod registry, a hidden command to start a local in-memory OCI registry for testing purposes, now treats repository tags as immutable to ensure published module versions cannot be modified. The "Working with a custom module registry" tutorial has been updated to use cue mod registry.

CUE Language Server Protocol Implementation

This release includes the first 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.

Subscribe to the LSP announce discussion, or join us in #cuepls on CUE Slack.

Full list of changes since v0.8.0-alpha.1

v0.8.0-alpha.1

13 Feb 10:10
Compare
Choose a tag to compare
v0.8.0-alpha.1 Pre-release
Pre-release

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.

Full list of changes since v0.7.1
  • README: briefly document that we support two Go versions by @mvdan in e69d893
  • cue/interpreter/wasm: rework the way we test Wasm by @4ad in 41b9e66
  • cue/interpreter/wasm: remove Wazero global state by @4ad in 6d68b3a
  • cue/interpreter/wasm: add support for Wasm functions that take and return structs by @4ad in 2ce1036
  • cue/interpreter/wasm: add support for arbitrary types in extern attributes by @4ad in c896078
  • internal/core/runtime: expand runtime.Compile signature to accomodate non-builtins by @4ad in 063b8c1
  • cmd/cue,pkg/tool/exec: rely on cue schema for exec.Run defaults by @nickfiggins in b460e71
  • cmd/cue: unhide mod tidy and mod publish by @myitcv in d37ea66
  • internal/ci: run the end-to-end tests with -race by @mvdan in a948eb5
  • cmd/cue: add testscript for registry auth via logins.json by @mvdan in 64c5656
  • cmd/cue: fix registry client race by @rogpeppe in 3d1c0cb
  • cmd/cue: add mod registry server command by @rogpeppe in 649c7f6
  • clarify that we require Go 1.21 or later now by @mvdan in bef7c4e
  • internal/ci: upgrade Go matrix include go1.22.0 by @myitcv in 63dbc2d
  • internal/ci: use node.js 20-compatible action versions by @myitcv in 15a4b3e
  • README: simplify "install from source" instructions by @mvdan in 5037afc
  • README: add Docker badge and instructions by @mvdan in b6a6f67
  • bump cuelabs.dev/go/oci/ociregistry dependency by @mvdan in 0eb0106
  • cmd/cue: simplify exec trimming in TestX by @nnnkkk7 in eafeb11
  • pkg/path: fix package comment by @jpluscplusm in 4818cf7
  • cue/load: allow conversion of module-local paths to OS paths by @rogpeppe in 20451a6
  • cmd/cue: add test for self import in modules mode by @rogpeppe in 707c6d7
  • internal/e2e: switch all tests to cue mod publish by @mvdan in 2930a8e
  • README: remove obsolete mention of Google by @jpluscplusm in 64a117c
  • cue/load: make the tests less noisy by @mvdan in 079532c
  • cue/load: use fewer absolute paths in tests by @mvdan in a25c24b
  • cue/parser: make the example self-contained by @mvdan in fc77363
  • internal/mod/modload: fix panic on error in tidy by @rogpeppe in 3146f22
  • internal/mod: fix tidy in the presence of local code by @rogpeppe in 2a56875
  • cmd/cue: make the config directory configurable by @mvdan in 22b1ca3
  • internal/e2e: start using cue mod tidy by @mvdan in 34db9eb
  • cmd/cue: add version to module.cue file by @rogpeppe in 9ceec10
  • cue/load: fix crash when there is no module file by @rogpeppe in ec7ca0a
  • internal/e2e: start using cue mod init modpath@version by @mvdan in 7855e15
  • cue/token: deprecate base offset by @rogpeppe in b0358a6
  • cmd/cue/cmd: support major versions in module path by @rogpeppe in e8efa7e
  • internal/mod/modload: support adding language version by @rogpeppe in 2120803
  • internal/mod/modpkgload: support gen directories by @rogpeppe in c6e4adf
  • internal/e2e: tweak expected error string after the cue/load changes by @mvdan in b67300b
  • cue/load: use modpkgload to resolve dependencies by @rogpeppe in fa12218
  • cmd/cue/cmd: add (failing) submodule test by @RogP...
Read more