Merge "Update clang version used for bindgen to r433403"
diff --git a/bazel/properties.go b/bazel/properties.go
index 1a846ba..ed4e9fc 100644
--- a/bazel/properties.go
+++ b/bazel/properties.go
@@ -743,6 +743,31 @@
return keys
}
+// DeduplicateAxesFromBase ensures no duplication of items between the no-configuration value and
+// configuration-specific values. For example, if we would convert this StringListAttribute as:
+// ["a", "b", "c"] + select({
+// "//condition:one": ["a", "d"],
+// "//conditions:default": [],
+// })
+// after this function, we would convert this StringListAttribute as:
+// ["a", "b", "c"] + select({
+// "//condition:one": ["d"],
+// "//conditions:default": [],
+// })
+func (sla *StringListAttribute) DeduplicateAxesFromBase() {
+ base := sla.Value
+ for axis, configToList := range sla.ConfigurableValues {
+ for config, list := range configToList {
+ remaining := SubtractStrings(list, base)
+ if len(remaining) == 0 {
+ delete(sla.ConfigurableValues[axis], config)
+ } else {
+ sla.ConfigurableValues[axis][config] = remaining
+ }
+ }
+ }
+}
+
// TryVariableSubstitution, replace string substitution formatting within each string in slice with
// Starlark string.format compatible tag for productVariable.
func TryVariableSubstitutions(slice []string, productVariable string) ([]string, bool) {
diff --git a/bazel/properties_test.go b/bazel/properties_test.go
index 9464245..85596e2 100644
--- a/bazel/properties_test.go
+++ b/bazel/properties_test.go
@@ -293,3 +293,74 @@
}
}
}
+
+func TestDeduplicateAxesFromBase(t *testing.T) {
+ attr := StringListAttribute{
+ Value: []string{
+ "all_include",
+ "arm_include",
+ "android_include",
+ "linux_x86_include",
+ },
+ ConfigurableValues: configurableStringLists{
+ ArchConfigurationAxis: stringListSelectValues{
+ "arm": []string{"arm_include"},
+ "x86": []string{"x86_include"},
+ },
+ OsConfigurationAxis: stringListSelectValues{
+ "android": []string{"android_include"},
+ "linux": []string{"linux_include"},
+ },
+ OsArchConfigurationAxis: stringListSelectValues{
+ "linux_x86": {"linux_x86_include"},
+ },
+ ProductVariableConfigurationAxis("a"): stringListSelectValues{
+ "a": []string{"not_in_value"},
+ },
+ },
+ }
+
+ attr.DeduplicateAxesFromBase()
+
+ expectedBaseIncludes := []string{
+ "all_include",
+ "arm_include",
+ "android_include",
+ "linux_x86_include",
+ }
+ if !reflect.DeepEqual(expectedBaseIncludes, attr.Value) {
+ t.Errorf("Expected Value includes %q, got %q", attr.Value, expectedBaseIncludes)
+ }
+ expectedConfiguredIncludes := configurableStringLists{
+ ArchConfigurationAxis: stringListSelectValues{
+ "x86": []string{"x86_include"},
+ },
+ OsConfigurationAxis: stringListSelectValues{
+ "linux": []string{"linux_include"},
+ },
+ OsArchConfigurationAxis: stringListSelectValues{},
+ ProductVariableConfigurationAxis("a"): stringListSelectValues{
+ "a": []string{"not_in_value"},
+ },
+ }
+ for _, axis := range attr.SortedConfigurationAxes() {
+ if _, ok := expectedConfiguredIncludes[axis]; !ok {
+ t.Errorf("Found unexpected axis %s", axis)
+ continue
+ }
+ expectedForAxis := expectedConfiguredIncludes[axis]
+ gotForAxis := attr.ConfigurableValues[axis]
+ if len(expectedForAxis) != len(gotForAxis) {
+ t.Errorf("Expected %d configs for %s, got %d: %s", len(expectedForAxis), axis, len(gotForAxis), gotForAxis)
+ }
+ for config, value := range gotForAxis {
+ if expected, ok := expectedForAxis[config]; ok {
+ if !reflect.DeepEqual(expected, value) {
+ t.Errorf("For %s, expected: %#v, got %#v", axis, expected, value)
+ }
+ } else {
+ t.Errorf("Got unexpected config %q for %s", config, axis)
+ }
+ }
+ }
+}
diff --git a/bp2build/cc_library_conversion_test.go b/bp2build/cc_library_conversion_test.go
index c840016..c2c35e7 100644
--- a/bp2build/cc_library_conversion_test.go
+++ b/bp2build/cc_library_conversion_test.go
@@ -25,18 +25,18 @@
// See cc/testing.go for more context
soongCcLibraryPreamble = `
cc_defaults {
- name: "linux_bionic_supported",
+ name: "linux_bionic_supported",
}
toolchain_library {
- name: "libclang_rt.builtins-x86_64-android",
- defaults: ["linux_bionic_supported"],
- vendor_available: true,
- vendor_ramdisk_available: true,
- product_available: true,
- recovery_available: true,
- native_bridge_supported: true,
- src: "",
+ name: "libclang_rt.builtins-x86_64-android",
+ defaults: ["linux_bionic_supported"],
+ vendor_available: true,
+ vendor_ramdisk_available: true,
+ product_available: true,
+ recovery_available: true,
+ native_bridge_supported: true,
+ src: "",
}`
)
@@ -113,17 +113,14 @@
srcs: ["bionic.cpp"]
},
},
+ include_build_directory: false,
}
`,
expectedBazelTargets: []string{`cc_library(
name = "foo-lib",
- copts = [
- "-Wall",
- "-I.",
- "-I$(BINDIR)/.",
- ],
+ copts = ["-Wall"],
+ export_includes = ["foo-dir"],
implementation_deps = [":some-headers"],
- includes = ["foo-dir"],
linkopts = ["-Wl,--exclude-libs=bar.a"] + select({
"//build/bazel/platforms/arch:x86": ["-Wl,--exclude-libs=baz.a"],
"//build/bazel/platforms/arch:x86_64": ["-Wl,--exclude-libs=qux.a"],
@@ -186,6 +183,7 @@
ldflags: ["-Wl,--exclude-libs=libgcc_eh.a"],
},
},
+ include_build_directory: false,
}
`,
expectedBazelTargets: []string{`cc_library(
@@ -195,8 +193,6 @@
"-Wextra",
"-Wunused",
"-Werror",
- "-I.",
- "-I$(BINDIR)/.",
],
implementation_deps = [":libc_headers"],
linkopts = [
@@ -277,12 +273,12 @@
moduleTypeUnderTest: "cc_library",
moduleTypeUnderTestFactory: cc.LibraryFactory,
moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryBp2Build,
- dir: "foo/bar",
filesystem: map[string]string{
- "foo/bar/both.cpp": "",
- "foo/bar/sharedonly.cpp": "",
- "foo/bar/staticonly.cpp": "",
- "foo/bar/Android.bp": `
+ "both.cpp": "",
+ "sharedonly.cpp": "",
+ "staticonly.cpp": "",
+ },
+ blueprint: soongCcLibraryPreamble + `
cc_library {
name: "a",
srcs: ["both.cpp"],
@@ -304,36 +300,57 @@
static_libs: ["static_dep_for_shared"],
whole_static_libs: ["whole_static_lib_for_shared"],
},
- bazel_module: { bp2build_available: true },
+ include_build_directory: false,
}
-cc_library_static { name: "static_dep_for_shared" }
+cc_library_static {
+ name: "static_dep_for_shared",
+ bazel_module: { bp2build_available: false },
+}
-cc_library_static { name: "static_dep_for_static" }
+cc_library_static {
+ name: "static_dep_for_static",
+ bazel_module: { bp2build_available: false },
+}
-cc_library_static { name: "static_dep_for_both" }
+cc_library_static {
+ name: "static_dep_for_both",
+ bazel_module: { bp2build_available: false },
+}
-cc_library_static { name: "whole_static_lib_for_shared" }
+cc_library_static {
+ name: "whole_static_lib_for_shared",
+ bazel_module: { bp2build_available: false },
+}
-cc_library_static { name: "whole_static_lib_for_static" }
+cc_library_static {
+ name: "whole_static_lib_for_static",
+ bazel_module: { bp2build_available: false },
+}
-cc_library_static { name: "whole_static_lib_for_both" }
+cc_library_static {
+ name: "whole_static_lib_for_both",
+ bazel_module: { bp2build_available: false },
+}
-cc_library { name: "shared_dep_for_shared" }
+cc_library {
+ name: "shared_dep_for_shared",
+ bazel_module: { bp2build_available: false },
+}
-cc_library { name: "shared_dep_for_static" }
+cc_library {
+ name: "shared_dep_for_static",
+ bazel_module: { bp2build_available: false },
+}
-cc_library { name: "shared_dep_for_both" }
+cc_library {
+ name: "shared_dep_for_both",
+ bazel_module: { bp2build_available: false },
+}
`,
- },
- blueprint: soongCcLibraryPreamble,
expectedBazelTargets: []string{`cc_library(
name = "a",
- copts = [
- "bothflag",
- "-Ifoo/bar",
- "-I$(BINDIR)/foo/bar",
- ],
+ copts = ["bothflag"],
dynamic_deps = [":shared_dep_for_both"],
implementation_deps = [":static_dep_for_both"],
shared = {
@@ -374,6 +391,7 @@
whole_static_libs: ["whole_static_lib_for_shared"],
},
bazel_module: { bp2build_available: true },
+ include_build_directory: false,
}
cc_prebuilt_library_static { name: "whole_static_lib_for_shared" }
@@ -386,10 +404,6 @@
blueprint: soongCcLibraryPreamble,
expectedBazelTargets: []string{`cc_library(
name = "a",
- copts = [
- "-Ifoo/bar",
- "-I$(BINDIR)/foo/bar",
- ],
shared = {
"whole_archive_deps": [":whole_static_lib_for_shared_alwayslink"],
},
@@ -574,24 +588,24 @@
":both_filegroup",
],
static: {
- srcs: [
- "static_source.cpp",
- "static_source.cc",
- "static_source.c",
- "static_source.s",
- "static_source.S",
- ":static_filegroup",
- ],
+ srcs: [
+ "static_source.cpp",
+ "static_source.cc",
+ "static_source.c",
+ "static_source.s",
+ "static_source.S",
+ ":static_filegroup",
+ ],
},
shared: {
- srcs: [
- "shared_source.cpp",
- "shared_source.cc",
- "shared_source.c",
- "shared_source.s",
- "shared_source.S",
- ":shared_filegroup",
- ],
+ srcs: [
+ "shared_source.cpp",
+ "shared_source.cc",
+ "shared_source.c",
+ "shared_source.s",
+ "shared_source.S",
+ ":shared_filegroup",
+ ],
},
bazel_module: { bp2build_available: true },
}
@@ -693,16 +707,13 @@
srcs: ["a.cpp"],
version_script: "v.map",
bazel_module: { bp2build_available: true },
+ include_build_directory: false,
}
`,
},
blueprint: soongCcLibraryPreamble,
expectedBazelTargets: []string{`cc_library(
name = "a",
- copts = [
- "-Ifoo/bar",
- "-I$(BINDIR)/foo/bar",
- ],
srcs = ["a.cpp"],
version_script = "v.map",
)`},
@@ -718,29 +729,26 @@
dir: "foo/bar",
filesystem: map[string]string{
"foo/bar/Android.bp": `
- cc_library {
- name: "a",
- srcs: ["a.cpp"],
- arch: {
- arm: {
- version_script: "arm.map",
- },
- arm64: {
- version_script: "arm64.map",
- },
- },
+cc_library {
+ name: "a",
+ srcs: ["a.cpp"],
+ arch: {
+ arm: {
+ version_script: "arm.map",
+ },
+ arm64: {
+ version_script: "arm64.map",
+ },
+ },
- bazel_module: { bp2build_available: true },
- }
+ bazel_module: { bp2build_available: true },
+ include_build_directory: false,
+}
`,
},
blueprint: soongCcLibraryPreamble,
expectedBazelTargets: []string{`cc_library(
name = "a",
- copts = [
- "-Ifoo/bar",
- "-I$(BINDIR)/foo/bar",
- ],
srcs = ["a.cpp"],
version_script = select({
"//build/bazel/platforms/arch:arm": "arm.map",
@@ -757,35 +765,21 @@
moduleTypeUnderTest: "cc_library",
moduleTypeUnderTestFactory: cc.LibraryFactory,
moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryBp2Build,
- dir: "foo/bar",
- filesystem: map[string]string{
- "foo/bar/Android.bp": `
+ blueprint: soongCcLibraryPreamble + `
cc_library {
name: "mylib",
- bazel_module: { bp2build_available: true },
+ bazel_module: { bp2build_available: false },
}
cc_library {
name: "a",
shared_libs: ["mylib",],
- bazel_module: { bp2build_available: true },
+ include_build_directory: false,
}
`,
- },
- blueprint: soongCcLibraryPreamble,
expectedBazelTargets: []string{`cc_library(
name = "a",
- copts = [
- "-Ifoo/bar",
- "-I$(BINDIR)/foo/bar",
- ],
dynamic_deps = [":mylib"],
-)`, `cc_library(
- name = "mylib",
- copts = [
- "-Ifoo/bar",
- "-I$(BINDIR)/foo/bar",
- ],
)`},
})
}
@@ -796,14 +790,12 @@
moduleTypeUnderTest: "cc_library",
moduleTypeUnderTestFactory: cc.LibraryFactory,
moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryBp2Build,
- dir: "foo/bar",
- filesystem: map[string]string{
- "foo/bar/Android.bp": `
+ blueprint: soongCcLibraryPreamble + `
cc_library {
name: "a",
srcs: ["a.cpp"],
pack_relocations: false,
- bazel_module: { bp2build_available: true },
+ include_build_directory: false,
}
cc_library {
@@ -811,10 +803,10 @@
srcs: ["b.cpp"],
arch: {
x86_64: {
- pack_relocations: false,
- },
+ pack_relocations: false,
+ },
},
- bazel_module: { bp2build_available: true },
+ include_build_directory: false,
}
cc_library {
@@ -822,27 +814,17 @@
srcs: ["c.cpp"],
target: {
darwin: {
- pack_relocations: false,
- },
+ pack_relocations: false,
+ },
},
- bazel_module: { bp2build_available: true },
+ include_build_directory: false,
}`,
- },
- blueprint: soongCcLibraryPreamble,
expectedBazelTargets: []string{`cc_library(
name = "a",
- copts = [
- "-Ifoo/bar",
- "-I$(BINDIR)/foo/bar",
- ],
linkopts = ["-Wl,--pack-dyn-relocs=none"],
srcs = ["a.cpp"],
)`, `cc_library(
name = "b",
- copts = [
- "-Ifoo/bar",
- "-I$(BINDIR)/foo/bar",
- ],
linkopts = select({
"//build/bazel/platforms/arch:x86_64": ["-Wl,--pack-dyn-relocs=none"],
"//conditions:default": [],
@@ -850,10 +832,6 @@
srcs = ["b.cpp"],
)`, `cc_library(
name = "c",
- copts = [
- "-Ifoo/bar",
- "-I$(BINDIR)/foo/bar",
- ],
linkopts = select({
"//build/bazel/platforms/os:darwin": ["-Wl,--pack-dyn-relocs=none"],
"//conditions:default": [],
@@ -869,24 +847,18 @@
moduleTypeUnderTest: "cc_library",
moduleTypeUnderTestFactory: cc.LibraryFactory,
moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryBp2Build,
- dir: "foo/bar",
- filesystem: map[string]string{
- "foo/bar/Android.bp": `
+ blueprint: soongCcLibraryPreamble + `
cc_library {
name: "a",
cflags: ["-include header.h",],
- bazel_module: { bp2build_available: true },
+ include_build_directory: false,
}
`,
- },
- blueprint: soongCcLibraryPreamble,
expectedBazelTargets: []string{`cc_library(
name = "a",
copts = [
"-include",
"header.h",
- "-Ifoo/bar",
- "-I$(BINDIR)/foo/bar",
],
)`},
})
@@ -898,40 +870,30 @@
moduleTypeUnderTest: "cc_library",
moduleTypeUnderTestFactory: cc.LibraryFactory,
moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryBp2Build,
- dir: "foo/bar",
- filesystem: map[string]string{
- "foo/bar/Android.bp": `cc_library {
+ blueprint: soongCcLibraryPreamble + `cc_library {
name: "a",
srcs: ["a.cpp"],
- cflags: [
- "-Wall",
- ],
+ cflags: ["-Wall"],
cppflags: [
"-fsigned-char",
"-pedantic",
- ],
+ ],
arch: {
arm64: {
cppflags: ["-DARM64=1"],
+ },
},
- },
target: {
android: {
cppflags: ["-DANDROID=1"],
+ },
},
- },
- bazel_module: { bp2build_available: true },
+ include_build_directory: false,
}
`,
- },
- blueprint: soongCcLibraryPreamble,
expectedBazelTargets: []string{`cc_library(
name = "a",
- copts = [
- "-Wall",
- "-Ifoo/bar",
- "-I$(BINDIR)/foo/bar",
- ],
+ copts = ["-Wall"],
cppflags = [
"-fsigned-char",
"-pedantic",
@@ -953,32 +915,23 @@
moduleTypeUnderTest: "cc_library",
moduleTypeUnderTestFactory: cc.LibraryFactory,
moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryBp2Build,
- dir: "foo/bar",
- filesystem: map[string]string{
- "foo/bar/Android.bp": `
- cc_library {
- name: "a",
- srcs: ["a.cpp"],
- target: {
- android_arm: {
- version_script: "android_arm.map",
- },
- linux_bionic_arm64: {
- version_script: "linux_bionic_arm64.map",
- },
- },
-
- bazel_module: { bp2build_available: true },
- }
+ blueprint: soongCcLibraryPreamble + `
+cc_library {
+ name: "a",
+ srcs: ["a.cpp"],
+ target: {
+ android_arm: {
+ version_script: "android_arm.map",
+ },
+ linux_bionic_arm64: {
+ version_script: "linux_bionic_arm64.map",
+ },
+ },
+ include_build_directory: false,
+}
`,
- },
- blueprint: soongCcLibraryPreamble,
expectedBazelTargets: []string{`cc_library(
name = "a",
- copts = [
- "-Ifoo/bar",
- "-I$(BINDIR)/foo/bar",
- ],
srcs = ["a.cpp"],
version_script = select({
"//build/bazel/platforms/os_arch:android_arm": "android_arm.map",
@@ -1031,6 +984,7 @@
],
},
},
+ include_build_directory: false,
}
cc_library {
@@ -1071,10 +1025,6 @@
expectedBazelTargets: []string{
`cc_library(
name = "foo_static",
- copts = [
- "-I.",
- "-I$(BINDIR)/.",
- ],
dynamic_deps = select({
"//build/bazel/platforms/arch:arm": [],
"//conditions:default": [":arm_shared_lib_excludes"],
@@ -1117,14 +1067,11 @@
name: "foo-lib",
srcs: ["impl.cpp"],
no_libcrt: true,
+ include_build_directory: false,
}
`,
expectedBazelTargets: []string{`cc_library(
name = "foo-lib",
- copts = [
- "-I.",
- "-I$(BINDIR)/.",
- ],
srcs = ["impl.cpp"],
use_libcrt = False,
)`}})
@@ -1144,14 +1091,11 @@
name: "foo-lib",
srcs: ["impl.cpp"],
no_libcrt: false,
+ include_build_directory: false,
}
`,
expectedBazelTargets: []string{`cc_library(
name = "foo-lib",
- copts = [
- "-I.",
- "-I$(BINDIR)/.",
- ],
srcs = ["impl.cpp"],
use_libcrt = True,
)`}})
@@ -1166,7 +1110,6 @@
"impl.cpp": "",
},
blueprint: soongCcLibraryPreamble + `
-cc_library_headers { name: "some-headers" }
cc_library {
name: "foo-lib",
srcs: ["impl.cpp"],
@@ -1178,14 +1121,11 @@
no_libcrt: true,
},
},
+ include_build_directory: false,
}
`,
expectedBazelTargets: []string{`cc_library(
name = "foo-lib",
- copts = [
- "-I.",
- "-I$(BINDIR)/.",
- ],
srcs = ["impl.cpp"],
use_libcrt = select({
"//build/bazel/platforms/arch:arm": False,
@@ -1204,7 +1144,6 @@
"impl.cpp": "",
},
blueprint: soongCcLibraryPreamble + `
-cc_library_headers { name: "some-headers" }
cc_library {
name: "foo-lib",
srcs: ["impl.cpp"],
@@ -1217,14 +1156,11 @@
no_libcrt: true,
},
},
+ include_build_directory: false,
}
`,
expectedBazelTargets: []string{`cc_library(
name = "foo-lib",
- copts = [
- "-I.",
- "-I$(BINDIR)/.",
- ],
srcs = ["impl.cpp"],
use_libcrt = select({
"//build/bazel/platforms/arch:arm": False,
@@ -1240,102 +1176,74 @@
moduleTypeUnderTest: "cc_library",
moduleTypeUnderTestFactory: cc.LibraryFactory,
moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryBp2Build,
- dir: "foo/bar",
- filesystem: map[string]string{
- "foo/bar/Android.bp": `
+ blueprint: soongCcLibraryPreamble + `
cc_library {
name: "nothing",
- bazel_module: { bp2build_available: true },
+ include_build_directory: false,
}
cc_library {
name: "keep_symbols",
- bazel_module: { bp2build_available: true },
strip: {
- keep_symbols: true,
- }
+ keep_symbols: true,
+ },
+ include_build_directory: false,
}
cc_library {
name: "keep_symbols_and_debug_frame",
- bazel_module: { bp2build_available: true },
strip: {
- keep_symbols_and_debug_frame: true,
- }
+ keep_symbols_and_debug_frame: true,
+ },
+ include_build_directory: false,
}
cc_library {
name: "none",
- bazel_module: { bp2build_available: true },
strip: {
- none: true,
- }
+ none: true,
+ },
+ include_build_directory: false,
}
cc_library {
name: "keep_symbols_list",
- bazel_module: { bp2build_available: true },
strip: {
- keep_symbols_list: ["symbol"],
- }
+ keep_symbols_list: ["symbol"],
+ },
+ include_build_directory: false,
}
cc_library {
name: "all",
- bazel_module: { bp2build_available: true },
strip: {
- all: true,
- }
+ all: true,
+ },
+ include_build_directory: false,
}
`,
- },
- blueprint: soongCcLibraryPreamble,
expectedBazelTargets: []string{`cc_library(
name = "all",
- copts = [
- "-Ifoo/bar",
- "-I$(BINDIR)/foo/bar",
- ],
strip = {
"all": True,
},
)`, `cc_library(
name = "keep_symbols",
- copts = [
- "-Ifoo/bar",
- "-I$(BINDIR)/foo/bar",
- ],
strip = {
"keep_symbols": True,
},
)`, `cc_library(
name = "keep_symbols_and_debug_frame",
- copts = [
- "-Ifoo/bar",
- "-I$(BINDIR)/foo/bar",
- ],
strip = {
"keep_symbols_and_debug_frame": True,
},
)`, `cc_library(
name = "keep_symbols_list",
- copts = [
- "-Ifoo/bar",
- "-I$(BINDIR)/foo/bar",
- ],
strip = {
"keep_symbols_list": ["symbol"],
},
)`, `cc_library(
name = "none",
- copts = [
- "-Ifoo/bar",
- "-I$(BINDIR)/foo/bar",
- ],
strip = {
"none": True,
},
)`, `cc_library(
name = "nothing",
- copts = [
- "-Ifoo/bar",
- "-I$(BINDIR)/foo/bar",
- ],
)`},
})
}
@@ -1346,12 +1254,9 @@
moduleTypeUnderTest: "cc_library",
moduleTypeUnderTestFactory: cc.LibraryFactory,
moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryBp2Build,
- dir: "foo/bar",
- filesystem: map[string]string{
- "foo/bar/Android.bp": `
+ blueprint: soongCcLibraryPreamble + `
cc_library {
name: "multi-arch",
- bazel_module: { bp2build_available: true },
target: {
darwin: {
strip: {
@@ -1370,17 +1275,12 @@
keep_symbols: true,
},
},
- }
+ },
+ include_build_directory: false,
}
`,
- },
- blueprint: soongCcLibraryPreamble,
expectedBazelTargets: []string{`cc_library(
name = "multi-arch",
- copts = [
- "-Ifoo/bar",
- "-I$(BINDIR)/foo/bar",
- ],
strip = {
"keep_symbols": select({
"//build/bazel/platforms/arch:arm64": True,
@@ -1411,15 +1311,12 @@
blueprint: soongCcLibraryPreamble + `
cc_library {
name: "root_empty",
- system_shared_libs: [],
+ system_shared_libs: [],
+ include_build_directory: false,
}
`,
expectedBazelTargets: []string{`cc_library(
name = "root_empty",
- copts = [
- "-I.",
- "-I$(BINDIR)/.",
- ],
system_dynamic_deps = [],
)`},
})
@@ -1435,16 +1332,13 @@
cc_library {
name: "static_empty",
static: {
- system_shared_libs: [],
- },
+ system_shared_libs: [],
+ },
+ include_build_directory: false,
}
`,
expectedBazelTargets: []string{`cc_library(
name = "static_empty",
- copts = [
- "-I.",
- "-I$(BINDIR)/.",
- ],
static = {
"system_dynamic_deps": [],
},
@@ -1462,16 +1356,13 @@
cc_library {
name: "shared_empty",
shared: {
- system_shared_libs: [],
- },
+ system_shared_libs: [],
+ },
+ include_build_directory: false,
}
`,
expectedBazelTargets: []string{`cc_library(
name = "shared_empty",
- copts = [
- "-I.",
- "-I$(BINDIR)/.",
- ],
shared = {
"system_dynamic_deps": [],
},
@@ -1494,15 +1385,12 @@
system_shared_libs: [],
}
}
- },
+ },
+ include_build_directory: false,
}
`,
expectedBazelTargets: []string{`cc_library(
name = "shared_empty",
- copts = [
- "-I.",
- "-I$(BINDIR)/.",
- ],
shared = {
"system_dynamic_deps": [],
},
@@ -1528,14 +1416,11 @@
system_shared_libs: [],
},
},
+ include_build_directory: false,
}
`,
expectedBazelTargets: []string{`cc_library(
name = "target_linux_bionic_empty",
- copts = [
- "-I.",
- "-I$(BINDIR)/.",
- ],
system_dynamic_deps = [],
)`},
})
@@ -1555,14 +1440,11 @@
system_shared_libs: [],
},
},
+ include_build_directory: false,
}
`,
expectedBazelTargets: []string{`cc_library(
name = "target_bionic_empty",
- copts = [
- "-I.",
- "-I$(BINDIR)/.",
- ],
system_dynamic_deps = [],
)`},
})
@@ -1575,39 +1457,30 @@
moduleTypeUnderTestFactory: cc.LibraryFactory,
moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryBp2Build,
blueprint: soongCcLibraryPreamble + `
-cc_library {name: "libc"}
-cc_library {name: "libm"}
+cc_library {
+ name: "libc",
+ bazel_module: { bp2build_available: false },
+}
+cc_library {
+ name: "libm",
+ bazel_module: { bp2build_available: false },
+}
cc_library {
name: "foo",
system_shared_libs: ["libc"],
shared: {
- system_shared_libs: ["libm"],
+ system_shared_libs: ["libm"],
},
+ include_build_directory: false,
}
`,
expectedBazelTargets: []string{`cc_library(
name = "foo",
- copts = [
- "-I.",
- "-I$(BINDIR)/.",
- ],
shared = {
"system_dynamic_deps": [":libm"],
},
system_dynamic_deps = [":libc"],
-)`, `cc_library(
- name = "libc",
- copts = [
- "-I.",
- "-I$(BINDIR)/.",
- ],
-)`, `cc_library(
- name = "libm",
- copts = [
- "-I.",
- "-I$(BINDIR)/.",
- ],
)`},
})
}
diff --git a/bp2build/cc_library_headers_conversion_test.go b/bp2build/cc_library_headers_conversion_test.go
index ea2c10a..8b490f8 100644
--- a/bp2build/cc_library_headers_conversion_test.go
+++ b/bp2build/cc_library_headers_conversion_test.go
@@ -25,18 +25,18 @@
// See cc/testing.go for more context
soongCcLibraryHeadersPreamble = `
cc_defaults {
- name: "linux_bionic_supported",
+ name: "linux_bionic_supported",
}
toolchain_library {
- name: "libclang_rt.builtins-x86_64-android",
- defaults: ["linux_bionic_supported"],
- vendor_available: true,
- vendor_ramdisk_available: true,
- product_available: true,
- recovery_available: true,
- native_bridge_supported: true,
- src: "",
+ name: "libclang_rt.builtins-x86_64-android",
+ defaults: ["linux_bionic_supported"],
+ vendor_available: true,
+ vendor_ramdisk_available: true,
+ product_available: true,
+ recovery_available: true,
+ native_bridge_supported: true,
+ src: "",
}`
)
@@ -99,11 +99,13 @@
cc_library_headers {
name: "lib-1",
export_include_dirs: ["lib-1"],
+ bazel_module: { bp2build_available: false },
}
cc_library_headers {
name: "lib-2",
export_include_dirs: ["lib-2"],
+ bazel_module: { bp2build_available: false },
}
cc_library_headers {
@@ -113,7 +115,7 @@
arch: {
arm64: {
- // We expect dir-1 headers to be dropped, because dir-1 is already in export_include_dirs
+ // We expect dir-1 headers to be dropped, because dir-1 is already in export_include_dirs
export_include_dirs: ["arch_arm64_exported_include_dir", "dir-1"],
},
x86: {
@@ -132,11 +134,7 @@
"-I.",
"-I$(BINDIR)/.",
],
- implementation_deps = [
- ":lib-1",
- ":lib-2",
- ],
- includes = [
+ export_includes = [
"dir-1",
"dir-2",
] + select({
@@ -145,25 +143,15 @@
"//build/bazel/platforms/arch:x86_64": ["arch_x86_64_exported_include_dir"],
"//conditions:default": [],
}),
-)`, `cc_library_headers(
- name = "lib-1",
- copts = [
- "-I.",
- "-I$(BINDIR)/.",
+ implementation_deps = [
+ ":lib-1",
+ ":lib-2",
],
- includes = ["lib-1"],
-)`, `cc_library_headers(
- name = "lib-2",
- copts = [
- "-I.",
- "-I$(BINDIR)/.",
- ],
- includes = ["lib-2"],
)`},
})
}
-func TestCcLibraryHeadersOSSpecificHeader(t *testing.T) {
+func TestCcLibraryHeadersOsSpecificHeader(t *testing.T) {
runCcLibraryHeadersTestCase(t, bp2buildTestCase{
description: "cc_library_headers test with os-specific header_libs props",
moduleTypeUnderTest: "cc_library_headers",
@@ -171,12 +159,30 @@
moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryHeadersBp2Build,
filesystem: map[string]string{},
blueprint: soongCcLibraryPreamble + `
-cc_library_headers { name: "android-lib" }
-cc_library_headers { name: "base-lib" }
-cc_library_headers { name: "darwin-lib" }
-cc_library_headers { name: "linux-lib" }
-cc_library_headers { name: "linux_bionic-lib" }
-cc_library_headers { name: "windows-lib" }
+cc_library_headers {
+ name: "android-lib",
+ bazel_module: { bp2build_available: false },
+}
+cc_library_headers {
+ name: "base-lib",
+ bazel_module: { bp2build_available: false },
+}
+cc_library_headers {
+ name: "darwin-lib",
+ bazel_module: { bp2build_available: false },
+}
+cc_library_headers {
+ name: "linux-lib",
+ bazel_module: { bp2build_available: false },
+}
+cc_library_headers {
+ name: "linux_bionic-lib",
+ bazel_module: { bp2build_available: false },
+}
+cc_library_headers {
+ name: "windows-lib",
+ bazel_module: { bp2build_available: false },
+}
cc_library_headers {
name: "foo_headers",
header_libs: ["base-lib"],
@@ -187,32 +193,10 @@
linux_glibc: { header_libs: ["linux-lib"] },
windows: { header_libs: ["windows-lib"] },
},
- bazel_module: { bp2build_available: true },
+ include_build_directory: false,
}`,
expectedBazelTargets: []string{`cc_library_headers(
- name = "android-lib",
- copts = [
- "-I.",
- "-I$(BINDIR)/.",
- ],
-)`, `cc_library_headers(
- name = "base-lib",
- copts = [
- "-I.",
- "-I$(BINDIR)/.",
- ],
-)`, `cc_library_headers(
- name = "darwin-lib",
- copts = [
- "-I.",
- "-I$(BINDIR)/.",
- ],
-)`, `cc_library_headers(
name = "foo_headers",
- copts = [
- "-I.",
- "-I$(BINDIR)/.",
- ],
implementation_deps = [":base-lib"] + select({
"//build/bazel/platforms/os:android": [":android-lib"],
"//build/bazel/platforms/os:darwin": [":darwin-lib"],
@@ -221,24 +205,6 @@
"//build/bazel/platforms/os:windows": [":windows-lib"],
"//conditions:default": [],
}),
-)`, `cc_library_headers(
- name = "linux-lib",
- copts = [
- "-I.",
- "-I$(BINDIR)/.",
- ],
-)`, `cc_library_headers(
- name = "linux_bionic-lib",
- copts = [
- "-I.",
- "-I$(BINDIR)/.",
- ],
-)`, `cc_library_headers(
- name = "windows-lib",
- copts = [
- "-I.",
- "-I$(BINDIR)/.",
- ],
)`},
})
}
@@ -251,32 +217,23 @@
moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryHeadersBp2Build,
filesystem: map[string]string{},
blueprint: soongCcLibraryPreamble + `
-cc_library_headers { name: "android-lib" }
-cc_library_headers { name: "exported-lib" }
+cc_library_headers {
+ name: "android-lib",
+ bazel_module: { bp2build_available: false },
+ }
+cc_library_headers {
+ name: "exported-lib",
+ bazel_module: { bp2build_available: false },
+}
cc_library_headers {
name: "foo_headers",
target: {
android: { header_libs: ["android-lib"], export_header_lib_headers: ["exported-lib"] },
},
+ include_build_directory: false,
}`,
expectedBazelTargets: []string{`cc_library_headers(
- name = "android-lib",
- copts = [
- "-I.",
- "-I$(BINDIR)/.",
- ],
-)`, `cc_library_headers(
- name = "exported-lib",
- copts = [
- "-I.",
- "-I$(BINDIR)/.",
- ],
-)`, `cc_library_headers(
name = "foo_headers",
- copts = [
- "-I.",
- "-I$(BINDIR)/.",
- ],
deps = select({
"//build/bazel/platforms/os:android": [":exported-lib"],
"//conditions:default": [],
@@ -299,14 +256,14 @@
blueprint: soongCcLibraryPreamble + `cc_library_headers {
name: "foo_headers",
export_system_include_dirs: [
- "shared_include_dir",
+ "shared_include_dir",
],
target: {
- android: {
- export_system_include_dirs: [
- "android_include_dir",
+ android: {
+ export_system_include_dirs: [
+ "android_include_dir",
],
- },
+ },
linux_glibc: {
export_system_include_dirs: [
"linux_include_dir",
@@ -320,24 +277,21 @@
},
arch: {
arm: {
- export_system_include_dirs: [
- "arm_include_dir",
+ export_system_include_dirs: [
+ "arm_include_dir",
],
- },
+ },
x86_64: {
export_system_include_dirs: [
"x86_64_include_dir",
],
},
},
+ include_build_directory: false,
}`,
expectedBazelTargets: []string{`cc_library_headers(
name = "foo_headers",
- copts = [
- "-I.",
- "-I$(BINDIR)/.",
- ],
- includes = ["shared_include_dir"] + select({
+ export_system_includes = ["shared_include_dir"] + select({
"//build/bazel/platforms/arch:arm": ["arm_include_dir"],
"//build/bazel/platforms/arch:x86_64": ["x86_64_include_dir"],
"//conditions:default": [],
@@ -375,14 +329,11 @@
name: "lib-1",
export_include_dirs: ["lib-1"],
no_libcrt: true,
+ include_build_directory: false,
}`,
expectedBazelTargets: []string{`cc_library_headers(
name = "lib-1",
- copts = [
- "-I.",
- "-I$(BINDIR)/.",
- ],
- includes = ["lib-1"],
+ export_includes = ["lib-1"],
)`},
})
}
diff --git a/bp2build/cc_library_static_conversion_test.go b/bp2build/cc_library_static_conversion_test.go
index d9145f6..5c9afbf 100644
--- a/bp2build/cc_library_static_conversion_test.go
+++ b/bp2build/cc_library_static_conversion_test.go
@@ -26,18 +26,18 @@
// See cc/testing.go for more context
soongCcLibraryStaticPreamble = `
cc_defaults {
- name: "linux_bionic_supported",
+ name: "linux_bionic_supported",
}
toolchain_library {
- name: "libclang_rt.builtins-x86_64-android",
- defaults: ["linux_bionic_supported"],
- vendor_available: true,
- vendor_ramdisk_available: true,
- product_available: true,
- recovery_available: true,
- native_bridge_supported: true,
- src: "",
+ name: "libclang_rt.builtins-x86_64-android",
+ defaults: ["linux_bionic_supported"],
+ vendor_available: true,
+ vendor_ramdisk_available: true,
+ product_available: true,
+ recovery_available: true,
+ native_bridge_supported: true,
+ src: "",
}`
)
@@ -112,31 +112,37 @@
cc_library_headers {
name: "header_lib_1",
export_include_dirs: ["header_lib_1"],
+ bazel_module: { bp2build_available: false },
}
cc_library_headers {
name: "header_lib_2",
export_include_dirs: ["header_lib_2"],
+ bazel_module: { bp2build_available: false },
}
cc_library_static {
name: "static_lib_1",
srcs: ["static_lib_1.cc"],
+ bazel_module: { bp2build_available: false },
}
cc_library_static {
name: "static_lib_2",
srcs: ["static_lib_2.cc"],
+ bazel_module: { bp2build_available: false },
}
cc_library_static {
name: "whole_static_lib_1",
srcs: ["whole_static_lib_1.cc"],
+ bazel_module: { bp2build_available: false },
}
cc_library_static {
name: "whole_static_lib_2",
srcs: ["whole_static_lib_2.cc"],
+ bazel_module: { bp2build_available: false },
}
cc_library_static {
@@ -192,16 +198,16 @@
"-I.",
"-I$(BINDIR)/.",
],
+ export_includes = [
+ "export_include_dir_1",
+ "export_include_dir_2",
+ ],
implementation_deps = [
":header_lib_1",
":header_lib_2",
":static_lib_1",
":static_lib_2",
],
- includes = [
- "export_include_dir_1",
- "export_include_dir_2",
- ],
linkstatic = True,
srcs = [
"foo_static1.cc",
@@ -211,38 +217,6 @@
":whole_static_lib_1",
":whole_static_lib_2",
],
-)`, `cc_library_static(
- name = "static_lib_1",
- copts = [
- "-I.",
- "-I$(BINDIR)/.",
- ],
- linkstatic = True,
- srcs = ["static_lib_1.cc"],
-)`, `cc_library_static(
- name = "static_lib_2",
- copts = [
- "-I.",
- "-I$(BINDIR)/.",
- ],
- linkstatic = True,
- srcs = ["static_lib_2.cc"],
-)`, `cc_library_static(
- name = "whole_static_lib_1",
- copts = [
- "-I.",
- "-I$(BINDIR)/.",
- ],
- linkstatic = True,
- srcs = ["whole_static_lib_1.cc"],
-)`, `cc_library_static(
- name = "whole_static_lib_2",
- copts = [
- "-I.",
- "-I$(BINDIR)/.",
- ],
- linkstatic = True,
- srcs = ["whole_static_lib_2.cc"],
)`},
})
}
@@ -273,7 +247,7 @@
srcs: [
],
include_dirs: [
- "subpackage",
+ "subpackage",
],
}`,
expectedBazelTargets: []string{`cc_library_static(
@@ -305,14 +279,11 @@
cc_library_static {
name: "foo_static",
export_include_dirs: ["subpackage"],
+ include_build_directory: false,
}`,
expectedBazelTargets: []string{`cc_library_static(
name = "foo_static",
- copts = [
- "-I.",
- "-I$(BINDIR)/.",
- ],
- includes = ["subpackage"],
+ export_includes = ["subpackage"],
linkstatic = True,
)`},
})
@@ -334,14 +305,11 @@
cc_library_static {
name: "foo_static",
export_system_include_dirs: ["subpackage"],
+ include_build_directory: false,
}`,
expectedBazelTargets: []string{`cc_library_static(
name = "foo_static",
- copts = [
- "-I.",
- "-I$(BINDIR)/.",
- ],
- includes = ["subpackage"],
+ export_system_includes = ["subpackage"],
linkstatic = True,
)`},
})
@@ -391,7 +359,7 @@
"-Isubpackage",
"-I$(BINDIR)/subpackage",
],
- includes = ["./exported_subsubpackage"],
+ export_includes = ["./exported_subsubpackage"],
linkstatic = True,
)`},
})
@@ -473,18 +441,21 @@
moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryStaticBp2Build,
filesystem: map[string]string{},
blueprint: soongCcLibraryStaticPreamble + `
-cc_library_static { name: "static_dep" }
-cc_library_static { name: "static_dep2" }
+cc_library_static {
+ name: "static_dep",
+ bazel_module: { bp2build_available: false },
+}
+cc_library_static {
+ name: "static_dep2",
+ bazel_module: { bp2build_available: false },
+}
cc_library_static {
name: "foo_static",
arch: { arm64: { static_libs: ["static_dep"], whole_static_libs: ["static_dep2"] } },
+ include_build_directory: false,
}`,
expectedBazelTargets: []string{`cc_library_static(
name = "foo_static",
- copts = [
- "-I.",
- "-I$(BINDIR)/.",
- ],
implementation_deps = select({
"//build/bazel/platforms/arch:arm64": [":static_dep"],
"//conditions:default": [],
@@ -494,20 +465,6 @@
"//build/bazel/platforms/arch:arm64": [":static_dep2"],
"//conditions:default": [],
}),
-)`, `cc_library_static(
- name = "static_dep",
- copts = [
- "-I.",
- "-I$(BINDIR)/.",
- ],
- linkstatic = True,
-)`, `cc_library_static(
- name = "static_dep2",
- copts = [
- "-I.",
- "-I$(BINDIR)/.",
- ],
- linkstatic = True,
)`},
})
}
@@ -520,18 +477,21 @@
moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryStaticBp2Build,
filesystem: map[string]string{},
blueprint: soongCcLibraryStaticPreamble + `
-cc_library_static { name: "static_dep" }
-cc_library_static { name: "static_dep2" }
+cc_library_static {
+ name: "static_dep",
+ bazel_module: { bp2build_available: false },
+}
+cc_library_static {
+ name: "static_dep2",
+ bazel_module: { bp2build_available: false },
+}
cc_library_static {
name: "foo_static",
target: { android: { static_libs: ["static_dep"], whole_static_libs: ["static_dep2"] } },
+ include_build_directory: false,
}`,
expectedBazelTargets: []string{`cc_library_static(
name = "foo_static",
- copts = [
- "-I.",
- "-I$(BINDIR)/.",
- ],
implementation_deps = select({
"//build/bazel/platforms/os:android": [":static_dep"],
"//conditions:default": [],
@@ -541,20 +501,6 @@
"//build/bazel/platforms/os:android": [":static_dep2"],
"//conditions:default": [],
}),
-)`, `cc_library_static(
- name = "static_dep",
- copts = [
- "-I.",
- "-I$(BINDIR)/.",
- ],
- linkstatic = True,
-)`, `cc_library_static(
- name = "static_dep2",
- copts = [
- "-I.",
- "-I$(BINDIR)/.",
- ],
- linkstatic = True,
)`},
})
}
@@ -567,23 +513,32 @@
moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryStaticBp2Build,
filesystem: map[string]string{},
blueprint: soongCcLibraryStaticPreamble + `
-cc_library_static { name: "static_dep" }
-cc_library_static { name: "static_dep2" }
-cc_library_static { name: "static_dep3" }
-cc_library_static { name: "static_dep4" }
+cc_library_static {
+ name: "static_dep",
+ bazel_module: { bp2build_available: false },
+}
+cc_library_static {
+ name: "static_dep2",
+ bazel_module: { bp2build_available: false },
+}
+cc_library_static {
+ name: "static_dep3",
+ bazel_module: { bp2build_available: false },
+}
+cc_library_static {
+ name: "static_dep4",
+ bazel_module: { bp2build_available: false },
+}
cc_library_static {
name: "foo_static",
static_libs: ["static_dep"],
whole_static_libs: ["static_dep2"],
target: { android: { static_libs: ["static_dep3"] } },
arch: { arm64: { static_libs: ["static_dep4"] } },
+ include_build_directory: false,
}`,
expectedBazelTargets: []string{`cc_library_static(
name = "foo_static",
- copts = [
- "-I.",
- "-I$(BINDIR)/.",
- ],
implementation_deps = [":static_dep"] + select({
"//build/bazel/platforms/arch:arm64": [":static_dep4"],
"//conditions:default": [],
@@ -593,34 +548,6 @@
}),
linkstatic = True,
whole_archive_deps = [":static_dep2"],
-)`, `cc_library_static(
- name = "static_dep",
- copts = [
- "-I.",
- "-I$(BINDIR)/.",
- ],
- linkstatic = True,
-)`, `cc_library_static(
- name = "static_dep2",
- copts = [
- "-I.",
- "-I$(BINDIR)/.",
- ],
- linkstatic = True,
-)`, `cc_library_static(
- name = "static_dep3",
- copts = [
- "-I.",
- "-I$(BINDIR)/.",
- ],
- linkstatic = True,
-)`, `cc_library_static(
- name = "static_dep4",
- copts = [
- "-I.",
- "-I$(BINDIR)/.",
- ],
- linkstatic = True,
)`},
})
}
@@ -641,13 +568,10 @@
name: "foo_static",
srcs: ["common.c", "foo-*.c"],
exclude_srcs: ["foo-excluded.c"],
+ include_build_directory: false,
}`,
expectedBazelTargets: []string{`cc_library_static(
name = "foo_static",
- copts = [
- "-I.",
- "-I$(BINDIR)/.",
- ],
linkstatic = True,
srcs_c = [
"common.c",
@@ -671,14 +595,11 @@
cc_library_static {
name: "foo_static",
srcs: ["common.c"],
- arch: { arm: { srcs: ["foo-arm.c"] } }
+ arch: { arm: { srcs: ["foo-arm.c"] } },
+ include_build_directory: false,
}`,
expectedBazelTargets: []string{`cc_library_static(
name = "foo_static",
- copts = [
- "-I.",
- "-I$(BINDIR)/.",
- ],
linkstatic = True,
srcs_c = ["common.c"] + select({
"//build/bazel/platforms/arch:arm": ["foo-arm.c"],
@@ -708,13 +629,10 @@
arch: {
arm: { srcs: ["for-arm.c"], exclude_srcs: ["not-for-arm.c"] },
},
+ include_build_directory: false,
}`,
expectedBazelTargets: []string{`cc_library_static(
name = "foo_static",
- copts = [
- "-I.",
- "-I$(BINDIR)/.",
- ],
linkstatic = True,
srcs_c = ["common.c"] + select({
"//build/bazel/platforms/arch:arm": ["for-arm.c"],
@@ -746,13 +664,10 @@
arm: { srcs: ["for-arm.c"], exclude_srcs: ["not-for-arm.c"] },
x86: { srcs: ["for-x86.c"], exclude_srcs: ["not-for-x86.c"] },
},
+ include_build_directory: false,
} `,
expectedBazelTargets: []string{`cc_library_static(
name = "foo_static",
- copts = [
- "-I.",
- "-I$(BINDIR)/.",
- ],
linkstatic = True,
srcs_c = ["common.c"] + select({
"//build/bazel/platforms/arch:arm": [
@@ -799,14 +714,11 @@
arm64: { srcs: ["for-arm64.c"], exclude_srcs: ["not-for-arm64.c"] },
x86: { srcs: ["for-x86.c"], exclude_srcs: ["not-for-x86.c"] },
x86_64: { srcs: ["for-x86_64.c"], exclude_srcs: ["not-for-x86_64.c"] },
- },
+ },
+ include_build_directory: false,
} `,
expectedBazelTargets: []string{`cc_library_static(
name = "foo_static",
- copts = [
- "-I.",
- "-I$(BINDIR)/.",
- ],
linkstatic = True,
srcs_c = ["common.c"] + select({
"//build/bazel/platforms/arch:arm": [
@@ -863,13 +775,10 @@
arch: {
arm: { exclude_srcs: ["foo-no-arm.cc"] },
},
+ include_build_directory: false,
}`,
expectedBazelTargets: []string{`cc_library_static(
name = "foo_static",
- copts = [
- "-I.",
- "-I$(BINDIR)/.",
- ],
linkstatic = True,
srcs = ["common.cc"] + select({
"//build/bazel/platforms/arch:arm": [],
@@ -900,13 +809,10 @@
arm: { exclude_srcs: ["foo-no-arm.cc"] },
x86: { srcs: ["x86-only.cc"] },
},
+ include_build_directory: false,
}`,
expectedBazelTargets: []string{`cc_library_static(
name = "foo_static",
- copts = [
- "-I.",
- "-I$(BINDIR)/.",
- ],
linkstatic = True,
srcs = ["common.cc"] + select({
"//build/bazel/platforms/arch:arm": [],
@@ -928,26 +834,19 @@
moduleTypeUnderTestBp2BuildMutator: cc.CcLibraryStaticBp2Build,
filesystem: map[string]string{},
blueprint: soongCcLibraryStaticPreamble + `
-cc_library_static { name: "static_dep" }
+cc_library_static {
+ name: "static_dep",
+ bazel_module: { bp2build_available: false },
+}
cc_library_static {
name: "foo_static",
static_libs: ["static_dep", "static_dep"],
+ include_build_directory: false,
}`,
expectedBazelTargets: []string{`cc_library_static(
name = "foo_static",
- copts = [
- "-I.",
- "-I$(BINDIR)/.",
- ],
implementation_deps = [":static_dep"],
linkstatic = True,
-)`, `cc_library_static(
- name = "static_dep",
- copts = [
- "-I.",
- "-I$(BINDIR)/.",
- ],
- linkstatic = True,
)`},
})
}
@@ -970,13 +869,10 @@
multilib: {
lib32: { srcs: ["for-lib32.c"], exclude_srcs: ["not-for-lib32.c"] },
},
+ include_build_directory: false,
} `,
expectedBazelTargets: []string{`cc_library_static(
name = "foo_static",
- copts = [
- "-I.",
- "-I$(BINDIR)/.",
- ],
linkstatic = True,
srcs_c = ["common.c"] + select({
"//build/bazel/platforms/arch:arm": ["for-lib32.c"],
@@ -1008,13 +904,10 @@
lib32: { srcs: ["for-lib32.c"], exclude_srcs: ["not-for-lib32.c"] },
lib64: { srcs: ["for-lib64.c"], exclude_srcs: ["not-for-lib64.c"] },
},
+ include_build_directory: false,
} `,
expectedBazelTargets: []string{`cc_library_static(
name = "foo_static2",
- copts = [
- "-I.",
- "-I$(BINDIR)/.",
- ],
linkstatic = True,
srcs_c = ["common.c"] + select({
"//build/bazel/platforms/arch:arm": [
@@ -1079,13 +972,10 @@
lib32: { srcs: ["for-lib32.c"], exclude_srcs: ["not-for-lib32.c"] },
lib64: { srcs: ["for-lib64.c"], exclude_srcs: ["not-for-lib64.c"] },
},
+ include_build_directory: false,
}`,
expectedBazelTargets: []string{`cc_library_static(
name = "foo_static3",
- copts = [
- "-I.",
- "-I$(BINDIR)/.",
- ],
linkstatic = True,
srcs_c = ["common.c"] + select({
"//build/bazel/platforms/arch:arm": [
@@ -1146,21 +1036,21 @@
"not-for-everything.cpp": "",
"dep/Android.bp": `
genrule {
- name: "generated_src_other_pkg",
- out: ["generated_src_other_pkg.cpp"],
- cmd: "nothing to see here",
+ name: "generated_src_other_pkg",
+ out: ["generated_src_other_pkg.cpp"],
+ cmd: "nothing to see here",
}
genrule {
- name: "generated_hdr_other_pkg",
- out: ["generated_hdr_other_pkg.cpp"],
- cmd: "nothing to see here",
+ name: "generated_hdr_other_pkg",
+ out: ["generated_hdr_other_pkg.cpp"],
+ cmd: "nothing to see here",
}
genrule {
- name: "generated_hdr_other_pkg_x86",
- out: ["generated_hdr_other_pkg_x86.cpp"],
- cmd: "nothing to see here",
+ name: "generated_hdr_other_pkg_x86",
+ out: ["generated_hdr_other_pkg_x86.cpp"],
+ cmd: "nothing to see here",
}`,
},
blueprint: soongCcLibraryStaticPreamble + `
@@ -1196,14 +1086,11 @@
generated_headers: ["generated_hdr_other_pkg_x86"],
},
},
+ include_build_directory: false,
}
`,
expectedBazelTargets: []string{`cc_library_static(
name = "foo_static3",
- copts = [
- "-I.",
- "-I$(BINDIR)/.",
- ],
linkstatic = True,
srcs = [
"//dep:generated_hdr_other_pkg",
@@ -1256,13 +1143,10 @@
srcs: ["linux_bionic_x86_64_src.c"],
},
},
+ include_build_directory: false,
}`,
expectedBazelTargets: []string{`cc_library_static(
name = "foo_static",
- copts = [
- "-I.",
- "-I$(BINDIR)/.",
- ],
linkstatic = True,
srcs_c = select({
"//build/bazel/platforms/os:android": ["android_src.c"],
@@ -1301,13 +1185,11 @@
cflags: ["-Wbinder32bit"],
},
},
+ include_build_directory: false,
} `,
expectedBazelTargets: []string{`cc_library_static(
name = "foo_static",
- copts = [
- "-I.",
- "-I$(BINDIR)/.",
- ] + select({
+ copts = select({
"//build/bazel/product_variables:binder32bit": ["-Wbinder32bit"],
"//conditions:default": [],
}) + select({
@@ -1339,40 +1221,38 @@
cflags: ["-Wmalloc_not_svelte"],
},
},
- arch: {
- arm64: {
- product_variables: {
- malloc_not_svelte: {
- cflags: ["-Warm64_malloc_not_svelte"],
- },
- },
- },
- },
- multilib: {
- lib32: {
- product_variables: {
- malloc_not_svelte: {
- cflags: ["-Wlib32_malloc_not_svelte"],
- },
- },
- },
- },
- target: {
- android: {
- product_variables: {
- malloc_not_svelte: {
- cflags: ["-Wandroid_malloc_not_svelte"],
- },
- },
- }
- },
+ arch: {
+ arm64: {
+ product_variables: {
+ malloc_not_svelte: {
+ cflags: ["-Warm64_malloc_not_svelte"],
+ },
+ },
+ },
+ },
+ multilib: {
+ lib32: {
+ product_variables: {
+ malloc_not_svelte: {
+ cflags: ["-Wlib32_malloc_not_svelte"],
+ },
+ },
+ },
+ },
+ target: {
+ android: {
+ product_variables: {
+ malloc_not_svelte: {
+ cflags: ["-Wandroid_malloc_not_svelte"],
+ },
+ },
+ }
+ },
+ include_build_directory: false,
} `,
expectedBazelTargets: []string{`cc_library_static(
name = "foo_static",
- copts = [
- "-I.",
- "-I$(BINDIR)/.",
- ] + select({
+ copts = select({
"//build/bazel/product_variables:malloc_not_svelte": ["-Wmalloc_not_svelte"],
"//conditions:default": [],
}) + select({
@@ -1410,20 +1290,14 @@
asflags: ["-DPLATFORM_SDK_VERSION=%d"],
},
},
+ include_build_directory: false,
} `,
expectedBazelTargets: []string{`cc_library_static(
name = "foo_static",
- asflags = [
- "-I.",
- "-I$(BINDIR)/.",
- ] + select({
+ asflags = select({
"//build/bazel/product_variables:platform_sdk_version": ["-DPLATFORM_SDK_VERSION=$(Platform_sdk_version)"],
"//conditions:default": [],
}),
- copts = [
- "-I.",
- "-I$(BINDIR)/.",
- ],
linkstatic = True,
srcs_as = ["common.S"],
)`},
@@ -1439,15 +1313,12 @@
blueprint: soongCcLibraryStaticPreamble + `
cc_library_static {
name: "root_empty",
- system_shared_libs: [],
+ system_shared_libs: [],
+ include_build_directory: false,
}
`,
expectedBazelTargets: []string{`cc_library_static(
name = "root_empty",
- copts = [
- "-I.",
- "-I$(BINDIR)/.",
- ],
linkstatic = True,
system_dynamic_deps = [],
)`},
@@ -1464,20 +1335,17 @@
cc_defaults {
name: "static_empty_defaults",
static: {
- system_shared_libs: [],
- },
+ system_shared_libs: [],
+ },
+ include_build_directory: false,
}
cc_library_static {
name: "static_empty",
- defaults: ["static_empty_defaults"],
+ defaults: ["static_empty_defaults"],
}
`,
expectedBazelTargets: []string{`cc_library_static(
name = "static_empty",
- copts = [
- "-I.",
- "-I$(BINDIR)/.",
- ],
linkstatic = True,
system_dynamic_deps = [],
)`},
@@ -1498,14 +1366,11 @@
system_shared_libs: [],
},
},
+ include_build_directory: false,
}
`,
expectedBazelTargets: []string{`cc_library_static(
name = "target_bionic_empty",
- copts = [
- "-I.",
- "-I$(BINDIR)/.",
- ],
linkstatic = True,
system_dynamic_deps = [],
)`},
@@ -1530,14 +1395,11 @@
system_shared_libs: [],
},
},
+ include_build_directory: false,
}
`,
expectedBazelTargets: []string{`cc_library_static(
name = "target_linux_bionic_empty",
- copts = [
- "-I.",
- "-I$(BINDIR)/.",
- ],
linkstatic = True,
system_dynamic_deps = [],
)`},
@@ -1560,14 +1422,11 @@
system_shared_libs: ["libc"],
},
},
+ include_build_directory: false,
}
`,
expectedBazelTargets: []string{`cc_library_static(
name = "target_bionic",
- copts = [
- "-I.",
- "-I$(BINDIR)/.",
- ],
linkstatic = True,
system_dynamic_deps = select({
"//build/bazel/platforms/os:bionic": [":libc"],
@@ -1589,20 +1448,17 @@
cc_library_static {
name: "target_linux_bionic",
- system_shared_libs: ["libc"],
+ system_shared_libs: ["libc"],
target: {
linux_bionic: {
system_shared_libs: ["libm"],
},
},
+ include_build_directory: false,
}
`,
expectedBazelTargets: []string{`cc_library_static(
name = "target_linux_bionic",
- copts = [
- "-I.",
- "-I$(BINDIR)/.",
- ],
linkstatic = True,
system_dynamic_deps = [":libc"] + select({
"//build/bazel/platforms/os:linux_bionic": [":libm"],
diff --git a/bp2build/cc_object_conversion_test.go b/bp2build/cc_object_conversion_test.go
index 9ac28a5..4bda539 100644
--- a/bp2build/cc_object_conversion_test.go
+++ b/bp2build/cc_object_conversion_test.go
@@ -78,14 +78,12 @@
func TestCcObjectDefaults(t *testing.T) {
runCcObjectTestCase(t, bp2buildTestCase{
- description: "simple cc_object with defaults",
moduleTypeUnderTest: "cc_object",
moduleTypeUnderTestFactory: cc.ObjectFactory,
moduleTypeUnderTestBp2BuildMutator: cc.ObjectBp2Build,
blueprint: `cc_object {
name: "foo",
system_shared_libs: [],
- local_include_dirs: ["include"],
srcs: [
"a/b/*.h",
"a/b/c.c"
@@ -115,8 +113,6 @@
"-Wall",
"-Werror",
"-fno-addrsig",
- "-Iinclude",
- "-I$(BINDIR)/include",
"-I.",
"-I$(BINDIR)/.",
],
@@ -140,29 +136,23 @@
system_shared_libs: [],
srcs: ["a/b/c.c"],
objs: ["bar"],
+ include_build_directory: false,
}
cc_object {
name: "bar",
system_shared_libs: [],
srcs: ["x/y/z.c"],
+ include_build_directory: false,
}
`,
expectedBazelTargets: []string{`cc_object(
name = "bar",
- copts = [
- "-fno-addrsig",
- "-I.",
- "-I$(BINDIR)/.",
- ],
+ copts = ["-fno-addrsig"],
srcs = ["x/y/z.c"],
)`, `cc_object(
name = "foo",
- copts = [
- "-fno-addrsig",
- "-I.",
- "-I$(BINDIR)/.",
- ],
+ copts = ["-fno-addrsig"],
deps = [":bar"],
srcs = ["a/b/c.c"],
)`,
@@ -245,16 +235,13 @@
srcs: ["arch/arm/file.cpp"], // label list
},
},
+ include_build_directory: false,
}
`,
expectedBazelTargets: []string{
`cc_object(
name = "foo",
- copts = [
- "-fno-addrsig",
- "-I.",
- "-I$(BINDIR)/.",
- ] + select({
+ copts = ["-fno-addrsig"] + select({
"//build/bazel/platforms/arch:x86": ["-fPIC"],
"//conditions:default": [],
}),
@@ -295,16 +282,13 @@
cflags: ["-Wall"],
},
},
+ include_build_directory: false,
}
`,
expectedBazelTargets: []string{
`cc_object(
name = "foo",
- copts = [
- "-fno-addrsig",
- "-I.",
- "-I$(BINDIR)/.",
- ] + select({
+ copts = ["-fno-addrsig"] + select({
"//build/bazel/platforms/arch:arm": ["-Wall"],
"//build/bazel/platforms/arch:arm64": ["-Wall"],
"//build/bazel/platforms/arch:x86": ["-fPIC"],
@@ -344,16 +328,13 @@
cflags: ["-Wall"],
},
},
+ include_build_directory: false,
}
`,
expectedBazelTargets: []string{
`cc_object(
name = "foo",
- copts = [
- "-fno-addrsig",
- "-I.",
- "-I$(BINDIR)/.",
- ] + select({
+ copts = ["-fno-addrsig"] + select({
"//build/bazel/platforms/os:android": ["-fPIC"],
"//build/bazel/platforms/os:darwin": ["-Wall"],
"//build/bazel/platforms/os:windows": ["-fPIC"],
diff --git a/cc/bp2build.go b/cc/bp2build.go
index 537f01c..fffb093 100644
--- a/cc/bp2build.go
+++ b/cc/bp2build.go
@@ -535,12 +535,21 @@
return relativePaths
}
-func bp2BuildParseExportedIncludes(ctx android.TopDownMutatorContext, module *Module) bazel.StringListAttribute {
+// BazelIncludes contains information about -I and -isystem paths from a module converted to Bazel
+// attributes.
+type BazelIncludes struct {
+ Includes bazel.StringListAttribute
+ SystemIncludes bazel.StringListAttribute
+}
+
+func bp2BuildParseExportedIncludes(ctx android.TopDownMutatorContext, module *Module) BazelIncludes {
libraryDecorator := module.linker.(*libraryDecorator)
return bp2BuildParseExportedIncludesHelper(ctx, module, libraryDecorator)
}
-func Bp2BuildParseExportedIncludesForPrebuiltLibrary(ctx android.TopDownMutatorContext, module *Module) bazel.StringListAttribute {
+// Bp2buildParseExportedIncludesForPrebuiltLibrary returns a BazelIncludes with Bazel-ified values
+// to export includes from the underlying module's properties.
+func Bp2BuildParseExportedIncludesForPrebuiltLibrary(ctx android.TopDownMutatorContext, module *Module) BazelIncludes {
prebuiltLibraryLinker := module.linker.(*prebuiltLibraryLinker)
libraryDecorator := prebuiltLibraryLinker.libraryDecorator
return bp2BuildParseExportedIncludesHelper(ctx, module, libraryDecorator)
@@ -548,36 +557,22 @@
// bp2BuildParseExportedIncludes creates a string list attribute contains the
// exported included directories of a module.
-func bp2BuildParseExportedIncludesHelper(ctx android.TopDownMutatorContext, module *Module, libraryDecorator *libraryDecorator) bazel.StringListAttribute {
- // Export_system_include_dirs and export_include_dirs are already module dir
- // relative, so they don't need to be relativized like include_dirs, which
- // are root-relative.
- includeDirs := libraryDecorator.flagExporter.Properties.Export_system_include_dirs
- includeDirs = append(includeDirs, libraryDecorator.flagExporter.Properties.Export_include_dirs...)
- var includeDirsAttribute bazel.StringListAttribute
-
- getVariantIncludeDirs := func(includeDirs []string, flagExporterProperties *FlagExporterProperties, subtract bool) []string {
- variantIncludeDirs := flagExporterProperties.Export_system_include_dirs
- variantIncludeDirs = append(variantIncludeDirs, flagExporterProperties.Export_include_dirs...)
-
- if subtract {
- // To avoid duplicate includes when base includes + arch includes are combined
- // TODO: Add something similar to ResolveExcludes() in bazel/properties.go
- variantIncludeDirs = bazel.SubtractStrings(variantIncludeDirs, includeDirs)
- }
- return variantIncludeDirs
- }
-
+func bp2BuildParseExportedIncludesHelper(ctx android.TopDownMutatorContext, module *Module, libraryDecorator *libraryDecorator) BazelIncludes {
+ exported := BazelIncludes{}
for axis, configToProps := range module.GetArchVariantProperties(ctx, &FlagExporterProperties{}) {
for config, props := range configToProps {
if flagExporterProperties, ok := props.(*FlagExporterProperties); ok {
- archVariantIncludeDirs := getVariantIncludeDirs(includeDirs, flagExporterProperties, axis != bazel.NoConfigAxis)
- if len(archVariantIncludeDirs) > 0 {
- includeDirsAttribute.SetSelectValue(axis, config, archVariantIncludeDirs)
+ if len(flagExporterProperties.Export_include_dirs) > 0 {
+ exported.Includes.SetSelectValue(axis, config, flagExporterProperties.Export_include_dirs)
+ }
+ if len(flagExporterProperties.Export_system_include_dirs) > 0 {
+ exported.SystemIncludes.SetSelectValue(axis, config, flagExporterProperties.Export_system_include_dirs)
}
}
}
}
+ exported.Includes.DeduplicateAxesFromBase()
+ exported.SystemIncludes.DeduplicateAxesFromBase()
- return includeDirsAttribute
+ return exported
}
diff --git a/cc/config/tidy.go b/cc/config/tidy.go
index 8682502..fdc246c 100644
--- a/cc/config/tidy.go
+++ b/cc/config/tidy.go
@@ -39,6 +39,7 @@
"misc-*",
"performance-*",
"portability-*",
+ "-bugprone-easily-swappable-parameters",
"-bugprone-narrowing-conversions",
"-google-readability*",
"-google-runtime-references",
diff --git a/cc/library.go b/cc/library.go
index 92d9771..28bd741 100644
--- a/cc/library.go
+++ b/cc/library.go
@@ -228,16 +228,17 @@
Conlyflags bazel.StringListAttribute
Asflags bazel.StringListAttribute
- Hdrs bazel.LabelListAttribute
- Deps bazel.LabelListAttribute
- Implementation_deps bazel.LabelListAttribute
- Dynamic_deps bazel.LabelListAttribute
- Whole_archive_deps bazel.LabelListAttribute
- System_dynamic_deps bazel.LabelListAttribute
- Includes bazel.StringListAttribute
- Linkopts bazel.StringListAttribute
- Use_libcrt bazel.BoolAttribute
- Rtti bazel.BoolAttribute
+ Hdrs bazel.LabelListAttribute
+ Deps bazel.LabelListAttribute
+ Implementation_deps bazel.LabelListAttribute
+ Dynamic_deps bazel.LabelListAttribute
+ Whole_archive_deps bazel.LabelListAttribute
+ System_dynamic_deps bazel.LabelListAttribute
+ Export_includes bazel.StringListAttribute
+ Export_system_includes bazel.StringListAttribute
+ Linkopts bazel.StringListAttribute
+ Use_libcrt bazel.BoolAttribute
+ Rtti bazel.BoolAttribute
// This is shared only.
Version_script bazel.LabelAttribute
@@ -299,15 +300,16 @@
Conlyflags: compilerAttrs.conlyFlags,
Asflags: asFlags,
- Implementation_deps: linkerAttrs.deps,
- Deps: linkerAttrs.exportedDeps,
- Dynamic_deps: linkerAttrs.dynamicDeps,
- Whole_archive_deps: linkerAttrs.wholeArchiveDeps,
- System_dynamic_deps: linkerAttrs.systemDynamicDeps,
- Includes: exportedIncludes,
- Linkopts: linkerAttrs.linkopts,
- Use_libcrt: linkerAttrs.useLibcrt,
- Rtti: compilerAttrs.rtti,
+ Implementation_deps: linkerAttrs.deps,
+ Deps: linkerAttrs.exportedDeps,
+ Dynamic_deps: linkerAttrs.dynamicDeps,
+ Whole_archive_deps: linkerAttrs.wholeArchiveDeps,
+ System_dynamic_deps: linkerAttrs.systemDynamicDeps,
+ Export_includes: exportedIncludes.Includes,
+ Export_system_includes: exportedIncludes.SystemIncludes,
+ Linkopts: linkerAttrs.linkopts,
+ Use_libcrt: linkerAttrs.useLibcrt,
+ Rtti: compilerAttrs.rtti,
Version_script: linkerAttrs.versionScript,
@@ -2318,19 +2320,20 @@
}
type bazelCcLibraryStaticAttributes struct {
- Copts bazel.StringListAttribute
- Srcs bazel.LabelListAttribute
- Implementation_deps bazel.LabelListAttribute
- Deps bazel.LabelListAttribute
- Whole_archive_deps bazel.LabelListAttribute
- Dynamic_deps bazel.LabelListAttribute
- System_dynamic_deps bazel.LabelListAttribute
- Linkopts bazel.StringListAttribute
- Linkstatic bool
- Use_libcrt bazel.BoolAttribute
- Rtti bazel.BoolAttribute
- Includes bazel.StringListAttribute
- Hdrs bazel.LabelListAttribute
+ Copts bazel.StringListAttribute
+ Srcs bazel.LabelListAttribute
+ Implementation_deps bazel.LabelListAttribute
+ Deps bazel.LabelListAttribute
+ Whole_archive_deps bazel.LabelListAttribute
+ Dynamic_deps bazel.LabelListAttribute
+ System_dynamic_deps bazel.LabelListAttribute
+ Linkopts bazel.StringListAttribute
+ Linkstatic bool
+ Use_libcrt bazel.BoolAttribute
+ Rtti bazel.BoolAttribute
+ Export_includes bazel.StringListAttribute
+ Export_system_includes bazel.StringListAttribute
+ Hdrs bazel.LabelListAttribute
Cppflags bazel.StringListAttribute
Srcs_c bazel.LabelListAttribute
@@ -2375,11 +2378,12 @@
Dynamic_deps: linkerAttrs.dynamicDeps,
System_dynamic_deps: linkerAttrs.systemDynamicDeps,
- Linkopts: linkerAttrs.linkopts,
- Linkstatic: true,
- Use_libcrt: linkerAttrs.useLibcrt,
- Rtti: compilerAttrs.rtti,
- Includes: exportedIncludes,
+ Linkopts: linkerAttrs.linkopts,
+ Linkstatic: true,
+ Use_libcrt: linkerAttrs.useLibcrt,
+ Rtti: compilerAttrs.rtti,
+ Export_includes: exportedIncludes.Includes,
+ Export_system_includes: exportedIncludes.SystemIncludes,
Cppflags: compilerAttrs.cppFlags,
Srcs_c: compilerAttrs.cSrcs,
diff --git a/cc/library_headers.go b/cc/library_headers.go
index 44a7a71..30a81cc 100644
--- a/cc/library_headers.go
+++ b/cc/library_headers.go
@@ -103,12 +103,13 @@
}
type bazelCcLibraryHeadersAttributes struct {
- Copts bazel.StringListAttribute
- Hdrs bazel.LabelListAttribute
- Includes bazel.StringListAttribute
- Deps bazel.LabelListAttribute
- Implementation_deps bazel.LabelListAttribute
- System_dynamic_deps bazel.LabelListAttribute
+ Copts bazel.StringListAttribute
+ Hdrs bazel.LabelListAttribute
+ Export_includes bazel.StringListAttribute
+ Export_system_includes bazel.StringListAttribute
+ Deps bazel.LabelListAttribute
+ Implementation_deps bazel.LabelListAttribute
+ System_dynamic_deps bazel.LabelListAttribute
}
func CcLibraryHeadersBp2Build(ctx android.TopDownMutatorContext) {
@@ -131,11 +132,12 @@
linkerAttrs := bp2BuildParseLinkerProps(ctx, module)
attrs := &bazelCcLibraryHeadersAttributes{
- Copts: compilerAttrs.copts,
- Includes: exportedIncludes,
- Implementation_deps: linkerAttrs.deps,
- Deps: linkerAttrs.exportedDeps,
- System_dynamic_deps: linkerAttrs.systemDynamicDeps,
+ Copts: compilerAttrs.copts,
+ Export_includes: exportedIncludes.Includes,
+ Export_system_includes: exportedIncludes.SystemIncludes,
+ Implementation_deps: linkerAttrs.deps,
+ Deps: linkerAttrs.exportedDeps,
+ System_dynamic_deps: linkerAttrs.systemDynamicDeps,
}
props := bazel.BazelTargetModuleProperties{
diff --git a/rust/config/global.go b/rust/config/global.go
index e5b334d..b163bb6 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.54.0"
+ RustDefaultVersion = "1.55.0"
RustDefaultBase = "prebuilts/rust/"
DefaultEdition = "2018"
Stdlibs = []string{