v0.15.0-alpha.1
This release removes the old evalv2 evaluator, adds the explicitopen language experiment, and introduces an initial version of cue lsp.
Changes which may break some users are marked below with: ⚠️
Evaluator
⚠️ Removing evalv2
The old evalv2 evaluator, which previously could be re-enabled via CUE_EXPERIMENT=evalv3=0, is now deleted. The new evalv3 evaluator has been on by default since v0.13.0, and at this point our entire test suite including Unity is working.
Removing the old evaluator reduces significant load on development, as we were able to clear out four thousand lines of code and simplify the internal types and code structure. This is a necessary step to unblock upcoming feature work in the evaluator.
As a bonus, because the old and new evaluators shared many core evaluator types, removing the fields only used by the old evaluator yields modest memory usage improvements around 4-6%.
explicitopen experiment for #A...
The explicitopen experiment enables the posfix ... operator to explicitly open closed structs, allowing additional fields to be added. This is a breaking change to the language which we are starting to transition towards; many users found the existing embed semantics to be confusing.
Furthermore, the existing semantics greatly complicated the evaluator and prevented significant performance optimizations. The new semantics also resolve a number of limitations, such as not being able to enforce a schema at the package level without opening up the schema due to the necessary embedding.
Once a module’s language.version targets v0.15.0, this can be enabled via the file attribute @experiment(explicitopen). To automatically convert files or packages to the new semantics, use cue fix --exp=explicitopen. Once the proposal is accepted, we intend to provide a command to safely upgrade a module to use the new semantics, without affecting its dependencies nor dependents.
For more information, see the proposal on GitHub and the spec change patch.
Other changes
A number of panics and error regressions in the evaluator which were reported in the last month have been fixed; thank you to all who reported these.
Dependency analysis now avoids computing references more than once, which resolves an expontential performance issue for some configurations using chains of CUE references.
Evaluating concrete CUE values no longer involves dependency analysis; this should result in modest speed improvements for users of standard library APIs such as yaml.Marshal.
Some error positions which were lost in the transition from evalv2 to evalv3 have been reintroduced by a few fixes.
File embedding via the @embed attribute has gained an allowEmptyGlob option, to allow glob patterns to match zero files without causing an error.
cmd/cue
The cue fix --exp flag is introduced to rewrite files or packages to use new and experimental semantics with @experiment attributes.
cue get go now stops if loading the given Go packages resulted in any errors. We would previously try to continue in the presence of some syntax or type-checking errors, but this could easily lead to subtle bugs such as panics or generated CUE which was incomplete or incorrect.
LSP
This alpha release includes the initial version of cue lsp - with support for “go to definition”, code completion, hover documentation, and code formatting.
See our Getting Started wiki page for instructions on how to set it up with your editor.
Please report any bugs or missing features you encounter via the Issue tracker or via the #lsp channels on either Discord or Slack.
Encodings
The Protobuf decoder has been tweaked to not require files such as google/protobuf/timestamp.proto to exist on disk, given that they are mapped to CUE standard library APIs directly.
The Protobuf decoder has also been tweaked to support fully qualified references such as my.pkg.name.MessageName.
A bug is fixed in the TOML decoder where subtable keys could incorrectly lead to duplicate key errors.
Standard library
The net package has gained new AddIP and AddIPCIDR functions to add numerical offsets to IP addresses or CIDR networks.
The Atoi, ParseInt, and ParseUint functions in the strconv package now work on integers with unlimited precision, like the rest of the CUE evaluator, rather than just a maximum of 64 bits.
Go API
encoding/json gains JSON Pointer APIs, which are already useful in packages like encoding/jsonschema.
cue/ast introduces PostfixExpr to support upcoming additions to the language syntax.
tools/fix has gained new APIs to fix configs to use an active experiment, as well as fixing configs to a newer language version.
cue introduces a Path.Append convenience method.
cue/token is adjusted so that node positions within a file never result in an offset which is outside the bounds of the file. This could easily lead to subtle bugs or panics when using node position offsets.
cue/errors is adjusted so that Positions only collects printable positions, to prevent printing empty positions in the CLI.
cue/ast deprecates the File.Imports field in favor of the File.ImportSpecs iterator method. The iterator method File.ImportDecls is also introduced for completeness.
⚠️ The long-deprecated cue.ResolveReferences option API is now removed.
cue/parser.DeprecationError.Version is deprecated, as tracking CUE language versions via integers has not been used since v0.4.3, and the mechanism was never properly documented.
All changes
242 changes since v0.14.0by area
ai3
aidocument cueckoo runtrybot commandaiadd more commands allow listaiset coAuthoredBy in settings
all6
allclean up #skip-v2 txtar linesallreplace uses of cue/ast.File.VisitImports with ImportDeclsallsimplify iterating over reflect and go/types listsallrely ongo get -toolnow that we require Go 1.24 or laterallrequire Go 1.24 or later, release on 1.25allremove some more unused code found by staticcheck
cmd18
cmd/cuestop using an internal test packagecmd/cueadd a test showing how we can print empty positionscmd/cueincrease the cmd_after sleep before printing a timestampcmd/cueadd cue mod upgrade and --exp flag for fixcmd/cue-astalways print the ast if it existscmd/cueabortget goon any syntax or type errorscmd/cuetweakget goerror tests to actually do what they saycmd/cuere-enable skippedcue get gotest with broken go:embedcmd/cueuse os/signal.NotifyContext for the root command contextcmd/cue/cmdfix CRD importscmd/cue/cmdadd vet to CRD testcmd/cue/cmdskip TestVersion if VCS information is not stampedcmd/cuerip out the VCS-based version logiccmd/cuetestcue versionoutside of testscriptcmd/cuereplace os.Chdir with testing.T.Chdir in testscmd/cueinclude full gengotypes warning prefixcmd/cue/cmduse ParseInt with 64 bit size in cmd_after testdatacmd/cue/cmdremove EvalV2-specific tests
cue24
cueadd Path.Append methodcue/tokenclarify docs on printable positionscuecompile/erralias.txtar no longer stack overflows on evalv3cue/errorsomit non-printable positions from Positionscue/errorsuse cue/token.Pos.Compare directly in approximateEqualcueremove more unnecessary evalv3 test skipscueremove todoV3 for a Syntax test with a structural cyclecueremove the long-deprecated ResolveReferences optioncue/parserremove all users of FromVersioncue/parsertest use of ... with wrong versioncue/parser,cue/formatimplement PostfixExpr parsing and formattingcue/astadd PostfixExpr AST node for postfix operatorscue/loadsimplify DefaultTagVars code a bitcue/astadd a TODO as a reminder to remove deprecated Field fieldscue/astdeprecate File.Imports in favor of File.ImportSpecscue/astintroduce File.ImportSpecscue/astintroduce an iterator version of File.VisitImportscue/loadclarify semantics of Dir with Overlaycue/ast/astutil,internal/core/toposortremove unused codecue/tokencorrect out-of-bounds token offsets and positionscue/parserconsistent double-underscore validationcue/errorscleanupscue/interpreter/embedadd allowEmptyGlob option for globscueturn of some tests for evalv2
encoding11
encoding/protobufsupport decoding fully qualified referencesencoding/tomlfix decoding subtable duplicate keysencoding/protobufdon't require google/protobuf files on diskencoding/openapifix "allOff" misspellingencoding/openapiattempt round-trip of generated OpenAPI schemaencoding/openapideprecate Genencoding/jsonschemaremove evalv2 from test dataencoding/jsonschemaflip the character class tests on for Go 1.25encoding/jsonexport JSON Pointer functionsencoding/jsonschemaadd ExtractedCRD.VersionToPathencoding/xml/koalaremove trailing whitespace
internal125
internal/taskfactor out task function creationinternal/core/exportdisable pivotter for data outputinternal/core/adtavoid computing duplicate dependenciesinternal/core/depadd test for Issue #4064internal/core/depkeep track of number of dependencies computedinternal/core/adtreuse allocations of source-less booleansinternal/core/adtre-enable TestSchedulerinternal/ciupgrade to actions/setup-go@v6internal/ciupdate versions of Go and goreleaser for alpha.1internal/lspimplement hoverinternal/core/adtrevert "report comprehension error at task level"internal/core/adtreport comprehension error at task levelinternal/core/adtadd tests for Issue 4055 and 4056internal/core/adtdisable part of memory reclamation for disjunctionsinternal/core/adtstart clean up of IsClosedStructinternalremove "dev" test matricesinternal/lspcope with symlinks and files being deletedinternal/core/adtadd test for issue #4001internal/core/compilefix stack alignment for let referencesinternal/core/exportadd tests for Issue #4051internal/core/compileadd option to print expressions in let referencesinternal/coreremove some parallel testsinternal/core/depdon't do typo checks for dependency analysisinternal/core/adtgate openDebugGraph on debug flaginternal/core/adtpass flags through as isinternal/core/adtrefactor flags passed to unifyinternal/core/adtmake combinedFlags publicinternalremove old mechanism to track CUE language versionsinternal/lspimplement LSP Completioninternalmove SetPackage to cmd/cue/cmd.setPackageinternal/core/compileimplement __closeAll builtininternal/cueexperimentadd experiment validation and lifecycle APIinternalmove ListEllipsis to internal/core/compile.listEllipsisinternalmove MergeDocs to internal/core/export.mergeDocsinternalmove EmbedStruct to encoding/jsonschema.embedStructinternalmove IsEllipsis to cue/format.isEllipsisinternal/coreimplement #A...internalmove ErrInexact to internal/core/subsumeinternalConstraintToken is no longer necessaryinternalremove ErrIncomplete, which was read once but never setinternalinline the only use of NewAttrinternal/core/adtremove checkinternal/golangorgx/tools/testenvremove unnecessary packageinternal/ci/checksimprove @-mention commentsinternal/golangorgx/tools/xcontextreplace Detach with context.WithoutCancelinternal/golangorgx/tools/fuzzyremove another unused packageinternal/golangorgx/gopls/util/constraintsremove another unused packageinternal/golangorgx/tools/proxydirremove another unused packageinternal/golangorgx/gopls/versionremove another unused packageinternal/golangorgx/tools/memoizeremove another unused packageinternal/golangorgx/tools/versionsremove as an unused packageinternal/golangorgx/tools/gocommandremove as an unused packageinternal/core/adtbetter doc comment for OpContextinternal/core/adtfix panic on uninitialized vertex in attemptOnly modeinternal/vcsremove SYSTEMROOT workaround for Windowsinternal/intsetdelete this no-longer-used packageinternal/cueconfiguse omitzero for RegistryLogin.Expiryinternal/core/adtfix dependency issueinternal/core/adtadd test for dependency issueinternal/core/adtremove unused StructLit fieldsinternal/core/adtensure a node is initializedinternal/core/adtpromote some evalv3 results to "golden"internal/core/adtnote that envDisjunct.src is unused via a TODOinternal/core/adtuse stringer for two more typesinternal/core/adtadd a TODO about the parent in newInlineVertexinternal/core/adtdeduplicate code handling lower and upper boundsinternal/core/adtfix a few godocs to align with the declared namesinternal/core/adtremove duplicate package docsinternal/lspwire up jump-to-dfninternal/core/adtfix concreteness checkinternal/core/adtadd tests for 3993internal/core/adtclarify n.reqSets is a bufferinternal/core/adtadd tests for Issue 4020internal/core/adtremove Specialize methodsinternal/core/adtremove Environment.evalCachedinternal/core/adtapply evalv3 TODO in updateListTypeinternal/core/adtremove StructMarker.NeedCloseinternal/core/adtfix initArcs for errors in optional fieldsinternal/core/adtadd tests for Issue 4022internal/core/adtremove OpContext.optionalMarkinternal/core/adtremove CloseInfo.IsClosedinternal/core/adtremove StructInfo.Disableinternal/core/adtremove CycleInfo.Inlineinternal/core/adtdisable OpContext.toFinalizeinternal/core/adtremove OpContext.inDisjunctinternal/core/adtremove disjunct.isDefaultinternal/core/adtremove nodeContext.conjunctsinternal/core/adtactually set nodeContext.kindIDinternal/core/adtremove a piece of code in isFinal only needed for evalv2internal/core/adtremove a piece of code in isClosed only needed for evalv2internal/cueexperimentdeprecate the evalv3 flaginternal/adt/coreimprove validation error positionsinternal/core/adtuse cuetdtest for TestValidateinternal/core/adtadd missing dereferenceinternal/core/adtadd tests for 4011internal/core/adtadd more error positionsinternal/core/adtremove unused nodeContext fieldsinternal/core/adtremove some Vertex-related fieldsinternal/core/adtremove EvalV2 optional trackinginternal/core/adtremove obsolete CloseInfo methodsinternal/core/adtremove EvalV2 closeInfo remnantsinternal/core/adtremove unused Vertex fieldsinternal/core/adtremove unused nodeContext fieldsinternal/core/adtremove EvalV2 remnantsinternal/core/adtremove EvalV2-specific codeinternal/core/adtset right version for testinternalremove EvalV2 from public API and runtimeinternal/cuetdtestremove evalv2 from default matrixesinternal/cuetdtestremove support for evalv2internal/core/adtdetect non-cycleinternal/core/adtfix cycle for structural cyclesinternal/core/adtadd tests for issue 3940 and 3990internal/core/subsumeuse errors.Details instead of single errorinternal/core/subsumeremove explicit test indicesinternal/core/subsumeconvert to cuetdtest frameworkinternal/core/subsumeuse error strings in testsinternal/core/subsumereformat struct fieldsinternal/cidrop the use of ns-linux aliasesinternal/cihave the dispatch and trigger workflows use a separate cacheinternal/cidrop use of setup-buildx-actioninternal/cirequire that workflow names be uniqueinternal/cueversionbump LanguageVersion to v0.15.0internal/core/adtfix ellipsis strictness issueinternal/core/adtadd tests for #4015internal/robustiomark sleeping test as long
lsp36
lsp/definitionsAdd support for explicit-openlsp/servermake formatter be a noop if result is unparsablelsp/serveradd test to show bad formattinglsp/cacherefactor and reduce duplicationlsp/cacheprevent infinitely loading the same packagelsp/cache,lsp/fscache,lsp/serveralways use a non-nil ASTlsp/definitionscorrect modelling of ellipseslsp/definitionsadd test showing broken behaviourlsp/cachebe tolerant of unknown importslsp/definitionsdetect new nodes more efficientlylsp/definitionsfix forward references via explicit unificationlsp/definitionsadd test showing bad behaviourlsp/definitionscanonicalise import path during resolutionlsp/definitionsadd tests for bad importslsp/cacheOnly reformat CUE files if they have no syntactic errorslsp/serveradd test to demonstrate bad formattinglsp/fs_cachecache the parsing error as well as the astlsp/cacheAdd support for old module systemlsp/definitionsadd test for definition definitionslsp/definitionscorrect evaluation of comprehensionslsp/definitionsAdd test for broken for- and let-comprehensionslsp/definitionsImprove resolution of fields inline expressionslsp/definitionsadd tests for broken behaviorlsp/serverallow server to be initialized with zero workspace folderslsp/cacheDo not rely on import paths being uniquelsp/cacheOverride the registry Fetch method within LSPlsp/cacheAdd failing testlsp/definitionsMake field keys resolve to themselveslsp/definitionsgoto-dfn on an import spec jumps to that pkglsp/cachereduce column number by 1 if jump-to-definition produces no resultslsp/definitionsdo not ever call eval before all fields are establishedlsp/definitionsflatten testslsp/definitionsimplement ability for jump-to-dfn to switch package and modulelsp/cachecreate modules and packages when demanded by modpkgloadlsp/definitionsadd analysis to determine resolution of identslsp/cachedon't return cue errors to client
pkg4
pkg/strconvCUE_UPDATE=1 go testpkg/strconvmake ParseUint work with unlimited size intspkg/strconvfix Atoi and ParseInt to handle unlimited precision integerspkg/netadd ip arithmetic functions
tools5
tools/flowmake running variable more robusttools/fiximplement __closeAll wrapper insertiontools/fixadd TestX for quick teststools/fixadd experiment and upgrade supporttools/trimremove EvalV2 trim implementation
Other10
.claudewildcards are only supported at the end of a command- Revert "cmd/cue: use os/signal.NotifyContext for the root command context"
- update cobra and pflag dependencies
- update golang.org/x/... dependencies
- internal/core:adt: don't report errors beyond disjunction boundary
CONTRIBUTINGfix links spotted byxurls -fix- re-enable staticcheck's S1008 check
mod/modimportserrors from parsing are not terminal and are captured- Revert "mod/modregistry: mirror referrers in Client.Mirror"
mod/modregistrymirror referrers in Client.Mirror
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_bd465d62ccc3e3d8b41089a88c10ec3c57b99dcdb5c8f5f835e25069f9e42646 |
| macOS, Apple silicon | cue_976ff187464d502c01e5ff336f2631319f464bf22a6cd8f69c9ccaf341e3f458 |
| Linux, x86-64 | cue_fad82b7517c8884ebb69578963cc27fe452de68f51bad7580c09cb6ba15ecde5 |
| Linux, Arm64 | cue_b19e832a717a7d3b8aaf1223762f3f1aa2c45f417448353c6cb1dfa21e8487bb |
| Windows, x86-64 | cue_442421b4235069b7ef6debf68f7759b13e7f466a1f85a12453c52e6b69eed522 |
| Windows, Arm64 | cue_0de329319cd8bb148d24715287c966d7cf0c3a98adeebe47da3ab45e8112da12 |
SHA-256 checksums for all of these: checksums.txt