Open jgillich opened 2 years ago
I see this is different from #1070?
Was this working before?
This is a bug in cuecontext.BuildInstances
, it works as expected using cue.Build
. #1070 is related but it's not the same, sorry if the title is a bit confusing.
Thanks for the clarification!
@jgillich I see where the difference is coming from. BuiltInstance
considers each package as its own evaluation, whereas Build
evaluates each package only once. From an encapsulation point of view BuildInstances
is the correct interpretation. Otherwise, it means the evaluation of a package would differer depending on what other packages happen to be specified on the command line. So I would consider this a bug fix.
However, I like your proposal of allowing tags of the format pkg/path.identifier in tags in #1070. That would provide an out for this case. Would that work for you?
Yea absolutely 👍
One more possibility, I've commented on that in #1070
What version of CUE are you using (
cue version
)?master/0.4.1 (Go) and 0.4.0 (cli)
Does this issue reproduce with the latest release?
Yes
What did you do?
Clone this repo or copy the files below https://github.com/jgillich/cue-sample
What did you expect to see?
The expected result is achieved through the cli:
What did you see instead?
The go code produces the following error:
This was traced down to be caused by using
cuecontext.BuildInstances
overcue.Build
. More information in this discussion: https://github.com/cue-lang/cue/discussions/1477