Releases: cue-lang/cue
v0.10.0-alpha.3
This release includes fixes to the evaluator and APIs as well as initial support for the TOML encoding.
Evaluator
CL 1198356 fixes a panic in the new evaluator relating to the new mechanism for tracking closedness information.
CL 1198566 fixes a performance regression introduced in CUE v0.6 where cue cmd
and tools/flow
became many times slower on some inputs.
CL 1198350 ensures that all interpreter errors, such as those from @embed
attributes, include position information.
Encodings
Initial support for TOML is included in this release, including support in cmd/cue
and an experimental Go package. See the issue tracker for remaining work in this space.
Builtins
CL 1198636 tweaks the existing path.Match
and tool/file.Glob
builtins to reject **
wildcard patterns as unsupported, to avoid confusion and allow future changes to their behavior. Note that this change may break uses of **
patterns, which behaved like *
.
Go API
CL 1198555 adds a cue/load.Config.SkipImports
option to avoid loading instances from import statements. This particularly helps cue fmt
, where the loading caused unwanted slowness and unnecessary errors.
CL 1198686 fixes cue/load
so that it no longer produces extra invalid packages when Config.Package
was set to *
and nested packages were loaded.
CL 1198351 fixes a bug in astutil.Sanitize
where unused imports were not being fully removed from ast.File
, causing errors in cue trim
where all uses of an import were removed.
CL 1198494 speeds up the Path
method on wrapped errors, which causes noticeable speed-ups in some edge cases.
Full list of changes since v0.10.0-alpha.2
- cue/interpreter/embed: forbid
**
via pkg/path.Match by @mvdan in 187fb1a - pkg: forbid
**
in path.Match and tool/file.Glob by @mvdan in 987a85e - pkg: add test cases for ** in file patterns or globs by @mvdan in 25bb3d4
- cue/load: do not create packages unnecessarily for files outside package directory by @rogpeppe in a4abb05
- cue/load: add test case for issue 3306 by @rogpeppe in f472fd2
- cue/load: implement SkipImports mode by @rogpeppe in 88306e2
- all: make use of the new slices.Clone and cmp.Or Go 1.22 APIs by @mvdan in 55d1cb1
- internal/core/adt: use a named vertexStatus constant rather than 0 by @mvdan in 862fcf1
- cmd/cue: hook up encoding/toml for import and export by @mvdan in 9b91188
- encoding/toml: add first implementation of an encoder by @mvdan in 54f2cce
- internal/core/dep: use a new visitor.marked map when recursing by @mvdan in 34739e9
- tools/flow: add test case for issue 2559 by @mvdan in 51bf6f2
- tools/flow: add to task stats in the first initTasks call by @mvdan in bc41b25
- internal/core/runtime: do not hide positions in interpreter errors by @rogpeppe in f7b7aaf
- cmd/cue: add test case for embedded file error by @rogpeppe in bfcfff3
- internal/cuetxtar: Correct nesting of tests by @cuematthew in dc199f5
- internal/cuetxtar: Be noisier if DebugArchive is faulty by @cuematthew in b77c599
- internal/core/walk: Clarify Visitor.Before documentation by @cuematthew in aa8e810
- cmd/cue: do not initialize cmd.Command twice in
cue cmd
by @mvdan in 3f84ba6 - cmd/cue: test that
cue cmd --cpuprofile
works by @mvdan in 17b3e52 - cue/errors: make wrapped.Path faster by bypassing unnecessary reflection by @mxey in e68bd63
- all: start using Go 1.22's loop var scoping and reflect.TypeFor by @mvdan in 055405a
- internal/core/adt: do not require closeContext.group to be non-nil by @cuematthew in c8f3cad
- cmd/cue: point "help get" text at CUE-specific cmd by @jpluscplusm in 5de5b42
- cue/ast/astutil: update ast.File.Imports properly in Sanitize by @mvdan in 8145bdd
v0.10.0-alpha.2
This release includes many fixes and enhancements, particularly for modules. It also starts requiring Go 1.22 or later, as Go 1.23.0 will be released very soon.
Modules
The cue help
documentation for modules and inputs has been expanded, and a number of error messages when using or publishing modules are now more helpful.
A new concept guide on CUE language versions documents the language.version
field in cue.mod/module.cue
files.
CL 1198249 adds support for an @ignore
file attribute to unconditionally ignore a file when loading packages or calculating dependencies.
CL 1198003 teaches the CUE loader to support symbolic links when loading from local directories, matching the behavior before CUE_EXPERIMENT=modules
was introduced.
CL 1198143 tweaks cue mod init
without an argument to create a module with the module path cue.example
rather than an empty path that made the module file invalid.
Go API
CL 1198157 fixes cue/parser
to accept keywords as valid selectors, aligning with the language specification.
Full list of changes since v0.10.0-alpha.1
- cmd/cue: add tests for symbolic links by @rogpeppe in 23fc4b1
- internal/buildattr: implement
@ignore
attributes by @rogpeppe in e00557b - cmd/cue,internal/buildattr: add tests for
@ignore
tags by @rogpeppe in d502843 - internal/ci: ensure internal/_e2e isn't broken in CI by @mvdan in 00879f0
- internal/ci: ensure commit messages do not @-mention users by @mvdan in cf6641c
- cue: add a regression test for a default elimination bug fixed in evalv3 by @myitcv in 97eeee4
- internal/ci: copy how internal/vcs sets a clean env for git tests by @mvdan in 9025f67
- internal/_e2e: remove unused import by @mvdan in 6a9997f
- cue/cmd: ensure flags are added if they are used by @cuematthew in 657d5ec
- internal/ci/checks: rewrite from bash to Go by @mvdan in 32013a7
- internal/ci: move commit check script to a separate file with tests by @mvdan in daf98a0
- all: make use of some more Go 1.22 std APIs by @mvdan in af83dad
- drop go1.21, start testing on go1.23rc2 by @mvdan in 1aaf802
- cmd/cue: use default module name for cue mod init by @rogpeppe in b3c12b3
- mod/module: improve error messages for bad module path by @rogpeppe in 3e9d805
- cmd/cue: add tests for module path errors by @rogpeppe in f7e48bb
- cmd/cue: add a reference to the Central Registry from
cue help modules
by @rogpeppe in 8986233 - cmd/cue: add information about import paths to
cue help inputs
by @rogpeppe in e9bc377 - cue/parser: accept keywords as selector by @haoqixu in 682ff0e
- all: replace internal/txtarfs with txtar.FS by @mvdan in e2054df
- internal/vcs: show stderr when git exits with an error by @mvdan in d0724a0
- internal/mod/modimports: remove duplicate test txtar file entry by @mvdan in 243da87
- cue/literal: use strconv.IsGraphic by @mvdan in acdd41f
- cue/load: avoid one stat call when loading a valid module by @mvdan in efdb072
- cue/load: add test coverage for loading a legacy cue.mod file by @mvdan in 28c6219
- internal/mod/modpkgload: symbolic links can be valid CUE files too by @rogpeppe in f5b905c
- internal/mod/modpkgload: propagate CUE syntax error by @rogpeppe in a36cc32
- cmd/cue: fix panic on bad syntax by @rogpeppe in af808c3
- cmd/cue: better error message for mismatched publish version by @rogpeppe in b513fc2
- cmd/cue: improve error message for malformed module path by @rogpeppe in 9a88d06
- README: point to cuelang.org for install docs by @jpluscplusm in f2066e3
- internal: remove some deprecated type/method usages by @cuematthew in e1f552f
- cue: use Value.Err in examples using Compile APIs by @mvdan in 719893f
v0.10.0-alpha.1
This release includes initial support for the embed proposal, multiple fixes for the new modules support, as well as many other fixes and enhancements.
Evaluator
CLs 1195897 and 1196094 fix two crashes with CUE_EXPERIMENT=evalv3
as reported by users.
Embed proposal
With CUE_EXPERIMENT=embed
, CUE now supports the embedding of non-CUE files within a CUE package. See the embed proposal and its design document for details, as well as the new how-to guide for the feature.
Modules
CL 1197530 fixes the behavior of build tags, and also adds support for parentheses in build tag expressions.
CL 1197531 implements better caching when evaluating dependencies, which should speed up evaluation of modules that use multi-directory packages.
Go API
CL 1196721 disallows importing or loading packages with an underscore qualifier like foo.com/bar:_
, as it was never intended behavior. Users should use the new embed proposal instead.
CL 1196820 adds a cue.LanguageVersion
function to obtain the current version of the language spec that the Go module implements.
CL 1197160 implements considered support for build tags in modules. Build tags are considered false when outside the main module.
Encodings
CL 1195628 ensures that cue/format
prints a newline after every comment.
CL 1195884 teaches cue/format
to preserve comments associated with ...
ellipsis expressions.
CL 538624 fixes a bug where cue/format
would start a CUE file with white space if it began with a clause.
CL 1196134 fixes a bug where a comment at the start of a CUE file would sometimes be indented.
CL 1196135 fixes a bug where index or selector expressions could cause extra tab indentation.
CL 1196291 tweaks the YAML decoder so that comments following a field are attached to the entire field.
CL 1196332 tweaks the JSONL (newline-delimited JSON) so that line numbers aren't reset with each new JSON value.
CL 1196436 tweaks the textproto decoder to correctly handle required and optional fields.
Builtins
CL 1196212 adds a list.Reverse
function to reverse the elements of a list.
CL 1197452 tweaks tool/exec.Run
so that its errors are unambiguous when any command arguments contain white space.
cmd/cue
CL 1196822 adds a --language-version
flag for cue mod init
and cue mod edit
to set the language.version
value.
CL 1197185 teaches cue mod resolve
to work on the current module when no arguments are given.
CL 1196370 teaches cue mod registry
to gracefully shut down when interrupted.
Full list of changes since v0.9.0
- mod/module: allow versionless module path in CheckPath by @rogpeppe in 3a379b7
- cmd/cue: add test case for issue 3262 by @rogpeppe in 56d6987
- mod/modload: ignore _test.cue files in dependencies by @rogpeppe in 7793367
- cmd/cue: fix link in embed help text by @rogpeppe in 77ac696
- mod/modfile: use fixed language version for Fix by @rogpeppe in 6f2bfb4
- cue/load: implement shared syntax cache by @rogpeppe in fc16ef8
- cue/load: move syntax cache into fileSystem by @rogpeppe in afa222f
- cue/load: use constructor for fileSystem by @rogpeppe in f787af8
- internal/buildattr: stop at package clause and support parentheses by @rogpeppe in 5cbddef
- internal/buildattr: add tests by @rogpeppe in 1bb894b
- cue/load: CUE files only contain a single
*ast.File
by @rogpeppe in 75d4005 - cue/load: move towards unified syntax cache by @rogpeppe in 14deefa
- cue/load: remove import comment parsing by @rogpeppe in b03789f
- cue/load: clean up allTags by @rogpeppe in 59fe2e4
- interpreter/wasm,internal/filetypes: fix wasm awkwardness by @rogpeppe in d5d4815
- cue/load: cache file names only by @rogpeppe in 4a8f673
- internal/filetypes: speed up common case by @rogpeppe in fed43b0
- cmd/cue: handle signals and perform a graceful shutdown for mod registry by @haoqixu in 27adbac
- bump go-internal to get the latest testscript fixes by @mvdan in 695fefc
- cue/interpreter/embed: don't allow hidden files in glob by @mpvl in 8bedc2b
- pkg/tool/exec: document how Run.cmd works with string versus list by @mvdan in 7e1f140
- update Go dependencies for the upcoming alpha by @mvdan in f6be8a8
- internal/ci: bump Go and goreleaser versions for the upcoming alpha by @mvdan in 16c45d3
- core/adt: simplify duplicate NumKind and NumberKind consts by @cuematthew in 304530f
- pkg/tool/exec: show command arguments in errors as a Go slice by @mvdan in 38269ec
- cmd/cue: test tool/exec.Run with arguments involving spaces by @mvdan in 5903ec8
- core/adt: rename CompositKind to CompositeKind by @cuematthew in 95802d3
- cmd/cue: add a forwards compatibility test case for bugfix releases by @mvdan in 2a96988
- cue/interpreter/embed: respect module boundaries by @rogpeppe in 6056916
- README: link to Slack and Discord via cuelang.org by @jpluscplusm in ddfe8eb
- cue/interpreter/embed: require type if glob extension not specified by @myitcv in 2c8ee2f
- cue/interpreter/embed: fix handling of dir matching glob by @myitcv in 970d10f
- cmd/cue: do not allow embedding of CUE file types (for now) by @myitcv in a0f2cac
- cmd/cue: add test case for embedding of CUE file type files by @myitcv in 868c110
- cmd/cue: provide initial text for 'help embed' by @myitcv in 5c8be53
- cmd/cue: document CUE_EXPERIMENT=embed by @myitcv in e460eb0
- tools/trim: convert inline tests to txtar by @cuematthew in 8079151
- doc/ref/impl: fix order of arguments in δ partial feature function by @cuematthew in 4eecacd
- cmd/cue: make mod resolve work with no args by @rogpeppe in dbe24df
- cue/load: better treatment for build tags with respect to modules by @rogpeppe in 79c1739
- internal/buildattr: factor out from cue/load by @rogpeppe in 7ca3925
- internal/ci: remove debug logging of commit message by @myitcv in f1f0963
- cmd/cue: implement --language-version flag for cue mod edit and init by @rogpeppe in e9b2c29
- mod/modfile: deprecate LatestKnownSchemaVersion by @rogpeppe in 71eb3be
- cue: add LanguageVersion by @rogpeppe in a9009e8
- cue/interpreter/embed: add support for embedding by @mpvl in 6594f45
- cue/ast,spec: document that
package _
is equivalent to missing package by @rogpeppe in c7f9334 - disallow explicit underscore import path qualifiers by @rogpeppe in 1c381a0
- cue/load: do not consider anonymous packages when checking package qualifier by @rogpeppe in 5ab2d73
- cmd/cue,cue/load: add tests for underscore packages by @rogpeppe in 9295a20
- internal/core/runtime: new attribute name for extern by @mpvl in b70e543
- internal/filetypes: split ParseFile by @mpvl in a1c1cd7
- pkg/list: add Reverse function by @NoamTD in f42327c
- cue/load: clarify the docs for Config.ModuleRoot by @mvdan in a94d22f
- README: simplify a bit, add new website links, add Discord invite by @mvdan in fecf80d
- encoding/protobuf/textproto: correctly decode required/optional fields by @haoqixu in dec1786
- encoding/json: fix position for jsonl by @haoqixu in 16c15d1
- remove navbar.md and its supporting logo by @mvdan in 0d69846...
v0.9.2
This release includes a fix for a regression around CUE files without a package name, and updates the compiled-in language version to match the actual tagged version v0.9.2.
CL 1196785 fixes the cue/load
logic to correctly take CUE files with out a package name into account (issue #3244).
Full list of changes since d8742c1
v0.9.1
This release includes a few fixes, mainly relating to CUE_EXPERIMENT=modules
being enabled by default in v0.9.0.
Modules
CLs 1196176 and 1196180 allow using and developing a module whose cue.mod/module.cue
lacks a major version suffix like @v0
, as adding one may break older CUE versions without CUE_EXPERIMENT=modules
.
CL 1196156 adds a cue/load.Config.AcceptLegacyModules
option to allow loading CUE modules without a language.version
field, given that the field was only introduced in v0.8.0.
CL 1196178 fixes a regression where loading a package with the cue/load.Config.Package
option set was no longer working as expected.
As a reminder, we are maintaining an FAQ page which should help modules users with the upgrade to v0.9.
Builtins
CL 1195888 fixes the path.Match
API so that it can actually take the three parameters it expects.
v0.9.0
This release includes major changes to Modules and the Evaluator, as well as many other fixes and improvements. A special thanks to Noam Dolovich for numerous contributions to this release!
Modules
Following the Modules proposal v3 being accepted, the modules experiment is now enabled by default in this release. It should no longer be necessary to set CUE_EXPERIMENT=modules
, and CUE_EXPERIMENT=modules=0
can be used to disable the experiment. We are not aware of any significant regressions, so please file a bug if you find one.
We have published an FAQ page which should help modules users with the upgrade to v0.9. We will add to this page over the coming weeks to ease the transition into the "new" modules mode.
This release also includes experimental support for the CUE Central Registry at https://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.
To get started with the Central Registry, we have published a tutorial on working with modules and the central registry as well. 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.
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. Use the new cue mod fix
command to add the field.
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.
cue mod publish
now includes VCS metadata in published module versions, as described in Proposal 3057.
The cue mod fix
command is added, which allows fixing up old cue.mod/module.cue
files; see cue help mod fix
.
The cue mod edit
command is added, which allows some automatic editing of cue.mod/module.cue
from the command line; see cue help mod edit
.
CL 1193289 teaches $CUE_REGISTRY
about a special none
registry, causing any matching modules to refuse to fetch or resolve.
CL 1195546 teaches cue mod publish
to include a LICENSE
file from the VCS repository root if the CUE module subdirectory has none.
CL 1194090 adds the --dryrun
, --json
, and --out
flags to cue mod publish
to inspect what would be published as part of a module version.
CL 1194106 adds the cue mod resolve
command to show how a module path resolves to a registry in the form of an OCI reference.
CL 1185280 adds cue help modules
as a high-level overview of CUE modules.
CL 1194669 restricts the parsing of cue.mod/module.cue
files to data-only mode, forbidding any references or comprehensions which may break cue mod
commands or cause other issues.
As a reminder, the ongoing and planned work can be seen in the Modules Roadmap.
Evaluator
The new evaluator can now be enabled in the command line via CUE_EXPERIMENT=evalv3
, and in the Go API via cuecontext.EvaluatorVersion(cuecontext.EvalV3)
. The new evaluator already includes a new disjunction algorithm as well as initial structure sharing support; note that structure sharing can be disabled with CUE_DEBUG=sharing=false
.
The work is not yet complete, and some known bugs remain, but over 95% of the existing tests are passing and the performance already looks promising. Work on this new evaluator will continue during the next release cycle. We will only turn on the new evaluator by default once we are reasonably confident that there are no significant regressions.
CL 1185458 ensures we detect permanent errors for undefined fields earlier, necessary for the permanent errors fix in tools/flow
below.
Subscribe to the Performance umbrella issue for updates, and see the Evaluator Roadmap project for the planned work ahead.
Encodings
The Encodings project was kicked off at a recent CUE Community Update call. As part of this, we now have an #encodings
channel on Slack and Discord, 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.
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 cmd/cue
as well as cue/load
when loading 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.
CL 1195047 fixes the decoding of YAML 1.1 octal numbers so that they no longer result in invalid CUE literals.
cmd/cue
CL 1189314 adds a cue fmt --check
flag to list badly formatted files rather than modifying them directly.
CL 1193778 adds a cue fmt --diff
flag which displays diffs instead of updating files.
CL 1193962 adds a cue fmt --files
flag to interpret the arguments as file paths to walk and recursively format rather than package patterns.
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.
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 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.
CL 1193934 improves cue fmt
so that it does not write to files on disk which are already well formatted.
CL 1194247 tweaks cue help
so that it correctly fails when given unknown help topics or commands.
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.
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 1191227 adds a cue/token.File.Lines
getter method, much like go/token.File.Lines
was added in Go 1.21.
CL 1193030 ensures that cue/load.Instances
always returns instances in a deterministic order, in particular when multiple instances share the same directory.
CL 1194421 fixes a memory leak where using load.Instances
to load CUE modules would increase the size of a global cue.Context
until the process was terminated.
CL 1187452 teaches tools/flow
to fail when a task encounters a permanent error, which were being ignored before.
CL 1191226 teaches cue/literal.ParseNum
to support both positive and negative signs for consistency.
CL 1194410 fixes cue/load
so that it errors on empty string arguments once again.
CL 1193515 fixes an edge case where cue/format
would vertically align fields at different struct levels.
CL 1193585 fixes a bug where cue/format
would print trailing commas for list elements after any inline comments, causing broken syntax.
CL 1193759 teaches cue/format
to collapse empty lists and structs to a si...
v0.9.0-rc.1
This release includes a number of fixes for issues spotted in the modules experiment now enabled by default as well as a few other fixes.
Modules
A number of changes such as CL 1195195 were made to fix a regression where CUE_EXPERIMENT=modules
, now on by default since v0.9.0-alpha.5
, would load every CUE package in the entire module even when only loading a single package.
CL 1195518 tweaks the structure of the module cache to be more consistent and self-explanatory.
CL 1195514 tweaks cue mod publish
so that OCI reference digests are not printed by default, as they are often non-deterministic due to VCS information.
CL 1195530 fixed a regression where importing packages with an unnecessary package name qualifier would always result in an error.
Encodings
CL 1195047 fixes the decoding of YAML 1.1 octal numbers so that they no longer result in invalid CUE literals.
v0.9.0-alpha.5
This release includes changes to the evaluator and modules experiments, as well as a number of other improvements and fixes.
Evaluator
Following the introduction of the new evaluator experiment in v0.8.0-alpha.2 via CUE_EXPERIMENT=evalv3
, this release includes support enabling the new evaluator via the Go API, as well as a number of fixes to known bugs in the new evaluator. More details can be found in the latest performance update posted by Marcel this week.
Subscribe to the Performance umbrella issue for future updates, and see the Evaluator Roadmap project for the planned work ahead.
Modules
Following the Modules proposal v3 being accepted, the modules experiment is now enabled by default in this release; see CL 1194664. It should no longer be necessary to set CUE_EXPERIMENT=modules
, and CUE_EXPERIMENT=modules=0
can be used to disable the experiment. We are not aware of any regressions, so please file a bug if you find one.
CL 1194780 adds a cue mod fix
command to fix up old cue.mod/module.cue
files; see cue help mod fix
.
CL 1194669 restricts the parsing of cue.mod/module.cue
files to data-only mode, forbidding any references or comprehensions which may break cue mod
commands or cause other issues.
CL 1194494 tweaks cue mod publish
so that uncommitted VCS changes outside of the module directory no longer cause a "VCS state is not clean" error.
CL 1194495 teaches our modules registry client to treat all HTTP 404 errors as "not found" to improve compatibility with some registries which seem to return invalid error codes.
As a reminder, the ongoing and planned work can be seen in the Modules Roadmap, and we continue to hold regular Modules feedback sessions.
Go API
CL 1194421 fixes a memory leak where using load.Instances
to load CUE modules would increase the size of a global cue.Context
until the process was terminated.
CL 1194410 fixes cue/load
so that it errors on empty string arguments once again.
Builtins
CL 1194165 fixes invalid builtin calls so that they correctly result in a "bottom" error.
CL 1194515 fixes structs.MinFields
and structs.MaxFields
to ignore optional fields, matching the documented behavior.
cmd/cue
CL 1193962 adds a cue fmt --files
flag to interpret the arguments as file paths to walk and recursively format rather than package patterns.
CL 1194247 tweaks cue help
so that it correctly fails when given unknown help topics or commands.
Full list of changes since v0.9.0-alpha.4
- internal/registrytest: satisfy staticcheck and gopls by @mvdan in 05453ff
- cmd/cue: add a regression test for issue 2704 by @mvdan in 46feda5
- internal/filetypes: remove unused test.cue file by @mvdan in c3dc2f2
- cmd/cue: ensure that fmt works outside a module with files too by @mvdan in 11cbcd3
- encoding/gocode/gocodec: remove cue.Runtime usages by @NoamTD in 078020b
- encoding/toml: add support for inline tables by @mvdan in 27a0190
- cue: add another test for a disjunction bug fixed in evalv3 by @mvdan in 3588e1a
- all: various very small cleanups from gopls and staticcheck by @mvdan in 96f16f0
- cue/load: treat all absDirFromImportPath errors as PackageErrors by @rogpeppe in fa64c62
- internal/cueexperiment: flip modules experiment flag default by @rogpeppe in 1ad8c52
- cue/load: set the absolute file name when setting source by @rogpeppe in 4a27795
- encoding/protobuf: cope with major version suffixes in module paths by @rogpeppe in b57a20a
- cue/load: do not scan imports of non-CUE files by @rogpeppe in ac35a40
- cue/load: add major version suffix to module path in testdata by @rogpeppe in f513a17
- cue/load: more correct treatment of module paths with major versions by @rogpeppe in 0b70e5b
- cmd/cue: add mod fix command by @rogpeppe in 4575558
- mod/modfile: add FixLegacy function by @rogpeppe in 1dee146
- cue/load: better treatment of files specified on the command line by @rogpeppe in 1591fd8
- cue/load: factor out syntax cache by @rogpeppe in ef3c0c5
- cue/load: remove directory argument from addFiles by @rogpeppe in 6804717
- cue/load: avoid "user:" and "instance:" error prefixes by @rogpeppe in 612837a
- cue/load: prepare for files package refactor by @rogpeppe in e888508
- mod/modfile: accept language versions after v0.8.0-alpha.0 by @rogpeppe in 443106f
- mod/modfile: add custom data field by @rogpeppe in a8693a0
- mod/modfile: parse module.cue in data-only mode by @rogpeppe in 21a5c8b
- encoding/openapi: link to correct upstream doc by @jpluscplusm in a861376
- encoding/toml: check parser errors and reject duplicate keys by @mvdan in eacde77
- encoding/gocode: remove unused test.cue file by @mvdan in abd5778
- encoding/toml: validate the resulting value against toml.Unmarshal by @mvdan in adf84fd
- cue/scanner: remove go-fuzz testing code and data by @mvdan in 5472c4b
- internal/cmd/cue-ast-print: do not panic on invalid values by @mvdan in c789d3e
- cue/literal: use Label for labels consistently by @mvdan in 97695d0
- cmd/cue: move Dockerfile to the main package directory by @mvdan in e801994
- cue/parser: switch from go-fuzz to native fuzzing by @mvdan in 43da0b0
- internal/ci: bump goreleaser and Go ahead of the next release by @mvdan in 7248da6
- internal/core/export: allow exporting snippets by @mpvl in e775398
- internal/pkg: make Len ignore optional fields by @NoamTD in afe322d
- all: remove last usages of ast.Node.{Comments,AddComment} by @NoamTD in 4ae7530
- cue: add regression test for a disjunction fix in evalv3 by @mvdan in b3006ad
- internal: remove some deprecated type/method usages by @NoamTD in 84fe1b9
- cuego: remove deprecated cue.Instance usage by @NoamTD in 1dcd350
- all: add language.version to module.cue files by @rogpeppe in 690add3
- cmd/cue: repurpose exitOnErr into printError by @mvdan in e9bf33c
- mod/module: add qualifier in ImportPath when necessary by @rogpeppe in 64baa18
- internal/core/adt: fix attribute processing by @mpvl in 185426f
- internal/core/export: fix dereferencing bug by @mpvl in efd38e6
- internal/cuetxtar: allow inline archives by @mpvl in 645d586
- internal/core/export: update error todos by @mpvl in 22b8c74
- cmd/cue: add cue fmt --files mode by @NoamTD in 336a991
- internal/core/export: fix test by @mpvl in 07d485c
- tools/flow: enable matrix tests by @mpvl in 5f8930a
- internal: replace and remove PackageInfo by @NoamTD in a49ee92
- internal/filetypes: remove deprecated API usage by @NoamTD in 9a0cae9
- cue/ast/astutil: remove deprecated API usage by @NoamTD in 64bbf1b
- doc/ref: the subsumption relation for fields was backwards by @mvdan in b83ae37
- cmd/cue: replace most fatal exitOnErr calls with error returns by @mvdan in 6c5f6e7
- internal/ci: upgrade GH actions JSON Schema by @myitcv in a246bdd
- pkg/encoding: add test cases for {json,yaml}.Validate by @NoamTD in 00a747c
- mod/modregistry: treat all 404 errors as not-found by @rogpeppe in bf75699
- pkg/struct: add tests for MinLength and MaxLength by @NoamTD in a169ae2
- encoding/toml: first decoder implementation by @mvdan in a35caed
- cmd/cue: ...
v0.9.0-alpha.4
This release includes changes to the evaluator and modules experiments, as well as a number of other improvements and fixes.
Evaluator
Following the introduction of the new evaluator experiment in v0.8.0-alpha.2 via CUE_EXPERIMENT=evalv3
, this release includes a number of fixes to known bugs in the new evaluator, as well as significant work towards supporting the new evaluator experiment via the Go API and not just cmd/cue
.
Subscribe to the Performance umbrella issue for updates, and see the Evaluator Roadmap project for the planned work ahead.
Modules
CL 1194090 adds the --dryrun
, --json
, and --out
flags to cue mod publish
to inspect what would be published as part of a module version.
CL 1194106 adds the cue mod resolve
command to show how a module path resolves to a registry in the form of an OCI reference.
As a reminder, the ongoing and planned work can be seen in the Modules Roadmap, and we continue to hold regular Modules feedback sessions.
Go API
CL 1193759 teaches cue/format
to collapse empty lists and structs to a single line for consistent formatting.
Builtins
CL 1193690 fixes math.MultipleOf
as it had an incorrect implementation which could easily return bad results.
cmd/cue
CL 1193778 adds a cue fmt --diff
flag which displays diffs instead of updating files.
CL 1193934 improves cue fmt
so that it does not write to files on disk which are already well formatted.
Full list of changes since v0.9.0-alpha.3
- cue: add regression test for issue 3042 by @mvdan in 612f1ae
- cue: remove TODO for TestExpr by @mpvl in 21b0039
- internal/core/adt: delay dereferencing in lookup by @mpvl in 7dd29f1
- internal/core/export: handle ConjunctGroups by @mpvl in 8935df9
- cue: exempt test for DisallowCycle by @mpvl in 1259cf9
- cue: fix some matrix tests by @mpvl in d3ed229
- internal/core/adt: disable dereference for new evaluator by @mpvl in aa42655
- internal/core/adt: move and rename Indirect by @mpvl in 759f26e
- cmd/cue: fail cue fmt if arg import path doesn't exist by @NoamTD in d9c5ae0
- cmd/cue: document -ldflags for local release builds by @mvdan in f9c2de9
- all: remove some unused code and other minor cleanups by @mvdan in 6132343
- cmd/cue: new "mod resolve" command by @rogpeppe in 59a0d3c
- internal/core/adt: fix missing dereference for equal by @mpvl in bc3e24c
- cue: fix Allows for new evaluator by @mpvl in 6e48c0d
- cmd/cue: add dry run flag to cue mod publish by @rogpeppe in 82bcda5
- internal/core/adt: fix missing field error message by @mpvl in b6a2637
- cue: ignore some tests for TestPos by @mpvl in 71220e6
- cue: set DynamicLabel by @mpvl in fa3bf5f
- cue/ast: move WalkVisitor and Visitor to astutil and unexport them by @mvdan in 05640c2
- cue/ast: don't walk comments twice by @mvdan in fd64550
- cue/ast: implement Visitor walking in terms of func walking by @mvdan in 30f7d28
- internal/cueversion: construct pseudoversion when possible by @rogpeppe in caa1e98
- internal/cueversion: split language and module versions by @rogpeppe in 2f90f54
- ast/astutil: use more generics to reduce duplication by @mvdan in d696e44
- cue/ast: add WalkVisitor to share with cue/ast/astutil by @mvdan in bf733fb
- internal/core/adt: fix matchPattern by @mpvl in 72ba528
- cue: fix IsClosed for new evaluator by @mpvl in 9cf30f1
- cue: fix default handling for new evaluator by @mpvl in 4a8a873
- cue/ast/astutil: remove quoted identifiers remnant by @mvdan in b3f170a
- internal/core/adt: do not dereference for newChildValue by @mpvl in adea575
- internal/core/adt: dereference default by @mpvl in 14e1ef2
- internal/core/debug: omit ConjunctGroups in compact mode by @mpvl in c6701b4
- internal/core/adt: enable matrix testing by @mpvl in 8b6705c
- cue: allow a tests to run with a variety of options by @mpvl in 548dd7c
- mod/modfile: better error message when disallowed field is used by @rogpeppe in fdf75f5
- cue/cmd: always write stdin to stdout in cue fmt by @NoamTD in 70cc402
- cue: change getInstance to getValue by @mpvl in ebcf2f5
- internal/core/adt: avoid loops in debug printing by @mpvl in bae8bbf
- internal/core/adt: clean up indirects and mark disjuncts by @mpvl in 831374c
- internal/core/adt: avoid hang with let processing by @mpvl in 382e4be
- internal/core/adt: introduce new cycle detection mechanism by @mpvl in fb37710
- cue/token: relative positions apply before, not after, a token by @mvdan in 1dda583
- cue/cmd: avoid overwriting formatted files in cue fmt by @NoamTD in fb9961a
- cmd/cue: add cue fmt --diff flag by @NoamTD in fcae10b
- cmd/cue: use fmt --check in the fmt_multi testscript by @mvdan in 68cd040
- cmd/cue: improve stdin input handling in cue fmt --check by @NoamTD in f254cc3
- cmd/cue: make cue fmt --check print files immediately by @NoamTD in 9e121cb
- cue/load: clean up some var names and code organization by @NoamTD in 41063b7
- encoding/protobuf: include annotations heading by @jpluscplusm in 35af5a1
- cue/testdata: update todos on various tests by @mpvl in de5d0cf
- internal/core/adt: do not share "inlined" structs by @mpvl in 1711c14
- internal/core/adt: prevent cyclic printing by @mpvl in 1860e39
- internal/core/adt: disable panic with TODO by @mpvl in 52c4c32
- mod/modregistry: allow RegistryResolver to return ErrRegistryNotFound by @rogpeppe in 89ae7d7
- pkg/math: fix MultipleOf algorithm by @NoamTD in c8cc462
- cue/math: add tests for MultipleOf by @NoamTD in 1f4927c
- all: don't use XXX strings unnecessarily by @mvdan in 506a0e8
- cue/format: collapse empty structs/lists to single line by @NoamTD in 53d5ab3
- all: prevent duplicate filenames in testscripts by @jpluscplusm in a835fb5
v0.8.2
This release includes a single fix for cue get go
: CL 1193892 fixes a regression introduced in cue get go
in v0.8.1
which caused transitive package dependencies to no longer be generated.