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

eval: regression giving "non-concrete value _ (type _) error" #3681

Closed
myitcv opened this issue Jan 15, 2025 · 1 comment
Closed

eval: regression giving "non-concrete value _ (type _) error" #3681

myitcv opened this issue Jan 15, 2025 · 1 comment
Labels
evaluator evalv3 issues affecting only the evaluator version 3 NeedsInvestigation

Comments

@myitcv
Copy link
Member

myitcv commented Jan 15, 2025

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

$ cue version
cue version v0.0.0-20250115193449-0ad6826e46b2

go version go1.23.2
      -buildmode exe
       -compiler gc
  DefaultGODEBUG asynctimerchan=1,gotypesalias=0,httpservecontentkeepheaders=1,tls3des=1,tlskyber=0,x509keypairleaf=0,x509negativeserial=1
     CGO_ENABLED 1
          GOARCH arm64
            GOOS linux
         GOARM64 v8.0
             vcs git
    vcs.revision 0ad6826e46b2dee462a8f307adcb04ef850bcda3
        vcs.time 2025-01-15T19:34:49Z
    vcs.modified false
cue.lang.version v0.12.0

Does this issue reproduce with the latest release?

n/a - testing evalv3 with tip

What did you do?

# evalv2
env CUE_EXPERIMENT=evalv3=0
exec cue export
cmp stdout stdout.golden

# evalv3
env CUE_EXPERIMENT=evalv3=1
exec cue export
cmp stdout stdout.golden

-- release.cue --
package github

workflows: release: _repo.repositoryDispatch
-- workflows.cue --
package github

_repo: {
	botGitHubUserTokenSecretsKey: *"again" | string

	pushTipToTrybotWorkflow: "\(botGitHubUserTokenSecretsKey)"

	repositoryDispatch: {
		_curlGitHubAPI: curlGitHubAPI
		"hello"
	}

	curlGitHubAPI: {
		#tokenSecretsKey: *botGitHubUserTokenSecretsKey | _
	}
}
workflows: doit: _repo.pushTipToTrybotWorkflow
-- stdout.golden --
{
    "workflows": {
        "release": "hello",
        "doit": "again"
    }
}

What did you expect to see?

Passing test.

What did you see instead?

# evalv2 (0.012s)
# evalv3 (0.031s)
> env CUE_EXPERIMENT=evalv3=1
> exec cue export
[stderr]
_repo.pushTipToTrybotWorkflow: invalid interpolation: non-concrete value _ (type _):
    ./workflows.cue:6:27
[exit status 1]
FAIL: /tmp/testscript3475180119/repro.txtar/script.txtar:8: unexpected command failure

This bisects to 80743ca

This was massively reduced from a much more involved case where the non-concrete error was more trickily buried under a matchN-related error.

@myitcv myitcv added NeedsInvestigation evaluator evalv3 issues affecting only the evaluator version 3 labels Jan 15, 2025
@mvdan
Copy link
Member

mvdan commented Jan 16, 2025

Reduced a bit further:

# evalv2
env CUE_EXPERIMENT=evalv3=0
exec cue vet -c input.cue

# evalv3
env CUE_EXPERIMENT=evalv3=1
exec cue vet -c input.cue

-- input.cue --
// Order dependent! These two fields need to go first.
out: one: #strDefaultDef
out: two: "\(strDefault)"

strDefault: *"fallback" | string
#strDefaultDef: strDefault

As of 0ad6826:

# evalv2 (0.010s)
> env CUE_EXPERIMENT=evalv3=0
> exec cue vet -c input.cue
# evalv3 (0.031s)
> env CUE_EXPERIMENT=evalv3=1
> exec cue vet -c input.cue
[stderr]
out.two: invalid interpolation: non-concrete value _ (type _):
    ./input.cue:3:11
[exit status 1]

Note that the reproducer is order dependent, which is worrying.

cueckoo pushed a commit that referenced this issue Jan 16, 2025
Issue #3681

Signed-off-by: Marcel van Lohuizen <[email protected]>
Change-Id: Ifb7f5cdd58f4d794c92ec59edc39df6c3b8c9406
Reviewed-on: https://gerrithub.io/c/cue-lang/cue/+/1207319
Reviewed-by: Daniel Martí <[email protected]>
TryBot-Result: CUEcueckoo <[email protected]>
Unity-Result: CUE porcuepine <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
evaluator evalv3 issues affecting only the evaluator version 3 NeedsInvestigation
Projects
None yet
Development

No branches or pull requests

2 participants