Switch PackageContext functions to take a ctx

So that the Path and similar functions can be used directly, without
manually adding something like configErrorWrapper (it just uses it all
the time now).

Test: out/soong/build.ninja is identical
Change-Id: I8cb524b09a84d0b8357d7c3501c71270af411e17
diff --git a/cc/builder.go b/cc/builder.go
index 372c531..142a326 100644
--- a/cc/builder.go
+++ b/cc/builder.go
@@ -197,10 +197,10 @@
 	_ = pctx.SourcePathVariable("sAbiDiffer", "prebuilts/clang-tools/${config.HostPrebuiltTag}/bin/header-abi-diff")
 
 	sAbiDiff = pctx.AndroidRuleFunc("sAbiDiff",
-		func(config android.Config) (blueprint.RuleParams, error) {
+		func(ctx android.PackageRuleContext) blueprint.RuleParams {
 
 			commandStr := "($sAbiDiffer $allowFlags -lib $libName -arch $arch -check-all-apis -o ${out} -new $in -old $referenceDump)"
-			distDir := config.ProductVariables.DistDir
+			distDir := ctx.Config().ProductVariables.DistDir
 			if distDir != nil && *distDir != "" {
 				distAbiDiffDir := *distDir + "/abidiffs/"
 				commandStr += "  || (mkdir -p " + distAbiDiffDir + " && cp ${out} " + distAbiDiffDir + " && exit 1)"
@@ -208,7 +208,7 @@
 			return blueprint.RuleParams{
 				Command:     commandStr,
 				CommandDeps: []string{"$sAbiDiffer"},
-			}, nil
+			}
 		},
 		"allowFlags", "referenceDump", "libName", "arch")