profile
viewpoint
Jana Radhakrishnan mrjana Docker Inc. United States

mrjana/concentric 1

Drive which glues multiple cloud drives together

mrjana/socketplane 1

SocketPlane - Multi-Host Container Networking

mrjana/bonjour 0

mDNS/DNS-SD (also know as Apple Bonjour) library for Go (in pure Go)

mrjana/docker 0

Docker - the open-source application container engine

mrjana/docker-py 0

An API client for docker written in Python

mrjana/engine-api 0

Go libraries providing client and server components compatible with the Docker engine

mrjana/go-plugins-helpers 0

Go helper packages to extend the Docker Engine

mrjana/libc 0

Raw bindings to platform APIs for Rust

mrjana/libkv 0

Distributed Key/Value store abstraction library

issue openedcuelang/cue

Possible dependency analyzer issue while only marshaling as yaml

<!-- Please answer these questions before submitting your issue. Thanks! For questions please use one of our forums: https://cuelang.slack.com/ -->

What version of CUE are you using (cue version)?

<pre> $ cue version cue version custom darwin/amd64 </pre>

<!-- If you built from source, specify what git tag or commit was used. -->

 GOPATH=~/golang GO111MODULE=on go get -u cuelang.org/go/cmd/cue@5c3a17baeb02fc5c3638e8a28a574944f211e66e
go: finding cuelang.org/go 5c3a17baeb02fc5c3638e8a28a574944f211e66e
go: finding cuelang.org/go/cmd 5c3a17baeb02fc5c3638e8a28a574944f211e66e
go: finding cuelang.org/go/cmd/cue 5c3a17baeb02fc5c3638e8a28a574944f211e66e
go: finding cuelang.org 5c3a17baeb02fc5c3638e8a28a574944f211e66e
go: downloading cuelang.org/go v0.0.16-0.20200212203016-5c3a17baeb02
go: extracting cuelang.org/go v0.0.16-0.20200212203016-5c3a17baeb02
go: finding github.com/mpvl/unique latest
go: finding golang.org/x/sync latest
go: finding golang.org/x/xerrors latest
go: finding golang.org/x/net latest
go: finding golang.org/x/tools latest
go: downloading golang.org/x/tools v0.0.0-20200214201135-548b770e2dfa
go: extracting golang.org/x/tools v0.0.0-20200214201135-548b770e2dfa

Does this issue reproduce with the latest release?

Yes.

What did you do?

This looks like an issue similar to #237 but only happens when yaml marshaler is used. Can quite understand why.

package foo

import (
    "encoding/yaml"
    "tool/exec"
    "tool/cli"
)

foo: {
  a :: string
  b: a
}

command: local_config: {
    task: getuser: exec.Run & {
        cmd: "printenv USER"
        stdout: string
    }
    task: write: cli.Print & {
        text:  yaml.Marshal(foo & { a :: task.getuser.stdout })
    }
}

<!-- If possible, provide a recipe for reproducing the error. -->

What did you expect to see?

Good yaml output

What did you see instead?

❯ cue cmd local_config .
text: error in call to encoding/yaml.Marshal: error marshaling into JSON: json: error calling MarshalJSON for type cue.Value: cue: marshal error: b: cannot convert incomplete value "string" to JSON:
    ./hello_tool.cue:20:16

created time in 8 days

more