Merge "Remove soong.config, FileConfigurableOptions, MegaDevice config."
This commit is contained in:
@@ -1337,17 +1337,6 @@ func decodeTargetProductVariables(config *config) (map[OsType][]Target, error) {
|
|||||||
addTarget(BuildOs, *variables.HostSecondaryArch, nil, nil, nil, NativeBridgeDisabled, nil, nil)
|
addTarget(BuildOs, *variables.HostSecondaryArch, nil, nil, nil, NativeBridgeDisabled, nil, nil)
|
||||||
}
|
}
|
||||||
|
|
||||||
// An optional host target that uses the Bionic glibc runtime.
|
|
||||||
if Bool(config.Host_bionic) {
|
|
||||||
addTarget(LinuxBionic, "x86_64", nil, nil, nil, NativeBridgeDisabled, nil, nil)
|
|
||||||
}
|
|
||||||
|
|
||||||
// An optional cross-compiled host target that uses the Bionic glibc runtime on an arm64
|
|
||||||
// architecture.
|
|
||||||
if Bool(config.Host_bionic_arm64) {
|
|
||||||
addTarget(LinuxBionic, "arm64", nil, nil, nil, NativeBridgeDisabled, nil, nil)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Optional cross-compiled host targets, generally Windows.
|
// Optional cross-compiled host targets, generally Windows.
|
||||||
if String(variables.CrossHost) != "" {
|
if String(variables.CrossHost) != "" {
|
||||||
crossHostOs := osByName(*variables.CrossHost)
|
crossHostOs := osByName(*variables.CrossHost)
|
||||||
@@ -1437,53 +1426,6 @@ type archConfig struct {
|
|||||||
abi []string
|
abi []string
|
||||||
}
|
}
|
||||||
|
|
||||||
// getMegaDeviceConfig returns a list of archConfigs for every architecture simultaneously.
|
|
||||||
func getMegaDeviceConfig() []archConfig {
|
|
||||||
return []archConfig{
|
|
||||||
{"arm", "armv7-a", "generic", []string{"armeabi-v7a"}},
|
|
||||||
{"arm", "armv7-a-neon", "generic", []string{"armeabi-v7a"}},
|
|
||||||
{"arm", "armv7-a-neon", "cortex-a7", []string{"armeabi-v7a"}},
|
|
||||||
{"arm", "armv7-a-neon", "cortex-a8", []string{"armeabi-v7a"}},
|
|
||||||
{"arm", "armv7-a-neon", "cortex-a9", []string{"armeabi-v7a"}},
|
|
||||||
{"arm", "armv7-a-neon", "cortex-a15", []string{"armeabi-v7a"}},
|
|
||||||
{"arm", "armv7-a-neon", "cortex-a53", []string{"armeabi-v7a"}},
|
|
||||||
{"arm", "armv7-a-neon", "cortex-a53.a57", []string{"armeabi-v7a"}},
|
|
||||||
{"arm", "armv7-a-neon", "cortex-a72", []string{"armeabi-v7a"}},
|
|
||||||
{"arm", "armv7-a-neon", "cortex-a73", []string{"armeabi-v7a"}},
|
|
||||||
{"arm", "armv7-a-neon", "cortex-a75", []string{"armeabi-v7a"}},
|
|
||||||
{"arm", "armv7-a-neon", "cortex-a76", []string{"armeabi-v7a"}},
|
|
||||||
{"arm", "armv7-a-neon", "krait", []string{"armeabi-v7a"}},
|
|
||||||
{"arm", "armv7-a-neon", "kryo", []string{"armeabi-v7a"}},
|
|
||||||
{"arm", "armv7-a-neon", "kryo385", []string{"armeabi-v7a"}},
|
|
||||||
{"arm", "armv7-a-neon", "exynos-m1", []string{"armeabi-v7a"}},
|
|
||||||
{"arm", "armv7-a-neon", "exynos-m2", []string{"armeabi-v7a"}},
|
|
||||||
{"arm64", "armv8-a", "cortex-a53", []string{"arm64-v8a"}},
|
|
||||||
{"arm64", "armv8-a", "cortex-a72", []string{"arm64-v8a"}},
|
|
||||||
{"arm64", "armv8-a", "cortex-a73", []string{"arm64-v8a"}},
|
|
||||||
{"arm64", "armv8-a", "kryo", []string{"arm64-v8a"}},
|
|
||||||
{"arm64", "armv8-a", "exynos-m1", []string{"arm64-v8a"}},
|
|
||||||
{"arm64", "armv8-a", "exynos-m2", []string{"arm64-v8a"}},
|
|
||||||
{"arm64", "armv8-2a", "kryo385", []string{"arm64-v8a"}},
|
|
||||||
{"arm64", "armv8-2a-dotprod", "cortex-a55", []string{"arm64-v8a"}},
|
|
||||||
{"arm64", "armv8-2a-dotprod", "cortex-a75", []string{"arm64-v8a"}},
|
|
||||||
{"arm64", "armv8-2a-dotprod", "cortex-a76", []string{"arm64-v8a"}},
|
|
||||||
{"x86", "", "", []string{"x86"}},
|
|
||||||
{"x86", "atom", "", []string{"x86"}},
|
|
||||||
{"x86", "haswell", "", []string{"x86"}},
|
|
||||||
{"x86", "ivybridge", "", []string{"x86"}},
|
|
||||||
{"x86", "sandybridge", "", []string{"x86"}},
|
|
||||||
{"x86", "silvermont", "", []string{"x86"}},
|
|
||||||
{"x86", "stoneyridge", "", []string{"x86"}},
|
|
||||||
{"x86", "x86_64", "", []string{"x86"}},
|
|
||||||
{"x86_64", "", "", []string{"x86_64"}},
|
|
||||||
{"x86_64", "haswell", "", []string{"x86_64"}},
|
|
||||||
{"x86_64", "ivybridge", "", []string{"x86_64"}},
|
|
||||||
{"x86_64", "sandybridge", "", []string{"x86_64"}},
|
|
||||||
{"x86_64", "silvermont", "", []string{"x86_64"}},
|
|
||||||
{"x86_64", "stoneyridge", "", []string{"x86_64"}},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// getNdkAbisConfig returns a list of archConfigs for the ABIs supported by the NDK.
|
// getNdkAbisConfig returns a list of archConfigs for the ABIs supported by the NDK.
|
||||||
func getNdkAbisConfig() []archConfig {
|
func getNdkAbisConfig() []archConfig {
|
||||||
return []archConfig{
|
return []archConfig{
|
||||||
|
@@ -54,28 +54,9 @@ var FutureApiLevel = ApiLevel{
|
|||||||
isPreview: true,
|
isPreview: true,
|
||||||
}
|
}
|
||||||
|
|
||||||
// configFileName is the name the file containing FileConfigurableOptions from
|
// The product variables file name, containing product config from Kati.
|
||||||
// soong_ui for the soong_build primary builder.
|
|
||||||
const configFileName = "soong.config"
|
|
||||||
|
|
||||||
// productVariablesFileName contain the product configuration variables from soong_ui for the
|
|
||||||
// soong_build primary builder and Kati.
|
|
||||||
const productVariablesFileName = "soong.variables"
|
const productVariablesFileName = "soong.variables"
|
||||||
|
|
||||||
// A FileConfigurableOptions contains options which can be configured by the
|
|
||||||
// config file. These will be included in the config struct.
|
|
||||||
type FileConfigurableOptions struct {
|
|
||||||
Mega_device *bool `json:",omitempty"`
|
|
||||||
Host_bionic *bool `json:",omitempty"`
|
|
||||||
Host_bionic_arm64 *bool `json:",omitempty"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetDefaultConfig resets the receiving FileConfigurableOptions to default
|
|
||||||
// values.
|
|
||||||
func (f *FileConfigurableOptions) SetDefaultConfig() {
|
|
||||||
*f = FileConfigurableOptions{}
|
|
||||||
}
|
|
||||||
|
|
||||||
// A Config object represents the entire build configuration for Android.
|
// A Config object represents the entire build configuration for Android.
|
||||||
type Config struct {
|
type Config struct {
|
||||||
*config
|
*config
|
||||||
@@ -97,12 +78,8 @@ type DeviceConfig struct {
|
|||||||
type VendorConfig soongconfig.SoongConfig
|
type VendorConfig soongconfig.SoongConfig
|
||||||
|
|
||||||
// Definition of general build configuration for soong_build. Some of these
|
// Definition of general build configuration for soong_build. Some of these
|
||||||
// configuration values are generated from soong_ui for soong_build,
|
// product configuration values are read from Kati-generated soong.variables.
|
||||||
// communicated over JSON files like soong.config or soong.variables.
|
|
||||||
type config struct {
|
type config struct {
|
||||||
// Options configurable with soong.confg
|
|
||||||
FileConfigurableOptions
|
|
||||||
|
|
||||||
// Options configurable with soong.variables
|
// Options configurable with soong.variables
|
||||||
productVariables productVariables
|
productVariables productVariables
|
||||||
|
|
||||||
@@ -113,7 +90,6 @@ type config struct {
|
|||||||
// purposes.
|
// purposes.
|
||||||
BazelContext BazelContext
|
BazelContext BazelContext
|
||||||
|
|
||||||
ConfigFileName string
|
|
||||||
ProductVariablesFileName string
|
ProductVariablesFileName string
|
||||||
|
|
||||||
Targets map[OsType][]Target
|
Targets map[OsType][]Target
|
||||||
@@ -170,11 +146,6 @@ type jsonConfigurable interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func loadConfig(config *config) error {
|
func loadConfig(config *config) error {
|
||||||
err := loadFromConfigFile(&config.FileConfigurableOptions, absolutePath(config.ConfigFileName))
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
return loadFromConfigFile(&config.productVariables, absolutePath(config.ProductVariablesFileName))
|
return loadFromConfigFile(&config.productVariables, absolutePath(config.ProductVariablesFileName))
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -384,7 +355,6 @@ func ConfigForAdditionalRun(c Config) (Config, error) {
|
|||||||
func NewConfig(srcDir, buildDir string, moduleListFile string) (Config, error) {
|
func NewConfig(srcDir, buildDir string, moduleListFile string) (Config, error) {
|
||||||
// Make a config with default options.
|
// Make a config with default options.
|
||||||
config := &config{
|
config := &config{
|
||||||
ConfigFileName: filepath.Join(buildDir, configFileName),
|
|
||||||
ProductVariablesFileName: filepath.Join(buildDir, productVariablesFileName),
|
ProductVariablesFileName: filepath.Join(buildDir, productVariablesFileName),
|
||||||
|
|
||||||
env: originalEnv,
|
env: originalEnv,
|
||||||
@@ -439,9 +409,7 @@ func NewConfig(srcDir, buildDir string, moduleListFile string) (Config, error) {
|
|||||||
targets[CommonOS] = []Target{commonTargetMap[CommonOS.Name]}
|
targets[CommonOS] = []Target{commonTargetMap[CommonOS.Name]}
|
||||||
|
|
||||||
var archConfig []archConfig
|
var archConfig []archConfig
|
||||||
if Bool(config.Mega_device) {
|
if config.NdkAbis() {
|
||||||
archConfig = getMegaDeviceConfig()
|
|
||||||
} else if config.NdkAbis() {
|
|
||||||
archConfig = getNdkAbisConfig()
|
archConfig = getNdkAbisConfig()
|
||||||
} else if config.AmlAbis() {
|
} else if config.AmlAbis() {
|
||||||
archConfig = getAmlAbisConfig()
|
archConfig = getAmlAbisConfig()
|
||||||
@@ -864,11 +832,6 @@ func (c *config) DevicePrimaryArchType() ArchType {
|
|||||||
return c.Targets[Android][0].Arch.ArchType
|
return c.Targets[Android][0].Arch.ArchType
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *config) SkipMegaDeviceInstall(path string) bool {
|
|
||||||
return Bool(c.Mega_device) &&
|
|
||||||
strings.HasPrefix(path, filepath.Join(c.buildDir, "target", "product"))
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *config) SanitizeHost() []string {
|
func (c *config) SanitizeHost() []string {
|
||||||
return append([]string(nil), c.productVariables.SanitizeHost...)
|
return append([]string(nil), c.productVariables.SanitizeHost...)
|
||||||
}
|
}
|
||||||
|
@@ -78,11 +78,6 @@ func TestProductConfigAnnotations(t *testing.T) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
t.Errorf(err.Error())
|
t.Errorf(err.Error())
|
||||||
}
|
}
|
||||||
|
|
||||||
validateConfigAnnotations(&FileConfigurableOptions{})
|
|
||||||
if err != nil {
|
|
||||||
t.Errorf(err.Error())
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestMissingVendorConfig(t *testing.T) {
|
func TestMissingVendorConfig(t *testing.T) {
|
||||||
|
@@ -2399,10 +2399,6 @@ func (m *moduleContext) skipInstall(fullInstallPath InstallPath) bool {
|
|||||||
if m.Config().KatiEnabled() && !m.InstallBypassMake() {
|
if m.Config().KatiEnabled() && !m.InstallBypassMake() {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
if m.Config().SkipMegaDeviceInstall(fullInstallPath.String()) {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return false
|
return false
|
||||||
|
@@ -79,7 +79,7 @@ func main() {
|
|||||||
srcDir := filepath.Dir(flag.Arg(0))
|
srcDir := filepath.Dir(flag.Arg(0))
|
||||||
var ctx *android.Context
|
var ctx *android.Context
|
||||||
configuration := newConfig(srcDir)
|
configuration := newConfig(srcDir)
|
||||||
extraNinjaDeps := []string{configuration.ConfigFileName, configuration.ProductVariablesFileName}
|
extraNinjaDeps := []string{configuration.ProductVariablesFileName}
|
||||||
|
|
||||||
// Read the SOONG_DELVE again through configuration so that there is a dependency on the environment variable
|
// Read the SOONG_DELVE again through configuration so that there is a dependency on the environment variable
|
||||||
// and soong_build will rerun when it is set for the first time.
|
// and soong_build will rerun when it is set for the first time.
|
||||||
|
Reference in New Issue
Block a user