aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/skyframe
Commit message (Collapse)AuthorAge
* Support nested set serialization.Gravatar tomlu2017-11-27
| | | | PiperOrigin-RevId: 177032673
* Fix bug in SkyQuery's 'rbuildfiles' implementation where we were incorrectly ↵Gravatar nharmata2017-11-27
| | | | | | | | | using FileValue, rather than FileStateValue, nodes as the roots of the rdep traversal. This is incorrect e.g. when a .bzl file is a target of a symlink that is load'd from a BUILD file. RELNOTES: None PiperOrigin-RevId: 177018264
* Add platform data into to the ToolchainContext unconditionally.Gravatar John Cater2017-11-22
| | | | | | | Part of #4128. Change-Id: I1e043e7290912de5b246dbb8748cb2ad865ce38c PiperOrigin-RevId: 176664440
* Remove the hardcoded exclusion of the top-level //experimental directory. ↵Gravatar nharmata2017-11-21
| | | | | | | | | This is only relevant for things like 'bazel build //...' in workspaces that have a top-level //experimental directory. As such, this hardcoded exclusion is unlikely to be desired, especially by bazel users externally. Fixes #3822. RELNOTES: None PiperOrigin-RevId: 176569346
* Added new RuleClass flag to turn off platform support, to stop dependency ↵Gravatar John Cater2017-11-21
| | | | | | | | | cycles when loading platforms. Part of #4128. Change-Id: Ie55a91aaaec15d8eb537f59131fc2e69a8f9c251 PiperOrigin-RevId: 176509311
* Update GlobFunction to check for subdirectories crossing into a local ↵Gravatar John Cater2017-11-20
| | | | | | | | | repository. Part of #4056. Change-Id: I4b8e41660b0a135e23aa572bbfeea27a7cda0581 PiperOrigin-RevId: 176362103
* RELNOTES: --keep_incrementality_data flag allows Bazel servers to be run in ↵Gravatar janakr2017-11-12
| | | | | | | | | | | | | | memory-saving non-incremental mode independent of --batch and --discard_analysis_cache. A command run with --nokeep_incrementality_data will discard data that would be needed for incremental builds. Subsequent commands can be sent to the same server, but they will not get the benefit of incrementality from this command. However, if --keep_incrementality_data is specified on a subsequent command, the commands after that will get the benefits of incrementality. There are two benefits to not being dependent on --batch. First, this allows Bazel servers to be run in extreme memory-saving mode without the startup penalties (JVM startup, JITting) that --batch execution imposes. Second, this allows Bazel developers to inspect the state of a Bazel server after an extreme memory-saving build. In order to avoid discarding data unnecessarily (for instance, on a "bazel info used-heap-size-after-gc" or "bazel dump --skyframe=summary") the actual resetting of the graph is done lazily, right before its use in SequencedSkyframeExecutor#sync. This is morally a partial rollback of https://github.com/bazelbuild/bazel/commit/98cd82cbdcac7c48164a611c5a9aa8fc2f1720ef. For now, our tests specify all of the flags. After this change sticks, I plan to get rid of the --batch flag from these tests, which should allow for some clean-ups. Eventually --batch and --discard_analysis_cache may not imply that we don't keep incremental state: we can require that it be specified explicitly. PiperOrigin-RevId: 175335075
* Replace all usages of Blaze's Preconditions class with guava.Gravatar tomlu2017-11-09
| | | | | | | | Blaze had its own class to avoid GC from varargs array creation for the precondition happy path. Guava now (mostly) implements these, making it unnecessary to maintain our own. This change was almost entirely automated by search-and-replace. A few BUILD files needed fixing up since I removed an export of preconditions from lib:util, which was all done by add_deps. There was one incorrect usage of Preconditions that was caught by error prone (which checks Guava's version of Preconditions) that I had to change manually. PiperOrigin-RevId: 175033526
* Remove least important argument to 5+ arg Preconditions#checkState/checkNotNull.Gravatar tomlu2017-11-08
| | | | | | This change prepares a move to Guava's preconditions. Guava only has vararg-avoiding overloads up to 4 args. PiperOrigin-RevId: 175015502
* Prefer catastrophic action execution exceptions to non-catastrophic ones. ↵Gravatar janakr2017-11-07
| | | | | | | | This is both probably what the user most cares about, and also restores a Skyframe invariant, that as a catastrophic exception bubbles up, it stays catastrophic. There is actually no hard Skyframe requirement for that, so we could consider relaxing it, but I'm willing to keep it for now. PiperOrigin-RevId: 174759976
* Add more assertions about test suite expansion behaviorGravatar Googler2017-11-07
| | | | | | | | | | | Characterizing this correctly this time: Target patterns are evaluated with two different sets of semantics. For determining which targets to build, only test suites in exclusion target patterns are expanded. For determining which tests to run (or determining which targets to build if --build_tests_only is set), test suites in all target patterns are expanded. In each case, test suites are expanded for each target pattern individually, not for the whole set of targets after the list of target patterns is processed. Also update a related code comment. The newer implementation for this logic already has equivalent tests for this behavior, in particular testFilterNegativeTestFromTestSuite and testNegativeTestSuiteExpanded in LoadingPhaseRunnerTest. RELNOTES: None PiperOrigin-RevId: 174756583
* Break dependency on vfs from the interface of syntax and cmdline.Gravatar tomlu2017-11-06
| | | | | | | | These libs are exposed externally, implying that the vfs is also exposed externally. We break out PathFragment from vfs to still use this in their interface. This class is a much smaller dependency than the entire vfs. PiperOrigin-RevId: 174729373
* Don't require --keep_going to discard graph edges. It's unnecessary.Gravatar janakr2017-11-02
| | | | PiperOrigin-RevId: 174202685
* Fix bug where all three implementations of ↵Gravatar nharmata2017-10-31
| | | | | | | | | RecursivePackageProvider#getPackagesUnderDirectory assumed that the given directory needed to be strictly underneath all directories in the given blacklistedSubdirectories set, yet the callsites were calling this method such that the given directory was not-necessarily-strictly underneath the blacklistedSubdirectories. N.B. There is no end-to-end bug in EnvironmentBackedRecursivePackageProvider because TargetPatternFunction's usage of TargetPattern#eval is always with blacklistedSubdirectories=ImmutableSet.of(). Also note that the existing fast-path in GraphBackedRecursivePackageProvider is dead code because the Preconditions check would fail first :( RELNOTES: None PiperOrigin-RevId: 173924216
* Move TransitiveTargetKey to a dedicated top-level classGravatar ulfjack2017-10-30
| | | | PiperOrigin-RevId: 173873310
* Thread FileSystem through to a single Path#delete call site.Gravatar tomlu2017-10-30
| | | | | | This requires a fairly large amount of changes to fundamental objects like BlazeRuntime, Executor, and so on, as well as changing a lot of test code to thread the file system through. I expect future CLs to be much smaller. PiperOrigin-RevId: 173678144
* Rename Label.EXTERNAL_PACKAGE_FILE_NAME to WORKSPACE_FILE_NAMEGravatar ulfjack2017-10-27
| | | | | | | This more clearly indicates what this is. Also change some hard-coded uses to use the constant instead. PiperOrigin-RevId: 173658659
* Allow/require callers of AbstractPackageLoader to set Skylark semantics ↵Gravatar brandjon2017-10-27
| | | | | | | | | | | explicitly Previously the default semantics were used unconditionally. Allowing non-default semantics is a feature. Requiring semantics to be specified explicitly helps to avoid unintentional divergence from the caller's intended semantics. We recently did the same thing for Skylark's Environment.Builder (https://github.com/bazelbuild/bazel/commit/b368b39f8ba1e8e8a67af50e5ade9127b2b149d7). Also pass Skylark semantics through Package.Builder.Helper, so that the extra verification done for shell tests uses the same semantics as the build. RELNOTES: None PiperOrigin-RevId: 173544885
* Reset evaluator eagerly when incremental state changes. And add a regression ↵Gravatar janakr2017-10-24
| | | | | | test to make sure we are using the expected type of node entries when discarding/keeping graph edges. PiperOrigin-RevId: 173131307
* Propagate skylark flags to WORKSPACE and repo rulesGravatar brandjon2017-10-24
| | | | | RELNOTES: Skylark semantics flags now affect WORKSPACE files and repository rules. PiperOrigin-RevId: 173130286
* Automatic code cleanup.Gravatar cushon2017-10-23
| | | | PiperOrigin-RevId: 173054453
* Post non-empty ActionResults for all completed Actions.Gravatar ruperts2017-10-23
| | | | | RELNOTES: None. PiperOrigin-RevId: 172955521
* Don't set globals in environments that aren't readGravatar brandjon2017-10-23
| | | | | | | There are two Environments involved in running an implementation callback for rules/aspects/repository-rules: (1) The static environment of the function's definition, and (2) the caller's dynamic environment. The function will only consult (1), so trying to set anything on (2) is misleading. RELNOTES: None PiperOrigin-RevId: 172929301
* Add tests for ToolchainUtil, and fix an error when there is an error andGravatar John Cater2017-10-23
| | | | | | | | | values are missing while fetching toolchains. Fixes #3928. Change-Id: I4fde784f56daf544ba70c9848e006f1183c20a99 PiperOrigin-RevId: 172922687
* Add ObjectCodecTester, migrating a few tests to use itGravatar michajlo2017-10-20
| | | | | | | | | | | This provides a composition-based alternative to the existing inheritance-based testing style. The inheritance style has been showing its age/has become quite cumbersome when multiple codecs are in the same class or codecs are colocated with their encoded class. This will hopefully get rid of some friction when adding new codecs. RELNOTES: None PiperOrigin-RevId: 172778555
* Internal changeGravatar twerth2017-10-18
| | | | PiperOrigin-RevId: 172569624
* Add memory profiler.Gravatar tomlu2017-10-18
| | | | | | | | | | | This adds two dump command, bazel dump --rules and bazel dump --skylark_memory. dump --rules outputs a summary of the count, action count, and memory consumption of each rule and aspect class. dump --skylark_memory outputs a pprof-compatible file with all Skylark analysis allocations. Users can then use pprof as per normal to analyse their builds. RELNOTES: Add memory profiler. PiperOrigin-RevId: 172558600
* Actions now have the option of returning an ActionResult, containing a ↵Gravatar ruperts2017-10-18
| | | | | | | (possibly empty) set of SpawnResults created during execution of the Action. RELNOTES: None. PiperOrigin-RevId: 172529328
* Fall back on basic StringCodec if FastStringCodec isn't availableGravatar michajlo2017-10-18
| | | | | | | Also adds a method which can be used to tell if this behavior actually applied, for more performance-sensitive users. PiperOrigin-RevId: 172512011
* Properly report errors as errors.Gravatar nharmata2017-10-16
| | | | | RELNOTES: None PiperOrigin-RevId: 172133468
* Fix local repository detection when the repository path is absolute.Gravatar John Cater2017-10-13
| | | | | | | Fixes #3874. Change-Id: Ibbe3ea27b77426f551e2f70f082478edb2234749 PiperOrigin-RevId: 171957230
* Expose ActionLogBufferPathGenerator in SkyframeExecutor.Gravatar janakr2017-10-12
| | | | PiperOrigin-RevId: 171906076
* Small refactoring of AnalysisTestCase to allow alternate SkyframeExecutor ↵Gravatar janakr2017-10-11
| | | | | | implementations. PiperOrigin-RevId: 171730718
* In PerActionFileCache, tolerate requests for Artifacts that are not in the ↵Gravatar janakr2017-10-10
| | | | | | cache if we're doing input discovery: input discovery may find new artifacts we don't yet know about. Similarly, in SingleBuildFileCache, use the Artifact's path if it's available, rather than the poor man's route of the execRoot. PiperOrigin-RevId: 171635892
* Pull clearing of legacy configured target data up to SkyframeExecutor and ↵Gravatar janakr2017-10-10
| | | | | | rename method to better reflect what it is primarily doing. PiperOrigin-RevId: 171621356
* Allow NodeEntry implementations to keep just deps, as opposed to all edges ↵Gravatar janakr2017-10-10
| | | | | | or no edges. Also add option to disable checks in MemoizingEvaluatorTest that don't make sense for implementations that don't keep track of dirty nodes. Also extract RecordingDifferencer to an interface. And add a test for the situation that a node changes during a build that it's not requested, and which fails, necessitating cleanup. PiperOrigin-RevId: 171616817
* Consolidate ObjectCodec<String> creationGravatar michajlo2017-10-09
| | | | | | | | Opens the door to swapping in different implementations without needing to touch a ton of code. RELNOTES: None PiperOrigin-RevId: 171412555
* Move SkylarkSemanticsOptions to the packages/ directory, alongside ↵Gravatar brandjon2017-10-07
| | | | | | | | | SkylarkSemanticsCodec Note that the syntax package and its test package still depend indirectly on the options parser via other Bazel-specific packages. RELNOTES: None PiperOrigin-RevId: 171342823
* PackageLoader.loadPackages() tolerates duplicates in the list of packages to ↵Gravatar carmi2017-10-06
| | | | | | | load. RELNOTES: None PiperOrigin-RevId: 171298089
* Pass SkylarkSemantics through Skyframe instead of the options classGravatar brandjon2017-10-06
| | | | | | | Also remove the use of the @UsesOnlyCoreTypes annotation on SkylarkSemanticsOptions. It was only there to help mark that the options class was safe to put in Skyframe. RELNOTES: None PiperOrigin-RevId: 171248504
* Provide a source exec path -> path mapping in the ArtifactFactory, which is ↵Gravatar janakr2017-10-06
| | | | | | potentially more principled than just accessing the execRoot willy-nilly. PiperOrigin-RevId: 171234480
* Couple of Fileset micro-optimizations:Gravatar kush2017-10-06
| | | | | | | | 1. Prevent a redundant map.get() in SkyframeFilesetManifestAction#establishSkyframeDependencies 2. Make a more memory efficient FilesetEntrykey instead of reusing the LegacySkyKey. RELNOTES: none PiperOrigin-RevId: 171222499
* Fix the strict-ordering of symlinks created with Filesets which was ↵Gravatar kush2017-10-06
| | | | | | | inadvartently lost due to https://github.com/bazelbuild/bazel/commit/d8ba904a3b0598e97601bc670840e39f21799ead RELNOTES: none PiperOrigin-RevId: 171204884
* Don't symlink into the execroot if possible in SymlinkAction: instead, ↵Gravatar janakr2017-10-02
| | | | | | symlink directly to the target artifact. Also offer the option to not provide the package roots to create the execroot: we would like to avoid the execroot if possible. PiperOrigin-RevId: 170515263
* Automatic code cleanup.Gravatar cushon2017-09-29
| | | | PiperOrigin-RevId: 170503143
* Move serialization test utilities from test/ to main/Gravatar brandjon2017-09-29
| | | | | | | | | This is so other packages can depend on them without violating our style guide. (Dependencies on test/ packages should be limited to aggregating test suites.) The target is also renamed from ".../serialization:serialization-test-base" to a new subpackage, ".../serialization/testutils:testutils". RELNOTES: None PiperOrigin-RevId: 170426906
* More narrowly specify SkyframeExecutor#prepareExecution as ↵Gravatar janakr2017-09-28
| | | | | | #detectModifiedOutputFiles and move implementation to SequencedSkyframeExecutor. PiperOrigin-RevId: 170230031
* Mock cc toolchain is registered in module instead of in PlatformOptions.Gravatar cpeyser2017-09-28
| | | | PiperOrigin-RevId: 170200236
* Move ExternalPackageUtil to a new lib.repository package and simplify itGravatar ulfjack2017-09-26
| | | | | | | Move the nested Exception classes to top-level classes, remove unused functionality and move functionality only used in one place to that place. PiperOrigin-RevId: 170041246
* Stop injecting embedded artifacts. They're never used by anyone in Skyframe, ↵Gravatar janakr2017-09-26
| | | | | | and error-checking for their existence is already done by the client. PiperOrigin-RevId: 169966701