v0.15.0-alpha.2

cue-lang/cue Pre-release Released

A release of CUE OSS · its page on GitHub

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

Evaluator

self experiment

The self experiment enables a new “self” predeclared identifier, which refers to the innermost surrounding struct or list, or the top level if none exist.

Once a module’s language.version targets v0.15.0, this can be enabled via the file attribute @experiment(self). The introduction of a new predeclared identifier should be a fully backwards compatible change. The LSP also adds support for the self experiment.

For more information, see the proposal on GitHub and the spec change patch.

Other changes

⚠️ With its proposal accepted, the keepvalidators experiment is now stable, meaning that CUE_EXPERIMENT=keepvalidators is always enabled.

With its proposal accepted, the structcmp experiment is now stable with language.version at v0.15.0 or later, meaning that the @experiment(structcmp) attribute is unnecessary as it’s always enabled.

The evaluator now shows all user errors created with the error builtin when they can be related to a disjunction failure. Previously, the evaluator would try to only show user errors directly part of a disjunction error, but that caused too many omissions.

Fix a regression introduced in v0.12.0 where incomplete errors were not being handled consistently if they directly involved the top-level value.

cmd/cue

A new cue help experiments command is introduced to document all available per-file and global experiments.

Fix a regression introduced in v0.9.0 where loading a qualified pattern like ./...:pkgname no longer filtered files based on the package name given.

LSP

Support is added for standalone CUE files, meaning any CUE file which is not part of a package inside a module. For example, a CUE file without a package declaration, or a CUE file outside of any CUE module.

Encodings

The YAML library in the archived Go module gopkg.in/yaml.v3 has been replaced by go.yaml.in/yaml/v3, an active fork now maintained by the YAML organization.

cue exp gengotypes is improved to handle more edge cases with CUE package imports which could result in broken Go code.

Go API

cue/ast.StringLabelNeedsQuoting determines whether a string label needs to be quoted when used in CUE syntax.

cue/ast.NewStringLabel creates an ast.Label as either an unquoted identifier or a quoted string, depending on whether the string label needs quoting.

⚠️ cue/build.Instance.Match is removed, given that it was never set to any value at any point since it was added.

All changes

67 changes since v0.15.0-alpha.1by area

all3

  • allrun cuetxtar garbage collection@rogpeppe3e1e769
  • allconsistently split test table structs@mvdan43fd8bc
  • allswap len([]rune(s)) for utf8.RuneCountInString(s)@mvdan2de87fb

cmd11

  • cmd/cue/cmdalias cue help experiment@rogpeppe5432a20
  • cmd/cueadd a test case for the recent :pkgname CLI argument regression@mvdana880c06
  • cmd/cuesimplify when printing imported CUE schemas@mvdan16118b3
  • cmd/cueremove debug print in get go@mvdan91d2572
  • cmd/cueremove the last use of sh in testscripts@mvdan25d062b
  • cmd/cueinclude global experiments in experiment help@mpvl062fc5b
  • cmd/cueadded cue help experiments command@mpvlf1feade
  • cmd/cuetest the handling of interrupt signals@mvdan8e34149
  • cmd/cuetreat top-level incomplete errors consistently@mpvl26efa72
  • cmd/cueadd test for issue 4079 and 4029@mpvl07635e5
  • cmd/cueadd test for issue 4005@mpvl1fc8f9d

cue21

  • cue/astrename NewLabel to NewStringLabel@mvdan869b034
  • cue/buildremove the Instance.Match field, which was never set@mvdandc3731d
  • cue/literaluse Form.tripleQuote when quoting a string@mvdanaf175ed
  • cue/astremove commented out bits of code@mvdaned355b0
  • cue/testdataadd a test case for quoting paths in evaluator errors@mvdan08d34f9
  • cue/formatremove unnecessary IsDefOrHidden check@mvdan0010744
  • cue/astadd StringLabelNeedsQuoting@mvdan1f88e1a
  • cue/statsuse ResolveDep in arithmetic@rogpeppe37ebf7e
  • cue/testdata/basicrewriteuse consistent spelling for "diff/explanation"@rogpeppe8332fd5
  • cue/parseruse more robust logic for detecting the end of an interpolation@rogpeppeafdde34
  • cue/parseradd test case for string interpolation edge case@rogpeppe276bcce
  • cue/scannerdocument how interpolations work@rogpeppe7e9543b
  • cue/asttweak ParseImportPath to treat :pkgname as .:pkgname@mvdan0a41be8
  • cue/loadrespect package qualifiers when matching wildcard packages@rogpeppea862f84
  • cue/loaderadd test for issue 4110@rogpeppe36bcb3e
  • cueadd test for issue 4093@rogpeppe47dab36
  • cue/astintroduce NewLabel helper for regular fields@mvdan8561bce
  • cue/loadadd test case for the fixed issue 741@mvdanb74aa03
  • cuededuplicate work from adt.Vertex.Elems@mvdan258881a
  • cueimplement "self"@mpvl28641c0
  • cue/testdataadd fixed test case for issue 3743@mvdanbae3189

doc3

  • doc/ref/spec.mdsome formatting and typo fixes@mpvl139b17a
  • doc/ref/spec.mdsupport unary == bound@mpvl3500cef
  • doc/ref/spec.mdsupport comparing values of different types@mpvlc356290

internal20

  • internal/encoding/gotypeshandle CUE import aliases and duplicates@phoban01ba534b5
  • internal/cuetxtarimplement garbage collection@rogpeppea3eb068
  • internal/core/compileproperly quote labels in error message paths@mvdan01181e9
  • internal/cuetdtestconsider the first item in a Matrix to be default@rogpeppe1bc296c
  • internal/core/adt"write" stats file even when it isn't changing@rogpeppe1873f84
  • internal/lsprefactoring@cuematthewab67c05
  • internal/core/adtadd Kind.AllKinds and Kind.Count methods@rogpeppe313e0c1
  • internal/exportcater for NodeLink@rogpeppeb2a7b29
  • internal/encoding/yamluse cue/ast.NewLabel@mvdan43c8a39
  • internal/core/convertuse reflect.Value iterator methods@mvdanbe9298b
  • internal/core/adtimprove structure sharing for _@mpvl458b038
  • internal/ciupdate various action dependencies@mvdan79e9f72
  • internal/core/adtmake Vertex.Elems return an iterator@mvdane95b0f9
  • internal/cueexperimentmake keepvalidators stable@mpvlc9da2b2
  • internal/cueexperimentstandardize experiment lifecycle system@mpvl9867177
  • internal/core/adtaccept structcmp experiment@mpvl8572198
  • internal/core/adtshow all user errors@mpvl519b41f
  • internal/core/adtadd test for Issues 3983 and 3984@mpvlada7c5a
  • internal/core/debugprevent stack overflow@mpvl59ed403
  • internal/core/debugremove use of compact printer type@mpvl9ad4116

lsp5

  • lsp/cachebe robust for nil file content@cuematthewec216cf
  • lsp/definitionsadd support for the self experiment@cuematthewd4f9bfb
  • lsp/definitionscompletions from dot should be zero width@cuematthew5c15642
  • lsp/cacheprevent files from being both standalone and module/package@cuematthew9357acf
  • lsp/cacheadd support for standalone files@cuematthew632f9b7

Other4

  • encodinguse ast.StringLabelNeedsQuoting@mvdana73e4cd
  • update all dependencies@mvdan5944fee
  • encoding/xml/koalause ast.NewLabel@mvdan880df5b
  • swap gopkg.in/yaml.v3 for go.yaml.in/yaml/v3@mvdan2502321

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.15.0-alpha.2_darwin_amd64.tar.gz9545dabac462e54e360e2965149eca2261338b18e552b1395e06c48bf2a14504
macOS, Apple siliconcue_v0.15.0-alpha.2_darwin_arm64.tar.gz5f797e91691893c5bfebbfd750e691c45391c8bdf6d732f66c1c7677e5dc71d1
Linux, x86-64cue_v0.15.0-alpha.2_linux_amd64.tar.gz50f328e106748cd4176d47ed77b02f28ca9af30a4de75446f9a7365b9a5f1880
Linux, Arm64cue_v0.15.0-alpha.2_linux_arm64.tar.gzf3068cbabd612372adea7d0e0fe61bfb1632b6d3a0f67a378e255a6f016e52db
Windows, x86-64cue_v0.15.0-alpha.2_windows_amd64.zip8735b978147863a1e0b6c0a4bf2322d721962965d2d41effd061050ac66ff900
Windows, Arm64cue_v0.15.0-alpha.2_windows_arm64.zipf1c6232b36a9bfdb023c937aed9d7f24c37f20fc9d6f9d439622088535288a39

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

Install CUE