aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/java/com/google/devtools/build/lib/analysis
Commit message (Collapse)AuthorAge
* test-wrapper: add empty impl + Bazel flagGravatar Laszlo Csomor2018-08-14
| | | | | | | | | | | | | | | | | | | | | | | This commit adds: - the skeleton implementation of the Windows native test wrapper - a depenency on the native test wrapper from test rules, through the new $test_wrapper rule attribute - the --windows_native_test_wrapper Bazel flag, which is currently a no-op See https://github.com/bazelbuild/bazel/issues/5508 Change-Id: I8df95c8ce8bab53c51c257698ec95416065a836e Closes #5854. Change-Id: I2ffc78bceec5dd867af775b5878f105fa87c3dba PiperOrigin-RevId: 208650699
* Automated rollback of commit 9374ecf94ce44e8bc56e68678cb512abf4cf9ce2.Gravatar felly2018-08-10
| | | | | | | | | | | | | | | | | | | | | | *** Reason for rollback *** Rollforward with deduplication of traversals and regression test. RELNOTES: None *** Original change description *** Automated rollback of commit 39974a43abdd32e3a1acbc7da945b08da9983e4e. *** Reason for rollback *** b/112458627 *** Original change description *** Allow skyframe-aware actions to pass partial results through ActionExecutionContext. Remove FilesetProvider. PiperOrigin-RevId: 208231719
* Automated rollback of commit 39974a43abdd32e3a1acbc7da945b08da9983e4e.Gravatar felly2018-08-10
| | | | | | | | | | | | | *** Reason for rollback *** b/112458627 *** Original change description *** Allow skyframe-aware actions to pass partial results through ActionExecutionContext. Remove FilesetProvider. PiperOrigin-RevId: 208213955
* Batch all DependencyResolver#getTarget calls. This leads to some duplicate ↵Gravatar janakr2018-08-09
| | | | | | iteration, but that should be cheap, while requesting packages sequentially can hurt... PiperOrigin-RevId: 208126130
* Allow skyframe-aware actions to pass partial results through ↵Gravatar felly2018-08-09
| | | | | | | | ActionExecutionContext. Remove FilesetProvider. PiperOrigin-RevId: 208111251
* Improve error messaging for constraints violations.Gravatar gregce2018-08-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1) Break up dense lines with clearer pretty-printing. 2) When a violation happens because of a select(), mention both the target with the select (as before) *and* the dep that the select() chose. 3) Integrate this messaging into --target_environment violations, which currently provide no info about the root cause. Examples: ------------------------------------- select() + compatible_with violation: ------------------------------------- Before: ERROR: /workspace/testapp/BUILD:41:1: in cc_binary rule //testapp:top: the current command-line flags disqualify all supported environments because of incompatible select() paths: environment: //constraints:p removed by: //testapp:midlib (/workspace/testapp/BUILD:28:1) After: ERROR: /workspace/testapp/BUILD:41:1: in cc_binary rule //testapp:top: the current command line flags disqualify all supported environments because of incompatible select() paths: environment: //constraints:p removed by: //testapp:midlib (/workspace/testapp/BUILD:28:1) which has a select() that chooses dep: //testapp:glib which lacks: //constraints:p. ------------------------------------- select() + --target_environment=//constraints:p violation: ------------------------------------- Before: ERROR: This is a restricted-environment build. - //testapp:top does not support required environment //constraints:p After: ERROR: This is a restricted-environment build. //testapp:top does not support: environment: //constraints:p removed by: //testapp:midlib (/workspace/testapp/BUILD:28:1) which has a select() that chooses dep: //testapp:g which lacks: //constraints:p Fixes: #5795 PiperOrigin-RevId: 207910308
* Remove support for explicitly setting java_toolchain.encoding to UTF-8Gravatar cushon2018-08-08
| | | | PiperOrigin-RevId: 207891979
* Remove uses of java_toolchain.encodingGravatar cushon2018-08-07
| | | | PiperOrigin-RevId: 207734653
* Thread a path resolver through target/aspect complete event.Gravatar tomlu2018-08-02
| | | | | | | At the moment, an identity path resolver is passed. This will later be replaced by a contextual path resolver. RELNOTES: None PiperOrigin-RevId: 207138772
* Keep the analysis cache between builds when only trimmed test options change.Gravatar mstaib2018-08-02
| | | | | | | | | | | | | | | | | | | | When --trim_test_configuration is on and the only options which have changed are from the (trimmed) TestOptions (not counting trim_test_configuration itself), preserve the analysis cache rather than dropping it all. This means that as long as no non-test options change, non-test rules will not need to be reanalyzed. This also applies to test rules which were analyzed with this configuration since the last time non-test options changed. For example: --test_arg=A //test (//test and its dependencies are analyzed) --test_arg=B //test (only //test is reanalyzed) --test_arg=A //test (no reanalysis needed) --test_arg=A --define=Test=A //test (full reanalysis) --test_arg=A //test (full reanalysis) RELNOTES: None. PiperOrigin-RevId: 207105915
* Add a flag to evaluate the top level transitions in SkyframeGravatar ulfjack2018-08-02
| | | | | | | | | | | | | | | | | | | | | | | | This adds a new PrepareAnalysisPhaseFunction, which started out as a copy of some existing code from SkyframeExecutor, BuildView, AnalysisPhaseRunner, AnalysisUtils, and ConfigurationResolver, which was then modified to work inside Skyframe. Most of our tests already work with the new code, except for some of the tests related to configuration trimming in combination with dependency cycles. The reason for this is that we can only recover from dependency cycles at the end of a Skyframe invocation, but never inside a Skyframe invocation. The new code therefore cannot return partial results like the old code. This seems to make null builds a bit faster. In my testing, I saw null build times for a single test target go from ~50ms to ~40ms. This is probably due to slightly better caching - it seems that computing the configuration transitions and top-level targets is non-negligible, even if there's only a single top-level configuration for a single top-level target. This might be an even bigger win if there are a lot of top-level targets and configurations. PiperOrigin-RevId: 207083192
* Fix tests to work when the default value of the flag ↵Gravatar dbabkin2018-08-01
| | | | | | | | | --experimental_enable_tools_defaults_package flipped to false RELNOTES:none PiperOrigin-RevId: 206982558
* Refactor setupPackageCache to get all BuildConfiguration.Options references ↵Gravatar juliexxia2018-08-01
| | | | | | | | out of it. Setting up the package cache is necessary for proper loading. In the future, BuildConfiguration.Option options will be targets that need to be loaded in order to be parsed. Thus, we will need to be able to do loading before BuildConfiguration.Options are parsed. PiperOrigin-RevId: 206964473
* Improve artifact->owner label accounting in two ways. First, don't do the ↵Gravatar janakr2018-07-30
| | | | | | full mapping unless requested. This gets rid of any performance issue for the vast majority of builds. Second, if requested, use a custom data structure so that we don't have to create a full HashSet for artifacts whose only owning labels are their own owner labels. PiperOrigin-RevId: 206610370
* Automated rollback of commit 7e87730de985b7099b9b683571d58efdaab70890.Gravatar ccalvarin2018-07-27
| | | | | | | | | | | | | | | | | *** Reason for rollback *** Go back to the default constructor - instead of requiring everywhere to know the correct hash function, we'll have the default rely on global state. It will make transition easier, even if it makes the origin of the hash less obvious. *** Original change description *** Remove default MD5 in most of Bazel's virtual filesystems. This forces the ex-default to be explicit in a lot of tests, but I'd rather that than have the risk of implicit md5-use in production code. To keep this CL smaller, do not remove the default from UnixFS quite yet. RELNOTES: None. PiperOrigin-RevId: 206358838
* Automated rollback of commit db01c6f926bcb4774d901797c59f51dd54c05624.Gravatar janakr2018-07-27
| | | | | | | | | | *** Reason for rollback *** Rolling forward with fixes. *** Original change description *** PiperOrigin-RevId: 206339696
* Add a flag to split test.xml generation into a separate SpawnGravatar ulfjack2018-07-27
| | | | | | | | | | At this time, this is only implemented for the StandaloneTestStrategy. This solves a race condition on Posix-like systems, where we cannot guarantee that the pipes are actually fully flushed to disk when the test process exits, and this can cause the test.xml to be empty, which makes it hard to debug issues. (The test.log files do not show up in normal CI systems, only the test.xml files.) Progress on #4608. PiperOrigin-RevId: 206292179
* Remove default MD5 in most of Bazel's virtual filesystems.Gravatar ccalvarin2018-07-26
| | | | | | | | | This forces the ex-default to be explicit in a lot of tests, but I'd rather that than have the risk of implicit md5-use in production code. To keep this CL smaller, do not remove the default from UnixFS quite yet. RELNOTES: None. PiperOrigin-RevId: 206223521
* PiperOrigin-RevId: 206181674Gravatar shahan2018-07-26
|
* Target pattern eval: use the same number of threads as loadingGravatar ulfjack2018-07-26
| | | | | | | | Instead of using the default thread pool size of 200, use the number set for the loading phase. This is in preparation for interleaving the loading and target pattern eval phases. PiperOrigin-RevId: 206172915
* Automated rollback of commit ce8f52060e2cf1e5a49a522039f0cba2a340f7e3.Gravatar cushon2018-07-25
| | | | PiperOrigin-RevId: 206102499
* Support optional repository verificationGravatar Klaus Aehlig2018-07-25
| | | | | | | | | | | | | | | | Add an option to provide a file with a resolved value, that will be used to verify that the repositories mentioned in this file produce a correct directory tree. RELNOTES: newly added options --experimental_repository_hash_file and --experimental_verify_repository_rules allow to verify for repositories the directory generated against pre-recorded hashes. See documentation for those options. Work towards #5660. Change-Id: I2d8becb188d0fa51e890fb8f6139f321cca14b7b PiperOrigin-RevId: 206016792
* Remove LoadingResultGravatar ulfjack2018-07-25
| | | | | | | | | | | Instead, refactor the code to use TargetPatternPhaseValue exclusively. This removes the need to convert from TargetPatternPhaseValue to LoadingResult, and prepares for interleaving. It also reduces the number of Skyframe calls which may speed up null builds a bit, as a followup for https://github.com/bazelbuild/bazel/commit/1067310e18cb9ac203110726de0be53bdc403cea. PiperOrigin-RevId: 205989338
* Configured targets register created source artifacts with Skyframe.Gravatar shahan2018-07-24
| | | | PiperOrigin-RevId: 205876673
* Move LoadingPhaseCompleteEvent posting to TargetPatternPhaseFunctionGravatar ulfjack2018-07-24
| | | | | | | | | | | Also simplify LoadingPhaseCompleteEvent, and SkyframeExecutor, and remove LoadingCallback, which is unnecessary now that we only have a single implementation (previously LoadingPhaseRunner). This also removes some of the excessive Skyframe calls introduced by https://github.com/bazelbuild/bazel/commit/1067310e18cb9ac203110726de0be53bdc403cea, and prepares for interleaving target pattern eval and loading. PiperOrigin-RevId: 205813197
* Introduce option flag experimental_enable_tools_defaults_package.Gravatar dbabkin2018-07-23
| | | | | | | | Default value is true, and behavior related to //tools/defaults package is not changed. If set it to false, then in-memory Dfaultpacked will not be created. RELNOTES:none PiperOrigin-RevId: 205643628
* Fix TargetCompleteEvent.referencedLocalFilesGravatar ulfjack2018-07-23
| | | | | | | | It was missing the baseline coverage files, if any. This is safe even if unknown commit is rolled back. PiperOrigin-RevId: 205626149
* When applying an aspect to a generated file of a Fileset avoid creating the ↵Gravatar lpino2018-07-18
| | | | | | | | FilesetEntryMap for the aspect's RuleContext. The current logic in createFilesetEntryMap() uses the rule of the RuleContext.Builder to determine whether to create a filesetEntryMap or not, because of this, applying an aspect to a generated file of a fileset (e.g. 'out' attribute of a Fileset) causes createFilesetEntryMap to create the map even though the associated target is, for instance, a generated file. As a consequence, applying any aspect to a generated file of a fileset causes a NullPointerException. PiperOrigin-RevId: 205065778
* For all top-level artifacts, track the labels that own them when that is ↵Gravatar janakr2018-07-13
| | | | | | | | available. The owning labels are the labels of the top-level configured targets that requested this artifact to be built (there may be many such targets). In cases where the artifact is added not through a configured target (build-info artifacts and coverage artifacts), the label of the artifact's owner is used. PiperOrigin-RevId: 204432951
* Automated rollback of commit f4a3dd9b8124dc7b2795f89e6700881b66371e4f.Gravatar lberki2018-07-12
| | | | | | | | | | | | | | | | | | | | *** Reason for rollback *** Breaks //devtools/blaze/integration:{[]_test_test,gdp_validation_test} and at leats //contentads/supermixer/server:supermixer . *** Original change description *** Refactor handling of API generation in JavaPluginInfoProvider Instead of keeping two copies of state for the API-generating and non-API-generating cases, create a 'JavaPluginInfo' abstraction to contain all state for each case, and then keep two copies in the top-level JavaPluginInfoProvider provider. This will make it easier and less error-prone to add additional state to the provider. PiperOrigin-RevId: 204258844
* Move caching to BuildOptions instead of BuildConfigurationValue.Key.Gravatar mjhalupka2018-07-11
| | | | PiperOrigin-RevId: 204154609
* Refactor handling of API generation in JavaPluginInfoProviderGravatar cushon2018-07-11
| | | | | | | | | | | | Instead of keeping two copies of state for the API-generating and non-API-generating cases, create a 'JavaPluginInfo' abstraction to contain all state for each case, and then keep two copies in the top-level JavaPluginInfoProvider provider. This will make it easier and less error-prone to add additional state to the provider. PiperOrigin-RevId: 204151605
* Remove ToolchainContextException and make exception handling more robust.Gravatar John Cater2018-07-10
| | | | | Change-Id: Iefeab0de85541b963c6cc262339e73b79f630f8b PiperOrigin-RevId: 203952823
* Pull up calls to ToolchainContext.resolvedToolchainLabels and finishGravatar John Cater2018-07-09
| | | | | | | ToolchainContext configuration earlier. Change-Id: I034f56a8a181aac19ecb38e51558ccdc6c0c7a6a PiperOrigin-RevId: 203835978
* PiperOrigin-RevId: 203687257Gravatar Googler2018-07-08
|
* Remove support for java_runtime_suiteGravatar cushon2018-07-05
| | | | | RELNOTES: Remove support for java_runtime_suite; use alias() together with select() instead. PiperOrigin-RevId: 203393253
* Create a whitelist for android_library rules with deps but not srcsGravatar cushon2018-07-03
| | | | PiperOrigin-RevId: 203230801
* In SkyframeExecutor#invalidateConfigurationCollection, actually delete the ↵Gravatar janakr2018-07-03
| | | | | | nodes, instead of invalidating them. Invalidating isn't sound, because we're depending on externally injected state to be re-read during evaluation. Also rename the method to resetConfigurationCollectionForTesting since it's only used in tests. PiperOrigin-RevId: 203172895
* Refactor TemplateExpansionAction so that various strategies can be used to ↵Gravatar kush2018-06-29
| | | | | | | | | implement it. Also clarify the behavior of the expand_template API in the presence of multiple-substitutions. RELNOTES: None PiperOrigin-RevId: 202719656
* Deletes AutoCodec.PUBLIC_FIELDS strategy. Superseded by DynamicCodec.Gravatar shahan2018-06-29
| | | | PiperOrigin-RevId: 202704472
* Fix up some tests for Arm64Gravatar Arielle Albon2018-06-28
| | | | | | | | This is the first PR for my Arm64 test cleanup. Closes #5457. PiperOrigin-RevId: 202492291
* Automated refactor of Label.parseAbsolute() to always pass a repository mappingGravatar dannark2018-06-27
| | | | | RELNOTES: None PiperOrigin-RevId: 202360925
* Add convenience methods to check for flag existence and values in command lines.Gravatar twerth2018-06-26
| | | | | RELNOTES: None PiperOrigin-RevId: 202118168
* ToolchainContext directly implements SkylarkValue and SkylarkIndexable.Gravatar John Cater2018-06-22
| | | | | Change-Id: I355b138e143771fd826ab03951df821ea7d58ac5 PiperOrigin-RevId: 201740564
* Expose aspect actions from Skylark.Gravatar tomlu2018-06-22
| | | | | | | | | | | Like with providers, consumers get a merged view of all actions from the merged configured target (all other aspects + the base target). I had to rejig the aspect value / configured aspect to be symmetric with rule configured targets. I do not expect significant memory bloat from this. All lists / maps already existed, only extra fields have been added. RELNOTES: Expose aspect actions provider to Skylark. PiperOrigin-RevId: 201697923
* Remap labels that include a repository name that appear in $(location x).Gravatar dannark2018-06-21
| | | | | RELNOTES: None. PiperOrigin-RevId: 201588988
* Remove all uses of RuleDefinitionEnvironment#getLabel, replacing them with ↵Gravatar janakr2018-06-20
| | | | | | | | | | Label.parseAbsoluteUnchecked. Label already interns all labels, so the additional interning being done in every ConfiguredRuleClass.Builder was pointless memory and CPU. Keeping the RuleDefinitionEnvironment around makes things harder to serialize. Done using IntelliJ structural replace and then a super-painful adding of imports to every file that didn't compile (have to learn a better way to do this). PiperOrigin-RevId: 201427027
* Remove support for --discard_actions_after_execution.Gravatar tomlu2018-06-18
| | | | | | | The memory savings from this flag are not worth the complexity, and it interferes with action restarting. RELNOTES: Remove support for --discard_actions_after_execution. PiperOrigin-RevId: 201077905
* Let ConfiguredRuleClassProvider decide whether to drop the analysis cache.Gravatar mstaib2018-06-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ConfiguredRuleClassProvider can specify a predicate which accepts an OptionsDiff and the new BuildOptions in order to make a decision on whether the given diff requires the analysis cache to be dropped. This predicate is only called if all of the following hold: * there was an old configuration collection (if not, the cache is not dropped because there wasn't one yet) * the old configuration collection is not exactly equal to the new configuration collection (if it is, the cache is not dropped because it definitely hasn't changed) * the old configuration collection has the same number of configurations as the new collection (if not, the cache is always dropped because experimental_multi_cpu has changed, definitely not a flag which should cause old analysis cache to stick around!) If all of these hold, the old target configurations are paired up with the new target configurations by index in the configuration collection, and each pair is diffed. The predicate is called with each diff and the corresponding new configuration's build options. If any of these invocations returns true, the cache is dropped. Otherwise, the cache is kept for the next build. No implementation of this predicate is actually supplied for this change, so the old behavior (always drop the cache if the configuration changes at all) holds. RELNOTES: None. PiperOrigin-RevId: 201050049
* Consider runfiles symlinks when computing Runfiles.getEmptyFilenames().Gravatar Benjamin Peterson2018-06-18
| | | | | | | | | | | | | | Runfiles.getEmptyFilenames() only considered the unconditional and pruning manifest artifacts for empty-file insertion. Actual manifest creation asks the empty files supplier for empty files over symlinks (but not root symlinks!), too. Change-Id: Ice69bbaa9e6169bff7ec5833ee7ef1b73049a4a7 Closes #5334. Change-Id: Ice69bbaa9e6169bff7ec5833ee7ef1b73049a4a7 PiperOrigin-RevId: 201002604