v0.14.0
This release brings significant performance improvements, three language changes, and initial support for Kubernetes CRDs.
Changes which may break some users are marked below with: ⚠️
Evaluator
Performance
A particularly slow part of the new closedness algorithm has been rewritten for speed, resulting in improvements of up to 10x in wall times for some projects.
Significant progress has been made to the new evaluator’s memory usage; a few large projects experiencing high memory usage on v0.13 now see reductions of up to 80%.
Various other optimizations and performance bug fixes have been made to the new evaluator, yielding speed-ups of 5-20% on a variety of CUE projects.
error builtin
A new error builtin is added to the language, which allows users to create custom error values with a specified message.
Don’t simplify validators into concrete values
A new CUE_EXPERIMENT=keepvalidators experiment is introduced, already on by default, which prevents validators from being simplified into concrete values.
X == Y and == X
Firstly, there were several bug fixes related to ==. Most notably, [int] == [int] incorrectly resolved to true. It now correctly resolves to an error.
All other changes are enabled using the @experiment(structcmp) file-level attribute.
Enabling this experiment allows all CUE values to be compared for equality. This includes comparing structs.
The same experiment also allows a unary == to enforce that a value is a specific concrete value.
Other changes
⚠️ The file embedding experiment can no longer be disabled via CUE_EXPERIMENT=embed=0, having been introduced in CUE v0.10.0.
File embedding is now enabled when using the cue/cuecontext or cue/load APIs; earlier versions could not expose it via the Go API due to an import cycle.
⚠️ The topological field sorting experiment can no longer be disabled via CUE_EXPERIMENT=toposort=0, having been introduced in CUE v0.11.0.
⚠️ CUE_EXPERIMENT=cmdreferencepkg, introduced in v0.13.0 to require referencing tool packages to declare cue cmd tasks, is now on by default.
The new closedness algorithm has been adjusted to fix a number of “field not allowed” bugs, particularly in the form of regressions compared to the old evaluator.
A particularly slow part of the new closedness algorithm has been optimized, resulting in improvements of up to 10x in wall times for some projects.
cmd/cue
⚠️ cue def --strict jsonschema:, deprecated in favor of cue def jsonschema+strict: in v0.11.0, is no longer supported.
Two bugs have been fixed in the new cue trim algorithm where disjunctions could incorrectly select defaults or be treated as ambiguous.
Encodings
cue get crd introduces support for extracting Kubernetes Custom Resource Definitions (CRDs) as CUE definitions; see cue help get crd.
The new encoding/jsonschema.ExtractCRDs Go API exposes the extractor used by cue get crd.
The JSON Schema decoder has gained support for dependencies, bringing the pass rate for the official JSON Schema test suite up from 79% to 81%.
Go API
cue/load now provides module information via the new Instance.ModuleFile field.
⚠️ In order to support the above change, the mod/modfile.File.Format method has been moved to the function mod/modfile.Format: an API-breaking change but necessary to avoid a cyclic package dependency.
cue/parser gains a new Config API, which allows other packages like cue/load to properly apply the right parser options such as the CUE language version.
⚠️ In order to support the above change, the cue/parser.Config.ParseFile and cue/build.ParseFile signatures have now changed (incompatibly) to add a parser.Config argument, enabling the CUE language version to be passed through.
Fix an issue where cue.Value.Decode did not work with *math/big.Float types.
All changes
237 changes since v0.13.0by area
ai4
aispecify use of git codereviewaiallow certain tools unconditionallyaiadjustments to codeaiinitial Claude.md
all7
allmake some txtar table tests parallelallsimplify three iterator uses with range-over-funcallswap math/rand for math/rand/v2 where it affects behaviorallremove a bit of dead codeallswap math/rand for math/rand/v2 where it doesn't affect behaviorallrely on iterators being available since Go 1.23allensure we init cuedebug and cueexperiment before every use
cmd25
cmd/cueadd testscript for issue 4009cmd/cue/cmdadd tests for 3981cmd/cue/cmdspeed up use of sleeps to test concurrent commandscmd/cueimplement cue get crdcmd/cueskip tests using sleeps in short modecmd/cue/cmdfix versiontest testcmd/cueremove CUE_SYNTAX_OVERRIDE supportcmd/cueadd test cases for issue 3968cmd/cueadd testscript forexp gengotypesoutput filenamescmd/cueproperly document the keepvalidators experimentcmd/cuefix error on cue mod rename with a bad modulecmd/cueadd test case for modrename with a bad modulecmd/cueallow "access denied" testscript to pass on Winecmd/cuetweak two more testscripts to be portablecmd/cueadd false, echo, and cat testscript commandscmd/cuedrop debug lines from testscriptscmd/cueremove dev.txtar testscriptcmd/cuedeprecate --strict flag in favor of the jsonschema filetype tagcmd/cueturn all "cmd" testscripts away from legacy id/kind fieldscmd/cueconsistently use the same top-level command contextcmd/cueadd more CUE_DEBUG=http testscmd/cueremove stale testscript txtar files for CUE_EXPERIMENT=modules=0cmd/cueconsistently use tab indentation in help textscmd/cuedrop evalv3=0 testscriptscmd/cueimplement mirror --dry-run
cue20
cue/loadbuffer non-regular input files like we do for "-"cue/tokenadd []byte content to token.Filecue/statsremove unused CloseIDElems countercue/loaddeduplicate handling missing files for ad-hoc packagescue/loadreject unsupported cue.mod files by inspecting open errorscue/astEnsure ImportPath.Canonical copes with host-only pathscue/loadpass language version down to parsercue/loaduse error registry in SkipImports modecue/parserenable cueexperiment.File throughoutcue/loadactually populate build.Instance.ModuleFile correctlycue/parseradd Config typecue/loadinclude module file in build.Instancecue/parserprohibit definition identifiers for package namescue/astimprove ImportPath.Canonicalcue/astadd more tests for ImportPath.Canonicalcuefix decoding into big.Floatcueadd tests for issue 3927cueuse multiple sizes in BenchmarkLargeValueMarshalJSONcue/cuecontextalways enable embeddingcue/loadmake NoFilesError use position arguments for paths
encoding3
encoding/jsonschemaimplement dependenciesencoding/jsonschemaparallelize vendor_external.go a bitencoding/jsonschemaimplement ExtractCRDs
gopls4
gopls/cacheadd test for imports of non-ambiguous non-default modulesgopls/cacherework normalizeImportPathgopls/cacheignore imports of stdlibgopls/lsprpcAdjust gopls to cuelsp and simplify
internal154
internal/core/adtinline combinedFlags helpersinternal/core/adtrefactor combinedFlags from bit-packed uint32 to structinternal/core/adtrevert the top-level parallelism of EvalV{1,2} testsinternal/core/adtsilence tests once againinternal/cimake the writing of files reusableinternal/ciplace input parameters inside an #in structinternal/ci/baseadd helpers for OS + Go version matricesinternal/encoding/yamlproperly report disjunction errorsinternal/core/adtclear close checkinternal/core/adtexclude more cases for adding defIDinternal/core/adtadd tests for Issue 4000internal/core/adtfix panic on remnant notificationsinternal/core/adtadd cycle detectioninternal/core/adtremove requirement typeinternal/core/adtupdate testsinternal/lspMove much of our own code to internal/lspinternal/ciadd base steps for the common Go checks and staticcheckinternal/ciinclude more useful string values in baseinternal/cisplit Linux runners into "small" and "large"internal/ciallow gerritHubHostname to be overriddeninternal/core/adtnew data structure for reqSetsinternal/core/adtadd generation tracking to closedness infointernal/core/adtadd generation tracking to prevent stale context usageinternal/core/adtfix notification CloseInfointernal/core/adtadd tests for 3981internal/core/adtToDataAll rewriteinternal/ciallow additional cache modesinternal/cmd/cue-astuse cue/load with SkipImports=trueinternal/core/adtremove CloseIDElems counterinternal/core/adtadd counters before rewriteinternal/core/adthoist loopinternal/core/adtchange signatureinternal/core/adtremove replaceID.add fieldinternal/cistart publishing the moduleinternal/cicarve out into a separate module to be publishedinternal/cido a little bit more for trybot jobs in the base packageinternal/ciapply the top-level githubactions.#Workflow schemainternal/core/adtrevert CL 1208898 for evalv2internal/golangorgxremove the unused tools/facts packageinternal/golangorgx/vendoringremoveinternal/cirename "ubuntu" runner to "linux"internal/golangorgxdelete unused and Go-specific packagesinternal/golangorgxremove unused gopls/util packagesinternal/goplsrewrite gopls/cuelspinternal/goplsremove unnecessary old command aliasinternal/goplsrenaming of gopls to cuelspinternal/goplsdelete a lot of codeinternal/golangorgxremove gopls re-vendoring scriptinternal/core/adtfilter notificationsinternal/core/adtkeep track of notification countsinternal/core/adtrun evaluator tests in parallelinternal/pkgfix a race when contexts concurrently load std importsinternal/core/adtclean up orphaned arcsinternal/core/adtmark inlined nodes for cleanupinternal/core/adtprune parent processinginternal/core/adttrigger more diffs in statsinternal/core/adtclean up use of Vertex.stateinternal/core/adtbasic memory management for evalv3internal/core/adtcheck for nil state in parent disjunctioninternal/core/adtdelay processing of pattern constraintsinternal/core/adthandle equal disjunctsinternal/core/adtdo not set error for nil task stateinternal/core/adtreuse more letsinternal/core/adtallow unprocessedinternal/core/adtremove filter for let sharinginternal/core/adtrearrange newNodeContextinternal/core/adtmark nodeContext.clone as v2internal/core/adtadd benchmark for Issue 3334internal/core/adtmore eagerly update stats in testsinternal/ciskip "check git tags" when testing CLsinternal/ciuse shorter Namespace runner profile aliasesinternal/cirun tests with GOARCH=386 on protected branches onlyinternal/robustioadd stub js/wasm getFileID implementationinternal/core/adtnormalize how the tests configure the runtimeinternal/cuetxtardo not load the root cuelang.org/go CUE moduleinternal/robustioCopy from upstream and consolidate useinternal/core/adtremove unused test codeinternal/modpkgloadMake Package keep its set of filesinternal/coreremove a few unnecessary trailing Fprintln calls in testsinternal/lsp/fscacheCreate CUECacheFS and OverlayFSinternal/cidrop "evict caches" nightly cron jobinternal/cicache staticcheck via nscloud-cache-actioninternal/ciassume the CI machines are reasonably moderninternal/ciskip the test cache via GOFLAGS=-count=1internal/ciswitch to Namespace GitHub Actions runnersinternal/core/adtdelay stringifying nodes in errors via fmt.Stringerinternal/core/adtensure emptyNode is inertinternal/core/adtuse custom int set implementation for visitedinternal/core/adtremove cycle checkinternal/core/adtadd tests for 3978internal/core/adtrevert 1217228internal/core/compileadd version check for builtinsinternal/core/adtadd builtin for user-defined errorsinternal/core/adtrename CallContext.Exprinternal/ciupdate Go and goreleaser versionsinternal/core/adtsupport unary == and != for all typesinternal/core/adtcomparison of values of different typesinternal/core/adtconsider required fields for final values in Equalinternal/core/adtsupport comparsion of structsinternal/core/adtfix error gobbling of internal nodesinternal/core/adtadd tests for Issue 3977internal/cueexperimentsupport for per-file experimentsinternal/core/adtsimplify recursive getReqSets callsinternal/core/adtdo not repeat replaceIDs callsinternal/core/adthandle incomplete values in comparatorsinternal/core/adtuse replaceIDs incrementally in checkTyposinternal/core/adtrewrite replaceIDs to scale betterinternal/core/adtEqual should take defaults when appropriateinternal/core/adtlimit closedness check in Equalinternal/core/adtmerge validate package with adtinternal/core/adtadd tests for incomplete lists comparisoninternal/core/adtuse pointers for snapshot and result in nodeContextinternal/core/adtadd tests for Issue 3929internal/core/adthandle yields in Resolveinternal/core/adtadd tests for Issue 3972internal/core/adtmake small iota enums consistently uint8internal/core/adtallow lookup across disjunction boundaryinternal/core/adtapply vertex rewriting to blocked tasksinternal/core/adtadd tests for 3967internal/pkgonly use %s with stringifiable builtin errorsinternal/core/exportavoid panic on non-regular identifiers for packagesinternal/core/adtalso create embed scope for disjunctionsinternal/core/adtadd tests for 3964internal/core/adtfix default logicinternal/core/adtadd tests for 3958internal/corestart removing pre-toposort field ordering codeinternal/core/adtdon't check removed scopesinternal/core/adttrack scope of closed()internal/core/adtdo not remove embed groupsinternal/core/adtadjustments to closedness algointernal/core/adtchange ellipsis to fix hidden buginternal/core/adtupdate tests for 3833 and 3839 before fixinternal/core/adtadd tests for Issue 3920internal/core/adtalso typo check disjunctsinternal/core/adtadd tests for Issue 3957internal/core/adtremove most validator simplificationsinternal/core/adtcopy bounds.txtarinternal/golangorgxremove files build-tagged for old Go versionsinternal/golangorgx/tools/analysisinternalremoveinternal/golangorgx/tools/typesinternalremoveinternal/golangorgx/gopls/cache/methodsetsremoveinternal/golangorgx/tools/tokeninternalremoveinternal/cueexperimentenable cmdreferencepkg by defaultinternal/cueexperimenttoposort is always on nowinternal/cueexperimentkeep record of how experiments advancedinternal/cueexperimentfile embedding is always on nowinternal/core/adtpartially revert CL 1214950internal/core/adtadd tests for 3946internal/cueversionavoid dependency on golang.org/x/modinternal/core/adtdo not always filter disjunctsinternal/core/adtadd tests for 3947internal/cueexperimenttweak the docs for all experiment flagsinternal/cueversionbump languageVersion for v0.14internal/mod/modfiledatafactor out of mod/modfile
mod4
mod/modfiledatarename File.ModulePath() to File.ModuleRootPath()mod/modpkgloadcorrect calculation of pkg.fromExternalmod/modpkgloadcapture faulty behaviour of pkg.fromExternalmod/modpkgloadMake LoadPackages support nil shouldIncludePkgFile
tools4
tools/trimonly consider defaults when we're not ignoring the conjuncttools/flowavoid looking like we're usinggo runfor realtools/trimWork harder to discover disjunction branchestools/trimhandle error cases in API
Other12
pkg/encodingadd test cases for disjunction errors with Validatelsp/fscacheForce parsing mode to always be ParseComments- update dependencies for v0.14.0-rc.1
- update all direct dependencies
doc/ref/spec.mdsupport struct and list for equalitydoc/ref/spec.mddocument error builtin- update golang.org/x/... dependencies
cuecontextrevert support for CUE_EXPERIMENTcueexperimentexport Config type and use itREADMEminor updates- update all other dependencies
- update golang.org/x/...
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_bcbe7d6c2139f6b116945112c17687a25cf60a36deef4f3d5af873bc7e4260bf |
| macOS, Apple silicon | cue_9f1a88e2ccabe12f24bbd3934ab8a487ccfa78df2aae1183b9b39c26bded9a7a |
| Linux, x86-64 | cue_5733fe3a138eaacf8f8298f22c568e3ad55b3141971c1be9151906217fc2ee6a |
| Linux, Arm64 | cue_f987b1f8cba359973a3050ac276d01e29162cda1de6a4ddb135ff6186bfa6f02 |
| Windows, x86-64 | cue_9041f014820924e4fde7bb2c295f4da63e9ad6590f92d73e6c4bc37abe5f2077 |
| Windows, Arm64 | cue_045878cf337143b54ccaff2718c4dd2431922ad53182a17d088e7a3d731b032b |
SHA-256 checksums for all of these: checksums.txt