v0.17.0-alpha.3

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

Several long-standing cycle-detection bugs have been fixed, such as self-referential uses of matchN and matchIf, self-feeding disjunctions, and comprehensions that read a let binding which refers back to the comprehension’s own fields.

Fixed a bug where the same package imported via different qualified import paths (e.g. foo.com/bar@v0 or foo.com/bar:baz) did not share the same hidden field namespace.

Fix a data race which could occur when concurrently loading the same imported packages.

cmd/cue

Module replace directives

cue now supports replace directives, letting you substitute a module dependency with a local directory or a different remote module during development - for example while testing a fix to a dependency before it is published, or to replace a dependency with a fork including improvements.

This configuration lives in cue.mod/local-module.cue, which is excluded when publishing to registries. cue mod edit and cue mod tidy gain support for maintaining this file.

We have also published a how-to guide on replacing a dependency with a local module.

Read the full design and provide feedback in the proposal, or read the cue.mod/local-module.cue reference docs.

Other changes

Resolving an unversioned import from a dependency module now respects that module’s own default major version, instead of always using the main module’s default.

Fix a bug where the flag cue export --path was ignored when the inputs were pure CUE.

cue import --with-context now ensures that data represents the original raw input data, and not its interpretation like JSON Schema. Command input parsing is improved so that CUE packages can come after data files, such as cue vet -c data.yaml ./schema.

A $CUE_CACHE_DIR directory is no longer required when loading CUE without external dependencies.

Standard library

Add time.ToUnix and time.ToUnixNano, which convert an RFC3339Nano time value into seconds or nanoseconds since the Unix epoch, complementing the existing Unix builtin.

Go API

⚠️ The modconfig.Registry interface is changed to report default major versions, which is required for resolving unversioned imports against each dependency module’s own defaults. Clients that implement or wrap the interface will need to update. The new interface is future-proofed for upcoming modules changes.

All changes

57 changes since v0.17.0-alpha.2by area

cmd12

  • cmd/cuereject non-string label values for --path@mvdan5a0f4f7
  • cmd/cueadd test for --path with a non-string label value@mvdan772d1d3
  • cmd/cuedrop github.com/google/shlex test dependency@mvdan69bf7d7
  • cmd/cueadd test for package arguments listed after files@mvdaned3622b
  • cmd/cueadd replace directive support to mod edit@rogpeppe9984dae
  • cmd/cuehonor -l/--path when exporting CUE values@mvdan0abb86e
  • cmd/cueadd test for export -l with CUE output@mvdan14d7d4d
  • cmd/cuepoint to 'cue help flags' from the --with-context flag@mvdan8b9f8be
  • cmd/cueevaluate --with-context labels against the source data@mvdan9bb021f
  • cmd/cuetest various command scenarios without cache/config dirs@mvdan445c76d
  • cmd/cueadd test for label references with jsonschema import@mvdanf33b9de
  • cmd/cueadd test cases for issues 4370 and 4371@rogpeppe230bbbb

cue15

  • cue/loadaccept package arguments after file arguments@mvdandd80111
  • cue/testdataadd missing error output for issue2627@mpvl092c281
  • cue/build,cue/loadfix hidden-field namespace for versioned imports@rogpeppeb159ed1
  • cue/testdataadd regression test for issue #2937@mvdan39d5c4e
  • cue/errorsaugment paths of wrapped errors@mvdan71c13d2
  • cueformat builtin call's function operand as a bare reference@mvdan7392c8e
  • cueadd test for builtin call function operand formatting@mvdan72ff12b
  • cue/parsersupport try clauses in list literals@mvdanb0a4125
  • cue/testdataadd test case demonstrating #2627 reopen@mpvl684e354
  • cue/testdataadd regression tests for nested try clauses@mvdanf7a59da
  • cue/testdataadd a test for the cycle-detection blowup of issue #4377@mvdane7d5121
  • cueadd regression test for FillPath exporting fields as optional@mvdan00df6eb
  • cueaccept a leading index in ParsePath@mvdan0b61fdf
  • cueadd TestPaths cases for a leading index in a path@mvdana035333
  • cuegive each TestPaths case its own CUE input@mvdan5cf0e58

encoding5

  • encoding/inipass token.Pos through the decoder directly@mvdan91a3f18
  • encoding/iniminor decoder cleanups@mvdan5b8ba6e
  • encoding/inireject section and property name collisions@mvdaneb8ac73
  • encoding/jsonschemaadd test for doc comment reflow@mvdanfa683ed
  • encoding/jsonschemacompile CRD schema only once@mvdan139794b

internal16

  • internal/cuetxtarport old stats framework@mpvl489b249
  • internal/mod/modload,mod/modzip,cmd/cuetidy and publish two-file modules@rogpeppe5adf7f5
  • internal/mod/modpkgload,cue/loadresolve major version defaults per module@rogpeppeb24b39c
  • internalonly wrap over-long generated comment lines@mvdanb682521
  • internal/core/adthandle cycle placeholder for composite builtins@mpvl32244d1
  • internal/core/adtguard nodeContext free on refCount@mpvl03748aa
  • internal/cuetxtarfix inline runner writeStruct cycle and BasicType embed@mpvlafa5272
  • internal/core/adtresolve imports to a per-evaluation instance@mvdan86eb4f1
  • internal/modminor module-related code improvements@rogpeppe964c012
  • internal/core/adttest optional field referencing pushed-down comprehension@mvdan32e6da5
  • internal/core/adtattribute failed try references to the owning body@mvdan8c8c47c
  • internal/core/adtfire comprehensions on let-bound self references@mvdanf6d7894
  • internal/core/adtadd test for comprehensions on let-bound self references@mvdanc60ba81
  • internal/core/adtbound self-feeding disjunction recursion in cycle detection@mvdan43d216f
  • internal/core/compiledetect structural cycles in self-referential matchIf@mvdanec1313c
  • internal/core/compiledetect structural cycles in self-referential matchN@mvdand1a6540

pkg3

  • pkg/encoding/jsonadd test for Validate hiding the failing field@mvdan8507be6
  • pkg/timeadd ToUnix and ToUnixNano builtins@mvdand5a3fb7
  • pkg/listadd regression test for list.Contains with defaults@mvdan7c6d8ae

Other6

  • update dependencies ahead of v0.17.0-alpha.3@mvdanb7d1625
  • Revert "cue/errors: augment paths of wrapped errors"@mvdana361a5b
  • mod/modfile,cue/loadread replace directives from local-module.cue@rogpeppe12ecd27
  • alladd core plumbing for module replace directives@rogpeppe74d78c1
  • allmake more use of string cut/trim/contains APIs@mvdan40ad26f
  • mod/modconfiglazily initialize registry clients@mvdan44f24f1

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.3_darwin_amd64.tar.gzdd1dff72d37b9121e8e5ce94a5b25a2124b8e4a653264513b6afb71f0bc3f150
macOS, Apple siliconcue_v0.17.0-alpha.3_darwin_arm64.tar.gz3f6f487dacd7d1ca1de8d0dbd70a48c81be7d9e26cef156fc64e7e53671378e0
Linux, x86-64cue_v0.17.0-alpha.3_linux_amd64.tar.gz45d822bac1820eb8af266849e0979b2067b43820cc8ccb2a3c5ac51ff67f7166
Linux, Arm64cue_v0.17.0-alpha.3_linux_arm64.tar.gze3a438711b2632e76b0a86d471c85a34655b1c3d5f6c3ae6f8905076cd21f218
Windows, x86-64cue_v0.17.0-alpha.3_windows_amd64.zip6682da4419453a0330fd8cafb00f9d063be2261ee95be8802dec08ac983deca9
Windows, Arm64cue_v0.17.0-alpha.3_windows_arm64.zipab67013a9abd5f257941430fe42f36ef1feefc121820a3ccdf41df36f04d6678
Install CUE