Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f3ab29be authored by Spandan Das's avatar Spandan Das
Browse files

Dedupe all deps of cc_libraries

Without an explicit deduping in this helper function, a dependency may
appear multiple times in the generated BUILD files. I noticed this while
converting some internal google tests.

This currently does the deduping for the non-configurable root value. I
ran into some issues deduping the configurable values, and I will
address it in a followup CL.

Test: go test ./bp2build

Change-Id: Ie7b588a9c922d72e4fabfb1414a7cc3dc402ff86
parent 5e04d488
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -1023,6 +1023,13 @@ func bp2BuildParseBaseProps(ctx android.Bp2buildMutatorContext, module *Module)

	addMuslSystemDynamicDeps(ctx, linkerAttrs)

	// Dedupe all deps.
	(&linkerAttrs).deps.Value = bazel.FirstUniqueBazelLabelList((&linkerAttrs).deps.Value)
	(&linkerAttrs).implementationDeps.Value = bazel.FirstUniqueBazelLabelList((&linkerAttrs).implementationDeps.Value)
	(&linkerAttrs).implementationDynamicDeps.Value = bazel.FirstUniqueBazelLabelList((&linkerAttrs).implementationDynamicDeps.Value)
	(&linkerAttrs).wholeArchiveDeps.Value = bazel.FirstUniqueBazelLabelList((&linkerAttrs).wholeArchiveDeps.Value)
	(&linkerAttrs).implementationWholeArchiveDeps.Value = bazel.FirstUniqueBazelLabelList((&linkerAttrs).implementationWholeArchiveDeps.Value)

	return baseAttributes{
		compilerAttrs,
		linkerAttrs,