Add variant to dependency cycle errors am: e5ff770c95 am: 54d8f87981

Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/1689306

Change-Id: I896d8c4d6dfb1b8fedf0fcee78d0f6cfdee41a67
This commit is contained in:
Colin Cross 2021-04-29 03:00:26 +00:00 committed by Automerger Merge Worker
commit 2ef3c79d58
2 changed files with 9 additions and 10 deletions

View file

@ -2158,9 +2158,8 @@ func cycleError(cycle []*moduleInfo) (errs []error) {
for i := len(cycle) - 1; i >= 0; i-- { for i := len(cycle) - 1; i >= 0; i-- {
nextModule := cycle[i] nextModule := cycle[i]
errs = append(errs, &BlueprintError{ errs = append(errs, &BlueprintError{
Err: fmt.Errorf(" %q depends on %q", Err: fmt.Errorf(" %s depends on %s",
curModule.Name(), curModule, nextModule),
nextModule.Name()),
Pos: curModule.pos, Pos: curModule.pos,
}) })
curModule = nextModule curModule = nextModule

View file

@ -994,9 +994,9 @@ func Test_parallelVisit(t *testing.T) {
}) })
want := []string{ want := []string{
`encountered dependency cycle`, `encountered dependency cycle`,
`"C" depends on "A"`, `module "C" depends on module "A"`,
`"A" depends on "B"`, `module "A" depends on module "B"`,
`"B" depends on "C"`, `module "B" depends on module "C"`,
} }
for i := range want { for i := range want {
if len(errs) <= i { if len(errs) <= i {
@ -1030,8 +1030,8 @@ func Test_parallelVisit(t *testing.T) {
}) })
want := []string{ want := []string{
`encountered dependency cycle`, `encountered dependency cycle`,
`"D" depends on "C"`, `module "D" depends on module "C"`,
`"C" depends on "D"`, `module "C" depends on module "D"`,
} }
for i := range want { for i := range want {
if len(errs) <= i { if len(errs) <= i {
@ -1067,8 +1067,8 @@ func Test_parallelVisit(t *testing.T) {
}) })
want := []string{ want := []string{
`encountered dependency cycle`, `encountered dependency cycle`,
`"G" depends on "F"`, `module "G" depends on module "F"`,
`"F" depends on "G"`, `module "F" depends on module "G"`,
} }
for i := range want { for i := range want {
if len(errs) <= i { if len(errs) <= i {