This signifigantly improves the startup time of soong-built
python binaries. For example, running
`m apexer && time out/host/linux-x86/bin/apexer` gives
0.734s before this cl, and 0.094s after.
Fixes: 259718110
Test: Presubmits
Change-Id: Ib19e83e2c60c39a849525be117279c318de3afa7
Brings down time taken to fail from 18s to 13s (on aosp branch)
Test: temporarily coded random failure
Bug: N/A
Change-Id: Ib694eec977293f4dd7054e779d1b82b8cace93f6
This keeps this test compatible with a Bazel release change which
affects which files are present in `bazel cquery --output=files` for
py_binary targets. Since the executable will be present in a predictable
location under bazel-bin, we can hardcode that, instead.
We could have alternatively used --output_groups=python_zip_file for
'hermetic' python, but the bp2build-built deapexer target is missing
some dependencies on protobuf.
Bug: 265176532
Test: Manual runs of apex_comparison_tests.sh with the new Bazel release
Change-Id: Ib7021e7e81d1a7bf5ff4d222e2a7947a06d16791
This test builds an "empty" filegroup. Running it can be useful to
verify that the api_bp2build workspace has been setup correctly.
Test: TH
Change-Id: I78639a2dcdeb659b2d6fdf6abc85d85c4fb697bf
Resend aosp/2350557, with minor change on line 65 of apex_cc_module_arch_variant_tests.sh.
The pattern was:
'.*android_target.*: ([0-9]+)$'
and is changed to:
'.*opt-ST.*: ([0-9]+)$'
since the Bazel output directory name has been changed.
Bug: 258422889
Test: build/soong/tests/run_integration_tests.sh
Change-Id: Ib114bc0084d8ea2cd232d6478cc81a039b138bc4
Create a
build/bazel/product_config/generated/products/<product_name>/BUILD
file that contains the platform definitions needed for
a particular product. Currently we just create it for the
current lunch target, but the idea is that eventually when
all product config is in starlark, all the products will
have their platform definitions in the tree at once.
Bug: 249685973
Test: Presubmits
Change-Id: I08c82ff28dcf62f09d3b1d2e3186a6b961e12f6e
Needed because we import absl-py in our bazel.workspace file.
It only worked before in b, not mixed builds, because b was
run from the real android tree instead of out/soong/workspace.
Bug: 234449134
Bug: 249685973
Test: Presubmits
Change-Id: Ie6985582c55a4a95338fb3a8ff7b13ddb522c391
Revert submission 2308141-colefaust_run_b_from_out_folder
Reason for revert: Breaks CI due to more instances of the bazel shutdown issue
Reverted Changes:
I51c28e232:Allowlist build files in external/python/absl-py
I9e6530d95:Cd into the bazel workspace instead of using --pac...
Change-Id: Ice47ef2baaef9976546f9562dc7dd9b19b383d59
Needed because we import absl-py in our bazel.workspace file.
It only worked before in b, not mixed builds, because b was
run from the real android tree instead of out/soong/workspace.
Bug: 234449134
Bug: 249685973
Test: Presubmits
Change-Id: I51c28e23260bed7ca7d4968fd823f52f0d26a0ab
Make PackageVarContext implement PathGlobContext by implementing
GlobWithDeps. This will allow calls to ExistentPathForSource
inside a VariableFunc to use optimized glob dependencies instead of
falling back to AddNinjaFileDeps, which is resulting in extra
dependencies from soong_build on top level directories, triggering
extra Soong regenerations.
Remove the fallback path in ExistentPathForSource by making it take
a PathGlobContext, which is now a superset of PathContext.
Rewrite TestNinjaDeps to not rely on the unoptimized glob dependencies
in VariableFuncs and instead call ctx.Config().AddNinjaFileDeps
directly.
Bug: 257079828
Test: test_create_global_include_directory
Change-Id: I48cf189157d78b9252d339dbc9baeb27e4694807
This will make it easy to change a "false" boolean to "true" to push
`--bazel-mode` by default for all users.
Users may disable bazel-by-default with BUILD_BROKEN_DISABLE_BAZEL, and
bazel is disabled by default on Darwin hosts (due to lack of test
coverage).
Bug: 254628592
Bug: 254084584
Test: Presubmits
Test: Presubmits for aosp/2263623
Change-Id: Iec712119e06ca8ec93028207d88277f879184cc2
This helps with incrementality a lot: the symlink forest must depend on
almost every directory in the source tree so that if a new file is added
or removed from *anywhere*, it is regenerated.
Previously, we couldn't do this without invoking bp2build, which is
quite wasteful because bp2build takes way more time than the symlink
forest creation, even though we do the latter in a very suboptimal way
at the moment.
This means that if a source file is added or removed (which does not
affect globs), we don't pay the cost of bp2build anymore.
Also refactored symlink_forest.go on the side. Too much state was being
passed around in arguments.
This change reimplements aosp/2263423 ; the semantics of not touching an
output file is the exact same as order-only inputs and the latter is a
bit fewer lines of code.
Test: Presubmits.
Change-Id: I565c580df8a01bacf175d56747c3f50743d4a4d4
test_bp2build_generates_all_buildfiles uses the same directory for
--output_base and --sandbox_tmpfs_path. This is required on the build
servers, but causes issues locally. This commit adds a more helpful
error message when this test fails.
Test: build/soong/tests/bp2build_bazel_test.sh
Change-Id: Ib29a7edf456f8ae39bd429ebb367c8115e02c284
* We are interested mostly in the conversion the `default_applicable_licenses`
attribute, as `default_visibility` cannot be handled until every module's
`visibility` is handled.
* Several referenced license modules had to be manually enabled for
conversion, and likewise a few trivial Android.bp containing only
package and license modules.
* As Bazel allows only a single `package` rule, the package rules in a
manually converted BUILD.bazel files were removed (in
external/protobuf and prebuilts/clang/host/linux-x86 trees).
* The converted package rule is emitted before the `load` statements per
Bazel documentation.
Bug: 190817312
Test: treehugger
Change-Id: If8bf6fee1580177de3bb402923615bcd48923ed2
apex_comparison_test.sh defines a helper function to clean up state on
exit, but in error conditions the call_bazel function is not always
defined.
Test: added an exit 1 statement below trap
Change-Id: I73b0c56c0a4a2d9ed1d4c0bf38b6ac0ac985e716
RBE is already disabled for this test on CI. Locally, the mock checkout
created for the Soong integration tests does not set up RBE properly, so
we should just disable it explicitly so that the integration tests can
be run locally.
Test: build/soong/tests/run_integration_tests.sh
Change-Id: I38875a02b549a9d8c8368d6287c4516518d20e34
apex_diff_test targets were the last remaining dependents of make_injection. Rewriting them allows us to delete make_injection.
Test: CI
Change-Id: I928d8fe136d709b9f819c00c3127af66e720a7db
SC2236: use [[ -n "$var" ]] instead of [[ ! -z "$var" ]]
SC2035: use -- end of options, to accomodate filename w\ hyphens
SC2155: `local -r var=..` for readonly variable shellcheck ignores return value masking
SC2045: prefer glob to iteration over `ls`
Bug: N/A
Test: ran ./run_intergration_tests.sh
Change-Id: Iaf313857ecc417e855afd70c7455841b54b1c363