Closed tonyhb closed 3 years ago
This is fixable if I update the BuildFile
generated within an instance as follows, prior to building the instance:
instances[0].BuildFiles[0].Encoding = build.CUE
instances[0].BuildFiles[0].Form = build.Schema
instances[0].BuildFiles[0].Interpretation = ""
This is because Cue short circuits here: https://github.com/cuelang/cue/blob/master/internal/filetypes/filetypes.go#L77-L80
However, by default, Form
is an empty string and so evaluating does not short circuit.
This isn't so much a fix - the race condition/bug exists somewhere when parsing cue's builtin, using gob encoding.
That was a lie, my bad! If I include packages, this transient error still exists. Packages are never included with the correct file builds to skip this short circuit: https://github.com/cuelang/cue/blob/master/internal/filetypes/filetypes.go#L77-L80.
Instead, I had to reimplement dependency resolution and file parsing to generate instances for each file (and their depencency).
This issue has been migrated to https://github.com/cue-lang/cue/issues/1043.
For more details about CUE's migration to a new home, please see https://github.com/cue-lang/cue/issues/1078.
Does this issue reproduce with the latest release?
Yes
What did you do?
Every 1 in ~8 times, Cue will error when validating it's own cue files:
What did you expect to see?
No errors, as the cue input is valid.
What did you see instead?
Errors parsing cue's own internal definitions.