Allow java_sdk_libraries to include libraries statically into their
stubs. The immediate use-case of this is to embed libcore notice files
into their stubs.
Also extend the java_sdk_library tests for impl/stub-only-libs, plus
some not assert utils.
Bug: 173186484
Bug: 184839599
Test: soong tests
Change-Id: I1ebf2f35c048eab5cec5125482a0304fe660f188
- libc_openbsd_large_stack
- libc_openbsd
Also update the lib_dns comment as it makes more progress now (still fails).
Test: bp2build; bazel build //bionic/...
Test: USE_BAZEL_ANALYSIS=1 m libc
Change-Id: I54f104d359779420d181f195ecbfc9e1269e30be
This reverts commit f84e9c05e2.
Because this breaks the usage of boot-debug.img and
vendor_boot-debug.img
Bug: 185970130
Bug: 185990198
Test: make bootimage_debug
Change-Id: I7886c971982faae1d5bc34688643de8d94d6e201
Add RuleBuilderCommand.Validation and RuleBuilderCommand.Validations
that propagate to BuildParams.Validations.
Test: TestRuleBuilder_build, TestRuleBuilder
Change-Id: I9a08bbc073a432fd0b53b87d8948ac0f6afcf637
Order only dependencies that were added to a RuleBuilderCommand were
only propagated to the rule that was created for a missing dependencies
error. Set them on the main rule instead.
Test: TestRuleBuilder_build
Change-Id: I049d1bb921778d18d678439d236f69081927dc70
The property vintf_fragments accepts paths and references to other
modules; however, none of that is passed onto make, resulting in errors
if a non-local path is used.
Test: m
Bug: 184567830
Change-Id: If3b56ea8eec3b95b3a310b58bffd045cedd8ee52
Simplifies the process of debugging failing tests by making it easy for
the test fixture to produce debug output on a case by case basis.
Bug: 181070625
Test: m nothing
Change-Id: I22620a1bfb1737cffd017bdf7bbbfb609b60468c
OriginalModuleName is a clearer name for what the field represents.
Also document it.
Follow-up from aosp/1675466.
Test: TH
Change-Id: Ie1152b5ae63f388164582be70e193a91ef96c89c
This allows us to, for certain modules, enable bp2build, but disable
mixed builds.
This facilitates easier iteration on these two features, as modules can
be incrementally "fixed" for bp2build, even if they are not ready for
mixed builds integration.
Test: USE_BAZEL_ANALYSIS=1 m libc
Test: Manually verified that note_* modules exist in bionic/libc/BUILD
Test: bazel build //bionic/....
Change-Id: I3462c8398680140cfc953443d96196143b8ad0a3
Use license name unless package name is given.
Change the package name for the default android license to Android.
Test: m all
Change-Id: I0049b08fc4955a838e33c8bcfed104dbbf8ec7b1
It now handles adding .bp files and changing globs.
In order to do this, depfiles are now written separately from RunBlueprint.
This is necessary due to the confluence of a number of seemingly
unrelated factors:
1. The glob filelist dependencies are discovered in globSingleton
2. Singletons need to be registered because otherwise singleton module
types panic
3. Singletons don't work because they require mutators bp2build does not
run
Due to (1), we would need to run the glob singleton. However, due to (2)
and (3), we can't run singletons and have to run Blueprint with
StopBeforeGeneratingBuildActions, which is when the build actions
writing glob files would be generated. So what happens is:
1. When bp2build is run, the glob singleton is disabled
2. At the end of bp2build, the list of glob files is artifically added
to the depfile of the workspace marker file
3. When build.ninja is generated, the Ninja file containing the glob
list file is written by the now-active glob singleton
Test: Presubmits.
Change-Id: I3c5898d8c57c554a93520276c64a952afc912dbe
If sdk_version is set to "", it means the module is built with the
in-development version of the platform APIs. "core_platform" means the
in-development version of the core Java APIs. In both cases, the API
level (i.e. which version to use) is the in-development version.
Bug: 1663140
Test: m
Change-Id: Ia184190341223e9ac12710a8bb3a25004fd4f539
ApexInfo is not part of the properties struct. It can handle structs
having private fields.
Bug: 1663140
Test: m
Change-Id: Ib07d4410f0ce187c9de347da34b84b814b2eb537
A module will be installed to debug_ramdisk (or
debug_ramdisk/first_stage_ramdisk if recovery as boot is true) if
debug_ramdisk is set to true.
Bug: 184004542
Test: soong test
Change-Id: Ic5a4d27407e506fffa462de2149e0785f11b2ac7
This allows the following cc_library_static targets to build with bp2build:
- libc_freebsd
- libc_freebsd_large_stack
- libc_openbsd_ndk
- libc_gdtoa (* but still fails for mixed builds)
- libc_aeabi
- libc_static_dispatch
- libc_dynamic_dispatch
This also allows a number of other cc_library_static targets to progress further in their builds.
Test: Added unit test
Test: bp2build-sync.py write; bazel build //bionic/...
Change-Id: I71742565c16594448a41a6428a5c993171ec4cb4
Fixes an issue where prebuilt module under unexported soong
namespace overrides source modules when flag `prefer` was set.
Test: Create two modules under the same name, use cc_library_shared
for first one and cc_prebuilt_library_shared with `prefer` set
to true.
Then put the prebuilt module under `soong_namespace {}` and
attempt to compile it without appending the namespace path to
product namespaces.
Without this change it should fail to resolve the
cc_library_shared module even if it should be available.
Change-Id: I506641218e6af94a0b5f048e09e06d83602e50f5
Ramdisk path tests existed once, but have been removed for whatever
reason. This change revives the tests.
Test: soong test
Change-Id: Ibade91fbe3e044f772a50df15f448b04aa12d807
This is unused and doesn't work with our current API review process
anyway (un-drafting an API won't be flagged for API council review).
Test: treehugger
Bug: None
Change-Id: I6d8fcc9885b82dac5ada7772d9e3fb9101524ece
Before this change, exclude paths disabled sanitization of targets that
would otherwise be enabled by SanitizeDevice product variable (aka
SANITIZE_TARGET).
With this change, in addition to the above logic, exclude path disables
sanitization of targets that would otherwise be enabled by the
corresponding include path.
Effectively, this change disables sanitization of targets that are
covered by *both* include and exclude paths.
Test: build/soong/cc/cc_test.go
Bug: b/184976817
Change-Id: I96f1e2a808d88b352b92b7490fa1df5c010314c3
Properly plumb the available environment to the configuration instead of
going through the global variable originalEnv.
Test: Presubmit.
Change-Id: Ia1ea753d5e72c02a0dcaa4c0b43bd6e24fc47cec
There is little overlap at this point, but we expect these to converge
more over time, to handle exported includes, libs, etc., this will allow
those changes to be handled in one place and allow more consolidation of
code.
Test: bp2build generate & sync; mixed build libc
Change-Id: I51685dad9f4fc11a634965a3c9e84f4a0e279ecb
This adds the two modules to the bp2build/mixed builds denylist while we
investigate b/185079815.
Test: TH
Change-Id: I6d67c5c24502ac48bdc90a005ddef86c46eab0b7
Follow I2159cc9d85f388073198eac7456e5bf43e813096 that makes Glob
return a GlobResult.
Bug: 159845846
Test: glob_test.go
Change-Id: Ia771bdbdf1eb668623c4b3f00bf65e0e1e3a55c0
Rather than having a single storage container, make multiple so that it
is easier to unit test building modules with bazel with MockBazelContext
Test: go test genrule_test
Change-Id: I1da85d28f096d5102ad889b9518fdda6914342b1
This CL contains the converter for libdl_android, a cc_library that
expands into a cc_shared_library and a regular cc_library.
Test: TH
Test: bp2build; bazel test //build/bazel/tests/...
Change-Id: If70641a538211b0d6b2aac0e4d0d06912318304d
Previously, SdkSpec was constructed only from the user string. It didn't
make use of the Config struct where information about the latest stable
SDK version, etc. is recorded. As a result, the build system couldn't
check if the sdk version "current" is referring to the in-development
(i.e. not-yet-frozen) SDK version or the latest stable version.
"current" was always assumed to be in-development (IsPreview() returns
true) even when Platform_sdk_final == true.
As the first step for fixing that, this change requires
android.EarlyModuleContext to be passed when constructing SdkSpec from
the user string.
In the following changes, "current" will be mapped to either
FutureApiLevel (10000) or one of the FinalApiLevels() depending on
whether the platform SDK was finalized or not.
Bug: 175678607
Test: m
Change-Id: Ifea12ebf147ecccf12e7266dd382819806571543
The property init_rc accepts paths and references to other modules;
however, none of that is passed onto make, resulting in errors if a
non-local path is used.
Test: m
Bug: 184567830
Change-Id: Idbbf9de66c5182784d055e1cd64bcef34a7dbd79
go idiom is to define the interface where it is used rather than where
it is defined. This makes it obvious that ParseResult is not a used part
of the interface, removing the need to return an interface{} and cast
results.
Test: go test soong tests
Test: generate & sync bp2build; mixed build libc
Change-Id: I0d8d99c1d8d0125588522cc86502286b83c91bf7
Previously, the private deapexer module type was treated as a prebuilt
as that was the quickest way to implement it. However, there is no
reason why it should be as there is no corresponding source module type
which it might replace.
This change removes the prebuilt support to simplify the module type in
preparation for future work. As part of that it extracts the logic for
retrieving a single path from a PrebuiltSrcsSupplier to ensure
consistent behavior.
Bug: 181267622
Test: m droid
Change-Id: I1b2bb49601c13a3fff99a0026c235eaa70d2e612
Required fixes:
- Set MakeLinkType for libraries, even in mixed build mode.
- Set snapshot header information to empty list, which passes
validation logic for depending modules
Fixing these libraries also requires a Starlark change to
cc_library_static.bzl, which will be submitted separately.
Additionally, this adds better error messaging in the event that
output files are missing from a mixed-build library.
Test: USE_BAZEL_ANALYSIS=1 m libc
Test: USE_BAZEL_ANALYSIS=1 m runtime-module-sdk
Change-Id: Iad2c4d46359986fb0a43263292a15ed45fabbac7
This is a cleanup CL to make the OsTypeList accessor consistent with
ArchTypeList by creating a function that creates a copy of the
underlying slice.
Test: TH
Change-Id: I346c5c3937bbdb8a373e4d7135b896a5274cc1f1
SdkSpec.Version was an int type. Now it becomes ApiLevel type which
is a better abstraction of the version (or api level).
Bug: 1655587
Test: m
Change-Id: I4d67b9b9eae45f653b6af4f5b73da9e091b3dfab
This patch adds a variable to indicate to check if the target has the
flag PRODUCT_SET_DEBUGFS_RESTRICTIONS enabled.
Bug: 184381659
Test: make with/without PRODUCT_SET_DEBUGFS_RESTRICTIONS set
Change-Id: Ic14a3759b155ed4e16048d62fcd990f4ba7c906a
... in preparation for making the handling of sdk versions consistent
across java and cc modules.
Bug: 175678607
Test: m
Change-Id: I598f0454bce9b7320621022115412fbe97403945
Previously, genrules which were used as generated_headers only
propagated the old Soong gen directory as an include path, even if the
genrule was managed by Bazel. With this chance, the gen directory of the
Baze output files are used in mixed-build mode.
Test: USE_BAZEL_ANALYSIS=1 m libc
Test: m libc
Change-Id: I3913c4e5b0354421ba1fe43d1f6ef4d1e729a058
This CL is pretty large, so I recommend starting with reading the newly
added tests for the expected behavior.
This change works in conjunction with the linked CLs in the Gerrit topic.
Those CLs add support for new platform() definitions for OS targets
specified in Soong's arch.go, which are configurable through
Android.bp's `target {}` property. It works similary to previous CLs
adding support for the `arch {}` property.
These configurable props are keyed by the OS: android, linux_bionic,
windows, and so on. They map to `select` statements in label list
attributes, which this CL enables for cc_library_headers' header_libs
and export_header_lib_headers props.
This enables //bionic/libc:libc_headers to be generated correctly, from:
cc_library_headers {
name: "libc_headers",
target: {
android: {
header_libs: ["libc_headers_arch"],
export_header_lib_headers: ["libc_headers_arch"],
},
linux_bionic: {
header_libs: ["libc_headers_arch"],
export_header_lib_headers: ["libc_headers_arch"],
},
},
// omitted props
}
to:
cc_library_headers(
name = "libc_headers",
deps = [] + select({
"//build/bazel/platforms/os:android": [
":libc_headers_arch",
],
"//build/bazel/platforms/os:linux_bionic": [
":libc_headers_arch",
],
"//conditions:default": [],
}),
)
Test: TH
Test: Verify generated //bionic/libc:libc_headers
Fixes: 183597786
Change-Id: I01016cc2cc9a71449f02300d747f01decebf3f6e
This reverts commit 6d15d63556.
Reason for revert: Broke git_sc-mainline-prod on test_suites_x86_64
Fixes: 184305592
Change-Id: I4b2e2675e0dd9e2e84966f545a52f45d5b731bab
Without this fix, mixed builds are silently disabled, as a recent change
disabled mixed builds for all module types which are not listed in this
map. This map should be populated for both bp2build generation and for
mixed builds.
Test: lunch aosp_flame && USE_BAZEL_ANALYSIS=1 m libc
Change-Id: Ib2a3fb2de2e7a5204ef01355522ae569e0424dc7
Adds PrepareForTestWithNeverallowRules to make it easy to test
neverallow rules. Avoid exporting any unnecessary neverallow related
methods from the android package.
Bug: 181070625
Test: m nothing
Change-Id: Idfc6955cb23f1a4d1790be7879388154b03f3980
cc_object crtbrand sets product_variable.platform_sdk_version.asflag
and will not compile correctly within mixed builds without it.
Only handles product_variables that expand product variables.
Bug: 181794963
Test: ~/aosp/build/bazel/scripts/milestone-2/demo.sh full
Change-Id: I293fcb18032aa51f63bb7b3de94abd6d1ec38180
Deprecated the method to try and prevent any other uses being added.
Bug: 183650682
Test: m nothing
Change-Id: Ia6f43851e5a00c9d96af780e3bd21e03175e1a2f
Fixes the few tests that break due to this and which cannot easily be
separated into their own changes.
Bug: 183650682
Test: m nothing
Change-Id: Ia2f31213a1f114a78e66a81d89279ecde9f4c465
A previous change caused the depfile construction to be incorrect.
Test: run m queryview twice, second run is a no-op.
Fixes: 184026544
Change-Id: Ibaaa97d6a09956e1ca9c48643b0ffad75e44f051
* changes:
Make test_for arch variant.
Don't use APEX stubs between internal libs in the same APEX when building test_for modules.
Add FilterListPred.
Don't panic on "go test" invocations from the command line.
This is a step in the right direction to allow generalized specification
of variant information in the form of configuration transitions, such
that not all transitions must be specified manually. This allows for
much more reasonable addition of new variations in mixed builds.
Test: lunch aosp_flame && USE_BAZEL_ANALYSIS=1 m libc
Change-Id: I95898da06af6d0e3e1f7c073aaf8ec0ebe26c951
building test_for modules.
This extends the current approach where test modules always depend on
the platform variants of the APEX libs, and only skips the stubs on
them. It still has the limitation that the internal libs must have the
exact same apex_available lists.
Also some improvement of the test accuracy in TestTestFor.
Test: m libartagent-target
with http://r.android.com/q/topic:libdexfile-noext applied
Bug: 183217299
Change-Id: I2118b8a22c887077867a3ddbbe73437b4a29a6ad
* changes:
Replace ANDROID_SDK_HOME with ANDROID_PREFS_ROOT for metalava
Simplify lint rules using improved RuleBuilder rsp support
Support multiple rsp files in RuleBuilder
Pass rsp files into sbox and rewrapper
Add test for sbox input sandboxing
Support multiple rsp files in REParams
Move response file handling to a separate package
Use an interface instead of a string to retrieve the value for
$(location) or $(locations) expansions in genrules to allow
delaying the evaluation until the RuleBuilderCommand is available.
This allows using helpers like RuleBuilderCommand.PathForInputs
to properly rewrite the values for sandboxing.
Also remove the standalone SboxPathFor* methods that don't operate
on a specific RuleBuilderCommand that are now unnecessary.
Test: genrule_test.go
Change-Id: I8bb2647332ef118204a216cead23d062517e2b8c
The lint rule is manually creating a second rsp file because Ninja
only supports on per rule. Move the support into RuleBuilder so
that it can apply the same rewrites that it does to the primary
one.
Test: TestRuleBuilder_Build
Change-Id: Iec250a2d60e74ccf1b4ad085a960fec6867ea559
The current implementation causes inputs listed in an rsp file used with
sbox to be duplicated 3 times in the build.ninja file; once as a
dependency of the rule, once in the rspfile_content field of the rule
with the paths rewritten to be relative to the sandbox, and once in the
rule to write the sbox manifest. When RBE is enabled it also gets a
fourth copy in the list of files to be treated as inputs by rewrapper.
Reduce this to a single copy by using "$in" for the rspfile_content so
that the files only have to be listed in the input dependencies of the
rule, and then add support to sbox to rewrite the rsp file while copying
it into the sandbox, and pass it to rewrapper as well.
Test: m lint-check
Change-Id: I3f46f61119508d39a8bb231c99fc130153fb6f04
Add a test that was dropped in Ic0db961961b186e4ed9b76246881e3f04971825c.
Test: rule_builder_test.go
Change-Id: Idf136919939ad28eb5260dd8d686abe6948f47c7
rewrapper supports a comma separate list of rsp files, replace
REParams.RSPFile with REParmas.RSPFiles.
Test: remoteexec_test.go
Change-Id: I7850c071c23d368d6fad4480dd527d146c13c6d3
Makes Path.RelativeToTop the source of truth as to what `relative to
top` means.
Uses it in PathRelativeToTop so that it will be tested by the existing
tests that use AssertPathRelativeToTop.
Also adds RelativeToTop() to WritablePaths and Paths.
Bug: 183650682
Test: m droid
Change-Id: I88dc56afd1314e51b4e41795a2448cab4ce8a899
First, the buildDir() method was renamed to getBuildDir() to avoid
clashing with the buildDir field.
Then, a buildDir was added to both `OutputPath` and `InstallPath` but
not to `PhonyPath` as it does not contain any path components. Instead
the `PhonyPath.getBuildDir()` was changed to simply return "".
Bug: 183650682
Test: m droid
Change-Id: I12e1854c829b980c5c01205753c62c00dc0a4774
This change needed to add some additional files to the registered
files for PrepareForTestWithJavaDefaultModules because otherwise they
would fail when "TestAllowNonExistentPaths = false". Those files were
being added by the TestJavaLintRequiresCustomLintFileToExist (albeit in
some cases in different locations to that required by the default
modules but as the files are needed by the modules defined in
PrepareForTestWithJavaDefaultModules they should be defined in it.
A couple of other places also provided some files so moving them into
PrepareForTestWithJavaDefaultModules caused some conflicts which needed
to be resolved.
Bug: 183184375
Test: m nothing
Change-Id: I76ce9f1673c1c1c4000635b76b8377d582224bf1
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
If a genrule depends on a module that is disabled, in this case because
it is a device module in a host-only build, it can cause panics when
getPathsFromModuleDep retrieves a nil Path from the disabled module.
Treat disabled modules as missing dependencies.
Test: TestGenruleAllowMissingDependencies
Change-Id: I3c689c6b5505b21eaf7ae7cb93c00f96f438ac17
This is achieved by writing soong.environment.used in Main() instead of
as a side effect of a singleton. This makes a difference because build
actions are not generated when GENERATE_BAZEL_FILES=true is set,
therefore the side effect did not happen.
Arguably, Main() is made worse by this change, but I don't want to
tackle the problem of readably determining which mode soong_build is
running in in this change.
Test: Presubmits + the additional test.
Change-Id: I66af2429aedf008762173eaaa55b828b4cf4328b
It appears as though this is the first pre-singleton type to actually
be registered with the InitRegistrationContext as it failed due to an
uninitialized map, so this change also fixes that.
Bug: 182885307
Test: m nothing
Change-Id: Ibbf6d0db5f3c2fcc89291a16aa5f16b8b5009bd3
The methods returns a copy of TestingBuildParams with every usage of a
path that is relative to the temporary test build directory with a path
relative to a notional top. Similar to how PathRelativeToTop does.
Bug: 182885307
Test: m nothing
Change-Id: I6ec20fc52ed76748138f0d48b4df80f765dfcfdc
When searching for an TestingBuildParams this change will compare the
supplied path against the value returned by PathRelativeToTop() as well
as the String() and Rel() values. In the event that it cannot find the
file it also formats the available outputs, one per line with both rel
and path relative to top.
Bug: 182885307
Test: m nothing
Change-Id: Icbd37018b9a028abf37e27d1bea12a407316e031
Allows the removal of the provider parameter and makes it easier to add
new functionality to baseTestingComponent.
Bug: 182885307
Test: m nothing
Change-Id: Ie8ac600cbce982f2c5fc24a22968efe0c2a29d0c
The visit() method was dropped in favor of a list() method as the
latter makes it easier to treat fixtureFactory, simpleFixturePreparer
and compositeFixturePreparer as simple collections of already flattened
and deduped *simpleFixturePreparers. That will be used in a follow up
change.
Bug: 183235980
Test: m nothing
Change-Id: Ia41ae9bd4f9c39c85865ba698e0da6be00519caf
The ExtendWithErrorHandler method simply wraps the FixtureErrorHandler
in a FixturePreparer that will set the error handler in the fixture.
Bug: 183235980
Test: m nothing
Change-Id: Icf9a5f62cb532efc120300c2f906cd3397aa6763
The Preparer() method allows for another test to be run using the same
preparers as were used to create the TestResult. That is useful when
testing functionality like the sdk snapshot mechanism that generates an
Android.bp and a set of files that are intended to be reconsumed by
Soong. This method allows the test to process that output to ensure
that it is valid. A follow up change will migrate the CheckSnapshot()
method to use this as part of the migration of the sdk package to the
test fixture model.
Previously, the dedupAndFlattenPreparers() would not construct a list
containing all the preparers passed to it as it was trying to avoid
constructing such a list unless necessary. However, as every usage of
this method now needs to construct such a list that functionality has
been added to it.
Bug: 181070625
Test: m nothing
Change-Id: Iab34e2c861bdfd05c44e982224f70c5abc19e468
Prior to this FixtureFactory was basically a FixturePreparer with the
additional support for buildDirSupplier. This makes that a reality by
moving the functionality of FixtureFactory into FixturePreparer and
making FixtureFactory extend that with buildDirSupplier.
This also deprecates the Extend() method in favour of simply using the
GroupFixturePreparers() method.
Once all usages of buildDir have been removed so the buildDirSupplier
is no longer required then FixtureFactory will be removed altogether.
In the meantime follow up changes will migrate those tests that do not
require a buildDirSupplier to just use FixturePreparers in preparation
for the eventual removal of FixtureFactory.
Bug: 183235980
Test: m nothing
Change-Id: Ibb4e5bfec2f76ee34dd7de6aed6bbbfe27d337b8
PlatformSepolicyVersion and BoardSepolicyVers haven't assigned correctly
so far. Below is the reason why it hasn't been discovered yet.
DeviceConfig.PlatformSepolicyVersion() was added to support mixed
sepolicy build (setting BOARD_SEPOLICY_VERS and building vendor sepolicy
with old plat policy files). Soong compares PlatformSepolicyVersion()
and BoardSepolicyVers(), and used old vendor sources if both are
different. Back then, the only place where such logic played a role was
selinux contexts. Test codes were running as intended: after setting
BOARD_SEPOLICY_VERS the context files were built against old policies.
But there were two mistakes:
1) PlatformSepolicyVersion() was not added to soong_config.mk, so it was
always empty.
2) BOARD_SEPOLICY_VERS was set to default in system/sepolicy/Android.mk,
which was processed after soong_config. So if BOARD_SEPOLICY_VERS was
not set in BoardConfig.mk, BoardSepolicyVers() was empty, not
PLATFORM_SEPOLICY_VERSION.
And there were no issues as Soong only checked equality.
To fix the issue correctly, this commit adds the variable
PlatformSepolicyVersion, and then handles BoardSepolicyVers correctly by
returning PlatformSepolicyVersion if it's empty.
Test: set BOARD_SEPOLICY_VERS and see vendor_file_contexts changes
Change-Id: Ie55827f47d2903e9739eccacc3874d354d5c9f2d
The ExcludeFromApexContentsTag marker interface was added to avoid
every implementation of DepIsInSameApex() from having to deal with the
special tags, like PrebuiltDepTag. Unfortunately, when adding that
not all calls to DepIsInSameApex() were protected which meant that the
BootImageModule, which panics if it doesn't recognize a tag, was
causing failures. This change documents the need and improves the
consistency.
A follow up change will add a test for this.
Bug: 182992071
Test: m nothing
Change-Id: If0bf9a7447ebf7a0bb0c88e91951a7220d4af45c
Allow passing a remoteexec.REParams to RuleBuilder to configure it to
run the rule remotely through RBE. Requires the rule to use
SandboxInputs, which ensures that RuleBuilder is aware of all of the
inputs and outputs of the rule.
Running sbox in RBE initially seems unnecessary, as RBE is already a
good sandbox, but reproxy can execute RBE actions locally when configured
for local execution, local fallback or racing. Using sbox in RBE ensures
that these local actions are also sandboxed, giving consistent results
between directly executed actions, local RBE actions, and remote RBE
actions.
Bug: 182612695
Test: manual
Change-Id: Icf2f24dde8dee833eb680ba22566a8e1c0143b15
Remove the references to the android package in remotexec so that
the android package can reference the remoteexec package. This
will allow RuleBuilder to integrate directly with remoteexec.
Bug: 182612695
Test: m checkbuild
Change-Id: I15be5ef126d8aacbd605518638f341daf6f31bb3
When RuleBuilder.SandboxInputs() is called configure sbox to copy
all the input files into the sandbox directory and then change the
working directory there when running the command.
Copying input files into the sandbox directory gets tricky when
the input file is the output file from another rule, and could
be at an arbitrary, possibly absolute path based on the value
of OUT_DIR. They will need to be copied to a directory in the
sandbox using the path relative to OUT_DIR.
RSP files need special handling, they need to both be copied into
the sandbox as an input, rewritten to contain paths as seen in the
sandbox, and references to them on the command line need to use
sandbox paths.
Bug: 182612695
Test: rule_builder_test.go
Change-Id: Ic0db961961b186e4ed9b76246881e3f04971825c
* changes:
Convert android/ninja_deps_test.go to test fixtures
Add NinjaDeps to TestResult
Convert android/singleton_module_test.go to test fixtures
Convert android/neverallow_test.go to test fixtures
Convert android/singleton_module_test.go to test fixtures
Convert android/variable_test.go to test fixtures
Convert android/soong_config_modules_test.go to test fixtures
Convert android/mutator_test.go to test fixtures
Convert android/deptag_test.go to test fixtures
Adds the AlwaysRequireApexVariantTag interface to enable
ApexInfoMutator to differentiate between a tag that is excluded from
apex contents but still requires an apex variant and a tag that is
excluded from apex contents and does not require an apex variant.
That is needed to support the sdkMemberVersionedDepTag which excludes
the target from being added to the APEX but requires an APEX variant.
A more detailed explanation is in the comments.
The AlwaysRequireApexVariant() method follows the pattern used in
ReplaceSourceWithPrebuilt of having a method that returns a bool to
trigger the behavior and not say ExcludeFromApexContentsTag that simply
relies on the tag implementing an interface to trigger. That is because
the former is more flexible and allows a tag type to parameterize the
behavior if necessary.
The tags that this will exclude from creating an apex variant are:
* PrebuiltDepTag - by the time the apex variant has been created any
preferred prebuilts will have replaced the sources so there is no
need to create an APEX variant if the only dependency path from the
APEX to the prebuilt is via this tag.
* hiddenApiAnnotationsDependencyTag - the target of which is a purely
build time artifect and MUST NEVER end up in the APEX.
It will also stop calling DepIsInSameApex for any dependency created
by the sdkMemberVersionedDepTag. Which will fix the issue reported in
the bug.
Bug: 182992071
Test: m nothing
Change-Id: I9569e488d6446ca45d3ea8f32a9b74524eb865df
Replaces the uses of buildDir in the unit test methods with t.TempDir()
as it just needs a temporary directory.
Bug: 182885307
Test: m nothing
Change-Id: I70452d548eff53c0bccada09f60eba7a615b5371