cosmetic changes am: 16ac13506e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2132596 Change-Id: I00e1d350a7121309ed2b3d64d84df66d7169de91 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -938,12 +938,12 @@ func getConfigString(key cqueryKey) string {
|
|||||||
// Use host platform, which is currently hardcoded to be x86_64.
|
// Use host platform, which is currently hardcoded to be x86_64.
|
||||||
arch = "x86_64"
|
arch = "x86_64"
|
||||||
}
|
}
|
||||||
os := key.configKey.osType.Name
|
osName := key.configKey.osType.Name
|
||||||
if len(os) == 0 || os == "common_os" || os == "linux_glibc" {
|
if len(osName) == 0 || osName == "common_os" || osName == "linux_glibc" {
|
||||||
// Use host OS, which is currently hardcoded to be linux.
|
// Use host OS, which is currently hardcoded to be linux.
|
||||||
os = "linux"
|
osName = "linux"
|
||||||
}
|
}
|
||||||
return arch + "|" + os
|
return arch + "|" + osName
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetConfigKey(ctx BaseModuleContext) configKey {
|
func GetConfigKey(ctx BaseModuleContext) configKey {
|
||||||
|
@@ -167,7 +167,7 @@ func newAqueryHandler(aqueryResult actionGraphContainer) (*aqueryArtifactHandler
|
|||||||
|
|
||||||
// Map middleman artifact ContentHash to input artifact depset ID.
|
// Map middleman artifact ContentHash to input artifact depset ID.
|
||||||
// Middleman artifacts are treated as "substitute" artifacts for mixed builds. For example,
|
// Middleman artifacts are treated as "substitute" artifacts for mixed builds. For example,
|
||||||
// if we find a middleman action which has outputs [foo, bar], and output [baz_middleman], then,
|
// if we find a middleman action which has inputs [foo, bar], and output [baz_middleman], then,
|
||||||
// for each other action which has input [baz_middleman], we add [foo, bar] to the inputs for
|
// for each other action which has input [baz_middleman], we add [foo, bar] to the inputs for
|
||||||
// that action instead.
|
// that action instead.
|
||||||
middlemanIdToDepsetIds := map[artifactId][]depsetId{}
|
middlemanIdToDepsetIds := map[artifactId][]depsetId{}
|
||||||
@@ -348,7 +348,7 @@ func AqueryBuildStatements(aqueryJsonProto []byte) ([]BuildStatement, []AqueryDe
|
|||||||
if prevEntry, hasKey := depsetsByHash[aqueryDepset.ContentHash]; hasKey {
|
if prevEntry, hasKey := depsetsByHash[aqueryDepset.ContentHash]; hasKey {
|
||||||
// Two depsets collide on hash. Ensure that their contents are identical.
|
// Two depsets collide on hash. Ensure that their contents are identical.
|
||||||
if !reflect.DeepEqual(aqueryDepset, prevEntry) {
|
if !reflect.DeepEqual(aqueryDepset, prevEntry) {
|
||||||
return nil, nil, fmt.Errorf("Two different depsets have the same hash: %v, %v", prevEntry, aqueryDepset)
|
return nil, nil, fmt.Errorf("two different depsets have the same hash: %v, %v", prevEntry, aqueryDepset)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
depsetsByHash[aqueryDepset.ContentHash] = aqueryDepset
|
depsetsByHash[aqueryDepset.ContentHash] = aqueryDepset
|
||||||
|
@@ -224,7 +224,7 @@ func TestAqueryMultiArchGenrule(t *testing.T) {
|
|||||||
}]
|
}]
|
||||||
}`
|
}`
|
||||||
actualbuildStatements, actualDepsets, _ := AqueryBuildStatements([]byte(inputString))
|
actualbuildStatements, actualDepsets, _ := AqueryBuildStatements([]byte(inputString))
|
||||||
expectedBuildStatements := []BuildStatement{}
|
var expectedBuildStatements []BuildStatement
|
||||||
for _, arch := range []string{"arm", "arm64", "x86", "x86_64"} {
|
for _, arch := range []string{"arm", "arm64", "x86", "x86_64"} {
|
||||||
expectedBuildStatements = append(expectedBuildStatements,
|
expectedBuildStatements = append(expectedBuildStatements,
|
||||||
BuildStatement{
|
BuildStatement{
|
||||||
@@ -235,7 +235,7 @@ func TestAqueryMultiArchGenrule(t *testing.T) {
|
|||||||
fmt.Sprintf("bazel-out/sourceroot/k8-fastbuild/bin/bionic/libc/syscalls-%s.S", arch),
|
fmt.Sprintf("bazel-out/sourceroot/k8-fastbuild/bin/bionic/libc/syscalls-%s.S", arch),
|
||||||
},
|
},
|
||||||
Env: []KeyValuePair{
|
Env: []KeyValuePair{
|
||||||
KeyValuePair{Key: "PATH", Value: "/bin:/usr/bin:/usr/local/bin"},
|
{Key: "PATH", Value: "/bin:/usr/bin:/usr/local/bin"},
|
||||||
},
|
},
|
||||||
Mnemonic: "Genrule",
|
Mnemonic: "Genrule",
|
||||||
})
|
})
|
||||||
@@ -747,7 +747,7 @@ func TestTransitiveInputDepsets(t *testing.T) {
|
|||||||
actualbuildStatements, actualDepsets, _ := AqueryBuildStatements([]byte(inputString))
|
actualbuildStatements, actualDepsets, _ := AqueryBuildStatements([]byte(inputString))
|
||||||
|
|
||||||
expectedBuildStatements := []BuildStatement{
|
expectedBuildStatements := []BuildStatement{
|
||||||
BuildStatement{
|
{
|
||||||
Command: "/bin/bash -c 'touch bazel-out/sourceroot/k8-fastbuild/bin/testpkg/test_out'",
|
Command: "/bin/bash -c 'touch bazel-out/sourceroot/k8-fastbuild/bin/testpkg/test_out'",
|
||||||
OutputPaths: []string{"bazel-out/sourceroot/k8-fastbuild/bin/testpkg/test_out"},
|
OutputPaths: []string{"bazel-out/sourceroot/k8-fastbuild/bin/testpkg/test_out"},
|
||||||
Mnemonic: "Action",
|
Mnemonic: "Action",
|
||||||
@@ -758,7 +758,7 @@ func TestTransitiveInputDepsets(t *testing.T) {
|
|||||||
// Inputs for the action are test_{i} from 1 to 20, and test_root. These inputs
|
// Inputs for the action are test_{i} from 1 to 20, and test_root. These inputs
|
||||||
// are given via a deep depset, but the depset is flattened when returned as a
|
// are given via a deep depset, but the depset is flattened when returned as a
|
||||||
// BuildStatement slice.
|
// BuildStatement slice.
|
||||||
expectedFlattenedInputs := []string{}
|
var expectedFlattenedInputs []string
|
||||||
for i := 1; i < 20; i++ {
|
for i := 1; i < 20; i++ {
|
||||||
expectedFlattenedInputs = append(expectedFlattenedInputs, fmt.Sprintf("bazel-out/sourceroot/k8-fastbuild/bin/testpkg/test_%d", i))
|
expectedFlattenedInputs = append(expectedFlattenedInputs, fmt.Sprintf("bazel-out/sourceroot/k8-fastbuild/bin/testpkg/test_%d", i))
|
||||||
}
|
}
|
||||||
@@ -876,7 +876,7 @@ func flattenDepsets(depsetHashesToFlatten []string, allDepsets []AqueryDepset) [
|
|||||||
for _, depset := range allDepsets {
|
for _, depset := range allDepsets {
|
||||||
depsetsByHash[depset.ContentHash] = depset
|
depsetsByHash[depset.ContentHash] = depset
|
||||||
}
|
}
|
||||||
result := []string{}
|
var result []string
|
||||||
for _, depsetId := range depsetHashesToFlatten {
|
for _, depsetId := range depsetHashesToFlatten {
|
||||||
result = append(result, flattenDepset(depsetId, depsetsByHash)...)
|
result = append(result, flattenDepset(depsetId, depsetsByHash)...)
|
||||||
}
|
}
|
||||||
@@ -886,7 +886,7 @@ func flattenDepsets(depsetHashesToFlatten []string, allDepsets []AqueryDepset) [
|
|||||||
// Returns the contents of a given depset in post order.
|
// Returns the contents of a given depset in post order.
|
||||||
func flattenDepset(depsetHashToFlatten string, allDepsets map[string]AqueryDepset) []string {
|
func flattenDepset(depsetHashToFlatten string, allDepsets map[string]AqueryDepset) []string {
|
||||||
depset := allDepsets[depsetHashToFlatten]
|
depset := allDepsets[depsetHashToFlatten]
|
||||||
result := []string{}
|
var result []string
|
||||||
for _, depsetId := range depset.TransitiveDepSetHashes {
|
for _, depsetId := range depset.TransitiveDepSetHashes {
|
||||||
result = append(result, flattenDepset(depsetId, allDepsets)...)
|
result = append(result, flattenDepset(depsetId, allDepsets)...)
|
||||||
}
|
}
|
||||||
@@ -958,7 +958,7 @@ func TestSimpleSymlink(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
expectedBuildStatements := []BuildStatement{
|
expectedBuildStatements := []BuildStatement{
|
||||||
BuildStatement{
|
{
|
||||||
Command: "mkdir -p one/symlink_subdir && " +
|
Command: "mkdir -p one/symlink_subdir && " +
|
||||||
"rm -f one/symlink_subdir/symlink && " +
|
"rm -f one/symlink_subdir/symlink && " +
|
||||||
"ln -sf $PWD/one/file_subdir/file one/symlink_subdir/symlink",
|
"ln -sf $PWD/one/file_subdir/file one/symlink_subdir/symlink",
|
||||||
@@ -1022,7 +1022,7 @@ func TestSymlinkQuotesPaths(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
expectedBuildStatements := []BuildStatement{
|
expectedBuildStatements := []BuildStatement{
|
||||||
BuildStatement{
|
{
|
||||||
Command: "mkdir -p 'one/symlink subdir' && " +
|
Command: "mkdir -p 'one/symlink subdir' && " +
|
||||||
"rm -f 'one/symlink subdir/symlink' && " +
|
"rm -f 'one/symlink subdir/symlink' && " +
|
||||||
"ln -sf $PWD/'one/file subdir/file' 'one/symlink subdir/symlink'",
|
"ln -sf $PWD/'one/file subdir/file' 'one/symlink subdir/symlink'",
|
||||||
@@ -1154,7 +1154,7 @@ func TestTemplateExpandActionSubstitutions(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
expectedBuildStatements := []BuildStatement{
|
expectedBuildStatements := []BuildStatement{
|
||||||
BuildStatement{
|
{
|
||||||
Command: "/bin/bash -c 'echo \"Test template substitutions: abcd, python3\" | sed \"s/\\\\\\\\n/\\\\n/g\" > template_file && " +
|
Command: "/bin/bash -c 'echo \"Test template substitutions: abcd, python3\" | sed \"s/\\\\\\\\n/\\\\n/g\" > template_file && " +
|
||||||
"chmod a+x template_file'",
|
"chmod a+x template_file'",
|
||||||
OutputPaths: []string{"template_file"},
|
OutputPaths: []string{"template_file"},
|
||||||
@@ -1320,14 +1320,14 @@ func TestPythonZipperActionSuccess(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
expectedBuildStatements := []BuildStatement{
|
expectedBuildStatements := []BuildStatement{
|
||||||
BuildStatement{
|
{
|
||||||
Command: "/bin/bash -c 'echo \"Test template substitutions: abcd, python3\" | sed \"s/\\\\\\\\n/\\\\n/g\" > python_binary && " +
|
Command: "/bin/bash -c 'echo \"Test template substitutions: abcd, python3\" | sed \"s/\\\\\\\\n/\\\\n/g\" > python_binary && " +
|
||||||
"chmod a+x python_binary'",
|
"chmod a+x python_binary'",
|
||||||
InputPaths: []string{"python_binary.zip"},
|
InputPaths: []string{"python_binary.zip"},
|
||||||
OutputPaths: []string{"python_binary"},
|
OutputPaths: []string{"python_binary"},
|
||||||
Mnemonic: "TemplateExpand",
|
Mnemonic: "TemplateExpand",
|
||||||
},
|
},
|
||||||
BuildStatement{
|
{
|
||||||
Command: "../bazel_tools/tools/zip/zipper/zipper cC python_binary.zip __main__.py=bazel-out/k8-fastbuild/bin/python_binary.temp " +
|
Command: "../bazel_tools/tools/zip/zipper/zipper cC python_binary.zip __main__.py=bazel-out/k8-fastbuild/bin/python_binary.temp " +
|
||||||
"__init__.py= runfiles/__main__/__init__.py= runfiles/__main__/python_binary.py=python_binary.py && " +
|
"__init__.py= runfiles/__main__/__init__.py= runfiles/__main__/python_binary.py=python_binary.py && " +
|
||||||
"../bazel_tools/tools/zip/zipper/zipper x python_binary.zip -d python_binary.runfiles && ln -sf runfiles/__main__ python_binary.runfiles",
|
"../bazel_tools/tools/zip/zipper/zipper x python_binary.zip -d python_binary.runfiles && ln -sf runfiles/__main__ python_binary.runfiles",
|
||||||
|
Reference in New Issue
Block a user