-
Notifications
You must be signed in to change notification settings - Fork 294
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
evalv3: panic: unexpected uninitialized node #3330
Comments
looks like |
also ❯ CUE_EXPERIMENT=evalv3 go run cuelang.org/go/cmd/cue@master export ./amour/minecraft
#List.items: error in call to list.Concat: unexpected uninitialized node:
./amour/minecraft/list.cue:26:15
exit status 1 |
So it works if I comment these lines out: Unfortunately I tried making a minimal reproduction from this, but it works fine? import appsv1 "k8s.io/api/apps/v1"
appsv1.#Deployment & {
spec: template: spec: containers: [{
name: "test"
let probe = {exec: command: ["mc-health"]}
livenessProbe: probe
readinessProbe: probe
startupProbe: probe & {
initialDelaySeconds: 240
failureThreshold: 30
}
}]
} |
Okay, got it. ❯ CUE_EXPERIMENT=evalv3 go run cuelang.org/go/cmd/cue@master export ./a.cue
panic: unexpected uninitialized node [recovered]
panic: unexpected uninitialized node [recovered]
panic: unexpected uninitialized node import (
"list"
appsv1 "k8s.io/api/apps/v1"
)
#Deployment: appsv1.#Deployment & {
spec: template: spec: containers: [{
name: "test"
let probe = {exec: command: ["mc-health"]}
livenessProbe: probe
readinessProbe: probe
startupProbe: probe & {
initialDelaySeconds: 240
failureThreshold: 30
}
}]
}
deploymentList: list.Concat([[#Deployment]]) |
I found #3331 whilst trying to make a really minimal reproduction. |
Funnily enough, the reproduction is also fixed if I change let probe = {exec: command: ["mc-health"]} to let probe = v1.#Probe & {exec: command: ["mc-health"]} |
I managed to reduce this further to under ten standalone lines:
The test succeeds for the non-evalv3 part, but the evalv3 part panics as you show. |
I've spent some time refining this further. I suspect the panic is the consequence of things going off track a fair bit earlier on. I think there's something not quite right with definitions in v3, because:
This gives an error in v3 (not a panic), but in the old evaluator it works. However, if you change |
A bit shorter reproducer yet:
@cuematthew : your case is interesting. |
@mpvl Yes I see your point, but I thought that a definition was only closed when it is referenced. I think I would find it a little surprising to need to consider Also, in v3, export of:
does not error, and gives:
I don't know if you'd expect that or not. |
Issue #3325 Issue #3330 Issue #3331 Signed-off-by: Marcel van Lohuizen <[email protected]> Change-Id: I16c3639fb016020ea58b75e7ecefa0fc1d1afe84 Reviewed-on: https://cue.gerrithub.io/c/cue-lang/cue/+/1199271 Reviewed-by: Matthew Sackman <[email protected]> Reviewed-by: Daniel Martí <[email protected]> Unity-Result: CUE porcuepine <[email protected]> TryBot-Result: CUEcueckoo <[email protected]>
Before this change, any conjunct referred to was inserted at the insertion point in full. Top-level conjuncts have a tree representing the origin of their definition and embedding. This caused the closedness rules to be repeated when they should not, resulting in spurious "field not allowed" errors. The new algorithm splits a conjunct into branches with roots that are shared with the insertion point removed. This ensures that references that are in scope of a definition do not get spuriously inserted. Fixes #3330 Fixes #3331 Signed-off-by: Marcel van Lohuizen <[email protected]> Change-Id: I7a573f9576d3c46374647045d8ec226a1cd543b3 Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1199272 Reviewed-by: Matthew Sackman <[email protected]> TryBot-Result: CUEcueckoo <[email protected]> Reviewed-by: Daniel Martí <[email protected]> Unity-Result: CUE porcuepine <[email protected]>
What version of CUE are you using (
cue version
)?Does this issue reproduce with the latest stable release?
What did you do?
Clone https://github.com/uhthomas/automata, and run
What did you expect to see?
Successful export.
What did you see instead?
The text was updated successfully, but these errors were encountered: