aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/skyframe
Commit message (Collapse)AuthorAge
* Move tests from SkyframeLoadingAndAnalysisTest to LoadingPhaseRunnerTest.Gravatar Ulf Adams2016-02-02
| | | | | | | | This exposes an issue with the new Skyframe-based implementation, which is fixed here as well. -- MOS_MIGRATED_REVID=113556169
* Fix "put the colon here" message for non-default repositories.Gravatar Brian Silverman2016-02-02
| | | | | | | -- Change-Id: I86b90ff6eda6a16c2efeb8fffca301e2594c254e Reviewed-on: https://bazel-review.googlesource.com/#/c/2784/ MOS_MIGRATED_REVID=113529297
* Implement proper error handling for interleaved loading and analysis.Gravatar Ulf Adams2016-02-02
| | | | | | | | Add test coverage by re-running BuildViewTest with the new Skyframe loading phase runner. -- MOS_MIGRATED_REVID=113517509
* Parse the workspace name when a repository is loadedGravatar Kristina Chodorow2016-01-29
| | | | | | | | | Moved RepositoryValue to RepositoryDirectoryValue so that it could be cached (and not re-downloaded) even if the WorkspaceAST caused a Skyframe restart (as mentioned in https://github.com/bazelbuild/bazel/blob/master/src/main/java/com/google/devtools/build/lib/rules/repository/RepositoryDelegatorFunction.java#L130-L133). -- MOS_MIGRATED_REVID=113358489
* Small refactoring of SkyframeBuildView to reduce the diff for the next change.Gravatar Ulf Adams2016-01-29
| | | | | -- MOS_MIGRATED_REVID=113338481
* Parallelize Package retrieval during Sky-query operation. To maintain ↵Gravatar Eric Fellheimer2016-01-29
| | | | | | | type-safety, we now must pass in the exception type of the callback. -- MOS_MIGRATED_REVID=113313312
* Clear up some confusion about glob prefetching (the old comment was wrong). ↵Gravatar Nathan Harmata2016-01-29
| | | | | | | | | Also add some TODOs for potentially improving package loading performance. This CL has no semantic impact. -- MOS_MIGRATED_REVID=113301656
* Refactor DependencyResolver to collect and return loading errors.Gravatar Ulf Adams2016-01-28
| | | | | | | | | This should never be triggered in production, where we always run a loading phase first and only analyze targets that load successfully. I.e., this is just plumbing which will be hooked up in a subsequent change. -- MOS_MIGRATED_REVID=113258593
* Fix: return an error from the analysis phase with keep_going in error cases.Gravatar Ulf Adams2016-01-27
| | | | | | | | | | | - if there are failed top-level aspects - if there are conflicting actions I ended up rewriting how errors are signaled from the SkyframeBuildView. I think this is safe, but please review carefully. -- MOS_MIGRATED_REVID=113150100
* Store data about aspect configurations on Dependencies.Gravatar Michael Staib2016-01-27
| | | | | | | | | | | | | | | | | | | | Dependencies are the data structure which needs to propagate the configuration for each aspect as created by trimConfigurations down to the point where it's actually used. We need this to store different configurations for different aspects in a world where aspects have their own configurations, which may have more fragments than the target they're attached to. That world is on its way. Also in this CL: * Refactor Dependency to be an abstract parent class with separate implementations for Attribute.Transitions and BuildConfigurations, as well as null configurations, to avoid having to check nullness in various places. Users of the API will not see this, but get factory methods instead of constructors. As a consequence of this, refactor Dependency to be its own top-level class instead of a nested class in DependencyResolver. -- MOS_MIGRATED_REVID=113109615
* Move RepositoryName to its own top-level classGravatar Kristina Chodorow2016-01-26
| | | | | | | | | | As it's about to get more important in its own right. The only change that isn't just moving code around is making RepositoryName.validate package-private. -- MOS_MIGRATED_REVID=112956571
* Share some error handling code between aspects and top-level aspects.Gravatar Ulf Adams2016-01-25
| | | | | -- MOS_MIGRATED_REVID=112948493
* Make AspectFunction error handling match TopLevelAspectFunction.Gravatar Ulf Adams2016-01-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also match ConfiguredTargetFunction for target loading. It isn't currently possible to trigger either of these code paths - the loading phase ensures that we never attempt to analyze targets that fail to load - the Skylark import or conversion cannot fail, because Skylark checks during .bzl execution that all referenced symbols are Skylark aspects Therefore, the only way to trigger this would be if there was a native rule requesting a non-existent or broken Skylark aspect for its dependencies, but that is currently not possible - native rules can only request native aspects. However, for interleaved loading and analysis, we need to limit the set of exception classes that can be thrown from AspectFunction - we do that here by changing the constructor of AspectFunctionException to only accept either NoSuchThingException or AspectCreationException. That in turn requires that we re-throw the Skylark import and conversion exceptions as AspectCreationException, which is exactly what TopLevelAspectFunction is already doing, and necessary for correct error handling if we do ever support Skylark aspects in native rules. Alternatively, I could change the code path to crash Bazel, but that seems strictly worse. Even if we can't test this code, it's conceptually the right way to handle these errors. I'll move part of the error handling into loadSkylarkAspect in a subsequent change. -- MOS_MIGRATED_REVID=112938284
* Move analysis root cause tracking to the ConfiguredTargetFunction.Gravatar Ulf Adams2016-01-25
| | | | | | | | | | | | | | | | | | | | | | | | | The main remaining problem with interleaved loading and analysis is error handling. When interleaving, we don't run a real loading phase anymore, and loading errors can occur during the analysis phase, and need to be handled there. The plan is to have ConfiguredTargetFunction throw a ConfiguredValueCreationException with a list of all loading root causes, which requires that we also catch ConfiguredValueCreationException here, which in turn breaks analysis root cause handling, as that is currently relying on Skyframe root cause tracking. Moving analysis root cause handling into CTFunction makes it possible to subsequently also implement loading root cause handling here. This is also necessary if we want to have complete root cause handling in the general case: a target may have any number (and combination) of loading and analysis root causes at the same time. For now, we only pass a single analysis root cause, which mirrors the current Skyframe-based implementation. -- MOS_MIGRATED_REVID=112930871
* Use the existing exception instance, not a new one.Gravatar Ulf Adams2016-01-25
| | | | | | | | | | | | | Note that this can never happen in production - the loading phase ensures that we only attempt to analyze targets that load successfully. That's also why there are no tests for this. This code path will become live in a later change, with corresponding test coverage; the existing tests cover this in principle, we just need to make them run with the reduced loading phase. -- MOS_MIGRATED_REVID=112926211
* Allow an exit code to be specified in the ActionExecutionException when an ↵Gravatar Googler2016-01-25
| | | | | | | | | action fails, and propagate the exit code to BuildFailedException. And update all call sites that copy or wrap ActionExecutionExceptions. -- MOS_MIGRATED_REVID=112811857
* Extract parsing of the WORKSPACE file in two partsGravatar Damien Martin-Guillerez2016-01-22
| | | | | | | | | | | The WORKSPACE file AST is now parsed as a separate SkyFunction and this will be used to have multiple SkyValue for the same WORKSPACE file, splitting the execution of the AST after load statements to enable load statement of external dependencies in the WORKSPACE file. -- MOS_MIGRATED_REVID=112768897
* Properly filter out Aspect attributes when `blaze query` requests ↵Gravatar Dmitry Lomov2016-01-22
| | | | | | | | | --noimplicit_deps and/or --nohost_deps. RELNOTES: --noimplicit_deps and --nohost_deps work correctly for Aspect attributes. -- MOS_MIGRATED_REVID=112724917
* Refactor dependency filtering out of Rule class.Gravatar Dmitry Lomov2016-01-22
| | | | | -- MOS_MIGRATED_REVID=112717648
* Perform package loading in parallel with transitive target visitation. This ↵Gravatar Janak Ramakrishnan2016-01-21
| | | | | | | is a partial rollback of commit f1e257d because it turns out that loading sequentially can be a bottleneck. -- MOS_MIGRATED_REVID=112628616
* Fix a couple of bugs related to error handling for top-level aspects.Gravatar Ulf Adams2016-01-20
| | | | | -- MOS_MIGRATED_REVID=112561390
* Support unreadable filesGravatar Michajlo Matijkiw2016-01-20
| | | | | -- MOS_MIGRATED_REVID=112507181
* Allow opaque OptionsClassProvider to be passed around in BuildDriver#meta et ↵Gravatar Nathan Harmata2016-01-20
| | | | | | | all so that custom implementations can have custom options passed around. -- MOS_MIGRATED_REVID=112502778
* General cleanup for the configured target / aspect creation code.Gravatar Ulf Adams2016-01-19
| | | | | | | | | | | | | | - update some comments - add some comments to make it easier to follow - delete some dead code, in particular the SkyframeDependencyResolver can never be null; remove an non-applicable @Nullable annotation I'm trying to figure out how the error handling code works, in order to add support for interleaved loading+analysis, which requires handling loading errors in this code path. -- MOS_MIGRATED_REVID=112456674
* Disallow loads from external repos in WORKSPACE files. Currently, attempting ↵Gravatar John Field2016-01-18
| | | | | | | | | to do such a load will result in a skyframe circular dependency exception. As a side effect of this change, SkylarkImportFailedExceptions thrown by SkylarkImportLookupFunction are now caught by PackageFunction and wrapped and rethrown as a PackageFunctionException. Previously, the first exception wasn't caught, generating an uncaught exception error at top level. -- MOS_MIGRATED_REVID=112328755
* Refactor action output dumping to go through a single method.Gravatar Ulf Adams2016-01-15
| | | | | | | | | | | | | This is in preparation for moving the output dumping to the Reporter for two reasons: - we're currently relying on there being a Reporter which locks on itself; i.e., this code is tightly coupled with the Reporter code - the current Blaze output is confusing; we first print an info event, then the actual output, and then an error event - putting the Reporter in control allows us to fix that -- MOS_MIGRATED_REVID=112240684
* Display parsing errors for WORKSPACE filesGravatar Kristina Chodorow2016-01-15
| | | | | | | | | | | | | Previously, for some types of errors, you'd just see "WORKSPACE file could not be parsed" if there was a syntax error (instead of what the syntax error was). Change-Id: Ia278cf23b79f8daba02917cdfb4cc515a87080b1 -- Change-Id: Ia278cf23b79f8daba02917cdfb4cc515a87080b1 Reviewed-on: https://github.com/bazelbuild/bazel/pull/774 MOS_MIGRATED_REVID=112190322
* Add a few other Label.resolveRepositoryRelative() calls to make select() ↵Gravatar Lukacs Berki2016-01-15
| | | | | | | | | | | statements work in remote repositories. This work is somewhat sisyphean; the principled thing to do would be to just do this resolution when labels are parsed. Fixes #783. -- MOS_MIGRATED_REVID=112137996
* Remove some dead code.Gravatar Ulf Adams2016-01-14
| | | | | | | | | | | | The ConfiguredTargetFunction can only throw a NoSuch{Target,Package}Exception if it's run for a non-existent target. However, it will never request a CT for a non-existent target: all labels are run through DependencyResolver in order to determine the configuration transition, which requires loading the target. If it doesn't exist, the label is never returned from the DependencyResolver, and errors are swallowed (we rely on the loading phase to report the error). -- MOS_MIGRATED_REVID=112127012
* Use AutoProfiler in SkyQueryEnvironment#init. Also augment the ↵Gravatar Nathan Harmata2016-01-14
| | | | | | | WalkableGraphFactory interface with a hook to inform the factory when the WalkableGraph is done being used. -- MOS_MIGRATED_REVID=112074284
* Store excluded subdirectories as PathFragment instead of String inside ↵Gravatar Janak Ramakrishnan2016-01-14
| | | | | | | | | TargetPatternKey, since that is what is needed by callers. Also, since the PathFragments come from packages, they are guaranteed to be well-formed, so the checks we were doing were unnecessary. -- MOS_MIGRATED_REVID=112059930
* Inside findTargetsBeneathDirectory(), invoke the callback with all targets ↵Gravatar Eric Fellheimer2016-01-11
| | | | | | | from the current package batch. -- MOS_MIGRATED_REVID=111858978
* Add the ability to customize the bazel client's exit code used when the ↵Gravatar Nathan Harmata2016-01-08
| | | | | | | bazel server exits abruptly. -- MOS_MIGRATED_REVID=111641619
* Stream TargetPattern#eval implementations' results to a callback rather than ↵Gravatar Janak Ramakrishnan2016-01-07
| | | | | | | | | returning a ResolvedTargets set. This is the second step in a series to allow processing large sets of targets in query target patterns via streaming batches rather than all at once. This should also be a functional no-op. -- MOS_MIGRATED_REVID=111611858
* Split PrepareDepsOfTargetsUnderDirectory into two parts, one which does the ↵Gravatar Janak Ramakrishnan2016-01-07
| | | | | | | directory traversal and package loading, and the other which requests deps on all the transitive targets. We need values from the first half, but the second half can fail to evaluate because of a target cycle. By splitting them, we ensure that there will be values in the graph, so we can get the targets below a directory even if there are cycles present. -- MOS_MIGRATED_REVID=111609889
* Stream results of targets below directory to a callback rather than ↵Gravatar Janak Ramakrishnan2016-01-07
| | | | | | | | | returning a ResolvedTargets set. This is the first step in a series to allow processing large sets of targets in query target patterns via streaming batches rather than all at once. This should be a functional no-op. -- MOS_MIGRATED_REVID=111609309
* In SkyQueryEnvironment, don't silently give up when there's a cycle in the ↵Gravatar Janak Ramakrishnan2016-01-07
| | | | | | | graph. We can compute the universe target patterns outside of skyframe, which is the only reason we need the value we were requesting. Giving up was preventing us from evaluating "..." patterns even if the "..." pattern didn't contain any cycles itself. -- MOS_MIGRATED_REVID=111605976
* Stop parsing the WORKSPACE file when a parse error is detectedGravatar Kristina Chodorow2016-01-07
| | | | | | | | | | Parsing was continuing and tried to load skylark extensions even though an error was present in the WORKSPACE file. Fixes #724 -- MOS_MIGRATED_REVID=111534382
* Add bulk package lookup for use during target pattern resolution.Gravatar Eric Fellheimer2016-01-04
| | | | | -- MOS_MIGRATED_REVID=111130363
* Allow Skylark rules and aspects to contribute to output groups.Gravatar Dmitry Lomov2015-12-28
| | | | | -- MOS_MIGRATED_REVID=110840166
* Use batch lookups in graph-backed recursive provider for greater efficiency.Gravatar Eric Fellheimer2015-12-28
| | | | | -- MOS_MIGRATED_REVID=110797095
* Enable label-based Skylark loading. In particular, such labels may reference ↵Gravatar John Field2015-12-22
| | | | | | | | | | | | | | | | | | | files in external repositories. In addition: - Cleaned up and refactored some tests to reflect the new loading behavior. Deferred to future CLs: - Updating Bazel Skylark documentation to reflect the new load form. - Enabling command-line loading of Aspects via labels. RELNOTES: Skylark load statements may now reference .bzl files via build labels, in addition to paths. In particular, such labels can be used to reference Skylark files in external repositories; e.g., load("@my_external_repo//some_pkg:some_file.bzl", ...). Path-based loads are now deprecated and may be disabled in the future. Caveats: Skylark files currently do not respect package visibility; i.e., all Skylark files are effectively public. Also, loads may not reference the special //external package. -- MOS_MIGRATED_REVID=110786452
* Open source LoadingPhaseRunnerTest and its Skyframe companion.Gravatar Ulf Adams2015-12-21
| | | | | | | | | | I had to make a small change to ExternalFilesHelper. The Bazel test setup creates a remote repository for the tools, so we always have external files, incl. during loading. However, some of the tests don't setup an output directory, but instead pass null, which would lead to a crash. -- MOS_MIGRATED_REVID=110669993
* Implement aspect attributes and expose them to aspect implementation function.Gravatar Dmitry Lomov2015-12-16
| | | | | -- MOS_MIGRATED_REVID=110356954
* Only depend on the WORKSPACE file for external files that are under the ↵Gravatar Lukacs Berki2015-12-16
| | | | | | | | | | | | | | | external/ directory, i.e. were created by Bazel. This avoids a cycle that arose when a file is load()ed from the WORKSPACE file that is reached through a symlink to an external directory: * The WORKSPACE file depends on the package lookup node of the .bzl file * The package lookup node (transitively) depends on wherever the symlink points * The target of the symlink is an external file and as such, it depends on the WORKSPACE file This will probably be, erm, interesting to solve when we get as far as to load stuff from external repositories in the WORKSPACE file, but we are just not there yet. -- MOS_MIGRATED_REVID=110344658
* Clean up the configuration-related code paths a bit.Gravatar Ulf Adams2015-12-11
| | | | | | | | | - If we have a class object available, we can use .cast(Object) - Only store the required options objects in CppConfigurationParameters rather than keeping the entire BuildOptions -- MOS_MIGRATED_REVID=109981236
* Use Bazel Preconditions variant which avoids varargs array creationGravatar Mark Schaller2015-12-10
| | | | | | | Reduces garbage. -- MOS_MIGRATED_REVID=109914243
* Shuffle around all the constants related to the name of the //external ↵Gravatar Lukacs Berki2015-12-10
| | | | | | | | | package and the prefix of external packages in the execroot. This is in preparation for renaming that path segment from "external" to "bazel-external" so that we can provide a symlink to it from the source tree so that the source tree looks like the execroot. -- MOS_MIGRATED_REVID=109882753
* Now that external files are not always treated as immutable, eliminate the ↵Gravatar Lukacs Berki2015-12-10
| | | | | | | "overlaid BUILD files" hack in RepositoryValue. -- MOS_MIGRATED_REVID=109877252
* Refactor external repository support significantly to solve a number of issues.Gravatar Lukacs Berki2015-12-09
| | | | | | | | | | | | | | | In particular: - Separate the implementation of maven_server into a RepositoryFunction and one that creates the MavenServerValue (ideally, maven_server wouldn't exist but we'll have to make to for the time being) - Refactor the logic of determining whether an external repository needs to be re-fetched to RepositoryDelegatorFunction - Make RepositoryFunctions not be SkyFunctions anymore (they are called from RepositoryDelegatorFunction, though, who *is* a SkyFunction) - Add a Skyframe dirtiness checker that makes --nofetch RepositoryValues not be cached - Add a bunch of test cases and javadoc There is only one wart that I know of that remains: changes to BUILD files of new_* repository rules that weren't refetched when their RepositoryValue was initiall created on server restart won't take effect. This is because we don't add those BUILD files to the created RepositoryValue. This will fix itself once the ExternalFilesHelper refactoring is submitted. -- MOS_MIGRATED_REVID=109768345