v0.10.0

cue-lang/cue Released

A release of CUE OSS · its page on GitHub

This release includes experimental support for the embed proposal, many fixes for the new evaluator and modules, as well as many other fixes and enhancements.

Evaluator

CLs 1195897, 1196094, 1198356, 1198736, and 1198860 fix crashes with CUE_EXPERIMENT=evalv3 as reported by users.

CLs 1199272, 1199273, and 1199340 fix spurious “field not allowed” error regressions in the new evaluator.

CL 1198566 fixes a performance regression introduced in CUE v0.6 where cue cmd and tools/flow became many times slower on some inputs.

CL 1198350 ensures that all interpreter errors, such as those from @embed attributes, include position information.

Embed proposal

With CUE_EXPERIMENT=embed, CUE now supports the embedding of non-CUE files within a CUE package. See the embed proposal and its design document for details, as well as the new how-to guide for the feature.

Modules

The cue help documentation for modules and inputs has been expanded, and a number of error messages when using or publishing modules are now more helpful.

A new concept guide on CUE language versions documents the language.version field in cue.mod/module.cue files.

CL 1198249 adds support for an @ignore file attribute to unconditionally ignore a file when loading packages or calculating dependencies.

CL 1198003 teaches the CUE loader to support symbolic links when loading from local directories, matching the behavior before CUE_EXPERIMENT=modules was introduced.

CL 1198143 tweaks cue mod init without an argument to create a module with the module path cue.example rather than an empty path that made the module file invalid.

CL 1197530 fixes the behavior of build tags, and also adds support for parentheses in build tag expressions.

CL 1197531 implements better caching when evaluating dependencies, which should speed up evaluation of modules that use multi-directory packages.

Go API

CL 1196721 disallows importing or loading packages with an underscore qualifier like foo.com/bar:_, as it was never intended behavior. Users should use the new embed proposal instead.

CL 1198555 adds a cue/load.Config.SkipImports option to avoid loading instances from import statements. This particularly helps cue fmt, where the loading caused unwanted slowness and unnecessary errors.

CL 1196820 adds a cue.LanguageVersion function to obtain the current version of the language spec that the Go module implements.

CL 1197160 implements considered support for build tags in modules. Build tags are considered false when outside the main module.

CL 1198686 fixes cue/load so that it no longer produces extra invalid packages when Config.Package was set to * and nested packages were loaded.

CL 1198351 fixes a bug in astutil.Sanitize where unused imports were not being fully removed from ast.File, causing errors in cue trim where all uses of an import were removed.

CL 1198494 speeds up the Path method on wrapped errors, which causes noticeable speed-ups in some edge cases.

CL 1198157 fixes cue/parser to accept keywords as valid selectors, aligning with the language specification.

Encodings

Initial support for TOML is included in this release, including support in cmd/cue and an experimental Go package. See the issue tracker for remaining work in this space.

CLs 1199309, 1199139, 1199306, 1199214, 1199398, 1199308, and 1199309 resolve a number of issues when decoding JSON Schema files.

CLs 1196332, 1199094, and 1199103 fix the JSON decoder to provide correct position information when decoding JSONL files or encountering a syntax error.

CL 1198874 fixes the loading of JSON files to reject multiple newline-delimited values, as those ar only allowed in NDJSON or JSONL files.

CL 1198876 teaches the YAML decoder to decode empty documents as null, aligning with the YAML spec and fixing panics when loading empty YAML files.

CL 1196291 tweaks the YAML decoder so that comments following a field are attached to the entire field.

CL 1196436 tweaks the textproto decoder to correctly handle required and optional fields.

CLs 1195628 and 1199054 ensure that cue/format prints the correct white space before and after comments.

CL 1195884 teaches cue/format to preserve comments associated with ... ellipsis expressions.

CL 538624 fixes a bug where cue/format would start a CUE file with white space if it began with a clause.

CL 1196134 fixes a bug in cue/format where a comment at the start of a CUE file would sometimes be indented.

CL 1196135 fixes a bug in cue/format where index or selector expressions could cause extra tab indentation.

Builtins

CL 1196212 adds a list.Reverse function to reverse the elements of a list.

CL 1197452 tweaks tool/exec.Run so that its errors are unambiguous when any command arguments contain white space.

CL 1198636 tweaks path.Match and tool/file.Glob to reject ** wildcard patterns as unsupported, to avoid confusion and allow future changes to their behavior. Note that this change may break uses of ** patterns, which behaved like *.

cmd/cue

CL 1196822 adds a --language-version flag for cue mod init and cue mod edit to set the language.version value.

CL 1197185 teaches cue mod resolve to work on the current module when no arguments are given.

CL 1196370 teaches cue mod registry to gracefully shut down when interrupted.

All changes

202 changes since v0.9.0by area

all7

  • allminor code cleanups@mvdandc3ba30
  • alldelay compiling global regexes and templates@mvdan252a666
  • alluse simpler for loop iterations@mvdan0d9d541
  • allmake use of the new slices.Clone and cmp.Or Go 1.22 APIs@mvdan55d1cb1
  • allstart using Go 1.22's loop var scoping and reflect.TypeFor@mvdan055405a
  • allmake use of some more Go 1.22 std APIs@mvdanaf83dad
  • allreplace internal/txtarfs with txtar.FS@mvdane2054df

cmd46

  • cmd/cuedo not panic on empty jsonl inputs@mvdan93670d7
  • cmd/cueprefer ndjson over ldjson@mvdan8b3cc67
  • cmd/cueexpand the embed help section@mvdanecda391
  • cmd/cueadd test for bad path lookup@rogpeppe9a9dd17
  • cmd/cueadd test case for bad jsonl syntax error positions@mvdan5e19deb
  • cmd/cuesuggest cue mod fix on all commands to add language.version@mvdan40eed23
  • cmd/cueadd test cases for embedding files inside symlink dirs@mvdan677ece8
  • cmd/cueadd a test for embedding symbolic links@mvdan4d941df
  • cmd/cueimplement cue import --dry-run@mvdanbcbc7cd
  • cmd/cueadd testscript for the jsonl file type@mvdan4c7aecf
  • cmd/cuespeed up get_go_json_compat.txtar@mvdan20d3c9c
  • cmd/cueuse fewer go/packages Need bits in get go@mvdan3260084
  • cmd/cueadd TOML to a couple of help topics I forgot about@mvdan0dccbf3
  • cmd/cueadd testscript to interpret empty files as various filetypes@mvdandb92bf8
  • cmd/cuefix all "flag used without being added" bugs@mvdan0bd038c
  • cmd/cuehook up encoding/toml for import and export@mvdan9b91188
  • cmd/cueadd test case for embedded file error@rogpeppebfcfff3
  • cmd/cuedo not initialize cmd.Command twice in cue cmd@mvdan3f84ba6
  • cmd/cuetest that cue cmd --cpuprofile works@mvdan17b3e52
  • cmd/cuepoint "help get" text at CUE-specific cmd@jpluscplusm5de5b42
  • cmd/cueadd tests for symbolic links@rogpeppe23fc4b1
  • cmd/cue,internal/buildattradd tests for @ignore tags@rogpepped502843
  • cmd/cueuse default module name for cue mod init@rogpeppeb3c12b3
  • cmd/cueadd tests for module path errors@rogpeppef7e48bb
  • cmd/cueadd a reference to the Central Registry from cue help modules@rogpeppe8986233
  • cmd/cueadd information about import paths to cue help inputs@rogpeppee9bc377
  • cmd/cuefix panic on bad syntax@rogpeppeaf808c3
  • cmd/cuebetter error message for mismatched publish version@rogpeppeb513fc2
  • cmd/cueimprove error message for malformed module path@rogpeppe9a88d06
  • cmd/cueadd test case for issue 3262@rogpeppe56d6987
  • cmd/cuefix link in embed help text@rogpeppe77ac696
  • cmd/cuehandle signals and perform a graceful shutdown for mod registry@haoqixu27adbac
  • cmd/cuetest tool/exec.Run with arguments involving spaces@mvdan5903ec8
  • cmd/cueadd a forwards compatibility test case for bugfix releases@mvdan2a96988
  • cmd/cuedo not allow embedding of CUE file types (for now)@myitcva0f2cac
  • cmd/cueadd test case for embedding of CUE file type files@myitcv868c110
  • cmd/cueprovide initial text for 'help embed'@myitcv5c8be53
  • cmd/cuedocument CUE_EXPERIMENT=embed@myitcve460eb0
  • cmd/cuemake mod resolve work with no args@rogpeppedbe24df
  • cmd/cueimplement --language-version flag for cue mod edit and init@rogpeppee9b2c29
  • cmd/cue,cue/loadadd tests for underscore packages@rogpeppe9295a20
  • cmd/cueremove unnecessary fields and do not use filepath.WalkDir@mvdandb5c6bf
  • cmd/cuecorrectly import comments after a field key@haoqixucc7cb90
  • cmd/cueforbid cue help help in favor of cue help@mvdan859f1f6
  • cmd/cueparse module.cue file in non-strict mode@rogpeppeb44f02f
  • cmd/cueadd test for mod edit strictness@rogpeppe3eafda7

cue47

  • cue/errorsavoid simple duplication when gathering errors@cuematthewee85bb9
  • cue/formatkeep blank between ast.EmbedDecl and comment@haoqixua6f1b76
  • cue/interpreter/embedforbid ** via pkg/path.Match@mvdan187fb1a
  • cue/loaddo not create packages unnecessarily for files outside package directory@rogpeppea4abb05
  • cue/loadadd test case for issue 3306@rogpeppef472fd2
  • cue/loadimplement SkipImports mode@rogpeppe88306e2
  • cue/errorsmake wrapped.Path faster by bypassing unnecessary reflection@mxeye68bd63
  • cue/ast/astutilupdate ast.File.Imports properly in Sanitize@mvdan8145bdd
  • cueadd a regression test for a default elimination bug fixed in evalv3@myitcv97eeee4
  • cue/cmdensure flags are added if they are used@cuematthew657d5ec
  • cue/parseraccept keywords as selector@haoqixu682ff0e
  • cue/literaluse strconv.IsGraphic@mvdanacdd41f
  • cue/loadavoid one stat call when loading a valid module@mvdanefdb072
  • cue/loadadd test coverage for loading a legacy cue.mod file@mvdan28c6219
  • cueuse Value.Err in examples using Compile APIs@mvdan719893f
  • cue/loadimplement shared syntax cache@rogpeppefc16ef8
  • cue/loadmove syntax cache into fileSystem@rogpeppeafa222f
  • cue/loaduse constructor for fileSystem@rogpeppef787af8
  • cue/loadCUE files only contain a single *ast.File@rogpeppe75d4005
  • cue/loadmove towards unified syntax cache@rogpeppe14deefa
  • cue/loadremove import comment parsing@rogpeppeb03789f
  • cue/loadclean up allTags@rogpeppe59fe2e4
  • cue/loadcache file names only@rogpeppe4a8f673
  • cue/interpreter/embeddon't allow hidden files in glob@mpvl8bedc2b
  • cue/interpreter/embedrespect module boundaries@rogpeppe6056916
  • cue/interpreter/embedrequire type if glob extension not specified@myitcv2c8ee2f
  • cue/interpreter/embedfix handling of dir matching glob@myitcv970d10f
  • cue/loadbetter treatment for build tags with respect to modules@rogpeppe79c1739
  • cueadd LanguageVersion@rogpeppea9009e8
  • cue/interpreter/embedadd support for embedding@mpvl6594f45
  • cue/ast,specdocument that package _ is equivalent to missing package@rogpeppec7f9334
  • cue/loaddo not consider anonymous packages when checking package qualifier@rogpeppe5ab2d73
  • cue/loadclarify the docs for Config.ModuleRoot@mvdana94d22f
  • cue/formatprevent vertical tabs from causing extra indentation@mvdan1f197eb
  • cue/formatavoid indenting a lone leading comment@mvdand70f9d7
  • cue/...remove remnants of /*block*/ comment support@mvdan0cf2060
  • cue/formatadd test cases for issue 2496@mvdan59e276a
  • cue/encoding/jsonschemafix staticcheck errors@NoamTDb095ecb
  • cue/loadfix loading when Config.Package does not match default package@rogpeppeac34157
  • cue/loadadd tests for issue 3213@rogpeppe4111b3e
  • cue/loadadd Config.AcceptLegacyModules@rogpeppe63d1318
  • cue/formatomit whitespace before the first clause@mvdan95035da
  • cue/formatadd a regression test for issue 1544@mvdan475f692
  • cue/formatrewrite TestFiles with testscript@mvdan08b1ce0
  • cue/formatpreserve comments associated with ellipsis@NoamTD9bd3e17
  • cue/formatadd tests for ellipsis comments in fmt -s@NoamTDda2a575
  • cue/formatensure a newline after every comment@mvdanb423a27

encoding26

  • encoding/jsonschemafix panic on impossible enum@rogpeppe4760f3b
  • encoding/jsonschemafix issue 3176@rogpeppe6694c55
  • encoding/jsonschemaadd test case for issue 3176@rogpeppe2122b51
  • encoding/jsonschemaadd test cases for nested values@rogpeppe0bd8619
  • encoding/jsonschemabetter "type excluded" logic@rogpeppe7ca1a14
  • encoding/jsonschemafix type exclusion test@rogpeppe5fde360
  • encoding/jsonschemaadd test cases for excluded types@rogpeppe89c7b4b
  • encoding/encoding/jsonschemaallow type number with int enum@rogpeppebdf9be8
  • encoding/jsonschemaonly one error per URL@rogpeppe8e99f5e
  • encoding/jsonschemasupport legacy id field@rogpeppe709741d
  • encoding/jsonschemaschema version support@rogpeppe6c26e3c
  • encoding/jsonschemaadd test for numeric enum with type@rogpeppe52ae410
  • encoding/jsonschemaimplement MapURL@rogpeppebddcb54
  • encoding/jsonfix positions when Decoder.Extract finds bad syntax@mvdana093c9b
  • encoding/jsonschemafix decoding of $id@haoqixu915059d
  • encoding/jsonfix location for JSON syntax error@haoqixu596a8c3
  • encoding/tomlsupport error positions@mvdan334a6fe
  • encoding/tomlmimic indented CUE multi-line strings in test strings@mvdan1ec257c
  • encoding/jsonschemadecode required properties as required fields@haoqixuc4697bd
  • encoding/tomlsupport decoding keys named "_"@mvdancf18d6f
  • encoding/jsonschemaadd test case for issue 3351@mvdan95c818c
  • encoding/jsonschemaport txtar tests to cuetxtar@mvdan44bc1ab
  • encoding/tomladd first implementation of an encoder@mvdan54f2cce
  • encoding/protobuf/textprotocorrectly decode required/optional fields@haoqixudec1786
  • encoding/jsonfix position for jsonl@haoqixu16c15d1
  • encoding/tomlimplement support for table arrays@mvdan8a6194a

internal46

  • internal/citest and release with Go 1.23.0@mvdan40da936
  • internal/core/adtfix validator closedness issue@mpvlc683420
  • internal/core/adtadd test for issue 3332@mpvlc8ff441
  • internal/core/adtstill process pattern for closeContext@mpvl81740d5
  • internal/core/adtsplit conjunct trees based on prefix@mpvl8e02b92
  • internal/core/adtadd tests for closedness@mpvl53bbdad
  • internal/core/debugsimplify logic of debug visualization@mpvl2e312df
  • internal/core/adtshow # only on original defintion node@mpvl6cc01b0
  • internal/encoding/yamldecode empty inputs as "null"@mvdan30a5c79
  • internal/core/adtfix panic triggered by using wrong condition@mpvlcd689ef
  • internal/encodingdecode json files as a single JSON value@mvdane8e6f04
  • internal/ci/checkbump yuin/goldmark@mvdandfe07b8
  • internal/core/adtdon't signal cleared schedulers@mvdan0d4258e
  • internal/cuetdtestmake M.Flags (internal) public@cuematthew91929bd
  • internal/core/adtuse a named vertexStatus constant rather than 0@mvdan862fcf1
  • internal/core/depuse a new visitor.marked map when recursing@mvdan34739e9
  • internal/core/runtimedo not hide positions in interpreter errors@rogpeppef7b7aaf
  • internal/cuetxtarCorrect nesting of tests@cuematthewdc199f5
  • internal/cuetxtarBe noisier if DebugArchive is faulty@cuematthewb77c599
  • internal/core/walkClarify Visitor.Before documentation@cuematthewaa8e810
  • internal/core/adtdo not require closeContext.group to be non-nil@cuematthewc8f3cad
  • internal/buildattrimplement @ignore attributes@rogpeppee00557b
  • internal/ciensure internal/_e2e isn't broken in CI@mvdan00879f0
  • internal/ciensure commit messages do not @-mention users@mvdancf6641c
  • internal/cicopy how internal/vcs sets a clean env for git tests@mvdan9025f67
  • internal/_e2eremove unused import@mvdan6a9997f
  • internal/ci/checksrewrite from bash to Go@mvdan32013a7
  • internal/cimove commit check script to a separate file with tests@mvdandaf98a0
  • internal/vcsshow stderr when git exits with an error@mvdand0724a0
  • internal/mod/modimportsremove duplicate test txtar file entry@mvdan243da87
  • internal/mod/modpkgloadsymbolic links can be valid CUE files too@rogpeppef5b905c
  • internal/mod/modpkgloadpropagate CUE syntax error@rogpeppea36cc32
  • internalremove some deprecated type/method usages@cuematthewe1f552f
  • internal/buildattrstop at package clause and support parentheses@rogpeppe5cbddef
  • internal/buildattradd tests@rogpeppe1bb894b
  • internal/filetypesspeed up common case@rogpeppefed43b0
  • internal/cibump Go and goreleaser versions for the upcoming alpha@mvdan16c45d3
  • internal/buildattrfactor out from cue/load@rogpeppe7ca3925
  • internal/ciremove debug logging of commit message@myitcvf1f0963
  • internal/core/runtimenew attribute name for extern@mpvlb70e543
  • internal/filetypessplit ParseFile@mpvla1c1cd7
  • internal/cueversionbump LanguageVersion for v0.10@mvdan525e18b
  • internal/cialways check that git is clean when we finish@mvdanb44ef61
  • internal/core/adtfix pointer comparison issue in equalTerminal@mpvl1376fa8
  • internal/core/adtfix lifetime tracking of shared closeContext@mpvl2785aa4
  • internal/core/adtupdate TestX to include language version@mpvl8fdc65e

mod7

  • mod/modregistryreturn empty list for Versions with invalid name@rogpeppef00a023
  • mod/moduleimprove error messages for bad module path@rogpeppe3e9d805
  • mod/moduleallow versionless module path in CheckPath@rogpeppe3a379b7
  • mod/modloadignore _test.cue files in dependencies@rogpeppe7793367
  • mod/modfileuse fixed language version for Fix@rogpeppe6f2bfb4
  • mod/modfiledeprecate LatestKnownSchemaVersion@rogpeppe71eb3be
  • mod/modfilealways allow missing major version in module field@rogpeppe1795a49

pkg6

  • pkgforbid ** in path.Match and tool/file.Glob@mvdan987a85e
  • pkgadd test cases for ** in file patterns or globs@mvdan25bb3d4
  • pkg/tool/execdocument how Run.cmd works with string versus list@mvdan7e1f140
  • pkg/tool/execshow command arguments in errors as a Go slice@mvdan38269ec
  • pkg/listadd Reverse function@NoamTDf42327c
  • pkg/pathadd missing param declaration@NoamTDe09cb31

README3

  • READMEpoint to cuelang.org for install docs@jpluscplusmf2066e3
  • READMElink to Slack and Discord via cuelang.org@jpluscplusmddfe8eb
  • READMEsimplify a bit, add new website links, add Discord invite@mvdanfecf80d

tools3

  • tools/flowadd test case for issue 2559@mvdan51bf6f2
  • tools/flowadd to task stats in the first initTasks call@mvdanbc41b25
  • tools/trimconvert inline tests to txtar@cuematthew8079151

Other11

  • update golang.org/x/... and ociregistry for rc.1@mvdanc15144f
  • drop go1.21, start testing on go1.23rc2@mvdan1aaf802
  • interpreter/wasm,internal/filetypesfix wasm awkwardness@rogpepped5d4815
  • bump go-internal to get the latest testscript fixes@mvdan695fefc
  • update Go dependencies for the upcoming alpha@mvdanf6be8a8
  • core/adtsimplify duplicate NumKind and NumberKind consts@cuematthew304530f
  • core/adtrename CompositKind to CompositeKind@cuematthew95802d3
  • doc/ref/implfix order of arguments in δ partial feature function@cuematthew4eecacd
  • disallow explicit underscore import path qualifiers@rogpeppe1c381a0
  • remove navbar.md and its supporting logo@mvdan0d69846
  • update github.com/emicklei/proto@mvdan1d70939

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.10.0_darwin_amd64.tar.gzcdd6acbd87528ae8f8f62497770a600ea23503d6f8b46f5919c7008f20b5238f
macOS, Apple siliconcue_v0.10.0_darwin_arm64.tar.gzf72e5dae8b682f43a1e80fb3066a42e82c77725ac2a175927212d0be9d12671a
Linux, x86-64cue_v0.10.0_linux_amd64.tar.gz8f449c76f69c94fd17fff869e96ec34de7f059d6d63bf05617477ed0e6133fd2
Linux, Arm64cue_v0.10.0_linux_arm64.tar.gz49369a3566af3117712a7a91dc2ec924cb5c4128385ab2edd877d9997e761312
Windows, x86-64cue_v0.10.0_windows_amd64.zipae09f026261331530593966ab2d61b330a6565fd7339c13a3eed3eaa5bd4c066
Windows, Arm64cue_v0.10.0_windows_arm64.zipe82bececf6aafcee74b9be4273b0163299939d0cea95fd32e8349854667775bc

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

Install CUE