v0.13.0-alpha.1

cue-lang/cue Pre-release Released

A release of CUE OSS · its page on GitHub

This release brings a new cue trim algorithm, a performance fix for field ordering, two new commands, and many fixes.

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

Evaluator

A great deal of work has happened in the new evaluator, which can be used via CUE_EXPERIMENT=evalv3. Marcel recently posted another update on performance progress.

An entirely new algorithm for cue trim and tools/trim has been implemented for CUE_EXPERIMENT=evalv3, which resolves all known bugs when trimming CUE. Give it a try and report any issues you find.

⚠️ The new topological sort algorithm for field ordering has been tweaked to avoid becoming too slow in some cases. This may result in some ordering changes, but we expect them to be relatively small. See the change for more details.

The parser now correctly allows keywords as required field labels such as if!: _, fixing a discrepancy with the spec.

cmd/cue

The new cue refactor imports command rewrites import paths, making it easy to migrate between module locations and major versions.

The new cue mod mirror command copies modules from one registry to another.

cue get go should no longer attempt to import types from the Go standard library as CUE, which caused errors.

Hidden files and files with build tags should now be correctly filtered when loading a single CUE package.

Encodings

Loading binary files, such as via @embed(file="foo", type=binary), no longer requires the input to be valid UTF-8.

⚠️ The JSON Schema decoder now imports schema descriptions as CUE doc comments, which required a change to encoding/jsonschema.Config.DefineSchema.

Go API

⚠️ The long-deprecated cue.Runtime methods Parse, FromExpr, CompileFile, and CompileExpr are now removed.

module.SplitPathVersion and module.ParseImportPath have been deprecated in favor of cue/ast.SplitPackageVersion and cue/ast.ParseImportPath package to consolidate the API.

The new mod/module.Version.Compare method is added in favor of module.Sort, which is now deprecated.

The new mod/modfile.File.ModuleForImportPath function allows resolving a module and default major version for a package without consulting a registry.

The new mod/modregistry.Client.Mirror method implements the logic behind the new cue mod mirror command.

All changes

142 changes since v0.12.0by area

all9

  • allstart making more use of strings.Cut@mvdan7d62514
  • allunconvert -apply ./...@mvdancbed854
  • alluse a few more newer std APIs@mvdan538fb69
  • allstart using slices.Backward@mvdan66d4c35
  • alluse more maps and slices APIs from Go 1.23@mvdan6a00a13
  • allGODEBUG=gotypesalias=1 is on as of go1.23.0@mvdan0eeb982
  • allstart using maps and slices APIs from Go 1.23@mvdanb343839
  • alluse eval.NewContext when possible@mpvlf4da7a3
  • alluse ast.ParseImportPath and ast.ImportPath@rogpepped5ab208

cmd18

  • cmd/cuemention --inject-vars/-T flag for injection help@myitcv90c1965
  • cmd/cue, internal/mod/modimportsadd test cases for issue 3795@rogpeppe2742aba
  • cmd/cueadjust the detection of Go standard library packages@mvdan153fc8a
  • cmd/cueactually drop unsupported Go std types in get go@mvdan97cbf7e
  • cmd/cueadd testscript reproducing get go issues with std packages@mvdan9a53c81
  • cmd/cuefix refactor imports over multiple modules@rogpeppe7cc1de3
  • cmd/cue/cmdshow incorrect handling of binary files when embedded@nichtsundniemand073d23c
  • cmd/cuestop marking the login command as experimental@mvdan324b3da
  • cmd/cueembed support is no longer experimental@mvdandce7fda
  • cmd/cue/cmdadd test for edge case@mpvl587d5a1
  • cmd/cuedon't truncate refactor-imports help text@jpluscplusm9413ce6
  • cmd/cueupdate workflow command help text links@jpluscplusm3545df1
  • cmd/cueimprove CUE example for exp-gengotypes@jpluscplusm8d8a36d
  • cmd/cuemention -c=false in vet's incomplete error@jpluscplusm6fb2a9b
  • cmd/cueadd experimental warning to gengotypes@jpluscplusmf0ed173
  • cmd/cueimplement mod mirror@rogpeppe7d7abff
  • cmd/cueadd refactor imports command@rogpeppe8dbff63
  • cmd/cuefix typos in cue-help-filetypes@jpluscplusm0a43336

core4

  • core/toposortstop trying to order structinfos/structlits@cuematthewbc6c485
  • core/toposortDo not calculate cycles within an SCC@cuematthewd73e690
  • core/adtcorrect copying of conjuncts in stripNonDefaults@cuematthew15a702e
  • core/adtCombine Vertex.Structs when inserting Conjunct for evalv3@cuematthew2d65404

cue10

  • cue/loadrespect build tags when determining package@rogpeppe58e09ee
  • cue/loaduse iterator range@rogpeppe9ba4189
  • cue/parserallow if as a label for a required field@haoqixu18367a6
  • cue/interpreter/embedremove obsolete TODOs@mvdan8585568
  • cue/parserallow for as label for required field@haoqixufc8791f
  • cuetweak cue.Value.Decode with Go std changes@mvdan4e0cc47
  • cue/testdataadd a benchmark test for https://cuelang.org/issue/3514@myitcvd12c8be
  • cueadd tests for Unify@mpvlb582d7f
  • cue/astproperly deprecate Optional and Token in Fields@mvdan0265d7d
  • cueremove more long-deprecated APIs@mvdan2c86de5

encoding12

  • encoding/jsonschemasupport x-kubernetes-embedded-resource@rogpeppe0cd0a0c
  • encoding/jsonschemainitial support for Kubernetes CRDs@rogpeppe0dcaff5
  • encoding/jsonschemadelete code for Go 1.22@mvdan24e90ed
  • encoding/jsonschemasupport single schema not at root@rogpeppecdc4123
  • encoding/openapiconvert remaining cue->json tests to txtar@cuematthewba1084a
  • encoding/openapiconvert test suite to txtar@cuematthew374c59e
  • encoding/jsonschemapass comments to DefineSchema@rogpeppe880023b
  • encoding/jsonschemapass comments to DefineSchema@rogpeppe7a3708e
  • encoding/jsonschemabetter placement of jsonschema attribute@rogpeppe09effdb
  • encoding/jsonschemaadd test case for if/then/else with $id@rogpeppe29be366
  • encoding/openapiswap sort.Slice for slices.Sort@mvdan1d7f66f
  • encoding/jsonschemause a cmp-based stable sort when decoding constraints@mvdandb72890

internal69

  • internal/mod/modimportsexclude hidden CUE files@rogpeppe8f2c89c
  • internal/ciupdate Go and goreleaser@mvdanbebbaa9
  • internal/cuetxtarAppend \n to generated txtar file content@cuematthew5d2da07
  • internal/_e2eremove unused CUE_REGISTRY_TOKEN env var@mvdan239f3d3
  • internal/core/adtfix counter issue@mpvla0c6dfe
  • internal/core/adtfix edge case in structural cycles with structure sharing@mpvl966a504
  • internal/core/adtfix structural cycle stack overflow@mpvla66eaf3
  • internal/core/adtremove Inline check@mpvl7bb676e
  • internal/core/adtmake inline expressions addressable@mpvl35ec59b
  • internal/core/adtdo not hasNonCycle in one case@mpvl52c02d0
  • internal/core/adtrefactor unifyNode@mpvle55c7a8
  • internal/core/adtadd tests for issue 3634@mpvl8ed768a
  • internal/encodingdon't interpret files as UTF8 with the binary encoding@nichtsundniemand0b36c4e
  • internal/core/adtpropagate default marker in single nested value@mpvl26a698f
  • internal/core/adtadd tests for issue 3779@mpvl8b80c3d
  • internal/core/adtfix FromDef@mpvldf327a6
  • internal/core/adtshorten closeContext graph depth@mpvlb17ea50
  • internal/vcsuse os.CopyFS from Go 1.23@mvdan873afd5
  • internal/core/adtremove unnecessary clearing of CloseInfo@mpvl3ed6d8d
  • internal/core/adthoist feature checking logic@mpvlae5a017
  • internal/core/adtdo not add arc dependencies for some nodes@mpvl98a3f93
  • internal/core/adtprepare for shortening root@mpvl58b3e7d
  • internal/core/adtadd test for closeContext graph shortening@mpvl0d33c2e
  • internal/core/adtsimplify ellipsis logic@mpvl694d295
  • internal/core/adtfix bug when merging closing struct with ellipsis@mpvl7822519
  • internal/core/adtadd test for issue 3778@mpvldf049c8
  • internal/core/adtbring semantics of top in line with v2@mpvl9601805
  • internal/core/adtfix yield unwinding issue for validators@mpvl34ab133
  • internal/core/adtadd tests for 3762@mpvl71edb90
  • internal/core/adtfix consistency issue for disjunctions@mpvlbb1be01
  • internal/core/adtadd tests for 3124@mpvl53fbe1e
  • internal/core/adtremove diff/todo/p1@mpvla1be113
  • internal/core/adtimprove reference cycle behavior@mpvl67886c6
  • internal/core/adtexplicitly detect cycle error@mpvl4350436
  • internal/core/adtput blocking queue on stack@mpvl313b62f
  • internal/core/adtadd tests for 3669 and 3737@mpvl18a0661
  • internal/core/adtdisable nodeContext.free@mpvl93d4e38
  • internal/core/adtprune recursive processing@mpvld8d19aa
  • internal/core/adtremove noop counter@mpvl3390dea
  • internal/core/adtlogging improvements@mpvl7b03078
  • internal/core/adtpass and use OpContext to functions using Schema@mpvlf1d39f0
  • internal/encoding/yamluse adt.Unify instead of Value.Unify@mpvlc9c8cb4
  • internal/core/adtavoid crash@mpvl11be031
  • internal/core/adtmove cycle state saving logic to Expr@mpvl3e021be
  • internal/valuesupport more types and rename ConvertToContext@mpvl96d9f6f
  • internal/core/adtadd Expr method on CallContext@mpvlee11854
  • internal/core/adtrecursively resolve pending arcs before lookup@mpvl8d01019
  • internal/core/adtadd test for issue 3708@mpvl7bfa238
  • internal/core/adtremove GroupUnify mechanism@mpvlab1e2d9
  • internal/core/adtdo not carry forward FromEmbed@mpvl455b96b
  • internal/core/adtdo not carry forward FromDef flag@mpvl3d57eed
  • internal/core/adtuse adt.Unify in cue package@mpvldd9e48f
  • internal/envflagsmall follow-ups to int and string support@mvdane6fec6b
  • internal/core/adtfix handling of top@mpvl433e3c3
  • internal/envflagsupport int and string flags@mvdan0e42b0b
  • internal/envflagskip over empty comma-separated elements@mvdan62ea127
  • internal/core/adtpass CallContext to builtin functions@mpvl5991735
  • internal/core/adtfirst step in using CallContext@mpvl5886c49
  • internal/core/adtfix hang on finalization@mpvld4d20b6
  • internal/core/adtprevent recursion in calls@mpvl16e3250
  • internal/core/adtdo not count validators as new data@mpvl5b4a02e
  • internal/core/adtfix some cycle issues related to validators@mpvl36174e5
  • internal/core/adtset the parent in UnifyValidator@mpvl0eb0235
  • internal/core/adthoist unifyValidator@mpvl7fd7f6d
  • internal/core/adtavoid cycle in debug output@mpvlbd087f6
  • internal/core/adtadd tests for 3649@mpvlc63ed21
  • internal/core/adtadd more error context in matchN@mpvl950a30f
  • internal/cmd/cue-astadd support for ref and file-only@rogpeppe809299a
  • internal/cueversionbump LanguageVersion for v0.13@mvdan8a94279

mod6

  • mod/moduleadd Version.Compare@mvdan931fecb
  • mod/modregistrytestmove from internal/registrytest@mvdanb14cfde
  • mod/modregistryadd Mirror@rogpeppe5d7cdbb
  • mod/modfileadd ModuleForImportPath@rogpeppeb684a52
  • mod/modfilemake it an error to have an empty module path@rogpeppec269767
  • mod/moduleadd explicit test for package path with full version@rogpeppe24cf1f8

pkg3

  • pkguse adt.Unify instead of Value.Unify@mpvlb71b8c0
  • pkg/encoding/jsonexpand implementation of Validate in place@mpvl87db94f
  • pkg/encoding/yamlhoist validate functionality@mpvldc3e807

Other11

  • update golang.org/x dependencies@mvdanb6618cc
  • update various dependencies unlikely to cause breakage@mvdan66f9e79
  • cue.moduse exp3 curated modules@myitcvfca4a5f
  • Revert "encoding/jsonschema: pass comments to DefineSchema"@mvdanb6f250e
  • tools/trimimplement trim for evalv3@cuematthewe3d44f0
  • tools/trimprepare for trimv3@cuematthew13fdb81
  • require Go 1.23 or later, test and release with Go 1.24@mvdan1a8c16d
  • update emicklei/proto and protocolbuffers/txtpbfmt@mvdan2781759
  • ast/astutilmake Resolve aware of version suffixes@rogpeppe6a125a9
  • cue.modupgrade to latest GitHub actions curated module@myitcv802d7f4
  • ast/astutiladd test for resolving imports with major version suffix@rogpeppe5ab4551

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.13.0-alpha.1_darwin_amd64.tar.gzd74b484db9d0b82685fdb865e4b4a1a4ab14e7fd0bfc4ee49766e9f8e48f5d34
macOS, Apple siliconcue_v0.13.0-alpha.1_darwin_arm64.tar.gz96c31242efabb5edd7d89769c2f6163dfd01ccc305ae8323195f2d853cbf370d
Linux, x86-64cue_v0.13.0-alpha.1_linux_amd64.tar.gz4bf8b7f3139dc4383cb63a0a822f4b08b8ea4aa1cbba9a32ae641539c1345fb9
Linux, Arm64cue_v0.13.0-alpha.1_linux_arm64.tar.gz0ac1ed0a478c6bd6f1ec93656f4d9b65ce15f9eb6a20f18964046ac7ce5af861
Windows, x86-64cue_v0.13.0-alpha.1_windows_amd64.zipb2b2ff3b1b2cb6cffdab69e590a1dc2f1156c6bb573d738c2b0ddb4ed83138f8
Windows, Arm64cue_v0.13.0-alpha.1_windows_arm64.zip332743a002bf7b2022763753e7e93144991542bc222da790bed0e0283033a3d6

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

Install CUE