Skip to content

Commit

Permalink
Add variant to dependency cycle errors am: e5ff770
Browse files Browse the repository at this point in the history
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/1689306

Change-Id: I5146b753d84b0df9125c14a0dc617198f7c51852
  • Loading branch information
colincross authored and android-build-merge-worker-robot committed Apr 29, 2021
2 parents 010f5bb + e5ff770 commit 54d8f87
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
5 changes: 2 additions & 3 deletions context.go
Original file line number Diff line number Diff line change
Expand Up @@ -2158,9 +2158,8 @@ func cycleError(cycle []*moduleInfo) (errs []error) {
for i := len(cycle) - 1; i >= 0; i-- {
nextModule := cycle[i]
errs = append(errs, &BlueprintError{
Err: fmt.Errorf(" %q depends on %q",
curModule.Name(),
nextModule.Name()),
Err: fmt.Errorf(" %s depends on %s",
curModule, nextModule),
Pos: curModule.pos,
})
curModule = nextModule
Expand Down
14 changes: 7 additions & 7 deletions context_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -994,9 +994,9 @@ func Test_parallelVisit(t *testing.T) {
})
want := []string{
`encountered dependency cycle`,
`"C" depends on "A"`,
`"A" depends on "B"`,
`"B" depends on "C"`,
`module "C" depends on module "A"`,
`module "A" depends on module "B"`,
`module "B" depends on module "C"`,
}
for i := range want {
if len(errs) <= i {
Expand Down Expand Up @@ -1030,8 +1030,8 @@ func Test_parallelVisit(t *testing.T) {
})
want := []string{
`encountered dependency cycle`,
`"D" depends on "C"`,
`"C" depends on "D"`,
`module "D" depends on module "C"`,
`module "C" depends on module "D"`,
}
for i := range want {
if len(errs) <= i {
Expand Down Expand Up @@ -1067,8 +1067,8 @@ func Test_parallelVisit(t *testing.T) {
})
want := []string{
`encountered dependency cycle`,
`"G" depends on "F"`,
`"F" depends on "G"`,
`module "G" depends on module "F"`,
`module "F" depends on module "G"`,
}
for i := range want {
if len(errs) <= i {
Expand Down

0 comments on commit 54d8f87

Please sign in to comment.