Open verdverm opened 2 years ago
The problem seems to be that we end up using filepath.Join
with the module root and the directory to be loaded, which does the wrong thing when that directory is absolute. Definitely needs a fix, but I also don't think this is urgent as most common scenarios have a workaround: using a relative path.
For completeness here is a repro.
exec cue eval $WORK
cmp stdout stdout.golden
-- x.cue --
package x
x: 5
-- stdout.golden --
x: 5
A passing test
> exec cue eval $WORK
[stderr]
cannot find package "$WORK"
[exit status 1]
FAIL: /tmp/testscript708032307/repro.txtar/script.txtar:1: unexpected command failure
(sent too early)
Thanks for the report, @verdverm!
I discovered the same bug recently and added a failing test case in https://review.gerrithub.io/c/cue-lang/cue/+/1194381. I will take a look at this soon.
What version of CUE are you using (
cue version
)?v0.4.3
What did you do?
What did you expect to see?
the same output as
cue eval
in the current directoryWhat did you see instead?
an error