Skip to content
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

evaluator: 'cycle error' reports no position information #3118

Open
myitcv opened this issue May 3, 2024 · 0 comments
Open

evaluator: 'cycle error' reports no position information #3118

myitcv opened this issue May 3, 2024 · 0 comments

Comments

@myitcv
Copy link
Member

myitcv commented May 3, 2024

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

$ cue version
cue version v0.0.0-20240503105822-dff77a6d2a5a

go version go1.22.1
      -buildmode exe
       -compiler gc
  DefaultGODEBUG httplaxcontentlength=1,httpmuxgo121=1,tls10server=1,tlsrsakex=1,tlsunsafeekm=1
     CGO_ENABLED 1
          GOARCH arm64
            GOOS linux
             vcs git
    vcs.revision dff77a6d2a5a1133cedf2572dd9464fc62f62a16
        vcs.time 2024-05-03T10:58:22Z
    vcs.modified false
cue.lang.version v0.9.0

Does this issue reproduce with the latest release?

Yes

What did you do?

# new evaluator does output some position information
env CUE_EXPERIMENT='evalv3'
! exec cue export x.cue
stderr 'x\.cue'
cmp stderr new.golden

# old evaluator should output _some_ position information
env CUE_EXPERIMENT=''
! exec cue export x.cue
stderr 'x\.cue'

-- x.cue --
#TimeSpan: {
	start:    float
	duration: float
	end:      float

	start:    end - duration
	duration: end - start
	end:      start + duration

	start: <=end
}

examples: [string]: #TimeSpan

examples: eg1: {
    start: 10.0
    duration: 2.1
}

examples: eg2: {
    start: 10.0
}

examples: eg3: {
    end: 10.0
}
-- new.golden --
examples.eg2.start: non-concrete value end for bound <=:
    ./x.cue:10:11
examples.eg2.duration: non-concrete value float in operand to -:
    ./x.cue:7:12
    ./x.cue:4:12
examples.eg3.duration: non-concrete value <=10.0 & float in operand to -:
    ./x.cue:7:12

What did you expect to see?

Passing test.

What did you see instead?

# new evaluator does output some position information (0.014s)
# old evaluator should output _some_ position information (0.011s)
> env CUE_EXPERIMENT=''
> ! exec cue export x.cue
[stderr]
cycle error
[exit status 1]
> stderr 'x\.cue'
FAIL: /tmp/testscript203630098/repro.txtar/script.txtar:10: no match for `x\.cue` found in stderr

Is there perhaps something we can do with the old evaluator to output some position information here?

cc @b4nst

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant