summaryrefslogtreecommitdiff
path: root/python
AgeCommit message (Collapse)Author
2021-05-03Support blueprint_go_binary in PathForModuleSrcColin Cross
Allow blueprint_go_binary to be used as test data by supporting it in PathForModuleSrc. Also make python use GetDirectDepsWithTag instead of VisitDirectDeps so it doesn't fail on the dependency to a Blueprint (non-Android) module. Fixes: 186528269 Test: manual Change-Id: Ibc1d7caf7bf1fa5db805c3b885a95df4baee0ecf
2021-04-20Mark par_test as not unit testsJulien Desprez
They seem to be used as Soong validation. They are not implemented against the python unit tests framework, so we can execute them as such in CI automatically. Change-Id: I8fe662d5d3399d60c8a05acc79b4dd51b5d138a6 Test: presubmit Bug: 183730987
2021-04-19Change par file generate rules.yangbill
Make sure the shebang of the par file is consistent with the main python script rather than use /usr/bin/python arbitrarily. Bug: 185399398 Bug: 185094069 Test: m atest ; atest-dev --help m atest-py2 ; atest-py2-dev --help Change-Id: Ice4590b3d173e6d11e608c2ca29b297df0dc4089
2021-03-30bp2build: arch-configurable selects for label list attrs.Jingwen Chen
This CL adds the configurable LabelListAttribute support to bp2build. Test: go test Change-Id: I2ef9e385d9cf1b1845988128eca1d8cda1ecb5e8
2021-03-24bp2build: add allowlist for package-level conversions.Jingwen Chen
This CL adds the support for specifying lists of directories in build/soong/android/bazel.go, which are then written into out/soong/bp2build/MANIFEST. Using this configuration, modules/directories can either default to bp2build_available: true or false, while still retaining the ability to opt-in or out at the module level. It also ensures that ConvertWithBp2Build returns true iff the module type has a registered bp2build converter. Test: go tests Test: demo.sh full Test: TreeHugger presubmits for bp2build and mixed builds. Change-Id: I0e0f6f4b1b2ec045f2f1c338f7084defc5d23a55
2021-03-22Remove usages of FixtureFactory from misc packagesPaul Duffin
These packages have already been migrated to use per test build directory so have no need for a FixtureFactory. Bug: 183235980 Test: m nothing Change-Id: I667d1d992caaf0f615de91f89efdae11c44986c2
2021-03-17Convert python package to fixturesPaul Duffin
Bug: 182885307 Test: m nothing Change-Id: I78506a10f0e6ba8ad4952e8305f47ffd5a33b359
2021-03-17Add preparers for pythonPaul Duffin
Bug: 181070625 Test: m nothing Change-Id: I590ad62db6fd62719c83286780563cf6d55e3e17
2021-03-17Fix hole in python testing code that ignored a broken testPaul Duffin
The test running code would only check errors if there were any reported. That ignored the "module with duplicate runfile path" test which was not reporting the expected error. This change corrects that mistake, and then fixes the test which had started to fail. It is possible that the failing test highlights a bug in the python code but if so that will need to be fixed in a follow up bug. Bug: 183046274 Test: m nothing Change-Id: I961b15a452725e7b15ba9d21b4a4a672ba3d004a
2021-03-09bp2build: add python_binary_host converter.Jingwen Chen
This CL adds a simple python_binary_host to native py_binary converter for standalone modules that don't depend on libs. It also adds support for the conditional py2/py3 build target based on the version prop. Test: milestone-2/demo.sh full Test: bazel query 'kind("py_binary rule", //bionic/...)' Test: bazel run //bionic/libc/tools:genfunctosyscallnrs Test: bazel run //bionic/libc/tools:genseccomp Test: go tests Fixes: 182236395 Change-Id: Ibe5ec6cd0dc12a61b3a449a8c723d80b891fae42
2021-02-22Merge "Add ctx to AndroidMkExtraEntriesFunc"Treehugger Robot
2021-02-19Add ctx to AndroidMkExtraEntriesFuncColin Cross
Add a ctx parameter to AndroidMkExtraEntriesFunc to allow them to access providers. Test: m checkbuild Change-Id: Id6becc1e425c3c3d8519248f8c0ce80777fac7cc Merged-In: Id6becc1e425c3c3d8519248f8c0ce80777fac7cc
2021-02-06Add LOCAL_LICENSE_KINDS to build/soongBob Badour
Added SPDX-license-identifier-Apache-2.0 to: Android.bp android/Android.bp android/soongconfig/Android.bp androidmk/Android.bp apex/Android.bp bazel/Android.bp bp2build/Android.bp bpf/Android.bp bpfix/Android.bp cc/Android.bp cc/config/Android.bp cc/libbuildversion/Android.bp cc/libbuildversion/tests/Android.bp cc/ndk_api_coverage_parser/Android.bp cc/ndkstubgen/Android.bp cc/symbolfile/Android.bp cmd/dep_fixer/Android.bp cmd/diff_target_files/Android.bp cmd/extract_apks/Android.bp cmd/extract_jar_packages/Android.bp cmd/extract_linker/Android.bp cmd/fileslist/Android.bp cmd/host_bionic_inject/Android.bp cmd/javac_wrapper/Android.bp cmd/merge_zips/Android.bp cmd/multiproduct_kati/Android.bp cmd/path_interposer/Android.bp cmd/pom2bp/Android.bp cmd/pom2mk/Android.bp cmd/sbox/Android.bp cmd/soong_build/Android.bp cmd/soong_env/Android.bp cmd/soong_ui/Android.bp cmd/zip2zip/Android.bp cmd/zipsync/Android.bp cuj/Android.bp dexpreopt/Android.bp dexpreopt/dexpreopt_gen/Android.bp env/Android.bp etc/Android.bp filesystem/Android.bp finder/Android.bp finder/cmd/Android.bp genrule/Android.bp jar/Android.bp java/Android.bp java/config/Android.bp kernel/Android.bp linkerconfig/Android.bp linkerconfig/proto/Android.bp makedeps/Android.bp partner/Android.bp phony/Android.bp python/Android.bp python/tests/Android.bp remoteexec/Android.bp rust/Android.bp rust/config/Android.bp scripts/Android.bp sdk/Android.bp sh/Android.bp shared/Android.bp symbol_inject/Android.bp symbol_inject/cmd/Android.bp sysprop/Android.bp tradefed/Android.bp ui/build/Android.bp ui/logger/Android.bp ui/metrics/Android.bp ui/metrics/proc/Android.bp ui/status/Android.bp ui/terminal/Android.bp ui/tracer/Android.bp xml/Android.bp zip/Android.bp zip/cmd/Android.bp Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-BSD to: finder/fs/Android.bp third_party/zip/Android.bp Bug: 68860345 Bug: 151177513 Bug: 151953481 Test: m all Exempt-From-Owner-Approval: janitorial work Change-Id: Ia47ca14f16b8c9f84f9d533a07e5b00e2c04e8d4
2020-12-04Merge "Add comments/refactor for python.go"Treehugger Robot
2020-12-01Pass pctx and ctx to NewRuleBuilderColin Cross
Enable the RuleBuilder and RuleBuilderCommand methods to access the BuilderContext by passing it to NewRuleBuilder instead of RuleBuilder.Build. Test: genrule_test.go Test: rule_builder_test.go Test: m checkbuild Change-Id: I63e6597e19167393876dc2259d6f521363b7dabc
2020-12-01Add comments/refactor for python.goLiz Kammer
Test: all soong tests Test: m nothing Change-Id: Ib3b95d7c2831b97026e76a39af515fd51c6cb2c7
2020-12-01Add test suite handling to central androidmk codeLiz Kammer
MTS is introducing partial MTS test suites that are per-module, with names of the format: mts-${MODULE}. By centralizing the code for test suites, we can automatically add "mts" test suite when an "mts-${MODULE}" test suite is specified, reducing duplication. Test: m mts Bug: 170318013 Change-Id: I8ce9d3c252fcc0a937bb5f2826d21cb6c6932d82
2020-11-26Merge "Refactor python to use AndroidMkEntries."Liz Kammer
2020-11-24Refactor python to use AndroidMkEntries.Liz Kammer
This is to enable consolidating test compatibility suite handling in Soong's AndroidMk files. Test: go test soong tests Test: m nothing and compare soong/Android mk files -- only diffs is that lines matching "^LOCAL_SHARED_LIBRARIES := $" are absent Change-Id: I4922a1c8b0231cd98ebd2bc7257956eb9c0d240c
2020-11-24Merge "Annotate dependency tags for dependencies of installed files"Colin Cross
2020-11-23Annotate dependency tags for dependencies of installed filesColin Cross
Relands Ic22603a5c0718b5a21686672a7471f952b4d1017 with a minor change to track libc++ dependencies for python hosts and after a fix to an internal genrule that depended on transitively installed java libraries (ag/13068670). Soong currently assumes that installed files should depend on installed files of all transitive dependencies, which results in extra installed file dependencies through genrules, static libs, etc. Annotate dependency tags for dependencies for which the installed files are necessary such as shared libraries and JNI libraries. This avoids extra installed files, and is also a first step towards genrules using their own copy of tools instead of the installed copy. Bug: 124313442 Test: m checkbuild Test: java.TestBinary Test: cc.TestInstallSharedLibs Test: deptag_test.go Change-Id: I725871249d561428e6f67bba6a7c65b580012b72
2020-11-23Add java_data parameter to python modulesColin Cross
csuite has a python module that wants to embed the outputs of java modules. This has caused issues with mismatched variants bewteen the arch-specific python module and the common java modules. Add a java_data property that is similar to the data property but uses the common arch variant. Bug: 173977903 Test: m checkbuild Change-Id: I0f2f0e4159650cd5d42b510d5177678e7ee91b4d
2020-11-23Use local variations for python version splitsColin Cross
Use a local variation for python version splits. This causes dependencies from python modules not to look for variations that match the version split, which will simplify a python module depending on a java module (for example for test data) because Soong won't look for a python version variant of the java module. Bug: 173977903 Test: go test ./python Change-Id: Ib034140c478ffbc7467ab830d3cfa5683c31d05c
2020-11-18Merge "Add unit_test test option in test configs"Dan Shi
2020-11-16Merge "Fix bug in python module hasExtention."Treehugger Robot
2020-11-16Fix bug in python module hasExtention.Liz Kammer
Test: m nothing Test: soong go tests Change-Id: I1944a3bbb871bc1021c841d944e765bb0cadba86
2020-11-16Add unit_test test option in test configsDan Shi
This change allows a test (native, java, rust or python) to be included in host-unit-tests suite when test option `unit_test` is set to true. Bug: 172006742 Test: m host-unit-tests Change-Id: I69d3eb5b51198c549e2e6914ceac3a4fc33c3cf2
2020-11-12Pass Config to NewTestContext instead of ctx.RegisterColin Cross
Prepare for using Config when adding singletons by passing Config to NewTestContext and NewContext instead of to ctx.Register. This will enable a followup change to store SingletonMakeVarsProviders registered on the Context in the Config, which is necessary to run multiple tests in parallel without data races. Test: all soong tests Change-Id: Id229629a4e42ff4487d317241673837726c075fc
2020-11-02Consolidate python version properties in mutatorLiz Kammer
Test: m Bug: 165114590 Change-Id: Iaf874f7098317a52827b113167e3dc1ed044e907
2020-10-09Revert "Make lots of tests run in parallel"Colin Cross
This reverts commit 323dc60712491c71ccdc5363c42df61f0a192487. Reason for revert: Possible cause of test instability Bug: 170513220 Test: soong tests Change-Id: Iee168e9fbb4210569e6cffcc23e60d111403abb8
2020-10-06Make lots of tests run in parallelColin Cross
Putting t.Parallel() in each test makes them run in parallel. Additional t.Parallel() could be added to each subtest, although that requires making a local copy of the loop variable for table driven tests. Test: m checkbuild Change-Id: I5d9869ead441093f4d7c5757f2447385333a95a4
2020-09-29Merge "Add support of test data to python_host_test"Treehugger Robot
2020-09-24HostCross is an attribute of a Target, not OsTypeJiyong Park
A host target is considered as being cross-compiled when the target can't run natively on the build machine. For example, linux_glibc/x86_64 is a non-cross target on a standard x86/Linux machine, but is a cross host on Mac. Previously, whether cross or not was a static attribute of an OsType. For example, Windows was always considered as cross host, while linux_bionic was not. This becomes a problem when we support more host targets like linux_bionic/arm64 which should be cross-host on standard x86/Linux machines. This change removes HostCross from the OsClass type and instead adds a property HostCross to the Target type. When a target is being added, it is initialized to true when the target can't run natively on the current build machine. Bug: 168086242 Test: m Change-Id: Ic37c8db918873ddf324c86b12b5412952b0f2be2
2020-09-21Add support of test data to python_host_testDan Shi
Bug: none Test: m -j vts_vndk_abi_test confirm abi_dump.zip found next to test binary Change-Id: I834dddfc13eb9e7addd234307b085b16124db234
2020-07-27Add `data_native_bins` property to java_test_hostLiz Kammer
When multiple os/arch variants are supported, java_test_host could not find a matching arch due to java having arch:common, whereas native binaries support a specific architecture. This change adds the property `data_native_bins` in order to support binaries with the appropriate os/arch variants. Test: m FirmwareDtboVerification with data_native_bins Test: forrest Bug: 153848038 Change-Id: I45adebff0fde2811d5ef5620c697b97b768c951f
2020-06-22Implement OutputFiles for python modules.Liz Kammer
This enables python binaries to be included in data properties with the format ":module". Test: m FirmwareDtboVerification with local changes Bug: 153848038 Change-Id: I2a02dc382fcbb142d8e4fbdbb6ca461986627d25
2020-06-10Fix using generated test configs for sh_test, python_test and rust_test modulesColin Cross
Annotate the test config properties with android:"path", and always use LOCAL_FULL_TEST_CONFIG to pass the path to Make. Bug: 157621988 Test: manual Change-Id: I1c020e642f83d994d63c9e9cb56e686086d5acaa
2020-06-01Soong package structure refactoringJaewoong Jung
Give prebuilt_etc and sh_binary their own packages and split the gigantic main Android.bp up to small, per-package ones. Test: m nothing, TreeHugger Bug: 156980228 Change-Id: I7b00cd344b9f16861f1ff39edf0029f016b853d0
2020-03-11Don't check elf properties of python prebuiltsDan Willemsen
We're not doing a great job of copying over all the library dependencies (especially when using sanitizer libraries). Just omit these from the checks, which shouldn't really matter. Bug: 151093572 Change-Id: I8470bbfbf36a51739e8a7e699ad090a66c9db8b2 Test: treehugger
2020-02-19Add tests for py(2|3)-cmdDan Willemsen
Test: m par_test{,3} py{2,3}-cmd; ./runtest.sh Change-Id: I4aadd9fc85be4381bd9a0843064ceaa87150b5ee
2020-01-20Python3 on device links against liblogDan Willemsen
Fixes: 148037229 Test: cherry-pick https://r.android.com/1212194; m try_python_binary_test Change-Id: I6e26ba232d7698a4889a6e0be1aeb09d54cc4dc5
2020-01-06Pass auto_gen_config setting in Android.bp to makefileDan Shi
Bug: none Test: local test with fuzzy_fastboot Change-Id: I2c62f6fb58737538ef9e1e9fcbe63e03dfa7ee91
2019-12-18Move filesystem into ConfigColin Cross
The filesystem object was available through ModuleContext.Fs(), but gives too much access to the filesystem without enforicing correct dependencies. In order to support sandboxing the soong_build process move the filesystem into the Config. The next change will make it private. Bug: 146437378 Test: all Soong tests Change-Id: I5d3ae9108f120fd335b21efd612aefa078378813
2019-12-03Test par file argument handlingDan Willemsen
This had been broken with my python3 launcher. Test: build/soong/python/tests/runtest.sh Change-Id: I0524e5a80244bf1080cb28237b23ef0d023e03dc
2019-11-25Make TestContext.RegisterModuleType take an android.ModuleFactoryColin Cross
Avoid having to pass ModuleFactoryAdaptor to every call to RegisterModuleType in a test by wrapping RegisterModuleType. Test: all soong tests Change-Id: If8847d16487de0479cc3020b728256922b3cadba
2019-11-04Add python3 embedded launcher supportDan Willemsen
Test: m par_test{,3}; build/soong/python/tests/runtest.sh Change-Id: I9c0fac9e2947616fdeedbfc55026dc3065966e71
2019-10-16Add method to determine variations from a TargetColin Cross
The arch variants are hardcoded in every module type. Refactor them out into a Target.Variations() method in preparation for splitting the arch mutator into two, which will require using different variations. Test: m checkbuild Change-Id: I28ef7cd5168095ac888fe77f04e27f9ad81978c0
2019-10-07Merge "Remove old-style support for translated second architectures"Treehugger Robot
2019-10-03Replace RelPathString() with ToMakePath()Colin Cross
Add a ToMakePath() method that returns a new path that points out out/ instead of out/soong/, and replace the "$(OUT_DIR)/" + path.RelPathString() pattern with path.ToMakePath().String() Bug: 141877526 Test: m checkbuild Change-Id: I391b9f2ed78c83a58d905d48355ce9b01d610d16
2019-10-03Separate InstallPath from OutputPathColin Cross
Create a new type InstallPath that is similar to OutputPath to differentiate intermediates output paths from installed output paths. RelPathString is a poorly defined, undocumented function that is primarily used to get an install path relative to out/soong to generate an equivalent install path for Make relative to $(OUT_DIR). Move it to InstallPath for now, and fix the one remaining user on OutputPath. Add a method to create an NDK install path so that ndk_sysroot.go doesn't have to do it manually with PathForOutput. Bug: 141877526 Test: m checkbuild Change-Id: I83c5a0bd1fd6c3dba8d3b6d20d039f64f353ddd5