Merge "Denylist more infinite symlinks in the tree."
diff --git a/android/bazel_handler.go b/android/bazel_handler.go
index 4d9423a..8ab003c 100644
--- a/android/bazel_handler.go
+++ b/android/bazel_handler.go
@@ -878,7 +878,7 @@
}
// The actual Bazel action.
- cmd.Text(" " + buildStatement.Command)
+ cmd.Text(buildStatement.Command)
for _, outputPath := range buildStatement.OutputPaths {
cmd.ImplicitOutput(PathForBazelOut(ctx, outputPath))
diff --git a/android/makevars.go b/android/makevars.go
index ece7091..a74185a 100644
--- a/android/makevars.go
+++ b/android/makevars.go
@@ -472,7 +472,8 @@
fmt.Fprintf(buf, "\tchmod +x $@\n")
}
if extraFiles := install.extraFiles; extraFiles != nil {
- fmt.Fprintf(buf, "\tunzip -qDD -d '%s' '%s'\n", extraFiles.dir.String(), extraFiles.zip.String())
+ fmt.Fprintf(buf, "\t( unzip -qDD -d '%s' '%s' 2>&1 | grep -v \"zipfile is empty\"; exit $${PIPESTATUS[0]} ) || \\\n", extraFiles.dir.String(), extraFiles.zip.String())
+ fmt.Fprintf(buf, "\t ( code=$$?; if [ $$code -ne 0 -a $$code -ne 1 ]; then exit $$code; fi )\n")
}
fmt.Fprintln(buf)
}
diff --git a/android/module.go b/android/module.go
index 8bbfd8a..ad01e9e 100644
--- a/android/module.go
+++ b/android/module.go
@@ -3282,8 +3282,9 @@
extraCmds := ""
if extraZip != nil {
- extraCmds += fmt.Sprintf(" && unzip -qDD -d '%s' '%s'",
+ extraCmds += fmt.Sprintf(" && ( unzip -qDD -d '%s' '%s' 2>&1 | grep -v \"zipfile is empty\"; exit $${PIPESTATUS[0]} )",
extraZip.dir.String(), extraZip.zip.String())
+ extraCmds += " || ( code=$$?; if [ $$code -ne 0 -a $$code -ne 1 ]; then exit $$code; fi )"
implicitDeps = append(implicitDeps, extraZip.zip)
}
diff --git a/apex/apex_test.go b/apex/apex_test.go
index 07372a3..7905710 100644
--- a/apex/apex_test.go
+++ b/apex/apex_test.go
@@ -6227,6 +6227,9 @@
name: "mybootclasspath_fragment",
contents: ["bcplib"],
apex_available: ["myapex"],
+ hidden_api: {
+ split_packages: ["*"],
+ },
}
java_library {
@@ -6241,6 +6244,9 @@
name: "override_bootclasspath_fragment",
contents: ["override_bcplib"],
apex_available: ["myapex"],
+ hidden_api: {
+ split_packages: ["*"],
+ },
}
java_library {
@@ -7294,6 +7300,9 @@
apex_available: [
"some-non-updatable-apex",
],
+ hidden_api: {
+ split_packages: ["*"],
+ },
}
java_library {
@@ -7352,6 +7361,9 @@
apex_available: [
"com.android.art.debug",
],
+ hidden_api: {
+ split_packages: ["*"],
+ },
}
apex_key {
@@ -8695,6 +8707,9 @@
name: "mybootclasspathfragment",
contents: ["mybootclasspathlib"],
apex_available: ["myapex"],
+ hidden_api: {
+ split_packages: ["*"],
+ },
}
java_library {
@@ -9015,6 +9030,9 @@
name: "mybootclasspathfragment",
contents: ["mybootclasspathlib"],
apex_available: ["myapex"],
+ hidden_api: {
+ split_packages: ["*"],
+ },
}
java_sdk_library {
@@ -9115,6 +9133,9 @@
name: "mybootclasspathfragment",
contents: ["mybootclasspathlib"],
apex_available: ["myapex"],
+ hidden_api: {
+ split_packages: ["*"],
+ },
}
java_sdk_library {
@@ -9334,6 +9355,9 @@
name: "mybootclasspathfragment",
contents: ["myjavalib"],
apex_available: ["myapex"],
+ hidden_api: {
+ split_packages: ["*"],
+ },
}
java_library {
name: "myjavalib",
diff --git a/apex/bootclasspath_fragment_test.go b/apex/bootclasspath_fragment_test.go
index ce6b7f7..b298dac 100644
--- a/apex/bootclasspath_fragment_test.go
+++ b/apex/bootclasspath_fragment_test.go
@@ -110,6 +110,9 @@
apex_available: [
"com.android.art",
],
+ hidden_api: {
+ split_packages: ["*"],
+ },
}
`,
)
@@ -209,6 +212,9 @@
apex_available: [
"com.android.art",
],
+ hidden_api: {
+ split_packages: ["*"],
+ },
}
bootclasspath_fragment {
@@ -220,6 +226,9 @@
module: "art-bootclasspath-fragment",
},
],
+ hidden_api: {
+ split_packages: ["*"],
+ },
}
`,
)
@@ -361,6 +370,9 @@
apex_available: [
"com.android.art",
],
+ hidden_api: {
+ split_packages: ["*"],
+ },
}
`, contentsInsert(contents))
@@ -853,6 +865,9 @@
apex_available: [
"myapex",
],
+ hidden_api: {
+ split_packages: ["*"],
+ },
}
`)
@@ -959,6 +974,9 @@
apex_available: [
"com.android.art",
],
+ hidden_api: {
+ split_packages: ["*"],
+ },
}
apex {
@@ -1010,6 +1028,9 @@
module: "art-bootclasspath-fragment",
},
],
+ hidden_api: {
+ split_packages: ["*"],
+ },
}
`)
@@ -1123,6 +1144,9 @@
apex_available: [
"com.android.art",
],
+ hidden_api: {
+ split_packages: ["*"],
+ },
}
apex {
@@ -1175,6 +1199,9 @@
module: "art-bootclasspath-fragment",
},
],
+ hidden_api: {
+ split_packages: ["*"],
+ },
}
`)
@@ -1282,6 +1309,9 @@
apex_available: [
"com.android.art",
],
+ hidden_api: {
+ split_packages: ["*"],
+ },
}
apex {
@@ -1334,6 +1364,9 @@
module: "art-bootclasspath-fragment",
},
],
+ hidden_api: {
+ split_packages: ["*"],
+ },
}
`)
diff --git a/apex/classpath_element_test.go b/apex/classpath_element_test.go
index 60f18bd..9142eed 100644
--- a/apex/classpath_element_test.go
+++ b/apex/classpath_element_test.go
@@ -88,6 +88,9 @@
"baz",
"quuz",
],
+ hidden_api: {
+ split_packages: ["*"],
+ },
}
java_library {
@@ -134,6 +137,9 @@
contents: [
"bar",
],
+ hidden_api: {
+ split_packages: ["*"],
+ },
}
java_library {
diff --git a/apex/platform_bootclasspath_test.go b/apex/platform_bootclasspath_test.go
index 06c39ee..4b48da8 100644
--- a/apex/platform_bootclasspath_test.go
+++ b/apex/platform_bootclasspath_test.go
@@ -125,6 +125,7 @@
unsupported_packages: [
"bar-unsupported-packages.txt",
],
+ split_packages: ["*"],
},
}
@@ -274,6 +275,9 @@
"baz",
"quuz",
],
+ hidden_api: {
+ split_packages: ["*"],
+ },
}
java_library {
@@ -317,6 +321,9 @@
name: "my-bootclasspath-fragment",
contents: ["bar"],
apex_available: ["myapex"],
+ hidden_api: {
+ split_packages: ["*"],
+ },
}
apex_key {
@@ -482,6 +489,9 @@
contents: [
"foo", "bar",
],
+ hidden_api: {
+ split_packages: ["*"],
+ },
}
prebuilt_bootclasspath_fragment {
@@ -599,6 +609,9 @@
generate_classpaths_proto: false,
contents: ["foo"],
apex_available: ["myapex"],
+ hidden_api: {
+ split_packages: ["*"],
+ },
}
java_library {
@@ -656,6 +669,9 @@
contents: [
"foo",
],
+ hidden_api: {
+ split_packages: ["*"],
+ },
}
platform_bootclasspath {
@@ -696,6 +712,9 @@
bootclasspath_fragment {
name: "not-in-apex-fragment",
contents: ["foo"],
+ hidden_api: {
+ split_packages: ["*"],
+ },
}
platform_bootclasspath {
@@ -746,6 +765,9 @@
name: "apex-fragment",
contents: ["foo", "bar"],
apex_available:[ "myapex" ],
+ hidden_api: {
+ split_packages: ["*"],
+ },
}
platform_bootclasspath {
diff --git a/bazel/aquery.go b/bazel/aquery.go
index ab31581..433d502 100644
--- a/bazel/aquery.go
+++ b/bazel/aquery.go
@@ -16,6 +16,7 @@
import (
"crypto/sha256"
+ "encoding/base64"
"encoding/json"
"fmt"
"path/filepath"
@@ -295,7 +296,7 @@
a.depsetHashToArtifactPathsCache[depsetHash] = result
return result, nil
} else {
- return nil, fmt.Errorf("undefined input depset hash %d", depsetHash)
+ return nil, fmt.Errorf("undefined input depset hash %s", depsetHash)
}
}
@@ -390,8 +391,8 @@
h := sha256.New()
// Use newline as delimiter, as paths cannot contain newline.
h.Write([]byte(strings.Join(directPaths, "\n")))
- h.Write([]byte(strings.Join(transitiveDepsetHashes, "\n")))
- fullHash := fmt.Sprintf("%016x", h.Sum(nil))
+ h.Write([]byte(strings.Join(transitiveDepsetHashes, "")))
+ fullHash := base64.RawURLEncoding.EncodeToString(h.Sum(nil))
return fullHash
}
diff --git a/bazel/aquery_test.go b/bazel/aquery_test.go
index 740a1f1..c9c8909 100644
--- a/bazel/aquery_test.go
+++ b/bazel/aquery_test.go
@@ -847,8 +847,8 @@
}
expectedDepsetFiles := [][]string{
- []string{"middleinput_one", "middleinput_two"},
- []string{"middleinput_one", "middleinput_two", "maininput_one", "maininput_two"},
+ {"middleinput_one", "middleinput_two", "maininput_one", "maininput_two"},
+ {"middleinput_one", "middleinput_two"},
}
assertFlattenedDepsets(t, actualDepsets, expectedDepsetFiles)
@@ -897,7 +897,7 @@
func assertFlattenedDepsets(t *testing.T, actualDepsets []AqueryDepset, expectedDepsetFiles [][]string) {
t.Helper()
if len(actualDepsets) != len(expectedDepsetFiles) {
- t.Errorf("Expected %d depsets, but got %d depsets", expectedDepsetFiles, actualDepsets)
+ t.Errorf("Expected %s depsets, but got %s depsets", expectedDepsetFiles, actualDepsets)
}
for i, actualDepset := range actualDepsets {
actualFlattenedInputs := flattenDepsets([]string{actualDepset.ContentHash}, actualDepsets)
diff --git a/cc/config/arm64_device.go b/cc/config/arm64_device.go
index dfe143f..66087e6 100644
--- a/cc/config/arm64_device.go
+++ b/cc/config/arm64_device.go
@@ -33,9 +33,7 @@
},
"armv8-a-branchprot": []string{
"-march=armv8-a",
- // Disable BTI until drm vendors stop using OS libraries as sources
- // of gadgets (https://issuetracker.google.com/216395195).
- "-mbranch-protection=pac-ret",
+ "-mbranch-protection=standard",
},
"armv8-2a": []string{
"-march=armv8.2-a",
diff --git a/cc/config/vndk.go b/cc/config/vndk.go
index 492cd98..dd612ce 100644
--- a/cc/config/vndk.go
+++ b/cc/config/vndk.go
@@ -17,100 +17,9 @@
// List of VNDK libraries that have different core variant and vendor variant.
// For these libraries, the vendor variants must be installed even if the device
// has VndkUseCoreVariant set.
-// TODO(b/150578172): clean up unstable and non-versioned aidl module
+// Note that AIDL-generated modules must use vendor variants by default.
var VndkMustUseVendorVariantList = []string{
- "android.hardware.authsecret-V1-ndk",
- "android.hardware.authsecret-V1-ndk_platform",
- "android.hardware.authsecret-ndk_platform",
- "android.hardware.authsecret-unstable-ndk_platform",
- "android.hardware.automotive.occupant_awareness-V1-ndk",
- "android.hardware.automotive.occupant_awareness-V1-ndk_platform",
- "android.hardware.automotive.occupant_awareness-ndk_platform",
- "android.hardware.gnss-V1-ndk",
- "android.hardware.gnss-V1-ndk_platform",
- "android.hardware.gnss-ndk_platform",
- "android.hardware.gnss-unstable-ndk_platform",
- "android.hardware.health-V1-ndk",
- "android.hardware.health-ndk",
- "android.hardware.health.storage-V1-ndk",
- "android.hardware.health.storage-V1-ndk_platform",
- "android.hardware.health.storage-ndk_platform",
- "android.hardware.health.storage-unstable-ndk_platform",
- "android.hardware.identity-V2-ndk_platform",
- "android.hardware.identity-V3-ndk",
- "android.hardware.identity-V3-ndk_platform",
- "android.hardware.identity-ndk_platform",
- "android.hardware.light-V1-ndk",
- "android.hardware.light-V1-ndk_platform",
- "android.hardware.light-ndk_platform",
- "android.hardware.memtrack-V1-ndk",
- "android.hardware.memtrack-V1-ndk_platform",
- "android.hardware.memtrack-ndk_platform",
- "android.hardware.memtrack-unstable-ndk_platform",
"android.hardware.nfc@1.2",
- "android.hardware.oemlock-V1-ndk",
- "android.hardware.oemlock-V1-ndk_platform",
- "android.hardware.oemlock-ndk_platform",
- "android.hardware.oemlock-unstable-ndk_platform",
- "android.hardware.power-V1-ndk_platform",
- "android.hardware.power-V2-ndk",
- "android.hardware.power-V2-ndk_platform",
- "android.hardware.power-ndk_platform",
- "android.hardware.power.stats-V1-ndk",
- "android.hardware.power.stats-V1-ndk_platform",
- "android.hardware.power.stats-ndk_platform",
- "android.hardware.power.stats-unstable-ndk_platform",
- "android.hardware.rebootescrow-V1-ndk",
- "android.hardware.rebootescrow-V1-ndk_platform",
- "android.hardware.rebootescrow-ndk_platform",
- "android.hardware.radio-V1-ndk",
- "android.hardware.radio-V1-ndk_platform",
- "android.hardware.radio.config-V1-ndk",
- "android.hardware.radio.config-V1-ndk_platform",
- "android.hardware.radio.data-V1-ndk",
- "android.hardware.radio.data-V1-ndk_platform",
- "android.hardware.radio.messaging-V1-ndk",
- "android.hardware.radio.messaging-V1-ndk_platform",
- "android.hardware.radio.modem-V1-ndk",
- "android.hardware.radio.modem-V1-ndk_platform",
- "android.hardware.radio.network-V1-ndk",
- "android.hardware.radio.network-V1-ndk_platform",
- "android.hardware.radio.sim-V1-ndk",
- "android.hardware.radio.sim-V1-ndk_platform",
- "android.hardware.radio.voice-V1-ndk",
- "android.hardware.radio.voice-V1-ndk_platform",
- "android.hardware.security.keymint-V1-ndk",
- "android.hardware.security.keymint-V1-ndk_platform",
- "android.hardware.security.keymint-ndk_platform",
- "android.hardware.security.keymint-unstable-ndk_platform",
- "android.hardware.security.secureclock-V1-ndk",
- "android.hardware.security.secureclock-V1-ndk_platform",
- "android.hardware.security.secureclock-ndk_platform",
- "android.hardware.security.secureclock-unstable-ndk_platform",
- "android.hardware.security.sharedsecret-V1-ndk",
- "android.hardware.security.sharedsecret-V1-ndk_platform",
- "android.hardware.security.sharedsecret-ndk_platform",
- "android.hardware.security.sharedsecret-unstable-ndk_platform",
- "android.hardware.vibrator-V1-ndk_platform",
- "android.hardware.vibrator-V2-ndk",
- "android.hardware.vibrator-V2-ndk_platform",
- "android.hardware.vibrator-ndk_platform",
- "android.hardware.weaver-V1-ndk",
- "android.hardware.weaver-V1-ndk_platform",
- "android.hardware.weaver-ndk_platform",
- "android.hardware.weaver-unstable-ndk_platform",
- "android.system.suspend-V1-ndk",
- "android.system.keystore2-V1-ndk",
- "android.se.omapi-V1-ndk_platform",
- "android.se.omapi-ndk_platform",
- "android.se.omapi-unstable-ndk_platform",
- "android.hardware.wifi.hostapd-V1-ndk",
- "android.hardware.wifi.hostapd-V1-ndk_platform",
- "android.hardware.wifi.supplicant-V1-ndk",
- "android.system.keystore2-V1-ndk_platform",
- "android.system.keystore2-ndk_platform",
- "android.system.keystore2-unstable-ndk_platform",
- "android.system.suspend-V1-ndk_platform",
"libbinder",
"libcrypto",
"libexpat",
diff --git a/cc/pgo.go b/cc/pgo.go
index 0632c15..463e2e6 100644
--- a/cc/pgo.go
+++ b/cc/pgo.go
@@ -41,7 +41,6 @@
const profileInstrumentFlag = "-fprofile-generate=/data/local/tmp"
const profileUseInstrumentFormat = "-fprofile-use=%s"
-const profileUseSamplingFormat = "-fprofile-sample-accurate -fprofile-sample-use=%s"
func getPgoProfileProjects(config android.DeviceConfig) []string {
return config.OnceStringSlice(pgoProfileProjectsConfigKey, func() []string {
@@ -56,12 +55,11 @@
type PgoProperties struct {
Pgo struct {
Instrumentation *bool
- Sampling *bool `android:"arch_variant"`
Profile_file *string `android:"arch_variant"`
Benchmarks []string
Enable_profile_use *bool `android:"arch_variant"`
// Additional compiler flags to use when building this module
- // for profiling (either instrumentation or sampling).
+ // for profiling.
Cflags []string `android:"arch_variant"`
} `android:"arch_variant"`
@@ -79,10 +77,6 @@
return props.Pgo.Instrumentation != nil && *props.Pgo.Instrumentation == true
}
-func (props *PgoProperties) isSampling() bool {
- return props.Pgo.Sampling != nil && *props.Pgo.Sampling == true
-}
-
func (pgo *pgo) props() []interface{} {
return []interface{}{&pgo.Properties}
}
@@ -135,18 +129,8 @@
return android.OptionalPathForPath(nil)
}
-func (props *PgoProperties) profileUseFlag(ctx ModuleContext, file string) string {
- if props.isInstrumentation() {
- return fmt.Sprintf(profileUseInstrumentFormat, file)
- }
- if props.isSampling() {
- return fmt.Sprintf(profileUseSamplingFormat, file)
- }
- return ""
-}
-
func (props *PgoProperties) profileUseFlags(ctx ModuleContext, file string) []string {
- flags := []string{props.profileUseFlag(ctx, file)}
+ flags := []string{fmt.Sprintf(profileUseInstrumentFormat, file)}
flags = append(flags, profileUseOtherFlags...)
return flags
}
@@ -169,19 +153,14 @@
// if profileFile gets updated
flags.CFlagsDeps = append(flags.CFlagsDeps, profileFilePath)
flags.LdFlagsDeps = append(flags.LdFlagsDeps, profileFilePath)
-
- if props.isSampling() {
- flags.Local.LdFlags = append(flags.Local.LdFlags, "-Wl,-mllvm,-no-warn-sample-unused=true")
- }
}
return flags
}
func (props *PgoProperties) isPGO(ctx BaseModuleContext) bool {
isInstrumentation := props.isInstrumentation()
- isSampling := props.isSampling()
- profileKindPresent := isInstrumentation || isSampling
+ profileKindPresent := isInstrumentation
filePresent := props.Pgo.Profile_file != nil
benchmarksPresent := len(props.Pgo.Benchmarks) > 0
@@ -194,7 +173,7 @@
if !profileKindPresent || !filePresent {
var missing []string
if !profileKindPresent {
- missing = append(missing, "profile kind (either \"instrumentation\" or \"sampling\" property)")
+ missing = append(missing, "profile kind")
}
if !filePresent {
missing = append(missing, "profile_file property")
@@ -208,14 +187,6 @@
ctx.ModuleErrorf("Instrumentation PGO specification is missing benchmark property")
}
- if isSampling {
- ctx.ModuleErrorf("Sampling PGO is deprecated, use AFDO instead")
- }
-
- if isSampling && isInstrumentation {
- ctx.PropertyErrorf("pgo", "Exactly one of \"instrumentation\" and \"sampling\" properties must be set")
- }
-
return true
}
diff --git a/cc/tidy.go b/cc/tidy.go
index ac1521b..ff49c64 100644
--- a/cc/tidy.go
+++ b/cc/tidy.go
@@ -144,8 +144,23 @@
tidyChecks += config.TidyChecksForDir(ctx.ModuleDir())
}
if len(tidy.Properties.Tidy_checks) > 0 {
- tidyChecks = tidyChecks + "," + strings.Join(esc(ctx, "tidy_checks",
- config.ClangRewriteTidyChecks(tidy.Properties.Tidy_checks)), ",")
+ // If Tidy_checks contains "-*", ignore all checks before "-*".
+ localChecks := tidy.Properties.Tidy_checks
+ ignoreGlobalChecks := false
+ for n, check := range tidy.Properties.Tidy_checks {
+ if check == "-*" {
+ ignoreGlobalChecks = true
+ localChecks = tidy.Properties.Tidy_checks[n:]
+ }
+ }
+ if ignoreGlobalChecks {
+ tidyChecks = "-checks=" + strings.Join(esc(ctx, "tidy_checks",
+ config.ClangRewriteTidyChecks(localChecks)), ",")
+ } else {
+ tidyChecks = tidyChecks + "," + strings.Join(esc(ctx, "tidy_checks",
+ config.ClangRewriteTidyChecks(localChecks)), ",")
+ }
+
}
if ctx.Windows() {
// https://b.corp.google.com/issues/120614316
diff --git a/cc/tidy_test.go b/cc/tidy_test.go
index 339b302..14b33b2 100644
--- a/cc/tidy_test.go
+++ b/cc/tidy_test.go
@@ -16,11 +16,83 @@
import (
"fmt"
+ "strings"
"testing"
"android/soong/android"
)
+func TestTidyChecks(t *testing.T) {
+ // The "tidy_checks" property defines additional checks appended
+ // to global default. But there are some checks disabled after
+ // the local tidy_checks.
+ bp := `
+ cc_library_shared { // has global checks + extraGlobalChecks
+ name: "libfoo_1",
+ srcs: ["foo.c"],
+ }
+ cc_library_shared { // has only local checks + extraGlobalChecks
+ name: "libfoo_2",
+ srcs: ["foo.c"],
+ tidy_checks: ["-*", "xyz-*"],
+ }
+ cc_library_shared { // has global checks + local checks + extraGlobalChecks
+ name: "libfoo_3",
+ srcs: ["foo.c"],
+ tidy_checks: ["-abc*", "xyz-*", "mycheck"],
+ }
+ cc_library_shared { // has only local checks after "-*" + extraGlobalChecks
+ name: "libfoo_4",
+ srcs: ["foo.c"],
+ tidy_checks: ["-abc*", "xyz-*", "mycheck", "-*", "xyz-*"],
+ }`
+ ctx := testCc(t, bp)
+
+ globalChecks := "-checks=${config.TidyDefaultGlobalChecks},"
+ firstXyzChecks := "-checks='-*','xyz-*',"
+ localXyzChecks := "'-*','xyz-*'"
+ localAbcChecks := "'-abc*','xyz-*',mycheck"
+ extraGlobalChecks := ",-bugprone-easily-swappable-parameters,"
+ testCases := []struct {
+ libNumber int // 1,2,3,...
+ checks []string // must have substrings in -checks
+ noChecks []string // must not have substrings in -checks
+ }{
+ {1, []string{globalChecks, extraGlobalChecks}, []string{localXyzChecks, localAbcChecks}},
+ {2, []string{firstXyzChecks, extraGlobalChecks}, []string{globalChecks, localAbcChecks}},
+ {3, []string{globalChecks, localAbcChecks, extraGlobalChecks}, []string{localXyzChecks}},
+ {4, []string{firstXyzChecks, extraGlobalChecks}, []string{globalChecks, localAbcChecks}},
+ }
+ t.Run("caseTidyChecks", func(t *testing.T) {
+ variant := "android_arm64_armv8-a_shared"
+ for _, test := range testCases {
+ libName := fmt.Sprintf("libfoo_%d", test.libNumber)
+ flags := ctx.ModuleForTests(libName, variant).Rule("clangTidy").Args["tidyFlags"]
+ splitFlags := strings.Split(flags, " ")
+ foundCheckFlag := false
+ for _, flag := range splitFlags {
+ if strings.HasPrefix(flag, "-checks=") {
+ foundCheckFlag = true
+ for _, check := range test.checks {
+ if !strings.Contains(flag, check) {
+ t.Errorf("tidyFlags for %s does not contain %s.", libName, check)
+ }
+ }
+ for _, check := range test.noChecks {
+ if strings.Contains(flag, check) {
+ t.Errorf("tidyFlags for %s should not contain %s.", libName, check)
+ }
+ }
+ break
+ }
+ }
+ if !foundCheckFlag {
+ t.Errorf("tidyFlags for %s does not contain -checks=.", libName)
+ }
+ }
+ })
+}
+
func TestWithTidy(t *testing.T) {
// When WITH_TIDY=1 or (ALLOW_LOCAL_TIDY_TRUE=1 and local tidy:true)
// a C++ library should depend on .tidy files.
diff --git a/java/bootclasspath_fragment.go b/java/bootclasspath_fragment.go
index b28d70c..0591012 100644
--- a/java/bootclasspath_fragment.go
+++ b/java/bootclasspath_fragment.go
@@ -858,11 +858,18 @@
packagePrefixes := b.sourceOnlyProperties.Hidden_api.Package_prefixes
singlePackages := b.sourceOnlyProperties.Hidden_api.Single_packages
if splitPackages != nil || packagePrefixes != nil || singlePackages != nil {
- if splitPackages == nil {
- splitPackages = []string{"*"}
- }
output.SignaturePatternsPath = buildRuleSignaturePatternsFile(
ctx, output.AllFlagsPath, splitPackages, packagePrefixes, singlePackages)
+ } else if !b.isTestFragment() {
+ ctx.ModuleErrorf(`Must specify at least one of the split_packages, package_prefixes and single_packages properties
+ If this is a new bootclasspath_fragment or you are unsure what to do add the
+ the following to the bootclasspath_fragment:
+ hidden_api: {split_packages: ["*"]},
+ and then run the following:
+ m analyze_bcpf && analyze_bcpf --bcpf %q
+ it will analyze the bootclasspath_fragment and provide hints as to what you
+ should specify here. If you are happy with its suggestions then you can add
+ the --fix option and it will fix them for you.`, b.BaseModuleName())
}
return output
diff --git a/java/bootclasspath_fragment_test.go b/java/bootclasspath_fragment_test.go
index 8ffe99a..83beb6d 100644
--- a/java/bootclasspath_fragment_test.go
+++ b/java/bootclasspath_fragment_test.go
@@ -121,6 +121,9 @@
],
},
},
+ hidden_api: {
+ split_packages: ["*"],
+ },
}
java_library {
@@ -201,6 +204,9 @@
core_platform_api: {
stub_libs: ["mycoreplatform.stubs"],
},
+ hidden_api: {
+ split_packages: ["*"],
+ },
}
java_library {
diff --git a/rust/config/global.go b/rust/config/global.go
index 554cfe2..647a7cf 100644
--- a/rust/config/global.go
+++ b/rust/config/global.go
@@ -24,7 +24,7 @@
var pctx = android.NewPackageContext("android/soong/rust/config")
var (
- RustDefaultVersion = "1.61.0"
+ RustDefaultVersion = "1.61.0.p1"
RustDefaultBase = "prebuilts/rust/"
DefaultEdition = "2021"
Stdlibs = []string{
diff --git a/sdk/bootclasspath_fragment_sdk_test.go b/sdk/bootclasspath_fragment_sdk_test.go
index a60039a..93ad172 100644
--- a/sdk/bootclasspath_fragment_sdk_test.go
+++ b/sdk/bootclasspath_fragment_sdk_test.go
@@ -101,6 +101,9 @@
image_name: "art",
contents: ["mybootlib"],
apex_available: ["com.android.art"],
+ hidden_api: {
+ split_packages: ["*"],
+ },
}
apex_key {
@@ -235,6 +238,9 @@
// This should be automatically added to the sdk_snapshot as a java_sdk_libs module.
stub_libs: ["mycoreplatform"],
},
+ hidden_api: {
+ split_packages: ["*"],
+ },
}
java_library {
@@ -453,6 +459,9 @@
contents: [
"myotherlib",
],
+ hidden_api: {
+ split_packages: ["*"],
+ },
}
java_library {
@@ -482,6 +491,9 @@
module: "myotherbootclasspathfragment"
},
],
+ hidden_api: {
+ split_packages: ["*"],
+ },
}
java_sdk_library {
@@ -561,6 +573,9 @@
image_name: "art",
contents: ["mybootlib"],
apex_available: ["myapex"],
+ hidden_api: {
+ split_packages: ["*"],
+ },
}
java_library {
@@ -668,6 +683,7 @@
unsupported_packages: [
"my-unsupported-packages.txt",
],
+ split_packages: ["*"],
},
}
diff --git a/sdk/sdk_test.go b/sdk/sdk_test.go
index e230d5c..1ec12c3 100644
--- a/sdk/sdk_test.go
+++ b/sdk/sdk_test.go
@@ -473,6 +473,9 @@
name: "mybootclasspathfragment",
apex_available: ["myapex"],
contents: ["mysdklibrary"],
+ hidden_api: {
+ split_packages: ["*"],
+ },
}
java_sdk_library {