Spotted today in the context of the go-rules release workflow, but has been seen before too:
$ ./pleasew build --profile release -o plugin.go.pleasegotool:$(pwd)/plz-out/bin/tools/please_go/please_go -p -v notice //package:please_go_release_files //package:driver_release_files
20:00:09.384 NOTICE: Build running for 0s, 0 / 1 tasks done, 0 workers busy
20:00:09.407 CRITICAL: Found multiple definitions for subrepo 'darwin_arm64' (&{Name:darwin_arm64 Root: PackageRoot: Target:<nil> State:0xc00021a3c0 Arch:{OS:darwin Arch:arm64} IsCrossCompile:true AdditionalConfigFiles:[] fs:{} fsSync:{done:{_:{} v:1} m:{state:0 sema:0}}} s &{Name:darwin_arm64 Root: PackageRoot: Target:<nil> State:0xc00021a3c0 Arch:{OS:darwin Arch:arm64} IsCrossCompile:true AdditionalConfigFiles:[] fs:<nil> fsSync:{done:{_:{} v:0} m:{state:0 sema:0}}})
Error: Process completed with exit code 1.
The architecture subrepo causing the problem isn't consistent - I've seen it fail with darwin_arm64 and linux_amd64 on different runs of the workflow. From the function that produces the error message, it seems that two subrepos can be equal if the structs representing them are deeply equal:
|
func (graph *BuildGraph) MaybeAddSubrepo(subrepo *Subrepo) *Subrepo { |
|
if !graph.subrepos.Add(subrepo.Name, subrepo) { |
|
old := graph.subrepos.Get(subrepo.Name) |
|
if !reflect.DeepEqual(old, subrepo) { |
|
log.Fatalf("Found multiple definitions for subrepo '%s' (%+v s %+v)", old.Name, old, subrepo) |
|
} |
|
return old |
|
} |
|
return subrepo |
|
} |
Perhaps this condition is slightly too strict - the unexported fs and fsSync fields were added relatively recently, in #3038, and from the error message above it appears that the subrepos are identical in other respects, so perhaps they should be excluded from the equality comparison.
Spotted today in the context of the go-rules release workflow, but has been seen before too:
The architecture subrepo causing the problem isn't consistent - I've seen it fail with
darwin_arm64andlinux_amd64on different runs of the workflow. From the function that produces the error message, it seems that two subrepos can be equal if the structs representing them are deeply equal:please/src/core/graph.go
Lines 105 to 114 in 382cfd6
Perhaps this condition is slightly too strict - the unexported
fsandfsSyncfields were added relatively recently, in #3038, and from the error message above it appears that the subrepos are identical in other respects, so perhaps they should be excluded from the equality comparison.