v0.14.0-alpha.1

cue-lang/cue Pre-release Released

A release of CUE OSS · its page on GitHub

This release introduces a new error builtin, two language changes, and many fixes and optimizations for the new closedness algorithm.

Changes which may break some users are marked below with: ⚠️

Evaluator

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 thix 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.

Documentation and examples will be available for the v0.14.0 release.

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.

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

114 changes since v0.13.0by area

all6

  • 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

cmd20

  • 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

cue14

  • 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

internal66

  • 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

Other8

  • 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-alpha.1_darwin_amd64.tar.gz1d72a3d992d9ede9984db10338cfdfe480079437c47b4cb99f77fdc7cd7367fe
macOS, Apple siliconcue_v0.14.0-alpha.1_darwin_arm64.tar.gz4ff0e86ac45c1484247b8308d8e2a5adf8e527b1713d35ecbb50f6868f02821d
Linux, x86-64cue_v0.14.0-alpha.1_linux_amd64.tar.gz9959bba0b5926da20cb282ade77a8124273ff8a3ccd577a33381d8340b589145
Linux, Arm64cue_v0.14.0-alpha.1_linux_arm64.tar.gz2caee4472438eed9e59a42cff73cb87f39945008c2a12b5b7addf0d32e5069aa
Windows, x86-64cue_v0.14.0-alpha.1_windows_amd64.zip86a8ae2876ddd9b8a5401b92f30514e6d0ce235a61a4a5377d3b29096661812d
Windows, Arm64cue_v0.14.0-alpha.1_windows_arm64.zipf384ee01ff8bdf6f3fc798daa9294df5f84a3c1f079ec8ed0e65a263f445fa5d

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

Install CUE