aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/java/com/google/devtools/build/lib/analysis/util
Commit message (Collapse)AuthorAge
* Fix broken tests.Gravatar Marian Lobur2015-09-02
| | | | | -- MOS_MIGRATED_REVID=102134151
* Aspects can get information from their base rule.Gravatar Marian Lobur2015-09-02
| | | | | -- MOS_MIGRATED_REVID=102126786
* Create baseline coverage actions for local sources only and aggregate.Gravatar Ulf Adams2015-08-31
| | | | | | | | | | | | | | | | We no longer generate baseline coverage for all transitive source files in every target; instead, we generate baseline coverage for the files in the current target and collect all of them transitively. That means much smaller but more baseline coverage files; the total content is smaller if you were providing more than one target with overlapping transitive closures on the command line. In addition, we now collect baseline coverage for all targets in the transitive closure of the top-level targets. Previously, if you only passed test targets, you would not get any baseline coverage. -- MOS_MIGRATED_REVID=101929897
* Drop the baseline artifact output group.Gravatar Ulf Adams2015-08-31
| | | | | | | | | | The baseline artifacts are part of the instrumented files provider now, and are strongly tied to the collect_code_coverage flag. It seems to be simpler to collect them explicitly in the BuildView (which already collects them for post-processing), than to rely on the output group selection. -- MOS_MIGRATED_REVID=101926341
* Move PackageIdentifier to cmdlineGravatar Kristina Chodorow2015-08-31
| | | | | | | | This is necessary to have TargetResolver depend on it without making it depend on the packages target. First step of #389. -- MOS_MIGRATED_REVID=101790345
* Implement the core structure for dynamic configurations.Gravatar Greg Estren2015-08-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a big change, so let me walk you through the key pieces: 1) This cl provides an alternative mechanism for creating configurations and doing configuration transitions that's "dynamic" in that the configurations can be created on the fly and the transitions are arbitrary mappings from BuildOptions --> BuildOptions that can also be created on the fly. It also integrates this with ConfiguredTargetFunction, so the configured target graph automatically uses this framework. 2) It does *not* replace old-style (which we'll call "static") configurations. For a number of important reasons: It's not yet at feature parity (particularly: no LIPO). It's not remotely tested across real projects enough to have confidence that it's battle-ready. It doesn't yet handle certain "special" functions like BuildConfiguration.prepareToBuild() and BuildConfiguration.getRoots(). It still relies on the old static transition logic to determine what transitions to apply (eventually we'll distribute that logic out, but that's too much for a single cl). We need the option to toggle it on and off until we have enough confidence in it. So with this cl, builds can be done in either mode. 3) The new flag --experimental_dynamic_configs toggles use of dynamic configurations. 4) Dynamic configurations are created with the Skyframe function BuildConfigurationFunction (this was already created in an earlier change). This consumes a BuildOptions and a set of configuration fragments to produce a BuildConfiguration. 5) Dynamic transitions are instances of the new class PatchTransition, which simply maps an input BuildOptions to an output BuildOptions. 6) Since static and dynamic configurations have to co-exist (for now), this cl tries hard to keep today's transition logic defined in a single place (vs. forking a dedicated copy for each configuration style). This is done via the new interface BuildConfiguration.TransitionApplier. BuildConfiguration.evaluateTransition is modified to feed its transition logic into TransitionApplier's common API. Both dynamic and static configurations have their own implementations that "do the right thing" with the results. 7) The transition applier for dynamic configurations basically stores the Transition, then allows DependencyResolver (which calls BuildConfiguration.evaluateTransition) to return Dependency instances containing that Transition (vs. a BuildConfiguration, which they traditionally contain). 7.5) An earlier variation of the dynamic transition applier retained BuildOptions (e.g. when it got a Transition it immediately applied it to get its output BuildOptions, then stored that). This had the advantage of making composing of transitions easier, especially within BuildConfiguration.evaluateTransition (which can theoretically apply multiple transitions to the input configuration). But it turns out that applying transitions has a cost, and it's simply more performant to pass them through until they're really needed. 8) In dynamic configuration mode, after ConfiguredTargetFunction gets its deps (e.g. an <Attribute, Dependency> multimap), it "trims" the configurations for its dependencies by a) only including config fragments required by the deps' subtrees and b) applying the transitions that came from 7). This all happens in the new method ConfiguredTargetFunction.trimConfigurations. 9) trimConfigurations is heavily performance-optimized based on a lot of experience running this through a large project within Google. As it turns out, the cost of host transitions can be atrocious (because there are a lot of them). Also, BuildOptions.clone() is expensive. And just creating BuildConfiguration SkyKeys also has a cost (largely because of BuildOptions cloning), so that shouldn't be done except when really necessary. My experience with this convinced me it's worth making this method complicated for the sake of making it fast. Since it basically visits every edge in the configured target graph (at least), it really needs to be slick. 10) Since host transitions in particular are problematic w.r.t. speed, I compute the host *once* in ConfigurationCollectionFunction.getHostConfiguration() and expose that reference to ConfiguredTargetFunction and other Skyframe functions. This limits recomputation to just when the fragments are trimmed. 11) Since options cloning is expensive, I'm doing something scary: exposing a BuildConfiguration.getOptions() method that returns a direct reference. Since BuildOptions is mutable, this is dangerous in the wrong hands. I can experiment with going back to cloning (with the caching of host transitions it may not matter as much), but we may ultimately have to put up with this risk for the sake of performant analysis time. What would be *really* awesome would be to make BuildOptions immutable. But that's not going to happen in this cl. So in short, the key abstractions in this cl are: - PatchTransition - BuildConfiguration.TransitionApplier - ConfiguredTargetFunction.trimConfigurations The current implementation imposes no analysis time penalty -- MOS_MIGRATED_REVID=101474620
* A prototype implementation of top-level aspects.Gravatar Dmitry Lomov2015-08-20
| | | | | -- MOS_MIGRATED_REVID=101033236
* Add test methods to check BuildConfiguration and ConfiguredTarget equality ↵Gravatar Greg Estren2015-08-04
| | | | | | | | | | | | | | | checking that are compatible with upcoming dynamic configurations (https://docs.google.com/document/d/1uoU8t7loTOu6uyzez-ilhcYgEXg4xjViJu0aqrf69TY/edit#heading=h.xsc8wmorka3u). With today's configuration machinery, configuration equality means reference equality. With dynamic configurations, that won't necessarily be the case. This is primarily for two reasons: 1) Fragment-limited configurations means that a target's configuration only includes fragments needed by the target and its transitive closure. So if a java_library depends on a cc_library with the same configuration, the cc_library's instance won't contain the JavaConfiguration fragment. 2) The (upcoming) first pass of dynamic configurations uses old-style configurations for top-level targets, and dynamic configs for everything underneath. This can impact test calls that request a configured target both directly and as a dependency of another target. This distinction will eventually go away, but not yet. Configurations that share the same options and fragments will continue to be reference-equal because of Skyframe caching. -- MOS_MIGRATED_REVID=99610132
* Remove more static configuration transitions from tests, as prep work for Gravatar Greg Estren2015-08-04
| | | | | | | []. -- MOS_MIGRATED_REVID=99592972
* Build a symlink tree for Android native library symlinks so that libraries ↵Gravatar Lukacs Berki2015-08-04
| | | | | | | | | from previous builds with a different CPU do not end up in the APK. Fixes #344. -- MOS_MIGRATED_REVID=99550457
* Allow modules to specify additional nodes in the graph to be invalidated and ↵Gravatar Janak Ramakrishnan2015-07-29
| | | | | | | | | | | use this functionality to properly invalidate http download nodes if the downloaded zip file doesn't match the specified hash. This still means that the actual files downloaded may not match, but checking all such files may be too expensive. This helps with #336 but before that issue can be closed all remote repositories (git, etc.), should have similar functionality added. -- MOS_MIGRATED_REVID=99317085
* Description redacted.Gravatar Laszlo Csomor2015-07-27
| | | | | -- MOS_MIGRATED_REVID=99181437
* Added an additional test for empty actions in Skylark.Gravatar Florian Weikert2015-07-20
| | | | | | | Currently, the best (and only?) way to access an empty action inside a test is via an extra action and an action listener. -- MOS_MIGRATED_REVID=98628097
* Remove two methods from FoundationTestCase.Gravatar Ulf Adams2015-07-17
| | | | | | | | One of them moves up to BuildViewTestCase, the other is done as a static import where needed. -- MOS_MIGRATED_REVID=98484132
* Make globs work in remote repositories.Gravatar Lukacs Berki2015-07-08
| | | | | | | | | | | This involved quite a few changes, mainly changing a bunch of places where we refer to packages by a PathFragment to PackageIdentifier. The only wart is the code in PathPackageLocator: ideally, it would just call into PackageLookupFunction. Unfortunately, it is (through globbing and Parser.include) called from within a Skyframe function, and we don't want to have two eval() calls going on at the same time, so we cannot use that. There is a potential correctness issue there: PathPackageLocator now assumes where external repositories are put and assumes that they are there when it gets control, but my understanding is that the associated RepositoryValue is always evaluated before, so it works out okay. -- MOS_MIGRATED_REVID=97751539
* Rollback of accidentally submitted change.Gravatar Lukacs Berki2015-07-07
| | | | | -- MOS_MIGRATED_REVID=97648982
* Make globs work in remote repositories.Gravatar Lukacs Berki2015-07-07
| | | | | | | | | | | This involved quite a few changes, mainly changing a bunch of places where we refer to packages by a PathFragment to PackageIdentifier. The only wart is the code in PathPackageLocator: ideally, it would just call into PackageLookupFunction. Unfortunately, it is (through globbing and Parser.include) called from within a Skyframe function, and we don't want to have two eval() calls going on at the same time, so we cannot use that. There is a potential correctness issue there: PathPackageLocator now assumes where external repositories are put and assumes that they are there when it gets control, but my understanding is that the associated RepositoryValue is always evaluated before, so it works out okay. -- MOS_MIGRATED_REVID=97647787
* Eliminate BuildConfiguration.getShortName().Gravatar Lukacs Berki2015-06-29
| | | | | | | This was only used in error reporting, and the interface of BuildConfiguration could use some more simplicity. The comment on BuildConfiguration.getShortName() was confusing: that field is *not* actually used to compute the output directory name, which took me a few minutes to realize. -- MOS_MIGRATED_REVID=97128287
* Migrate C++ link action .params files to the Blaze-standard ↵Gravatar Eric Fellheimer2015-06-15
| | | | | | | | | | | ParameterFileWriteAction. Performance changes: - output files of actions require an extra system call + incremental builds no longer require re-writing the .param file (typically) -- MOS_MIGRATED_REVID=95842983
* Description redacted.Gravatar Rumou Duan2015-06-05
| | | | | -- MOS_MIGRATED_REVID=95135804
* Add a hidden flag which allows us to set the size of the legacy globbing ↵Gravatar Eric Fellheimer2015-05-22
| | | | | | | thread pool. -- MOS_MIGRATED_REVID=94236393
* Adds a provider that exports Java source information. Adds some testing ↵Gravatar Googler2015-05-15
| | | | | | | support for Aspects. -- MOS_MIGRATED_REVID=93547419
* We are trying to merge same copies of the aspect, when target is declared in ↵Gravatar Marian Lobur2015-05-15
| | | | | | | different attributes, to which we have attached aspect. -- MOS_MIGRATED_REVID=93412457
* Open source some packages tests.Gravatar Ulf Adams2015-05-04
| | | | | -- MOS_MIGRATED_REVID=92727637
* Clean up analysis error reporting a bit:Gravatar Janak Ramakrishnan2015-04-28
| | | | | | | | | 1. Make --analysis_warnings_as_errors a no-op. 2. Stop doing a sanity check that we didn't succeed in analysis even with errors emitted. 3. As a result, emit an error about shared actions to the proper listener. -- MOS_MIGRATED_REVID=92262247
* Inline FoundationTestCase.scratchFile.Gravatar Ulf Adams2015-04-27
| | | | | -- MOS_MIGRATED_REVID=92128998
* Open source the aspects-related tests.Gravatar Ulf Adams2015-04-24
| | | | | -- MOS_MIGRATED_REVID=91907246
* Simplify the createConfiguration method in SkyframeExecutor.Gravatar Ulf Adams2015-04-23
| | | | | | | | | Instead of passing BuildConfigurationKey instances around, just pass in the little data we actually need. This allows removing the BuildConfigurationKey class. -- MOS_MIGRATED_REVID=91865340
* Enables BlazeModule to return multiple ActionContextProviders and ↵Gravatar Googler2015-04-23
| | | | | | | ActionContextConsumers. -- MOS_MIGRATED_REVID=91827715
* Pass in the test environment using ↵Gravatar Lukacs Berki2015-04-20
| | | | | | | | | | | BuildConfiguration.Options.testEnvironment instead of special-casing it in a large number of classes. The variables in the client environment are read in BlazeRuntime#beforeCommand() now. Note that this entails a slight loss of caching: before, "--test_env=a=A,b=B" and "--test_env=b=B,a=A" were equivalent, now they are not, since instead of comparing Map<String, String>, List<Map.Entry<String,String>> instances are compared. -- MOS_MIGRATED_REVID=91570828
* A minor refactoring of BlazeRuntime.Gravatar Lukacs Berki2015-04-17
| | | | | -- MOS_MIGRATED_REVID=91405317
* Open source the configuration tests.Gravatar Ulf Adams2015-04-17
| | | | | | | | | | | | | | | | | | - update the MOCK_CROSSTOOL to provide more stuff needed by tests - add a THIS_IS_BAZEL constant to allow disabling individual test cases - disable some tests in Bazel The disabled tests are mainly due to differences in the test setup - making the test setups more similar will largely fix that. I think we'll make some changes to our internal setup, too, not just the external one. For example, the use of 'k8' and 'piii' to refer to 'x86_64' and 'x86' seems archaic. I decided to leave the dependency on the C++ and Java configurations rather than rewriting the tests to use mock configurations. That would be nicer, but also requires significantly more work. -- MOS_MIGRATED_REVID=91399406
* Remove the full client environment from BuildConfiguration in favor of ↵Gravatar Lukacs Berki2015-04-17
| | | | | | | computing the test environment as early as possible, and passing that along. -- MOS_MIGRATED_REVID=91388451
* Actually run the actions tests in Bazel.Gravatar Ulf Adams2015-04-16
| | | | | | | This requires writing a workspace file for the JDK. -- MOS_MIGRATED_REVID=91287178
* Simplify BuildConfigurationTest and ConfigurationTestCase.Gravatar Ulf Adams2015-04-16
| | | | | -- MOS_MIGRATED_REVID=91286405
* Move test cases from BuildConfigurationTest to more specific test classes.Gravatar Ulf Adams2015-04-16
| | | | | -- MOS_MIGRATED_REVID=91284411
* Inline TestConstants.TEST_WORKSPACE_DIRECTORY.Gravatar Ulf Adams2015-04-14
| | | | | -- MOS_MIGRATED_REVID=90984191
* Description redacted.Gravatar Lukacs Berki2015-03-27
| | | | | -- MOS_MIGRATED_REVID=89680998
* Split up the DefaultsPackageTest into C++ and Java parts. Move some tests outGravatar Ulf Adams2015-03-20
| | | | | | | of BuildConfigurationTest into a new test class. -- MOS_MIGRATED_REVID=89113080
* Open source ConfigurationTestCase.Gravatar Ulf Adams2015-03-20
| | | | | -- MOS_MIGRATED_REVID=88944458
* add OutputGroupProvider.DEFAULT_GROUPS for commonly built groupsGravatar Michajlo Matijkiw2015-03-18
| | | | | | | | | unit tests and main code have fallen out of sync a few times, so consolidating the defaults here to make mistakes harder later on. one could argue this also gives a little better mental locality. -- MOS_MIGRATED_REVID=88921641
* Move some test helper classes into /util packages and open source them.Gravatar Ulf Adams2015-03-16
| | | | | | | Specifically, move AnalysisTestCase and SkyframeExecutorTestUtil. -- MOS_MIGRATED_REVID=88715957
* Some more cleanup.Gravatar Ulf Adams2015-03-10
| | | | | -- MOS_MIGRATED_REVID=87942730
* Inline a couple of methods from FoundationTestCase. Having these convenienceGravatar Ulf Adams2015-03-05
| | | | | | | | methods available doesn't seem to carry its weight, and this makes it easier for us to migrate to JUnit 4. -- MOS_MIGRATED_REVID=87597162
* Rename TopLevelArtifactProvider to OutputGroupProvider.Gravatar Lukacs Berki2015-03-05
| | | | | -- MOS_MIGRATED_REVID=87596401
* Description redacted.Gravatar Manuel Klimek2015-03-05
| | | | | -- MOS_MIGRATED_REVID=87594852
* Move BuildViewTestCase to the lib.analysis.util package.Gravatar Ulf Adams2015-03-05
| | | | | -- MOS_MIGRATED_REVID=87345558
* fix bug in test-specific top-level artifact helper behaviorGravatar Michajlo Matijkiw2015-02-26
| | | | | | | | | | | A recent change resulted in TopLevelArtifactHelper.getTopLevelArtifacts() returning an empty result when passed TopLevelArtifactContext.DEFAULT. This only happens in tests and wasn't caught because tests were never fully checking the results. Update MultiGroupForgeResourceAccountantTest to better consider/expose this failure and fixed. -- MOS_MIGRATED_REVID=87254923
* Open-source BuildViewTestCase and the infrastructure required by it, as well asGravatar Ulf Adams2015-02-25
the tests under analysis/actions. They don't run yet, because the mock client setup is still missing. -- MOS_MIGRATED_REVID=87149625