v0.4.1-beta.6
Bug fixes
After an extended summer break following CUE’s migration to cue-lang/cue, this release mainly focuses on bug fixes.
Thank you to @mvdan, @ameowlia, @antong, @slewiskelly, @hrvolapeter, @caarlos0, @yujunz, and @chai2010 for contributing to this release!
Project-level changes
A number of release-related issues that were missed in the migration from cuelang/cue to cue-lang/cue have been fixed. GoReleaser now correctly marks prereleases as such.
The CUE project now uses v1 of GoReleaser and as such we produce both amd64 and arm64 release assets for linux, windows and darwin, with accompanying amd64 and arm64 Docker images and manifests. The homebrew-tap recipe has also been updated to avoid an error message reported via https://github.com/cue-lang/homebrew-tap/issues/1.
As we near the halfway point to go1.18, go1.15 has been removed from the build matrix. The project’s policy for previous versions of Go will be formalized in the near future, but is likely to be that each major Go release is supported until there are two newer major releases, with a 3 month grace period following the release of a new major version (3 months being half a 6-month release cycle) before support for the oldest version is dropped. Correspondingly, go install instructions in the README have been updated to drop support for the old-style GO111MODULE form, instead preferring the go install cuelang.org/go@$version form.
Ahead of a live stream focussing on contributing to the CUE project back in November, the contribution guide was updated to provide more detail around the PR workflow. Further improvements will be made to reflect feedback following the livestream.
Encoders
An upgrade to the version of gopkg.in/yaml.v3 used by the CUE project may result in some formatting changes for Yaml output. This new version now also supports better string escaping for YAML v1.1 backwards compatibility support. However, it does not seem to apply these escapes consistently, so for now we added our own implementation (see also #1368 and #1076)
For instance, some unquoted strings might, when consumed by some old YAML parsers, be interpreted as values other than strings (float 60, bool, date-time…). Now:
service: "2222:22"
is consistently exported to Yaml as:
service: "2222:22" // before RHS was 2222:22
If this more aggressive quoting still proves insufficient, we can consider quoting all string values by default.
cmd/cue
Thanks to @chai2010, a working directory can be set for an exec.Run command in the tooling layer:
import "tool/exec"
command: ls: exec.Run & {
cmd: "ls"
dir: "/tmp"
}
cue eval exporting previously resulted in some strange results that involved let expressions (#1116). These bugs have been fixed and corresponding updates made to test expectations in unity. Similarly, a cue def bug where multiple list conjuncts resulted in an output containing a {} conjunct is now fixed (#1284).
API
cue.ResolveReferences has been fixed to work for the KubeVela project, although it is anticipated a better long-term solution is required.
@ameowlia helped fix an issue with a test example for cue.Context.
Various other bug fixes.
Evaluator
91476ab2151490e11c044fa48a95c713cf019b0b fixes a number of issues related to the use of aliases in lists (#1308), by introducing a new scope with list values. A side effect of this change is that value aliases now work with list values:
y: X = [1, 2, X[0]] // y: [1, 2, 1]A long-standing issue with defaults and string and number lists (#1025, #1404) has been fixed such that the following example no longer results in an incomplete-error:
exec cue export
-- x.cue --
package x
import "strings"
#something: {
image: string | *"some default"
toString: strings.Join([image], "")
}
x: #somethingA bug where comprehensions inside a definition resulted in an error (#1404) has now been fixed, meaning the following is correctly allowed:
#D: {
a: foo: 123
b: {for k, v in a {(k): v}}
}An important bug related to the handling of default values that result in error has been fixed (#1304 and #1257).
Various unexpected panics have been fixed, including a panic in the case of circular let declarations (#1042).
Language
This release makes no changes to the language.
The CUE spec now correctly defines $ as an identifier (#1264).
Docker images
docker pull docker.io/cuelang/cue:0.4.1-beta.6
All changes
70 changesby area
ci16
ciconfigure GoReleaser to mark prereleases as suchcionly trigger new version events after successful new versioncifix GoReleaser arm64 template detailscifix target for homebrew tapcifix up GoReleaser image template namesciuse GoReleaser v1.0.0ciremove go1.15 from the build matrixcicorrect location of unityciupdate to use go1.17.3 and go1.16.10cilatest Go versions in build matrixciimprove goreleaser workflowcitidy up encoding of JSON args to curlcire-enable full CI workflowscitidy up quoting of JSON args in workflow commandscifix Docker workflowcifix up new version trigger
cmd5
cmd/cueconfirm issues 1152 and 1153 are fixedcmd/cueget go: ignore anonymous enumscmd/cue/cmdimprove shell arg parsing in testscmd/cuerevert version string changecmd/cuefix up get go docs around "enum" types
cue8
cuesupport ResolveReferencescueauto-unwrap single embedded value in Exprcuefix output in ExampleContextcue/testdatahoist let cycle errorscuefix subsumption bug for disjuntion filteringcueExpr handles empty lists to or/and builtinscuedefine all Op constant values explicitly with that typecuedefine all Kind constant values explicitly with that type
doc10
doc/ref/spec.mdinclude$in identifierdoc/tutorial/kubernetesupdate typesdocrevamp contribution guide ahead of contributing live-streamdoc/ref/specfix typos and heading anchorsdocfix repeated word typos in specdocremove useless whitespace in main READMEdoc/contribupdate git codereview change to use -s flagdoc/tutorialfix errant use of list operatorsdoc/tutorial/kubernetesfix invalid user commandsdoc/tutorial/kubernetesupdate k8s version
internal15
internal/core/exportkeep open lists openinternal/core/exportfix let exportinginternal/core/adtfix regression of dynamic closed fields in definitionsinternal/core/exporttreat empty data vertices as structsinternal/core/adtclose open lists for Defaultinternal/core/exportfix bug with API-generated top-level closeinternal/core/adtdon't cache incomplete errors for letinternal/coreuse scope for listsinternal/core/compileremove unnecessary codeinternal/encoding/yamlupgrade go-yaml.v3internal/core/exportdon't add empty temp structinternal/encoding/yamlcanonicalize non-string map keysinternal/core/adtfix bound simplification for floatsinternal/core/adtfix disjunction buginternal/core/compilefix let cycle error
Other16
pkgfix default issue for string and numbers listspkg/internalcompute combined error severityencoding/openapifix crash in referenceencoding/yamlquote strings more aggressively- simplify install instructions assuming Go 1.16+
specUpdate example with regards to pattern constraintsfeatupdate go build matrixreadmefix top-level CONTRIBUTING guidereadmelink to CoC from main readme and contributing guidegeneraluse cuelang.org/issues as the general issue linkgithubfix up empty issue templategithubtidy up issue templatesgeneralupdate unity locationallchange references from cuelang/cue to cue-lang/cue- Allow setting working directory for exec.Run
interanal/core/runtimeremove commented out fields
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_961decd98074838fce62f12ed8e562303731bace9c55db3b23ea4a5d02745a29 |
| macOS, Apple silicon | cue_2070dccf79cd6faf5c02d1f340ca6c4e5c2ff74abb0c0d30aab2e1cb61fa1bb6 |
| Linux, x86-64 | cue_6c4b0913987f28e4851b5df2cec21fcaf903e95db61e3ab87ac8b2a9d551f78a |
| Linux, Arm64 | cue_af4a4420172a57a6a6089d7f0b4e1e121e2865a562233da615af5d7f6083af76 |
| Windows, x86-64 | cue_68a0615b134b0a00c1aef450b0e19c78763627ce156abc5b306011930c518ab7 |
| Windows, Arm64 | cue_471c908a438fa6c8840eaf2fe80ca68e66ad0c69674635234f627471f65a1f2d |
SHA-256 checksums for all of these: checksums.txt