v0.17.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: ⚠️

Language

The parser now allows a newline or a comma before the closing bracket of an index expression, matching how lists and func arguments allow omitting trailing commas:

foo[
    "bar"
]

Evaluator

The comprehension algorithm now waits to run a comprehension’s body until the fields it reads have a concrete value, rather than trying to produce its fields up front. This resolves a number of long-standing bugs, most notably the last known regressions from evalv2, where a comprehension that should have resolved instead failed as an incomplete value or a cycle.

This design also greatly simplifies upcoming evaluator work, such as introducing new builtins to replace comparing values to bottom, as well as the design of evalv4.

The evaluator no longer deduplicates errors just by position, which was causing some useful errors from disjunctions or standard library calls to be dropped incorrectly.

A number of bugs, panics, and hangs have been resolved as well.

cmd/cue

cue vet -d/--schema now supports hidden fields, and correctly reports an error when the command inputs are CUE only.

cue fix and cue trim no longer change file modification times when no changes are necessary.

Encodings

⚠️ The experimental JSON Schema encoder now emits most definitions without the leading # character, shortening names and ensuring compatibility with the wider JSON Schema ecosystem. This required deprecating encoding/jsonschema.GenerateConfig.NameFunc in favor of NamesFunc.

Several closedness bugs in the JSON Schema encoder have been fixed, ensuring that the generated JSON Schema behaves the same way as the original CUE definition.

The ProtoBuf decoder now resolves relative references following the usual scoping rules, instead of always resolving them against the top-level scope.

Go API

Add Path.Compare and Selector.Compare, providing allocation-free total ordering suitable for slices.SortFunc.

All changes

117 changes since v0.17.0-alpha.1by area

all3

  • alladopt the cueckoo @-import guidance mechanism@myitcv5f10676
  • allfix reversed argument order in cmp.Diff calls@mvdan82d70cb
  • allmake use of strings.CutPrefix@mvdan34f13a2

cmd11

  • cmd/cuefix vet -d resolving a hidden constraint@mvdan5651def
  • cmd/cueadd test for vet -d with a hidden constraint@mvdan1a0c02c
  • cmd/cueadd a regression test for issue 3187@mvdan8273d6f
  • cmd/cueadd test for mixing Docker and Podman auth files@mvdan268fe24
  • cmd/cuepreserve mtimes in cue fix and cue trim no-op rewrites@mvdan28b3474
  • cmd/cuedocument mtime drift in fix and trim@mvdane56df9e
  • cmd/cuefix json error tests on Go tip@mvdanbd45f3e
  • cmd/cue/cmdadd test for exec.Run JSON marshaling@mvdanf44f49a
  • cmd/cuesurface [inputs] and [flags] in command help@mvdanbfa0112
  • cmd/cueerror when -d/--schema is used without non-CUE input@mvdan0a3d5ba
  • cmd/cuetest current -d behavior with only CUE input@mvdan0409f59

cue28

  • cue/testdataadd test for list-length error with comprehensions@mvdan40961bb
  • cuefix Value.ReferencePath after Eval when sharing is disabled@mvdan9a6d76d
  • cueclarify Value.ReferencePath path semantics@mvdan0adb8dd
  • cue/errorsdeduplicate without rendering errors unnecessarily@mvdane9f02ca
  • cue/errorsreport all distinct errors at the same position@mvdan774942d
  • cue/errorsadd a test recording how often removeMultiples renders errors@mvdan2ba0d46
  • cue/errorsadd tests for distinct errors dropped at the same position@mvdana753484
  • cueavoid panic in Value.Path for dereferenced let bindings@mvdan58f2356
  • cue/testdata/cycleadd regression test for issue 4357@mvdanffc0541
  • cue/testdataadd #4149 regression test for or structural cycle@mvdan803c837
  • cue/testdataadd #4367 regression tests@mpvl2735d5a
  • cue/testdata/cycleadd regression test for issue 3364@mvdan40caafe
  • cue/parserallow a newline before the closing bracket of an index expression@mvdanfa44ce4
  • cue/testdataadd regression test for self-referential builtin cycles@mvdanabe46a1
  • cue/testdataadd test for issue #4312@mvdan9888e6f
  • cue/testdataadd comprehension pushdown regression for inline conjunction iterator@mpvl29b71ea
  • cue/testdataadd test for issue #4174@mvdan75c434d
  • cue/testdataadd test for issue #4094@mvdane0a7df6
  • cue/testdataadd test for issue #4091@mvdandd8ef3d
  • cue/parserremove pre-v0.2 alias special error@mvdan1889ee7
  • cue/parseradd test cases for pre-v0.2 alias handling@mvdanf68b1ed
  • cue/parserremove dead error test code@mvdand636840
  • cueadd Unify regression test for comp-produced sub-vertex@mpvl6a67e3f
  • cue/testdataadd regression test cases to comprehensions/pushdown@mpvlbd146e1
  • cuehandle ArcPending and ArcNotPresent in fromArcType@mpvl3b7b66e
  • cuedrop stale same-runtime/build requirement from Value docs@mvdane512a32
  • cue/testdatarelax test assertions for refactoring stability@mpvl55a7b0a
  • cueadd Compare methods to Path and Selector@rogpeppe63c8014

encoding11

  • encoding/jsonschemamark generation as experimental@rogpeppe223cfa7
  • encoding/protobuftranslate google.protobuf.Struct to an open struct@mvdanef3e0ee
  • encoding/protobufrespect lexical scoping rules@SteveRubled34b9f5
  • encoding/inimake dotted section-name nesting configurable@ReginaZhangMScd0f418
  • encoding/jsonschemafix closedness handling in Generate@rogpeppe3767108
  • encoding/jsonschemapass closedness mode through OrOp in Generate@rogpeppeb01cdb4
  • encoding/jsonschemaadd test case@rogpeppec0afa64
  • encoding/jsonschemaadd tests for closedness bugs in Generate@rogpeppe2db6796
  • encoding/jsonschemapropagate recursive closedness in Generate@mvdan2b2987e
  • encoding/jsonschematest recursive closedness of generated schemas@mvdan5a0dd64
  • encoding/jsonschemabetter definition names in Generate@rogpeppe8e638c0

internal52

  • internal/cibump Go and goreleaser for the upcoming alpha@mvdanc2a8155
  • internal/core/adtreport true element count for list length mismatch@mvdand474938
  • internal/core/debugonly print integer-labeled arcs of a list value@mvdan8fdf9d5
  • internal/filetypesclarify error for combined file type and file name@mvdanb15022d
  • internal/core/adtrecompute cached let results that resolved to a cycle@mvdan4a67df9
  • internal/cuetxtarkeep nested inline positions relative@mpvldede65a
  • internal/core/adtdetect structural cycle through inline conjunction@mvdanf518389
  • internal/core/compileupdate compile file comments@mpvl5a6110a
  • internal/core/adtloosen structure-sharing skip in cycle detection@mpvlaae3830
  • internal/core/adtbound self-recursion in cycle detection skip@mpvl297d254
  • internal/core/adtdo not treat structure sharing as a cycle@mpvlc37cf24
  • internal/core/adtscope task context error before deferred tasks@mpvl697512f
  • internal/core/adtskip typo check on cross-context Finalize@mpvla9f3f2a
  • internal/mod/modregistrybump ociregistry to merge auth sources@mvdan033671e
  • internal/core/adtskip in-flight nodes when reclaiming buffers@mpvl489f4a9
  • internal/core/compileinclude label-aliased fields in cross-file scope@mvdan4157262
  • internal/core/exportfix label references in pattern constraints@mvdan0c639f4
  • internal/core/compilestrip @test attributes from mirrored inputs@mpvlb343757
  • internal/core/adtflush label-only cyclic CallExpr deferments@mpvldd5b4c0
  • internal/core/adtremove unused nodeContextState.hasOpenValidator@mvdanae29eac
  • internal/core/adtremove unused Bottom.Permanent field@mvdan8f8a581
  • internal/core/adtremove unused Bottom.ForCycle field@mvdanb24e6fd
  • internal/core/adtremove unused StructLit.isComprehension field@mvdan0e0dbc1
  • internal/core/adtremove unused StructLit.IsOpen field@mvdan023bcd0
  • internal/ciset GORACE in the base config@mvdan0e2745d
  • internal/core/adtfix data race in concurrent FillPath@mvdan06056b9
  • internal/core/compileisolate txtar goldens@mpvldfc376f
  • internal/core/adtskip Disjunctions on ancestor-cycle arcs@mpvla10029d
  • internal/core/adtfix stale BaseValue cycle on cross-package imports@mpvlb7f911d
  • internal/core/adtre-deref v in Vertex.lookup after state.process@mpvld30d51a
  • internal/core/adtdefer fieldSetKnown while a parent task is still active@mpvl9e96d2c
  • internal/core/adtdependency-tracking comprehension pushdown@mpvl339485d
  • internal/core/toposortinterleave sibling Repeats in field ordering@mpvl00349c2
  • internal/core/exportadd another test for the toposort bug@mpvl93c3a70
  • internal/core/exportadd topocomp regression test@mpvl65492ed
  • internal/core/exportdedup conjuncts sharing the same body AST@mpvl18911c7
  • internal/core/adtadd reproducer for unity failure@mpvldefac2f
  • internal/ciallow specifying a custom ref in checkoutCode@mvdan697a664
  • internal/core/adtpropagate cycle errors via state in reportFieldError@mpvl424fe38
  • internal/core/adttighten up states@mpvle3cf2cd
  • internal/core/adtadd some edge case tests@mpvl8421e7e
  • internal/golangorgxremove unused dead files@mvdan84032e7
  • internal/core/adtidentified faulty tests@mpvl22e3b46
  • internal/core/adtlocalize cycle in disjunct sharing path@mpvl7c6198e
  • internal/core/adtyield on incomplete reference to in-flight node@mpvl17a5fa8
  • internal/cuetxtarhonor any= in cmpErr (nested @test(err, any, ...))@mpvl5f571a5
  • internal/cuetxtarreplay source @test directives for permute@mpvla90bc50
  • internal/cuetxtarrender struct-level errors as bare _|_ with err annotation@mpvla59b4cd
  • internal/cuetxtarauto-promote @test(eq:todo) under CUE_UPDATE@mpvlea842e9
  • internal/cuetxtartighten cmpStruct/cmpConjunction against silent passes@mpvldbda38d
  • internal/core/adtforce update cleanup@mpvlb3338e8
  • internal/anyhashnew package@rogpeppe019f9df

pkg5

  • pkg/listreport a missing less field as a fatal error@mvdan6aa4a11
  • pkg/encodingreport every Validate conflict@mvdan81f9d1b
  • pkg/encodingadd tests for Validate reporting a single conflict@mvdan5310062
  • pkg/listadd a regression test for list error printing hidden arcs@mvdanf9b4c66
  • pkg/tool/execdefault env to an empty struct@mvdan74211d7

Other7

  • .claudeadd a skill to draft release notes from a commit log@mvdan7935fe8
  • mod/modconfigdelete the dummy $DOCKER_CONFIG dir when the tests are done@mvdanffb2fbd
  • modconfigupdate ociregistry to pick up ociauth fix@mvdane5e958e
  • update dependencies ahead of the next alpha release@mvdan2fddd86
  • mod/modcacheretry .partial file writes on Windows@mvdanf438e31
  • add a SECURITY.md for easier GitHub discovery@mvdan8115669
  • tools/fixremove the unused processor type@mvdana07a818

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.17.0-alpha.2_darwin_amd64.tar.gz8c8331200b9dd161758d665443447913198241b104186fc7986f43367f63901d
macOS, Apple siliconcue_v0.17.0-alpha.2_darwin_arm64.tar.gzda725b063893748db3b8256a72efae81ad5a461217262072455189285e3eacd6
Linux, x86-64cue_v0.17.0-alpha.2_linux_amd64.tar.gz04bc21f137b948d6e086b1cecaf5fb32ca2344057cad04cc99137e2e0a7aefa1
Linux, Arm64cue_v0.17.0-alpha.2_linux_arm64.tar.gz586f5b3cbb8e8df79c6bb1a646291c31ebbc5f4a9da6ff9802cee6df0a290eab
Windows, x86-64cue_v0.17.0-alpha.2_windows_amd64.zipdef9ecc56bc8a2d3eb23d5502a8a5a83703e1ede54f8daec0890abb760d0f139
Windows, Arm64cue_v0.17.0-alpha.2_windows_arm64.zipab8fe35958572f468b2ea794e665686bd75fb8d5bfe2995b5b53974376a59a2d
Install CUE