Closed timspeetjens closed 3 years ago
@timspeetjens thanks for the reproducer above. Yes, definitely related to #924 and again seems like a valid request.
(sorry, that last message sent too quickly)
@timspeetjens purely as an FYI (because your reproducer above is great) you can specify a reproducer as a single file that can be copy-pasted as a test case:
https://github.com/cuelang/cue/wiki/Creating-test-or-performance-reproducers
Not critical, but does make the job of fixing things that bit easier.
Here's such a txtar
archive for this example:
exec cue cmd hello ./...
stdout 'Hello cue!'
-- dir/ca.cue --
package abc
_name: "cue"
-- hello_tool.cue --
package abc
import (
"tool/cli"
)
command: hello: {
print: cli.Print & {
text: "Hello \(_name)!"
}
}
For completeness, the following also fails, but might be the same issue:
exec cue cmd hello ./...
stdout 'Hello cue!'
-- dir/ca.cue --
package abc
p: {
_name: "cue"
}
-- hello_tool.cue --
package abc
import (
"tool/cli"
)
command: hello: {
print: cli.Print & {
text: "Hello \(p._name)!"
}
}
The output differs slightly:
command.hello.print.text: invalid string argument: invalid interpolation: undefined field: _name:
./hello_tool.cue:8:2
./hello_tool.cue:9:3
./hello_tool.cue:9:9
./hello_tool.cue:9:20
tool/cli:4:3
but might be the same issue:
Yes, it's the same issue.
This issue has been migrated to https://github.com/cue-lang/cue/issues/1032.
For more details about CUE's migration to a new home, please see https://github.com/cue-lang/cue/issues/1078.
What version of CUE are you using (
cue version
)?What did you do?
What did you expect to see?
What did you see instead?
This seems to be related to #924. In this case, the cue file resides in a leaf directory. Moving the
ca.cue
file next to thehello_tool.cue
file works as expected.