diff options
| -rw-r--r-- | android/bazel_handler.go | 74 | ||||
| -rw-r--r-- | android/config.go | 38 | ||||
| -rw-r--r-- | android/fixture.go | 10 | ||||
| -rw-r--r-- | android/variable.go | 8 | ||||
| -rw-r--r-- | android/writedocs.go | 7 | ||||
| -rw-r--r-- | cc/cc_test.go | 14 | ||||
| -rw-r--r-- | cc/config/x86_darwin_host.go | 2 | ||||
| -rw-r--r-- | cc/library.go | 44 | ||||
| -rw-r--r-- | cc/testing.go | 10 | ||||
| -rw-r--r-- | java/prebuilt_apis.go | 12 | ||||
| -rw-r--r-- | java/sdk_library.go | 10 | ||||
| -rw-r--r-- | ui/build/soong.go | 8 |
12 files changed, 168 insertions, 69 deletions
diff --git a/android/bazel_handler.go b/android/bazel_handler.go index 9cd9fadfe..667584072 100644 --- a/android/bazel_handler.go +++ b/android/bazel_handler.go @@ -37,6 +37,7 @@ type CqueryRequestType int const ( getAllFiles CqueryRequestType = iota getCcObjectFiles + getAllFilesAndCcObjectFiles ) // Map key to describe bazel cquery requests. @@ -58,7 +59,9 @@ type BazelContext interface { // Retrieves these files from Bazel's CcInfo provider. GetCcObjectFiles(label string, archType ArchType) ([]string, bool) - // TODO(cparsons): Other cquery-related methods should be added here. + // Returns the results of GetAllFiles and GetCcObjectFiles in a single query (in that order). + GetAllFilesAndCcObjectFiles(label string, archType ArchType) ([]string, []string, bool) + // ** End cquery methods // Issues commands to Bazel to receive results for all cquery requests @@ -116,6 +119,11 @@ func (m MockBazelContext) GetCcObjectFiles(label string, archType ArchType) ([]s return result, ok } +func (m MockBazelContext) GetAllFilesAndCcObjectFiles(label string, archType ArchType) ([]string, []string, bool) { + result, ok := m.AllFiles[label] + return result, result, ok +} + func (m MockBazelContext) InvokeBazel() error { panic("unimplemented") } @@ -154,6 +162,22 @@ func (bazelCtx *bazelContext) GetCcObjectFiles(label string, archType ArchType) } } +func (bazelCtx *bazelContext) GetAllFilesAndCcObjectFiles(label string, archType ArchType) ([]string, []string, bool) { + var allFiles []string + var ccObjects []string + + result, ok := bazelCtx.cquery(label, getAllFilesAndCcObjectFiles, archType) + if ok { + bazelOutput := strings.TrimSpace(result) + splitString := strings.Split(bazelOutput, "|") + allFilesString := splitString[0] + ccObjectsString := splitString[1] + allFiles = strings.Split(allFilesString, ", ") + ccObjects = strings.Split(ccObjectsString, ", ") + } + return allFiles, ccObjects, ok +} + func (n noopBazelContext) GetAllFiles(label string, archType ArchType) ([]string, bool) { panic("unimplemented") } @@ -162,6 +186,10 @@ func (n noopBazelContext) GetCcObjectFiles(label string, archType ArchType) ([]s panic("unimplemented") } +func (n noopBazelContext) GetAllFilesAndCcObjectFiles(label string, archType ArchType) ([]string, []string, bool) { + panic("unimplemented") +} + func (n noopBazelContext) InvokeBazel() error { panic("unimplemented") } @@ -253,8 +281,12 @@ func pwdPrefix() string { return "" } +// Issues the given bazel command with given build label and additional flags. +// Returns (stdout, stderr, error). The first and second return values are strings +// containing the stdout and stderr of the run command, and an error is returned if +// the invocation returned an error code. func (context *bazelContext) issueBazelCommand(runName bazel.RunName, command string, labels []string, - extraFlags ...string) (string, error) { + extraFlags ...string) (string, string, error) { cmdFlags := []string{"--output_base=" + context.outputBase, command} cmdFlags = append(cmdFlags, labels...) @@ -281,9 +313,10 @@ func (context *bazelContext) issueBazelCommand(runName bazel.RunName, command st bazelCmd.Stderr = stderr if output, err := bazelCmd.Output(); err != nil { - return "", fmt.Errorf("bazel command failed. command: [%s], env: [%s], error [%s]", bazelCmd, bazelCmd.Env, stderr) + return "", string(stderr.Bytes()), + fmt.Errorf("bazel command failed. command: [%s], env: [%s], error [%s]", bazelCmd, bazelCmd.Env, stderr) } else { - return string(output), nil + return string(output), string(stderr.Bytes()), nil } } @@ -452,6 +485,11 @@ phony_root(name = "phonyroot", strings.Join(deps_arm, ",\n "))) } +// Returns the file contents of the buildroot.cquery file that should be used for the cquery +// expression in order to obtain information about buildroot and its dependencies. +// The contents of this file depend on the bazelContext's requests; requests are enumerated +// and grouped by their request type. The data retrieved for each label depends on its +// request type. func (context *bazelContext) cqueryStarlarkFileContents() []byte { formatString := ` # This file is generated by soong_build. Do not edit. @@ -463,6 +501,13 @@ getCcObjectFilesLabels = { %s } +getAllFilesAndCcObjectFilesLabels = { + %s +} + +def get_all_files(target): + return [f.path for f in target.files.to_list()] + def get_cc_object_files(target): result = [] linker_inputs = providers(target)["CcInfo"].linking_context.linker_inputs.to_list() @@ -492,9 +537,11 @@ def get_arch(target): def format(target): id_string = str(target.label) + "|" + get_arch(target) if id_string in getAllFilesLabels: - return id_string + ">>" + ', '.join([f.path for f in target.files.to_list()]) + return id_string + ">>" + ', '.join(get_all_files(target)) elif id_string in getCcObjectFilesLabels: return id_string + ">>" + ', '.join(get_cc_object_files(target)) + elif id_string in getAllFilesAndCcObjectFilesLabels: + return id_string + ">>" + ', '.join(get_all_files(target)) + "|" + ', '.join(get_cc_object_files(target)) else: # This target was not requested via cquery, and thus must be a dependency # of a requested target. @@ -502,6 +549,7 @@ def format(target): ` var getAllFilesDeps []string = nil var getCcObjectFilesDeps []string = nil + var getAllFilesAndCcObjectFilesDeps []string = nil for val, _ := range context.requests { labelWithArch := getCqueryId(val) @@ -511,12 +559,16 @@ def format(target): getAllFilesDeps = append(getAllFilesDeps, mapEntryString) case getCcObjectFiles: getCcObjectFilesDeps = append(getCcObjectFilesDeps, mapEntryString) + case getAllFilesAndCcObjectFiles: + getAllFilesAndCcObjectFilesDeps = append(getAllFilesAndCcObjectFilesDeps, mapEntryString) } } getAllFilesDepsString := strings.Join(getAllFilesDeps, ",\n ") getCcObjectFilesDepsString := strings.Join(getCcObjectFilesDeps, ",\n ") + getAllFilesAndCcObjectFilesDepsString := strings.Join(getAllFilesAndCcObjectFilesDeps, ",\n ") - return []byte(fmt.Sprintf(formatString, getAllFilesDepsString, getCcObjectFilesDepsString)) + return []byte(fmt.Sprintf(formatString, getAllFilesDepsString, getCcObjectFilesDepsString, + getAllFilesAndCcObjectFilesDepsString)) } // Returns a workspace-relative path containing build-related metadata required @@ -531,6 +583,7 @@ func (context *bazelContext) InvokeBazel() error { context.results = make(map[cqueryKey]string) var cqueryOutput string + var cqueryErr string var err error intermediatesDirPath := absolutePath(context.intermediatesDir()) @@ -568,7 +621,7 @@ func (context *bazelContext) InvokeBazel() error { return err } buildrootLabel := "//:buildroot" - cqueryOutput, err = context.issueBazelCommand(bazel.CqueryBuildRootRunName, "cquery", + cqueryOutput, cqueryErr, err = context.issueBazelCommand(bazel.CqueryBuildRootRunName, "cquery", []string{fmt.Sprintf("kind(rule, deps(%s))", buildrootLabel)}, "--output=starlark", "--starlark:file="+cqueryFileRelpath) @@ -595,7 +648,8 @@ func (context *bazelContext) InvokeBazel() error { if cqueryResult, ok := cqueryResults[getCqueryId(val)]; ok { context.results[val] = string(cqueryResult) } else { - return fmt.Errorf("missing result for bazel target %s. query output: [%s]", getCqueryId(val), cqueryOutput) + return fmt.Errorf("missing result for bazel target %s. query output: [%s], cquery err: [%s]", + getCqueryId(val), cqueryOutput, cqueryErr) } } @@ -603,7 +657,7 @@ func (context *bazelContext) InvokeBazel() error { // // TODO(cparsons): Use --target_pattern_file to avoid command line limits. var aqueryOutput string - aqueryOutput, err = context.issueBazelCommand(bazel.AqueryBuildRootRunName, "aquery", + aqueryOutput, _, err = context.issueBazelCommand(bazel.AqueryBuildRootRunName, "aquery", []string{fmt.Sprintf("deps(%s)", buildrootLabel), // Use jsonproto instead of proto; actual proto parsing would require a dependency on Bazel's // proto sources, which would add a number of unnecessary dependencies. @@ -621,7 +675,7 @@ func (context *bazelContext) InvokeBazel() error { // Issue a build command of the phony root to generate symlink forests for dependencies of the // Bazel build. This is necessary because aquery invocations do not generate this symlink forest, // but some of symlinks may be required to resolve source dependencies of the build. - _, err = context.issueBazelCommand(bazel.BazelBuildPhonyRootRunName, "build", + _, _, err = context.issueBazelCommand(bazel.BazelBuildPhonyRootRunName, "build", []string{"//:phonyroot"}) if err != nil { diff --git a/android/config.go b/android/config.go index ae4df1cb0..bc1aa3a4d 100644 --- a/android/config.go +++ b/android/config.go @@ -287,24 +287,21 @@ func TestArchConfigNativeBridge(buildDir string, env map[string]string, bp strin return testConfig } -// TestArchConfigFuchsia returns a Config object suitable for using for -// tests that need to run the arch mutator for the Fuchsia arch. -func TestArchConfigFuchsia(buildDir string, env map[string]string, bp string, fs map[string][]byte) Config { - testConfig := TestConfig(buildDir, env, bp, fs) - config := testConfig.config - - config.Targets = map[OsType][]Target{ - Fuchsia: []Target{ +func fuchsiaTargets() map[OsType][]Target { + return map[OsType][]Target{ + Fuchsia: { {Fuchsia, Arch{ArchType: Arm64, ArchVariant: "", Abi: []string{"arm64-v8a"}}, NativeBridgeDisabled, "", "", false}, }, - BuildOs: []Target{ + BuildOs: { {BuildOs, Arch{ArchType: X86_64}, NativeBridgeDisabled, "", "", false}, }, } - - return testConfig } +var PrepareForTestSetDeviceToFuchsia = FixtureModifyConfig(func(config Config) { + config.Targets = fuchsiaTargets() +}) + func modifyTestConfigToSupportArchMutator(testConfig Config) { config := testConfig.config @@ -527,25 +524,6 @@ func (c *config) HostJavaToolPath(ctx PathContext, path string) Path { return PathForOutput(ctx, "host", c.PrebuiltOS(), "framework", path) } -// NonHermeticHostSystemTool looks for non-hermetic tools from the system we're -// running on. These tools are not checked-in to AOSP, and therefore could lead -// to reproducibility problems. Should not be used for other than finding the -// XCode SDK (xcrun, sw_vers), etc. See ui/build/paths/config.go for the -// allowlist of host system tools. -func (c *config) NonHermeticHostSystemTool(name string) string { - for _, dir := range filepath.SplitList(c.Getenv("PATH")) { - path := filepath.Join(dir, name) - if s, err := os.Stat(path); err != nil { - continue - } else if m := s.Mode(); !s.IsDir() && m&0111 != 0 { - return path - } - } - panic(fmt.Errorf( - "Cannot find non-hermetic system tool '%s' on path '%s'", - name, c.Getenv("PATH"))) -} - // PrebuiltOS returns the name of the host OS used in prebuilts directories. func (c *config) PrebuiltOS() string { switch runtime.GOOS { diff --git a/android/fixture.go b/android/fixture.go index 1def9c090..25dee2762 100644 --- a/android/fixture.go +++ b/android/fixture.go @@ -581,6 +581,16 @@ func (h *TestHelper) AssertStringDoesNotContain(message string, s string, unexpe } } +// AssertStringListContains checks if the list of strings contains the expected string. If it does +// not then it reports an error prefixed with the supplied message and including a reason for why it +// failed. +func (h *TestHelper) AssertStringListContains(message string, list []string, expected string) { + h.Helper() + if !InList(expected, list) { + h.Errorf("%s: could not find %q within %q", message, expected, list) + } +} + // AssertArrayString checks if the expected and actual values are equal and if they are not then it // reports an error prefixed with the supplied message and including a reason for why it failed. func (h *TestHelper) AssertArrayString(message string, expected, actual []string) { diff --git a/android/variable.go b/android/variable.go index dd000ad22..be12a0ad9 100644 --- a/android/variable.go +++ b/android/variable.go @@ -24,11 +24,17 @@ import ( ) func init() { - PreDepsMutators(func(ctx RegisterMutatorsContext) { + registerVariableBuildComponents(InitRegistrationContext) +} + +func registerVariableBuildComponents(ctx RegistrationContext) { + ctx.PreDepsMutators(func(ctx RegisterMutatorsContext) { ctx.BottomUp("variable", VariableMutator).Parallel() }) } +var PrepareForTestWithVariables = FixtureRegisterWithContext(registerVariableBuildComponents) + type variableProperties struct { Product_variables struct { Platform_sdk_version struct { diff --git a/android/writedocs.go b/android/writedocs.go index 6cb2f1024..67b9aa3ad 100644 --- a/android/writedocs.go +++ b/android/writedocs.go @@ -35,10 +35,11 @@ type docsSingleton struct{} func primaryBuilderPath(ctx SingletonContext) Path { buildDir := absolutePath(ctx.Config().BuildDir()) - primaryBuilder, err := filepath.Rel(buildDir, os.Args[0]) + binary := absolutePath(os.Args[0]) + primaryBuilder, err := filepath.Rel(buildDir, binary) if err != nil { - ctx.Errorf("path to primary builder %q is not in build dir %q", - os.Args[0], ctx.Config().BuildDir()) + ctx.Errorf("path to primary builder %q is not in build dir %q (%q)", + os.Args[0], ctx.Config().BuildDir(), err) } return PathForOutput(ctx, primaryBuilder) diff --git a/cc/cc_test.go b/cc/cc_test.go index 4f28eaf15..cc1f7d082 100644 --- a/cc/cc_test.go +++ b/cc/cc_test.go @@ -181,13 +181,12 @@ func TestFuchsiaDeps(t *testing.T) { }, }` - config := TestConfig(buildDir, android.Fuchsia, nil, bp, nil) - ctx := testCcWithConfig(t, config) + result := ccFixtureFactory.Extend(PrepareForTestOnFuchsia).RunTestWithBp(t, bp) rt := false fb := false - ld := ctx.ModuleForTests("libTest", "fuchsia_arm64_shared").Rule("ld") + ld := result.ModuleForTests("libTest", "fuchsia_arm64_shared").Rule("ld") implicits := ld.Implicits for _, lib := range implicits { if strings.Contains(lib.Rel(), "libcompiler_rt") { @@ -218,16 +217,13 @@ func TestFuchsiaTargetDecl(t *testing.T) { }, }` - config := TestConfig(buildDir, android.Fuchsia, nil, bp, nil) - ctx := testCcWithConfig(t, config) - ld := ctx.ModuleForTests("libTest", "fuchsia_arm64_shared").Rule("ld") + result := ccFixtureFactory.Extend(PrepareForTestOnFuchsia).RunTestWithBp(t, bp) + ld := result.ModuleForTests("libTest", "fuchsia_arm64_shared").Rule("ld") var objs []string for _, o := range ld.Inputs { objs = append(objs, o.Base()) } - if len(objs) != 2 || objs[0] != "foo.o" || objs[1] != "bar.o" { - t.Errorf("inputs of libTest must be []string{\"foo.o\", \"bar.o\"}, but was %#v.", objs) - } + result.AssertArrayString("libTest inputs", []string{"foo.o", "bar.o"}, objs) } func TestVendorSrc(t *testing.T) { diff --git a/cc/config/x86_darwin_host.go b/cc/config/x86_darwin_host.go index 1035df35b..b0344af84 100644 --- a/cc/config/x86_darwin_host.go +++ b/cc/config/x86_darwin_host.go @@ -136,7 +136,7 @@ var macTools = &macPlatformTools{} func getMacTools(ctx android.PackageVarContext) *macPlatformTools { macTools.once.Do(func() { - xcrunTool := ctx.Config().NonHermeticHostSystemTool("xcrun") + xcrunTool := "/usr/bin/xcrun" xcrun := func(args ...string) string { if macTools.err != nil { diff --git a/cc/library.go b/cc/library.go index 0e6e10764..6a3b87693 100644 --- a/cc/library.go +++ b/cc/library.go @@ -230,6 +230,7 @@ func LibraryStaticFactory() android.Module { module, library := NewLibrary(android.HostAndDeviceSupported) library.BuildOnlyStatic() module.sdkMemberTypes = []android.SdkMemberType{staticLibrarySdkMemberType} + module.bazelHandler = &staticLibraryBazelHandler{module: module} return module.Init() } @@ -406,6 +407,49 @@ type libraryDecorator struct { collectedSnapshotHeaders android.Paths } +type staticLibraryBazelHandler struct { + bazelHandler + + module *Module +} + +func (handler *staticLibraryBazelHandler) generateBazelBuildActions(ctx android.ModuleContext, label string) bool { + bazelCtx := ctx.Config().BazelContext + outputPaths, objPaths, ok := bazelCtx.GetAllFilesAndCcObjectFiles(label, ctx.Arch().ArchType) + if ok { + if len(outputPaths) != 1 { + // TODO(cparsons): This is actually expected behavior for static libraries with no srcs. + // We should support this. + ctx.ModuleErrorf("expected exactly one output file for '%s', but got %s", label, objPaths) + return false + } + outputFilePath := android.PathForBazelOut(ctx, outputPaths[0]) + handler.module.outputFile = android.OptionalPathForPath(outputFilePath) + + objFiles := make(android.Paths, len(objPaths)) + for i, objPath := range objPaths { + objFiles[i] = android.PathForBazelOut(ctx, objPath) + } + objects := Objects{ + objFiles: objFiles, + } + + ctx.SetProvider(StaticLibraryInfoProvider, StaticLibraryInfo{ + StaticLibrary: outputFilePath, + ReuseObjects: objects, + Objects: objects, + + // TODO(cparsons): Include transitive static libraries in this provider to support + // static libraries with deps. + TransitiveStaticLibrariesForOrdering: android.NewDepSetBuilder(android.TOPOLOGICAL). + Direct(outputFilePath). + Build(), + }) + handler.module.outputFile = android.OptionalPathForPath(android.PathForBazelOut(ctx, objPaths[0])) + } + return ok +} + // collectHeadersForSnapshot collects all exported headers from library. // It globs header files in the source tree for exported include directories, // and tracks generated header files separately. diff --git a/cc/testing.go b/cc/testing.go index fcd124e11..6840ef4c5 100644 --- a/cc/testing.go +++ b/cc/testing.go @@ -653,6 +653,14 @@ var PrepareForTestOnLinuxBionic = android.GroupFixturePreparers( android.FixtureAddTextFile(linuxBionicDefaultsPath, withLinuxBionic()), ) +// The preparer to include if running a cc related test for fuchsia. +var PrepareForTestOnFuchsia = android.GroupFixturePreparers( + // Place the default cc test modules for fuschia in a location that will not conflict with default + // test modules defined by other packages. + android.FixtureAddTextFile("defaults/cc/fuschia/Android.bp", withFuchsiaModules()), + android.PrepareForTestSetDeviceToFuchsia, +) + // This adds some additional modules and singletons which might negatively impact the performance // of tests so they are not included in the PrepareForIntegrationTestWithCc. var PrepareForTestWithCcIncludeVndk = android.GroupFixturePreparers( @@ -685,7 +693,7 @@ func TestConfig(buildDir string, os android.OsType, env map[string]string, var config android.Config if os == android.Fuchsia { - config = android.TestArchConfigFuchsia(buildDir, env, bp, mockFS) + panic("Fuchsia not supported use test fixture instead") } else { config = android.TestArchConfig(buildDir, env, bp, mockFS) } diff --git a/java/prebuilt_apis.go b/java/prebuilt_apis.go index 59b8b8c16..8a442b5ff 100644 --- a/java/prebuilt_apis.go +++ b/java/prebuilt_apis.go @@ -248,9 +248,9 @@ func prebuiltApiFiles(mctx android.LoadHookContext, p *prebuiltApis) { } // Create incompatibilities tracking files for all modules, if we have a "next" api. + incompatibilities := make(map[string]bool) if nextApiDir := String(p.properties.Next_api_dir); nextApiDir != "" { files := getPrebuiltFilesInSubdir(mctx, nextApiDir, "api/*incompatibilities.txt") - incompatibilities := make(map[string]bool) for _, f := range files { localPath := strings.TrimPrefix(f, mydir) module, _, scope := parseApiFilePath(mctx, localPath) @@ -266,11 +266,11 @@ func prebuiltApiFiles(mctx android.LoadHookContext, p *prebuiltApis) { incompatibilities[referencedModule+"."+scope] = true } - // Create empty incompatibilities files for remaining modules - for _, k := range android.SortedStringKeys(m) { - if _, ok := incompatibilities[k]; !ok { - createEmptyFile(mctx, apiModuleName(m[k].module+"-incompatibilities", m[k].scope, "latest")) - } + } + // Create empty incompatibilities files for remaining modules + for _, k := range android.SortedStringKeys(m) { + if _, ok := incompatibilities[k]; !ok { + createEmptyFile(mctx, apiModuleName(m[k].module+"-incompatibilities", m[k].scope, "latest")) } } } diff --git a/java/sdk_library.go b/java/sdk_library.go index 30d120d5c..b03f90cf4 100644 --- a/java/sdk_library.go +++ b/java/sdk_library.go @@ -452,6 +452,7 @@ type sdkLibraryProperties struct { // that references the latest released API and remove API specification files. // * API specification filegroup -> <dist-stem>.api.<scope>.latest // * Removed API specification filegroup -> <dist-stem>-removed.api.<scope>.latest + // * API incompatibilities baseline filegroup -> <dist-stem>-incompatibilities.api.<scope>.latest Dist_stem *string // A compatibility mode that allows historical API-tracking files to not exist. @@ -1059,6 +1060,9 @@ func (module *SdkLibrary) DepsMutator(ctx android.BottomUpMutatorContext) { if m := android.SrcIsModule(module.latestRemovedApiFilegroupName(apiScope)); !ctx.OtherModuleExists(m) { missingApiModules = append(missingApiModules, m) } + if m := android.SrcIsModule(module.latestIncompatibilitiesFilegroupName(apiScope)); !ctx.OtherModuleExists(m) { + missingApiModules = append(missingApiModules, m) + } } if len(missingApiModules) != 0 && !module.sdkLibraryProperties.Unsafe_ignore_missing_latest_api { m := module.Name() + " is missing tracking files for previously released library versions.\n" @@ -1165,6 +1169,10 @@ func (module *SdkLibrary) latestRemovedApiFilegroupName(apiScope *apiScope) stri return ":" + module.distStem() + "-removed.api." + apiScope.name + ".latest" } +func (module *SdkLibrary) latestIncompatibilitiesFilegroupName(apiScope *apiScope) string { + return ":" + module.distStem() + "-incompatibilities.api." + apiScope.name + ".latest" +} + func childModuleVisibility(childVisibility []string) []string { if childVisibility == nil { // No child visibility set. The child will use the visibility of the sdk_library. @@ -1389,6 +1397,8 @@ func (module *SdkLibrary) createStubsSourcesAndApi(mctx android.DefaultableHookC props.Check_api.Last_released.Api_file = latestApiFilegroupName props.Check_api.Last_released.Removed_api_file = proptools.StringPtr( module.latestRemovedApiFilegroupName(apiScope)) + props.Check_api.Last_released.Baseline_file = proptools.StringPtr( + module.latestIncompatibilitiesFilegroupName(apiScope)) if proptools.Bool(module.sdkLibraryProperties.Api_lint.Enabled) { // Enable api lint. diff --git a/ui/build/soong.go b/ui/build/soong.go index 500abdac5..884e95741 100644 --- a/ui/build/soong.go +++ b/ui/build/soong.go @@ -177,14 +177,6 @@ func runSoong(ctx Context, config Config) { ninjaEnv.Set("TOP", os.Getenv("TOP")) ninjaEnv.Set("SOONG_OUTDIR", config.SoongOutDir()) - // Needed for NonHermeticHostSystemTool() and that, only in tests. We should - // probably find a better way of running tests other than making $PATH - // available also to production builds. Note that this is not get same as - // os.Getenv("PATH"): config.Environment() contains the $PATH that redirects - // every binary through the path interposer. - configPath, _ := config.Environment().Get("PATH") - ninjaEnv.Set("PATH", configPath) - // For debugging if os.Getenv("SOONG_DELVE") != "" { ninjaEnv.Set("SOONG_DELVE", os.Getenv("SOONG_DELVE")) |