v0.4.1-beta.6

cue-lang/cue Pre-release Released

A release of CUE OSS · its page on GitHub

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:

cue
service: "2222:22" 

is consistently exported to Yaml as:

cue
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:

cue
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: #something

A 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 such547e5cc
  • cionly trigger new version events after successful new version6e68ca4
  • cifix GoReleaser arm64 template details795719e
  • cifix target for homebrew tapb68f4c3
  • cifix up GoReleaser image template names02556bc
  • ciuse GoReleaser v1.0.0e7da62f
  • ciremove go1.15 from the build matrixe62a95a
  • cicorrect location of unity718c9a0
  • ciupdate to use go1.17.3 and go1.16.109217c4d
  • cilatest Go versions in build matrixddd96c6
  • ciimprove goreleaser workflow370fac9
  • citidy up encoding of JSON args to curla4a38ed
  • cire-enable full CI workflows7d25ee2
  • citidy up quoting of JSON args in workflow commands59079b1
  • cifix Docker workflow6da50d9
  • cifix up new version trigger0070bb1

cmd5

  • cmd/cueconfirm issues 1152 and 1153 are fixed4d505e0
  • cmd/cueget go: ignore anonymous enumseb53c4e
  • cmd/cue/cmdimprove shell arg parsing in tests4e76bb4
  • cmd/cuerevert version string changeecb17c9
  • cmd/cuefix up get go docs around "enum" typesec427f9

cue8

  • cuesupport ResolveReferencesf68e000
  • cueauto-unwrap single embedded value in Expr061e661
  • cuefix output in ExampleContextf880467
  • cue/testdatahoist let cycle errors4f3988f
  • cuefix subsumption bug for disjuntion filteringb89ad85
  • cueExpr handles empty lists to or/and builtins9bb874c
  • cuedefine all Op constant values explicitly with that type72936e4
  • cuedefine all Kind constant values explicitly with that typefca61f5

doc10

  • doc/ref/spec.mdinclude $ in identifier75c3d6b
  • doc/tutorial/kubernetesupdate typesb9ac1ea
  • docrevamp contribution guide ahead of contributing live-streamdbf5992
  • doc/ref/specfix typos and heading anchors437920e
  • docfix repeated word typos in spec35c2f3c
  • docremove useless whitespace in main READMEe8550b8
  • doc/contribupdate git codereview change to use -s flag0f53054
  • doc/tutorialfix errant use of list operators38c8f7d
  • doc/tutorial/kubernetesfix invalid user commandsaa61ee7
  • doc/tutorial/kubernetesupdate k8s version67bf363

internal15

  • internal/core/exportkeep open lists opend413bb8
  • internal/core/exportfix let exporting9a040dc
  • internal/core/adtfix regression of dynamic closed fields in definitions6c30678
  • internal/core/exporttreat empty data vertices as structs9e7d4d6
  • internal/core/adtclose open lists for Defaultb99ce0a
  • internal/core/exportfix bug with API-generated top-level closec490d4c
  • internal/core/adtdon't cache incomplete errors for let9982526
  • internal/coreuse scope for lists91476ab
  • internal/core/compileremove unnecessary codef65dd0f
  • internal/encoding/yamlupgrade go-yaml.v3a8b721a
  • internal/core/exportdon't add empty temp struct0e56b82
  • internal/encoding/yamlcanonicalize non-string map keysc1c2cda
  • internal/core/adtfix bound simplification for floats59bdbb5
  • internal/core/adtfix disjunction bug62e876d
  • internal/core/compilefix let cycle error20ed9ab

Other16

  • pkgfix default issue for string and numbers lists910ff4d
  • pkg/internalcompute combined error severity7922f9b
  • encoding/openapifix crash in reference15adb6c
  • encoding/yamlquote strings more aggressivelya83c6c6
  • simplify install instructions assuming Go 1.16+29a686d
  • specUpdate example with regards to pattern constraints8031fe7
  • featupdate go build matrix5cf1aa1
  • readmefix top-level CONTRIBUTING guide5f28bb4
  • readmelink to CoC from main readme and contributing guide5ab75b8
  • generaluse cuelang.org/issues as the general issue link35c4960
  • githubfix up empty issue templatea68df18
  • githubtidy up issue templates723a7fe
  • generalupdate unity location3d9cd71
  • allchange references from cuelang/cue to cue-lang/cue06484a3
  • Allow setting working directory for exec.Run8e053d4
  • interanal/core/runtimeremove commented out fieldse8de4b1

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.4.1-beta.6_darwin_amd64.tar.gz961decd98074838fce62f12ed8e562303731bace9c55db3b23ea4a5d02745a29
macOS, Apple siliconcue_v0.4.1-beta.6_darwin_arm64.tar.gz2070dccf79cd6faf5c02d1f340ca6c4e5c2ff74abb0c0d30aab2e1cb61fa1bb6
Linux, x86-64cue_v0.4.1-beta.6_linux_amd64.tar.gz6c4b0913987f28e4851b5df2cec21fcaf903e95db61e3ab87ac8b2a9d551f78a
Linux, Arm64cue_v0.4.1-beta.6_linux_arm64.tar.gzaf4a4420172a57a6a6089d7f0b4e1e121e2865a562233da615af5d7f6083af76
Windows, x86-64cue_v0.4.1-beta.6_windows_amd64.zip68a0615b134b0a00c1aef450b0e19c78763627ce156abc5b306011930c518ab7
Windows, Arm64cue_v0.4.1-beta.6_windows_arm64.zip471c908a438fa6c8840eaf2fe80ca68e66ad0c69674635234f627471f65a1f2d

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

Install CUE