aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/skyframe/ActionMetadataHandler.java
Commit message (Collapse)AuthorAge
* Make Metadata an interface for FileArtifactValueGravatar ulfjack2017-06-26
| | | | | | | | | | Replace all previous uses of Metadata with FileArtifactValue (or a simple inner class in the case of ActionCacheChecker.CONSTANT_METADATA). Care was taken to make the equals method obey the equals contract, even in the presence of multiple implementations. PiperOrigin-RevId: 160115080
* ActionMetadataHandler: proper metadata even for the volatile workspace statusGravatar ulfjack2017-06-21
| | | | | | | | | | | | | | This is part of cleaning up the ActionInputFileCache / MetadataHandler split. Both classes generally store and return identical information, except the MetadataHandler lies about constant metadata artifacts. Instead of lying here, update the ActionCacheChecker, which is the only place where we actually want constant metadata. Additionally, remove getMetadataMaybe; again, the only caller that needs special casing is the ActionCacheChecker, so we move the special casing there instead of having it in the MetadataHandler. PiperOrigin-RevId: 159665345
* Move the chmod call from SkyframeActionExecutor to ActionMetadataHandlerGravatar ulfjack2017-04-07
| | | | | | | | | | | | | | | | | | | This relies on the explicit state transition in MetadataHandler to decide whether the chmod call is necessary (we must never call chmod if the action was not executed). This is a prerequisite for #1525. If we want to use ctime for detecting file content changes (which is more reliable than just mtime), then we must call chmod before stat, since chmod affects ctime. Before this change, we were caching the stat in ActionMetadataHandler, but calling chmod after action execution in SkyframeActionExecutor, which is the wrong order of calls. However, we must be able to stat in ActionMetadataHandler for cases where a single action runs multiple Spawns where one spawn's output is a subsequent spawn's input. Remove MetadataHandler.isInjected, which is no longer used anywhere. PiperOrigin-RevId: 152387133
* Explicitly document the state transition on MetadataHandlerGravatar ulfjack2017-04-06
| | | | | | | | | | | | | | | | The ActionMetadataHandler does an explicit state transition on discardOutputMetadata. Before the call, it may be used for action cache checking, and after the call it may be updated with execution results. Several of the methods now throw if they're used incorrectly, so I had to refactor the control flow in ActionExecutionFunction to correctly call discardOutputMetadata on the MetadataHandler in all cases. I discovered a resource leak (of FileOutErr) in IncludeParseFunction while I was at it, so I plugged that as well. One step towards #1525. PiperOrigin-RevId: 152363982
* Fix a null check in ActionMetadataHandler.Gravatar Kush Chakraborty2017-01-16
| | | | | | -- PiperOrigin-RevId: 144444493 MOS_MIGRATED_REVID=144444493
* Do not tickle TimestampGranularityMonitor for CONSTANT_METADATA artifacts.Gravatar Julio Merino2016-11-02
| | | | | | | | | | | | | | | | | | | | "Constant metadata" artifacts represent real files whose changes should be ignored by the build system. However, these artifacts were triggering the timestamp granularity checks in TimestampGranularityMonitor because the fact that they were "constant metadata" was not respected. Avoid this so that their regeneration does not cause the build to unnecessarily stall. One of these artifacts is the volatile workspace status file, which is unconditionally updated on each build. Before this fix, "blaze build" would get stuck for up to a second waiting for file system timestamps to catch up. With this fix, the artifact is ignored and the wait is gone. This problem is magnified on macOS where the default HFS+ file system only has second-level granularity. (This also affects Linux, but because current Linux file systems have milli/nanosecond-level granularity, the wait imposed by TimestampGranularityMonitor is minimal and thus not generally noticeable.) -- MOS_MIGRATED_REVID=137867586
* Accept valid relative symlinks in TreeArtifacts.Gravatar Rumou Duan2016-10-25
| | | | | -- MOS_MIGRATED_REVID=137072310
* Proper action output checks for TreeArtifacts. Instead of crashing Bazel, we ↵Gravatar Rumou Duan2016-10-19
| | | | | | | now handle failed TreeArtifact output checks gracefully. -- MOS_MIGRATED_REVID=136627086
* Add a method in MetadataHandler to retrieve contained artifacts from ↵Gravatar Rumou Duan2016-10-07
| | | | | | | TreeArtifacts. -- MOS_MIGRATED_REVID=135485914
* Make Digest (renamed Md5Digest) a little more multi-purpose.Gravatar Shreya Bhattarai2016-08-23
| | | | | -- MOS_MIGRATED_REVID=130986194
* Refactor FileArtifactValue and ArtifactValue now that presence of mtime and ↵Gravatar Janak Ramakrishnan2016-08-01
| | | | | | | digest are mutually exclusive. -- MOS_MIGRATED_REVID=128843642
* Remove FileArtifactValue#createWithDigest method now that empty files are ↵Gravatar Janak Ramakrishnan2016-07-29
| | | | | | | always digested. -- MOS_MIGRATED_REVID=128768429
* Fix leftover "size" check when deciding whether to use digest or mtime. ↵Gravatar Janak Ramakrishnan2016-07-29
| | | | | | | | | Since we no longer stored mtime for empty files, this bug meant that we always compared empty files equal (which is good). But we shouldn't be using Metadata based on mtime for them. A follow-up change will do a refactor to make this impossible. -- MOS_MIGRATED_REVID=128742054
* Don't treat empty files specially with respect to mtime/digest.Gravatar Janak Ramakrishnan2016-07-14
| | | | | | | RELNOTES: Bazel no longer regards an empty file as changed if its mtime has changed. -- MOS_MIGRATED_REVID=127328552
* Skyframe changes to support SpawnActionTemplate.Gravatar Rumou Duan2016-06-07
| | | | | | | | 1. Adds ActionTemplateExpansion{Function, Value} for ActionTemplate expansion. 2. Changes ArtifactFunction to support evaluating TreeFileArtifacts and TreeArtifacts generated by ActionTemplate. -- MOS_MIGRATED_REVID=124160939
* Introduce TreeFileArtifact, which represents files under TreeArtifacts.Gravatar Rumou Duan2016-04-14
| | | | | | | Remove ArtifactFile, which is rendered obsolete by TreeFileArtifact. -- MOS_MIGRATED_REVID=119789154
* Move TimestampGranularityMonitor to CommandEnvironment.Gravatar Ulf Adams2016-03-23
| | | | | | | | This is one of the last pieces of state in BlazeRuntime that isn't safe to share across command invocations. -- MOS_MIGRATED_REVID=117910631
* Rollback of commit a0eefb52f529b73c6cb92f0a762853646ea2eae6.Gravatar Googler2016-02-11
| | | | | | | | | | | | | *** Reason for rollback *** Rolling forward with the restored logic to avoid stat calls on injected Metadata. *** Original change description *** Automated [] rollback of commit df03e10f6552566982399b8779fe7bc7a17d75dc. -- MOS_MIGRATED_REVID=114447944
* Rollback of commit df03e10f6552566982399b8779fe7bc7a17d75dc.Gravatar Michajlo Matijkiw2016-02-11
| | | | | -- MOS_MIGRATED_REVID=114329043
* Make unpredictable action inputs and outputs available to Actions.Gravatar Michael Thvedt2016-02-10
| | | | | -- MOS_MIGRATED_REVID=114249806
* Support for handling TreeArtifact metadata and returning TreeArtifacts from ↵Gravatar Michael Thvedt2016-02-09
| | | | | | | ArtifactFunction. -- MOS_MIGRATED_REVID=114174899
* Use Bazel Preconditions variant which avoids varargs array creationGravatar Mark Schaller2015-12-10
| | | | | | | Reduces garbage. -- MOS_MIGRATED_REVID=109914243
* Rationalize copyright headersGravatar Damien Martin-Guillerez2015-09-25
| | | | | | | | | | | The headers were modified with `find . -type f -exec 'sed' '-Ei' 's|Copyright 201([45]) Google|Copyright 201\1 The Bazel Authors|' '{}' ';'` And manual edit for not Google owned copyright. Because of the nature of ijar, I did not modified the header of file owned by Alan Donovan. The list of authors were extracted from the git log. It is missing older Google contributors that can be added on-demand. -- MOS_MIGRATED_REVID=103938715
* Add a bit more debugging information in case of a digest mismatch.Gravatar Janak Ramakrishnan2015-07-10
| | | | | -- MOS_MIGRATED_REVID=97782188
* More descriptive error message on ActionMetadataHandler#injectDigest failureGravatar Michajlo Matijkiw2015-06-15
| | | | | -- MOS_MIGRATED_REVID=95852975
* Add runfiles to metadata caches and make them isFile awareGravatar Michajlo Matijkiw2015-05-26
| | | | | -- MOS_MIGRATED_REVID=94318260
* Belated cleanup of MetadataHandler#discardMetadata. Since we have per-action ↵Gravatar Janak Ramakrishnan2015-04-14
| | | | | | | metadata handlers, we can just unconditionally discard all output metadata with this call. -- MOS_MIGRATED_REVID=91008004
* Delete debugging code used to diagnose bug when shared actions raced to execute.Gravatar Janak Ramakrishnan2015-04-14
| | | | | -- MOS_MIGRATED_REVID=91007686
* Add more debugging to help track down crash.Gravatar Janak Ramakrishnan2015-04-09
| | | | | | | Note that we probably want to change the discardMetadata signature to no longer take an argument, since we have per-action metadata handling. However, I'd like to know that that's the source of the crash, if it is, which is why I'm not removing the argument right now. -- MOS_MIGRATED_REVID=90712991
* Add debug logging to help find mysterious crash experienced by users.Gravatar Janak Ramakrishnan2015-04-09
| | | | | | | Some care was taken to make sure that we only log when a file is missing *after* the action is executed, when its failure to be present should force a build failure anyway, in order to avoid a source of memory pressure. -- MOS_MIGRATED_REVID=90682557
* Split FileAndMetadataCache into two classes, since most of the shared ↵Gravatar Janak Ramakrishnan2015-04-06
functionality is gone. -- MOS_MIGRATED_REVID=90289916