cue/load: add package import cycle error
When two or more packages import each other resulting in a cycle,
cue/load used to cause an infinite loop.
Error instead, since we explicitly don't support import cycles,
per https://cuelang.org/docs/references/spec/#import-declarations:
It is illegal for a package to import itself, directly or indirectly
Fixes #849
Closes #2469 as merged as of commit ce733970.
Signed-off-by: Artem V. Navrotskiy <bozaro@yandex.ru>
Change-Id: I1928717b3df3c5e6c48eb4fa30966f26079e19c6
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1167597
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>
Reviewed-by: Roger Peppe <rogpeppe@gmail.com>
authored by