v0.17.0-alpha.3
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 --pathcmd/cueadd test for --path with a non-string label valuecmd/cuedrop github.com/google/shlex test dependencycmd/cueadd test for package arguments listed after filescmd/cueadd replace directive support to mod editcmd/cuehonor -l/--path when exporting CUE valuescmd/cueadd test for export -l with CUE outputcmd/cuepoint to 'cue help flags' from the --with-context flagcmd/cueevaluate --with-context labels against the source datacmd/cuetest various command scenarios without cache/config dirscmd/cueadd test for label references with jsonschema importcmd/cueadd test cases for issues 4370 and 4371
cue15
cue/loadaccept package arguments after file argumentscue/testdataadd missing error output for issue2627cue/build,cue/loadfix hidden-field namespace for versioned importscue/testdataadd regression test for issue #2937cue/errorsaugment paths of wrapped errorscueformat builtin call's function operand as a bare referencecueadd test for builtin call function operand formattingcue/parsersupport try clauses in list literalscue/testdataadd test case demonstrating #2627 reopencue/testdataadd regression tests for nested try clausescue/testdataadd a test for the cycle-detection blowup of issue #4377cueadd regression test for FillPath exporting fields as optionalcueaccept a leading index in ParsePathcueadd TestPaths cases for a leading index in a pathcuegive each TestPaths case its own CUE input
encoding5
encoding/inipass token.Pos through the decoder directlyencoding/iniminor decoder cleanupsencoding/inireject section and property name collisionsencoding/jsonschemaadd test for doc comment reflowencoding/jsonschemacompile CRD schema only once
internal16
internal/cuetxtarport old stats frameworkinternal/mod/modload,mod/modzip,cmd/cuetidy and publish two-file modulesinternal/mod/modpkgload,cue/loadresolve major version defaults per moduleinternalonly wrap over-long generated comment linesinternal/core/adthandle cycle placeholder for composite builtinsinternal/core/adtguard nodeContext free on refCountinternal/cuetxtarfix inline runner writeStruct cycle and BasicType embedinternal/core/adtresolve imports to a per-evaluation instanceinternal/modminor module-related code improvementsinternal/core/adttest optional field referencing pushed-down comprehensioninternal/core/adtattribute failed try references to the owning bodyinternal/core/adtfire comprehensions on let-bound self referencesinternal/core/adtadd test for comprehensions on let-bound self referencesinternal/core/adtbound self-feeding disjunction recursion in cycle detectioninternal/core/compiledetect structural cycles in self-referential matchIfinternal/core/compiledetect structural cycles in self-referential matchN
pkg3
pkg/encoding/jsonadd test for Validate hiding the failing fieldpkg/timeadd ToUnix and ToUnixNano builtinspkg/listadd regression test for list.Contains with defaults
Other6
- update dependencies ahead of v0.17.0-alpha.3
- Revert "cue/errors: augment paths of wrapped errors"
mod/modfile,cue/loadread replace directives from local-module.cuealladd core plumbing for module replace directivesallmake more use of string cut/trim/contains APIsmod/modconfiglazily initialize registry clients
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
| Platform | File and SHA-256 |
|---|---|
| macOS, Intel | cue_dd1dff72d37b9121e8e5ce94a5b25a2124b8e4a653264513b6afb71f0bc3f150 |
| macOS, Apple silicon | cue_3f6f487dacd7d1ca1de8d0dbd70a48c81be7d9e26cef156fc64e7e53671378e0 |
| Linux, x86-64 | cue_45d822bac1820eb8af266849e0979b2067b43820cc8ccb2a3c5ac51ff67f7166 |
| Linux, Arm64 | cue_e3a438711b2632e76b0a86d471c85a34655b1c3d5f6c3ae6f8905076cd21f218 |
| Windows, x86-64 | cue_6682da4419453a0330fd8cafb00f9d063be2261ee95be8802dec08ac983deca9 |
| Windows, Arm64 | cue_ab67013a9abd5f257941430fe42f36ef1feefc121820a3ccdf41df36f04d6678 |