cue-lang / cue

The home of the CUE language! Validate and define text-based and dynamic configuration
https://cuelang.org
Apache License 2.0
5.01k stars 283 forks source link

tools/flow: Reference not found when `./...` #2388

Open sjwl opened 1 year ago

sjwl commented 1 year ago

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

$ cue version
cue version v0.5.0

go version go1.19.8
       -compiler gc
       -trimpath true
     CGO_ENABLED 0
          GOARCH arm64
            GOOS linux

Does this issue reproduce with the latest stable release?

yes

What did you do?

 tree .
.
├── A
│   └── A.cue
├── base.cue
├── cue.mod
│   ├── module.cue
│   ├── pkg
│   └── usr
└── dump_tool.cue
cat base.cue
package foo

#FOO: "bar"
cat A/A.cue
package foo

foo: #FOO
cat dump_tool.cue 
package foo

import (
    "tool/cli"
)

command: dump: {
    task: print: cli.Print & {
                 text: #FOO
    }
}
cue dump ./...

What did you expect to see?

cue dump ./...
bar

What did you see instead?

cue dump ./...
command.dump.task.print.text: reference "#FOO" not found:
    ./dump_tool.cue:9:24

interestingly these worked as expected

cue dump ./A
bar
cue dump .
bar

but this did NOT

cue dump . ./A
command.dump.task.print.text: reference "#FOO" not found:
    ./dump_tool.cue:9:24
myitcv commented 1 year ago

Need to investigate and bisect.