cue/load: error when loading packages from inside cue.mod
Running cue commands from inside the cue.mod directory is a common
mistake for new users. Previously, commands like "cue export ." would
silently work, but others could easily fail in confusing ways.
Now, attempting to load packages from inside cue.mod produces a clear
error message: "cannot load packages inside the cue.mod directory"
The legacy directories cue.mod/pkg, cue.mod/usr, and cue.mod/gen
continue to work for backwards compatibility, as they are still
supported for placing package dependencies. Given that CUE packages
in those locations was commonplace, don't break direct loading of those
directories unless we really have to.
Signed-off-by: Daniel Martí <mvdan@mvdan.cc>
Change-Id: I9defb828d6a0c0b041b21466efce5af9e21efa6a
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1229769
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
Reviewed-by: Matthew Sackman <matthew@cue.works>