v0.14.0

cue-lang/cue Released

A release of CUE OSS · its page on GitHub

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 codereview@mpvlf34d9a5
  • aiallow certain tools unconditionally@mpvl80473ca
  • aiadjustments to code@mpvl4bdc446
  • aiinitial Claude.md@mpvl5530af0

all7

  • allmake some txtar table tests parallel@mvdan2d182a5
  • allsimplify three iterator uses with range-over-func@mvdanbb2494b
  • allswap math/rand for math/rand/v2 where it affects behavior@mvdan82ff070
  • allremove a bit of dead code@mvdanab546cf
  • allswap math/rand for math/rand/v2 where it doesn't affect behavior@mvdandb84c62
  • allrely on iterators being available since Go 1.23@mvdan100a7cc
  • allensure we init cuedebug and cueexperiment before every use@mvdanfc8460b

cmd25

  • cmd/cueadd testscript for issue 4009@mvdanfb631bd
  • cmd/cue/cmdadd tests for 3981@mpvl840ff27
  • cmd/cue/cmdspeed up use of sleeps to test concurrent commands@mvdan13461f1
  • cmd/cueimplement cue get crd@rogpeppea6df86a
  • cmd/cueskip tests using sleeps in short mode@mvdanf7e5f80
  • cmd/cue/cmdfix versiontest test@rogpeppe2bbc359
  • cmd/cueremove CUE_SYNTAX_OVERRIDE support@rogpeppe450ba7f
  • cmd/cueadd test cases for issue 3968@rogpeppee0010dd
  • cmd/cueadd testscript for exp gengotypes output filenames@mvdanb20d1a4
  • cmd/cueproperly document the keepvalidators experiment@mvdan398cdac
  • cmd/cuefix error on cue mod rename with a bad module@rogpeppe9f9ebac
  • cmd/cueadd test case for modrename with a bad module@rogpeppe90d9b04
  • cmd/cueallow "access denied" testscript to pass on Wine@mvdan250524b
  • cmd/cuetweak two more testscripts to be portable@mvdan9758314
  • cmd/cueadd false, echo, and cat testscript commands@mvdand1210a5
  • cmd/cuedrop debug lines from testscripts@mvdanc0c6072
  • cmd/cueremove dev.txtar testscript@mvdand0cb1dd
  • cmd/cuedeprecate --strict flag in favor of the jsonschema filetype tag@mvdan00d3a8f
  • cmd/cueturn all "cmd" testscripts away from legacy id/kind fields@mvdan8b11b9d
  • cmd/cueconsistently use the same top-level command context@mvdan60e5703
  • cmd/cueadd more CUE_DEBUG=http tests@mvdan6119be2
  • cmd/cueremove stale testscript txtar files for CUE_EXPERIMENT=modules=0@mvdanb7b7cc7
  • cmd/cueconsistently use tab indentation in help texts@mvdan9113b8e
  • cmd/cuedrop evalv3=0 testscripts@mvdana27b03f
  • cmd/cueimplement mirror --dry-run@rogpeppe707f96b

cue20

  • cue/loadbuffer non-regular input files like we do for "-"@mvdanfbb4840
  • cue/tokenadd []byte content to token.File@cuematthew3e50617
  • cue/statsremove unused CloseIDElems counter@mpvl930a98b
  • cue/loaddeduplicate handling missing files for ad-hoc packages@mvdan4cb33de
  • cue/loadreject unsupported cue.mod files by inspecting open errors@mvdanc80fdaf
  • cue/astEnsure ImportPath.Canonical copes with host-only paths@cuematthew703c22c
  • cue/loadpass language version down to parser@rogpepped567750
  • cue/loaduse error registry in SkipImports mode@rogpeppe5a04616
  • cue/parserenable cueexperiment.File throughout@mpvl86f7a64
  • cue/loadactually populate build.Instance.ModuleFile correctly@rogpeppe48ec278
  • cue/parseradd Config type@rogpeppe211309c
  • cue/loadinclude module file in build.Instance@rogpeppeab9ac54
  • cue/parserprohibit definition identifiers for package names@rogpeppe548c23c
  • cue/astimprove ImportPath.Canonical@rogpeppe12f3193
  • cue/astadd more tests for ImportPath.Canonical@rogpeppe3444f26
  • cuefix decoding into big.Float@haoqixudcc3088
  • cueadd tests for issue 3927@haoqixu7cfda37
  • cueuse multiple sizes in BenchmarkLargeValueMarshalJSON@mvdan4e0e427
  • cue/cuecontextalways enable embedding@rogpeppee2e0711
  • cue/loadmake NoFilesError use position arguments for paths@mvdan5b6d50f

encoding3

  • encoding/jsonschemaimplement dependencies@rogpeppe9620eae
  • encoding/jsonschemaparallelize vendor_external.go a bit@mvdan3b10030
  • encoding/jsonschemaimplement ExtractCRDs@rogpeppee2835d9

gopls4

  • gopls/cacheadd test for imports of non-ambiguous non-default modules@cuematthewe4cdcd3
  • gopls/cacherework normalizeImportPath@cuematthewf309265
  • gopls/cacheignore imports of stdlib@cuemattheweac9728
  • gopls/lsprpcAdjust gopls to cuelsp and simplify@cuematthewca86fb0

internal154

  • internal/core/adtinline combinedFlags helpers@mpvldffc5ce
  • internal/core/adtrefactor combinedFlags from bit-packed uint32 to struct@mpvlf44480d
  • internal/core/adtrevert the top-level parallelism of EvalV{1,2} tests@mvdan6c32704
  • internal/core/adtsilence tests once again@mvdan4f388b1
  • internal/cimake the writing of files reusable@mvdan649bb67
  • internal/ciplace input parameters inside an #in struct@mvdan92d4bab
  • internal/ci/baseadd helpers for OS + Go version matrices@mvdanf5ad0d3
  • internal/encoding/yamlproperly report disjunction errors@kilpkonnc7cc1a8
  • internal/core/adtclear close check@mpvld8451da
  • internal/core/adtexclude more cases for adding defID@mpvlb12697e
  • internal/core/adtadd tests for Issue 4000@mpvlb20058e
  • internal/core/adtfix panic on remnant notifications@mpvlfaecce4
  • internal/core/adtadd cycle detection@mpvl0740c0a
  • internal/core/adtremove requirement type@mpvlf0f4cee
  • internal/core/adtupdate tests@mpvl83f3c87
  • internal/lspMove much of our own code to internal/lsp@cuematthew6d10132
  • internal/ciadd base steps for the common Go checks and staticcheck@mvdana79c3d8
  • internal/ciinclude more useful string values in base@mvdana78e432
  • internal/cisplit Linux runners into "small" and "large"@mvdan6d3530b
  • internal/ciallow gerritHubHostname to be overridden@myitcv5cc6d81
  • internal/core/adtnew data structure for reqSets@mpvl3f23e12
  • internal/core/adtadd generation tracking to closedness info@mpvl5077511
  • internal/core/adtadd generation tracking to prevent stale context usage@mpvl19e2c74
  • internal/core/adtfix notification CloseInfo@mpvl0ccf38c
  • internal/core/adtadd tests for 3981@mpvl78e1a11
  • internal/core/adtToDataAll rewrite@mpvl2804f1d
  • internal/ciallow additional cache modes@jpluscplusm9afca73
  • internal/cmd/cue-astuse cue/load with SkipImports=true@mvdan45ab65e
  • internal/core/adtremove CloseIDElems counter@mpvl9033834
  • internal/core/adtadd counters before rewrite@mpvlc8256cd
  • internal/core/adthoist loop@mpvl24cc414
  • internal/core/adtchange signature@mpvl5ee4254
  • internal/core/adtremove replaceID.add field@mpvld987d88
  • internal/cistart publishing the module@mvdan05a3d64
  • internal/cicarve out into a separate module to be published@mvdan17177e9
  • internal/cido a little bit more for trybot jobs in the base package@mvdan1004c32
  • internal/ciapply the top-level githubactions.#Workflow schema@mvdand9aaac0
  • internal/core/adtrevert CL 1208898 for evalv2@mvdan1789dd4
  • internal/golangorgxremove the unused tools/facts package@mvdan60c36a5
  • internal/golangorgx/vendoringremove@mvdan4d66634
  • internal/cirename "ubuntu" runner to "linux"@mvdan8250c1f
  • internal/golangorgxdelete unused and Go-specific packages@mvdandbed9a3
  • internal/golangorgxremove unused gopls/util packages@mvdan9ca9609
  • internal/goplsrewrite gopls/cuelsp@cuematthewa23afdf
  • internal/goplsremove unnecessary old command alias@cuematthew4752c04
  • internal/goplsrenaming of gopls to cuelsp@cuematthew8935ee3
  • internal/goplsdelete a lot of code@cuematthew3fb3043
  • internal/golangorgxremove gopls re-vendoring script@mvdan3114a2f
  • internal/core/adtfilter notifications@mpvl971ee4f
  • internal/core/adtkeep track of notification counts@mpvl18b7df0
  • internal/core/adtrun evaluator tests in parallel@mvdan991e549
  • internal/pkgfix a race when contexts concurrently load std imports@mvdan79798ca
  • internal/core/adtclean up orphaned arcs@mpvla397974
  • internal/core/adtmark inlined nodes for cleanup@mpvle92f16e
  • internal/core/adtprune parent processing@mpvl1b7a71c
  • internal/core/adttrigger more diffs in stats@mpvlf389502
  • internal/core/adtclean up use of Vertex.state@mpvlfb4f507
  • internal/core/adtbasic memory management for evalv3@mpvl4ebd05f
  • internal/core/adtcheck for nil state in parent disjunction@mpvl4638be0
  • internal/core/adtdelay processing of pattern constraints@mpvlab40e7f
  • internal/core/adthandle equal disjuncts@mpvl654008d
  • internal/core/adtdo not set error for nil task state@mpvl495f602
  • internal/core/adtreuse more lets@mpvlb96ed2c
  • internal/core/adtallow unprocessed@mpvl4d894fa
  • internal/core/adtremove filter for let sharing@mpvl521d442
  • internal/core/adtrearrange newNodeContext@mpvlf42b369
  • internal/core/adtmark nodeContext.clone as v2@mpvlb7d9b69
  • internal/core/adtadd benchmark for Issue 3334@mpvl99494a6
  • internal/core/adtmore eagerly update stats in tests@mpvl2862a10
  • internal/ciskip "check git tags" when testing CLs@mvdan5100525
  • internal/ciuse shorter Namespace runner profile aliases@mvdan6f50798
  • internal/cirun tests with GOARCH=386 on protected branches only@mvdan673b49f
  • internal/robustioadd stub js/wasm getFileID implementation@cuematthewc13484f
  • internal/core/adtnormalize how the tests configure the runtime@mvdana6abf3b
  • internal/cuetxtardo not load the root cuelang.org/go CUE module@mvdan7a237eb
  • internal/robustioCopy from upstream and consolidate use@cuematthew4544972
  • internal/core/adtremove unused test code@mvdanee299f0
  • internal/modpkgloadMake Package keep its set of files@cuematthew6405ce0
  • internal/coreremove a few unnecessary trailing Fprintln calls in tests@mvdanc2f57e3
  • internal/lsp/fscacheCreate CUECacheFS and OverlayFS@cuematthew955e7f4
  • internal/cidrop "evict caches" nightly cron job@mvdan206e824
  • internal/cicache staticcheck via nscloud-cache-action@mvdanff4639c
  • internal/ciassume the CI machines are reasonably modern@mvdan7bddda5
  • internal/ciskip the test cache via GOFLAGS=-count=1@mvdand3da405
  • internal/ciswitch to Namespace GitHub Actions runners@mvdanf615383
  • internal/core/adtdelay stringifying nodes in errors via fmt.Stringer@mvdan7e4dff2
  • internal/core/adtensure emptyNode is inert@mpvl2adf5e9
  • internal/core/adtuse custom int set implementation for visited@rogpeppe12ec0ec
  • internal/core/adtremove cycle check@mpvld92e916
  • internal/core/adtadd tests for 3978@mpvl81795ac
  • internal/core/adtrevert 1217228@mpvl47912fc
  • internal/core/compileadd version check for builtins@mpvl985e693
  • internal/core/adtadd builtin for user-defined errors@mpvl3ad8663
  • internal/core/adtrename CallContext.Expr@mpvl64ffd0d
  • internal/ciupdate Go and goreleaser versions@mvdan8d463da
  • internal/core/adtsupport unary == and != for all types@mpvl030658e
  • internal/core/adtcomparison of values of different types@mpvl34faddf
  • internal/core/adtconsider required fields for final values in Equal@mpvl64d5789
  • internal/core/adtsupport comparsion of structs@mpvl2b7dfbd
  • internal/core/adtfix error gobbling of internal nodes@mpvl665f697
  • internal/core/adtadd tests for Issue 3977@mpvl996e8b0
  • internal/cueexperimentsupport for per-file experiments@mpvl52988e0
  • internal/core/adtsimplify recursive getReqSets calls@mvdan2d4263e
  • internal/core/adtdo not repeat replaceIDs calls@mvdan8241d9c
  • internal/core/adthandle incomplete values in comparators@mpvlc925040
  • internal/core/adtuse replaceIDs incrementally in checkTypos@mvdan16c782a
  • internal/core/adtrewrite replaceIDs to scale better@mvdanb4212a3
  • internal/core/adtEqual should take defaults when appropriate@mpvl361384c
  • internal/core/adtlimit closedness check in Equal@mpvle8e8682
  • internal/core/adtmerge validate package with adt@mpvl26e1596
  • internal/core/adtadd tests for incomplete lists comparison@mpvle67898f
  • internal/core/adtuse pointers for snapshot and result in nodeContext@mvdan1a2d2e7
  • internal/core/adtadd tests for Issue 3929@mpvl7777230
  • internal/core/adthandle yields in Resolve@mpvl81e88ee
  • internal/core/adtadd tests for Issue 3972@mpvl0ac3913
  • internal/core/adtmake small iota enums consistently uint8@mvdance44cfb
  • internal/core/adtallow lookup across disjunction boundary@mpvl20afefd
  • internal/core/adtapply vertex rewriting to blocked tasks@mpvld713052
  • internal/core/adtadd tests for 3967@mpvl5c5f970
  • internal/pkgonly use %s with stringifiable builtin errors@mvdanfc4ca40
  • internal/core/exportavoid panic on non-regular identifiers for packages@rogpeppe8bbf9b4
  • internal/core/adtalso create embed scope for disjunctions@mpvlc925902
  • internal/core/adtadd tests for 3964@mpvl2597e9e
  • internal/core/adtfix default logic@mpvl8dc494c
  • internal/core/adtadd tests for 3958@mpvl5d162df
  • internal/corestart removing pre-toposort field ordering code@mvdan6fd9f7d
  • internal/core/adtdon't check removed scopes@mpvl86ef530
  • internal/core/adttrack scope of closed()@mpvlc6abd6e
  • internal/core/adtdo not remove embed groups@mpvl191a0eb
  • internal/core/adtadjustments to closedness algo@mpvl6746a82
  • internal/core/adtchange ellipsis to fix hidden bug@mpvle9a4d11
  • internal/core/adtupdate tests for 3833 and 3839 before fix@mpvlf7e46e9
  • internal/core/adtadd tests for Issue 3920@mpvl75660e3
  • internal/core/adtalso typo check disjuncts@mpvldba18d3
  • internal/core/adtadd tests for Issue 3957@mpvldeed94c
  • internal/core/adtremove most validator simplifications@mpvl487e526
  • internal/core/adtcopy bounds.txtar@mpvl97927bc
  • internal/golangorgxremove files build-tagged for old Go versions@mvdan15536aa
  • internal/golangorgx/tools/analysisinternalremove@mvdan830ad6f
  • internal/golangorgx/tools/typesinternalremove@mvdan6024ad4
  • internal/golangorgx/gopls/cache/methodsetsremove@mvdan881004d
  • internal/golangorgx/tools/tokeninternalremove@mvdan518f13e
  • internal/cueexperimentenable cmdreferencepkg by default@mvdan16444fa
  • internal/cueexperimenttoposort is always on now@mvdan06de121
  • internal/cueexperimentkeep record of how experiments advanced@mvdanfa77cff
  • internal/cueexperimentfile embedding is always on now@mvdan23f2527
  • internal/core/adtpartially revert CL 1214950@mpvle1fd269
  • internal/core/adtadd tests for 3946@mpvld2adadc
  • internal/cueversionavoid dependency on golang.org/x/mod@rogpeppe94630d5
  • internal/core/adtdo not always filter disjuncts@mpvl50e6b31
  • internal/core/adtadd tests for 3947@mpvla1f0964
  • internal/cueexperimenttweak the docs for all experiment flags@mvdan1981718
  • internal/cueversionbump languageVersion for v0.14@mvdan9eb4c14
  • internal/mod/modfiledatafactor out of mod/modfile@rogpeppeda6a638

mod4

  • mod/modfiledatarename File.ModulePath() to File.ModuleRootPath()@cuematthewb8a14de
  • mod/modpkgloadcorrect calculation of pkg.fromExternal@cuematthewa8ba684
  • mod/modpkgloadcapture faulty behaviour of pkg.fromExternal@cuematthewc237083
  • mod/modpkgloadMake LoadPackages support nil shouldIncludePkgFile@cuematthew19d3abc

tools4

  • tools/trimonly consider defaults when we're not ignoring the conjunct@cuematthewb95b211
  • tools/flowavoid looking like we're using go run for real@mvdan5f4bd37
  • tools/trimWork harder to discover disjunction branches@cuematthew7f38bb8
  • tools/trimhandle error cases in API@mpvlbd237a2

Other12

  • pkg/encodingadd test cases for disjunction errors with Validate@kilpkonn5189932
  • lsp/fscacheForce parsing mode to always be ParseComments@cuematthew741955c
  • update dependencies for v0.14.0-rc.1@mvdan0c84f96
  • update all direct dependencies@mvdan2df1b5a
  • doc/ref/spec.mdsupport struct and list for equality@mpvld58d1f5
  • doc/ref/spec.mddocument error builtin@mpvlbe18b05
  • update golang.org/x/... dependencies@mvdane88d161
  • cuecontextrevert support for CUE_EXPERIMENT@mpvl2a70935
  • cueexperimentexport Config type and use it@mpvl33a1792
  • READMEminor updates@jpluscplusmeb54082
  • update all other dependencies@mvdanb226e16
  • update golang.org/x/...@mvdanc947a0b

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

PlatformFile and SHA-256
macOS, Intelcue_v0.14.0_darwin_amd64.tar.gzbcbe7d6c2139f6b116945112c17687a25cf60a36deef4f3d5af873bc7e4260bf
macOS, Apple siliconcue_v0.14.0_darwin_arm64.tar.gz9f1a88e2ccabe12f24bbd3934ab8a487ccfa78df2aae1183b9b39c26bded9a7a
Linux, x86-64cue_v0.14.0_linux_amd64.tar.gz5733fe3a138eaacf8f8298f22c568e3ad55b3141971c1be9151906217fc2ee6a
Linux, Arm64cue_v0.14.0_linux_arm64.tar.gzf987b1f8cba359973a3050ac276d01e29162cda1de6a4ddb135ff6186bfa6f02
Windows, x86-64cue_v0.14.0_windows_amd64.zip9041f014820924e4fde7bb2c295f4da63e9ad6590f92d73e6c4bc37abe5f2077
Windows, Arm64cue_v0.14.0_windows_arm64.zip045878cf337143b54ccaff2718c4dd2431922ad53182a17d088e7a3d731b032b

SHA-256 checksums for all of these: checksums.txt

Install CUE