aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/actions/Action.java
Commit message (Collapse)AuthorAge
* Rationalize local resource acquisitionGravatar Ulf Adams2017-03-03
| | | | | | | | | | | | | | | | | | | | | | Move all local resource acquisition to where local execution actually happens. Don't attempt to acquire resources per action, but only for individual spawns. This significantly simplifies the code. The downside is that we don't account for action-level work anymore. In general, actions should not perform any process execution themselves, but always delegate such work to a SpawnStrategy implementation. This change makes sure that every Spawn has local resources set in a way that is consistent with the previous state. However, there are two actions - Fileset and FileWrite -, which are not spawns, and so we now don't limit their concurrent execution anymore. For Fileset, all work is done in a custom Fileset-specific thread pool, so this shouldn't be a problem. I'm not sure about FileWriteAction. -- PiperOrigin-RevId: 149012600 MOS_MIGRATED_REVID=149012600
* Clean up the semantics of input discovering actions a bit by making ↵Gravatar Lukacs Berki2017-02-28
| | | | | | | | | | | | updateInputs() and inputsKnown() non-overridable and removing setInputs(). This comes at the cost of adding a flag to every action instance that's not used for non-input-discovering actions, but I think that's a deal. Simpler APIs are good, mmmmkay? Also fixed a few pre-existing issues in TestAction and ObjcCompileAction. -- PiperOrigin-RevId: 148749734 MOS_MIGRATED_REVID=148749734
* Simplify the Action interface by asking it a set of allowed inputs instead ↵Gravatar Lukacs Berki2017-02-02
| | | | | | | | | | of to resolve exec paths found in the action cache. The resolution algorithm was the same in all cases where it was implemented. -- PiperOrigin-RevId: 146344672 MOS_MIGRATED_REVID=146344672
* Simplify action input discovery by removing ↵Gravatar Lukacs Berki2017-01-31
| | | | | | | | | | Action#getInputsWhenSkippingInputDiscovery(). This has the side effect of always allowing new inputs to be discovered when Action#discoversInputs() return true, but since those actions are very few and have mostly to do with C++, I think it's an acceptable tradeoff for th ecode being that much simpler. -- PiperOrigin-RevId: 146098150 MOS_MIGRATED_REVID=146098150
* Prune modules when building modules themselves to reduce build times shortenGravatar Googler2016-12-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | critical paths. When the inputs of a module M are reduced to a set S, then that same set S also needs to be supplied to compile something that uses M. To do this, input discovery is divided into two stages. For each CppCompileAction, the first stage discovers the necessary modules (M above). These are then added as inputs to ensure that they are built. The second stage then finds all the modules (S above) that are required to use those and also adds them as inputs. For now, the new behavior is guarded by a new flag --experimental_prune_more_modules. This is currently implemented by reading the .d files of used modules add adding all their module dependencies. There are two noteworthy alternatives: 1. Hack up input discovery to understand modules, e.g. if a modular header is hit, continue scanning from all it's headers. However, this seems very brittle and a lot of additional information would have to be passed to the input discovery. 2. Directly pass the results from input discovery of one CppCompileAction to another one. However, this seems to tightly couple the execution of different CppCompileActions and might lead to a mess of different states, more memory consumption, etc. With the current implementation, there is a bit of runtime overhead of reading the .d files (many times). This could potentially be improved by caching the results. However, even without this caching, the runtime overhead is limited (<10%) for all builds I have tried (I have tried with builds where all the compile results are already in the executor's cache. -- MOS_MIGRATED_REVID=140793217
* Add experimental flag to stop requiring all transitive modules as inputs.Gravatar Googler2016-10-31
| | | | | | | | | Requiring all transitive modules to always be available can lead to long critical paths and even unnecessary compiles in combination with the prune_header_modules feature. -- MOS_MIGRATED_REVID=137696794
* Update ActionMetadata -> ActionExecutionMetadata references.Gravatar Greg Estren2016-09-28
| | | | | -- MOS_MIGRATED_REVID=134537085
* Action#discoverInputs returns an Iterable<Artifact> instead of aGravatar Cal Peyser2016-08-25
| | | | | | | Collection<Artifact> -- MOS_MIGRATED_REVID=131285541
* Allow Skyframe graph lookups and value retrievals to throw InterruptedException.Gravatar Janak Ramakrishnan2016-08-16
| | | | | | | The only place we now don't handle InterruptedException is in the action graph created after analysis, since I'm not sure that will be around for that much longer. -- MOS_MIGRATED_REVID=130327770
* Clarify that input/output names should be in cache key.Gravatar Janak Ramakrishnan2016-06-01
| | | | | -- MOS_MIGRATED_REVID=123729693
* Split ActionMetadata into ActionAnalysisMetadata and ActionExecutionMetadata.Gravatar Rumou Duan2016-04-26
| | | | | | | Except in action execution logic (ActionExecutionFunction, SkyframeActionExecutor, etc.), switch Action interface references to either ActionAnalysisMetadata if possible or ActionExecutionMetadata. -- MOS_MIGRATED_REVID=120723431
* Update the documentation for the Action class.Gravatar Ulf Adams2016-04-18
| | | | | -- MOS_MIGRATED_REVID=120117310
* Allow actions to specify if extra actions can attach to them.Gravatar Janak Ramakrishnan2016-04-07
| | | | | -- MOS_MIGRATED_REVID=119203499
* 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
* Handle exceptions encountered resolving packages during the execution phaseGravatar Michajlo Matijkiw2015-06-10
| | | | | | | | | | | | | | Currently we may do lookups of not-already-cached packages during the execution phase for actions that discover inputs. Exceptions encountered during this would go unhandled and result in a crash. Here we introduce PackageRootResolutionException which wraps these exceptions and triggers an ActionExecutionException which is cleanly handled in the exec phase. As part of this change SkyframeActionExecutor#getArtifactRoots(...) will fail properly on errors getting package roots. -- MOS_MIGRATED_REVID=95578891
* Delay updating inputs of an action when processing the action cache until it ↵Gravatar Janak Ramakrishnan2015-03-20
| | | | | | | | | | | is known that the action is a cache hit. This adds momentary memory overhead when checking the action cache, but should prevent a host of potential errors. Note that this cl assumes that an action that discovers its inputs does *not* take the names of its inputs into account when calculating its key, which is already stated as part of the javadoc of Action#getKey. -- MOS_MIGRATED_REVID=88971626
* Return the set of files found when discovering inputs. Skyframe will ↵Gravatar Janak Ramakrishnan2015-03-11
| | | | | | | | | probably want to store these and may declare dependencies in advance so all metadata is present in the graph. Long-term, we may be able to use the returned set to make input-discovering actions immutable, which would be nice. -- MOS_MIGRATED_REVID=88348068
* Replace some calls to ArtifactFactory.resolveSourceArtifact(PathFragment ↵Gravatar Marian Lobur2015-02-11
| | | | | | | execPath), with a skyframe native implementation ArtifactFactory.resolveSourceArtifact(Iterable<PathFragment> execPaths, PackageRootResolver resolver). -- MOS_MIGRATED_REVID=86062289
* Update from Google.Gravatar Han-Wen Nienhuys2015-02-25
-- MOE_MIGRATED_REVID=85702957