aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/analysis/actions
Commit message (Collapse)AuthorAge
* @Autocodec a few leftover classes. Also, add @AutoCodec builder support for ↵Gravatar cpeyser2018-03-20
| | | | | | boolean getters in "isFoo" form. PiperOrigin-RevId: 189753768
* @AutoCodec TemplateExpansionAction. Have to make some anonymous classes ↵Gravatar janakr2018-03-17
| | | | | | concrete. PiperOrigin-RevId: 189467877
* @AutoCodec some expressions that show up in Java configured targets.Gravatar janakr2018-03-16
| | | | PiperOrigin-RevId: 189419493
* Begins cleanup to allow ActionFS to be injected into all action executions.Gravatar shahan2018-03-15
| | | | PiperOrigin-RevId: 189244665
* Expose an actions provider on RuleConfiguredTarget instances.Gravatar cparsons2018-03-06
| | | | | | | | | Given a target (for example from a skylark aspect), one will be able to access a list of actions that the target generated using "target.actions". This is without additional memory footprint. Actions themselves are not fully exposed to skylark (and thus there isn't much meaning to gather from them in skylark yet). Access methods will follow soon. RELNOTES: None. PiperOrigin-RevId: 188098079
* Automated rollback of commit 96145511b34a2d7be834e3eb05927674e875c813.Gravatar janakr2018-03-05
| | | | | | | | | | | | | | | | | | | | | *** Reason for rollback *** Fixed issue that led to rollback. RELNOTES: None *** Original change description *** Automated rollback of commit eee53d3a33dde441f7e7adaecde81ef2d3db7c1b. *** Reason for rollback *** breaks Blaze_CorpTest *** Original change description *** @AutoCodec ConfiguredTargetValue. PiperOrigin-RevId: 187869560
* Automated rollback of commit eee53d3a33dde441f7e7adaecde81ef2d3db7c1b.Gravatar dannark2018-03-04
| | | | | | | | | | | | *** Reason for rollback *** breaks Blaze_CorpTest *** Original change description *** @AutoCodec ConfiguredTargetValue. PiperOrigin-RevId: 187783702
* @AutoCodec ConfiguredTargetValue.Gravatar cpeyser2018-03-02
| | | | PiperOrigin-RevId: 187635570
* Make JavaCompileAction and friends emit new-style arguments.Gravatar tomlu2018-03-01
| | | | | | | | | Instead of --direct_dependency, --indirect_dependency args we now emit --direct_dependencies. We no longer need to emit any jar owner information since that is baked into the jar by JavaBuilder. This CL also contains the deletion of CustomMultiArgv and the injecting_rule_kind aspect parameter, as the deleted code was the last remaining usage. RELNOTES: None PiperOrigin-RevId: 187558628
* Refactor the AbstractAction computeKey method to be easier to add invariantsGravatar jcater2018-02-28
| | | | | | for every type of action. PiperOrigin-RevId: 187368369
* Tag ParameterFileWriteAction with @AutoCodec.Gravatar mjhalupka2018-02-27
| | | | | | | | This requires codecs for CustomCommandLine and a Marshaller for Charset. Added AutoCodec functionality to generic classes like Iterable<T>. PiperOrigin-RevId: 187182889
* @AutoCodec FileWriteAction.Gravatar janakr2018-02-26
| | | | PiperOrigin-RevId: 187048921
* Apply @AutoCodec to ExecutableSymlinkAction and SymlinkAction.Gravatar mjhalupka2018-02-23
| | | | | | | AbstractAction had getPrimaryInput() and getPrimaryOutput() which is why arguments are renamed. PiperOrigin-RevId: 186795064
* @AutoCodec for GenRuleAction.Gravatar cpeyser2018-02-23
| | | | PiperOrigin-RevId: 186765754
* Add @AutoCodec to SpawnAction. Refactor the SpawnAction API for extra ↵Gravatar cpeyser2018-02-22
| | | | | | actions so that it is non-generic and does not persist a GeneratedExtension, which is hard to serialize. PiperOrigin-RevId: 186627440
* Move CommandLine, CommandLineItem, and ParamFileInfo from ↵Gravatar tomlu2018-02-15
| | | | | | | | | lib.analysis.actions -> lib.actions. These are fundamental types that want to sit alongside types like Spawn. RELNOTES: None PiperOrigin-RevId: 185887971
* Stop storing ActionTemplate in a SkyKey: it's too heavyweight. Use the same ↵Gravatar janakr2018-02-15
| | | | | | mechanism as for normal actions, have the ActionTemplateExpansionFunction look the template up when needed. PiperOrigin-RevId: 185861672
* Use AutoCodec to generate CODECs for a few more provider types that areGravatar cpeyser2018-02-15
| | | | | | exported by cc_library. PiperOrigin-RevId: 185852115
* Replace path implementation.Gravatar tomlu2018-02-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Path and PathFragment have been replaced with String-based implementations. They are pretty similar, but each method is dissimilar enough that I did not feel sharing code was appropriate. A summary of changes: PATH ==== * Subsumes LocalPath (deleted, its tests repurposed) * Use a simple string to back Path * Path instances are no longer interned; Reference equality will no longer work * Always normalized (same as before) * Some operations will now be slower, like instance compares (which were previously just a reference check) * Multiple identical paths will now consume more memory since they are not interned PATH FRAGMENT ============= * Use a simple string to back PathFragment * No more segment arrays with interned strings * Always normalized * Remove isNormalized * Replace some isNormalizied uses with containsUpLevelReferences() to check if path fragments try to escape their scope * To check if user input is normalized, supply static methods on PathFragment to validate the string before constructing a PathFragment * Because PathFragments are always normalized, we have to replace checks for literal "." from PathFragment#getPathString to PathFragment#getSafePathString. The latter returns "." for the empty string. * The previous implementation supported efficient segment semantics (segment count, iterating over segments). This is now expensive since we do longer have a segment array. ARTIFACT ======== * Remove Path instance. It is instead dynamically constructed on request. This is necessary to avoid this CL becoming a memory regression. RELNOTES: None PiperOrigin-RevId: 185062932
* Add type assertion that TreeFileArtifact's parentTreeArtifact member is aGravatar cpeyser2018-02-05
| | | | | | SpecialArtifact. PiperOrigin-RevId: 184539696
* Allow CustomCommandLine's mapFn to expand each object into multiple items.Gravatar tomlu2018-02-01
| | | | | | This is needed to migrate JavaCompileAction away from CustomMultiArgv. PiperOrigin-RevId: 184136486
* Improve safety of NestedSetFingerprintCache by detecting multiple instances ↵Gravatar tomlu2018-01-31
| | | | | | | | | | | | of the same mapFn class. This code tries to add protection against the user creating new mapFn instances per-rule. This would cause the nested set cache to be computed per-rule instead of shared across rule instances, causing memory bloat and slowdowns. Since this can only happen in native code, we can get away with detecting this and crashing blaze. I think this is a better choice than silently allowing it / falling back to slow computations. The user can override this behaviour by inheriting from CommandLineItem.CapturingMapFn, in which case the user is explicitly saying they assume responsibility for the number of instances of the mapFn the application will use. PiperOrigin-RevId: 184061642
* Use nested set cache in key computation for CustomCommandLine.Gravatar tomlu2018-01-29
| | | | | RELNOTES: None PiperOrigin-RevId: 183727976
* Add CommandLineItem interface.Gravatar tomlu2018-01-25
| | | | | | | | This interface makes it clearer in the type system exactly how items that go into a CustomCommandLine are turned into strings. It is a preparatory change to allow command line fingerprints to be more cheaply calculated, but it is valuable in itself from a code quality standpoint. PiperOrigin-RevId: 183274022
* Rename Root to ArtifactRoot.Gravatar tomlu2018-01-16
| | | | | | This is slightly more descriptive, and we will potentially want to use the name Root for a broader concept shared between ArtifactRoot and RootedPath. PiperOrigin-RevId: 182082367
* Fix Action subclasses so that the execution platform is properly set inGravatar John Cater2018-01-04
| | | | | | | | | more cases. Part of #4128. Change-Id: Ife5e4581f91ac07931d193ed5eaa256aab3ad047 PiperOrigin-RevId: 180826445
* Set the execution platform on a new SpawnAction based on the RuleContext.Gravatar John Cater2017-12-18
| | | | | | | Part of #4128. Change-Id: Ic46d2db2017b6cf4c14a91653ab75b3381b80b5a PiperOrigin-RevId: 179426362
* Allow not recognized Artifact category to be handled in Analysis phaseGravatar Googler2017-12-13
| | | | | | | Nonexistent artifact categories or categories that are not supported by the action config now throw InvalidConfigurationException instead of ExpansionException. This allows the checked exception to be caught and reported as a RuleErrorException in Analysis phase. RELNOTES: None. PiperOrigin-RevId: 178919727
* Add --experimental_java_coverage.Gravatar elenairina2017-12-05
| | | | | | | | | | | | | | | | | | Context: java_import or other custom rules (genrules or Skylark) do not propagate coverage information. Coverage metadata is retrieved from the compilation information and it is passed around through providers as Artifact(s). The problem with the current implementation is that there is no way of retrieving instrumentation metadata from arbitrary jars provided by java_import or other custom rules. --experimental_java_coverage solves the issue presented above ONLY for the java rules (has no effect for android/[]/etc). Implementation details: * For each build jar create a .txt file containing the relative path of each Java file. This file is included in the build jar. It is used for recreating the correct path for each covered file when included in the coverage report. * java_binary/java_test will set 3 environment variables: 1) JACOCO_METADATA_JAR - in experimental mode will be a txt file containing all the jars considered for collecting coverage (JacocoCoverageRunner filters out the ones that don't have .uninstrumented.class files). In non-experimental mode will be a jar containing all the instrumented class files. 2) JACOCO_MAIN_CLASS - The main class to be called for the current coverage run. Previously this information was embedded in the JACOCO_METADATA_JAR's manifest. 3) JACOCO_JAVA_RUNFILES RELNOTES: --experimental_java_coverage is available for testing. PiperOrigin-RevId: 177941471
* Added execution platform to the ActionExecutionMetadata.Gravatar John Cater2017-12-04
| | | | | | | Part of #4128. Change-Id: Id822d3ae6f8daf7c92a75bd8bd28590d4f625845 PiperOrigin-RevId: 177905460
* Remove some deadish Windows-related runfiles code.Gravatar Benjamin Peterson2017-12-04
| | | | | | | | | | | | | | | In particular, SymlinkTreeAction no longer needs to accept artifacts as an input. --experimental_enable_runfiles now immediately reports an error on Windows. This mostly unwinds e4974e4cc6aeb437d36b3b36eb20142b7120fb16 ("Separate runfiles middlemen into two layers") and 41f4456ac2348bef66739194853a1ddadcbb887e ("Make runfiles tree creation on Windows depend on the artifacts of the actual runfiles."). See https://groups.google.com/d/msg/bazel-dev/btOAgxv434g/bDhTOOePAgAJ. Change-Id: Iac3308669bfc07abfd1c91445922269d8fdc2a26 PiperOrigin-RevId: 177837504
* Add ActionKeyContext to Action#getKey.Gravatar tomlu2017-11-29
| | | | | | | This key context can be used by actions to share partial key computations, for instance when computing MD5s for nested sets. RELNOTES: None PiperOrigin-RevId: 177359607
* Return SpawnResults using a List instead of a Set.Gravatar ruperts2017-11-21
| | | | | | | | | Currently we don't care about the list order of SpawnResults. However, we may care about the list order later. Also, if the equals() method for SpawnResults is ever changed then it may be problematic to return SpawnResults in a Set. Aside: ActionResults use SpawnResults to calculate cumulative execution times for Actions, and may provide other metrics in future. RELNOTES: None. PiperOrigin-RevId: 176579460
* 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
* Reduce iterations and copies over inputs in ActionSpawn.Gravatar Jakob Buchgraber2017-10-30
| | | | | | | | | | | | | | | | The current implementation copies all inputs into a list and then iterates over them twice to remove filesets and manifests. We can do the filtering in one pass instead and avoid the copying to a list to save memory. In addition, the Action.getInputs() method often returns inputs stored in a NestedSet and we want to allow a caller to have access to it, so that he isn't forced to flatten it. A call can do that by checking if ActionSpawn.getInputFiles() is an instance of NestedSetView. Change-Id: I2fa8904827030c04bf29b14f0f3f942877c317a4 PiperOrigin-RevId: 173881256
* Add Path argument to supportsModifications, supports*LinksNatively.Gravatar tomlu2017-10-20
| | | | | | | | This works better with UnionFileSystem, as (eg.) different mapped file systems might not agree on whether they are read-only. No actual code changes have been made that actually uses this argument, so this should be a behaviour no-op. PiperOrigin-RevId: 172782759
* 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
* More SpawnResult-related plumbing changes to Actions, Strategies, ↵Gravatar ruperts2017-10-07
| | | | | | | | | ActionContexts, etc., so that SpawnResult metadata is returned upwards. Note that the TODOs mostly refer to changes that will appear in a subsequent CL (a CL to return SpawnResults, contained in ActionResults, from Actions/AbstractActions). I split off the remaining SpawnResult-related changes into this CL and kept the ActionResult-related changes separate. RELNOTES: None. PiperOrigin-RevId: 171355611
* Windows,launcher: add LauncherFileWriteActionGravatar Laszlo Csomor2017-10-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce LauncherFileWriteAction, a FileWriteAction that can create a native {java,sh,py}_binary launcher from the launcher stub and the user-specified launch information. The LauncherFileWriteAction class does not use the "copy" command of cmd.exe so it's not restricted with path lengths. The class stores a LaunchInfo object, which describes the launch data that the launcher stub reads to identify its payload. The LaunchInfo is a lazy object, similar to CustomCommandLine. LaunchInfo won't fully construct the launch data until it is about to write the data to the output. Thus LaunchInfo is memory efficient because it won't create any String objects in the analysis phase that it would only read in the execution phase. Fixes https://github.com/bazelbuild/bazel/issues/3802 Change-Id: I4ddd83369e7131d42e2e9b35f105ad2dc60bcc52 PiperOrigin-RevId: 171115105
* 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
* Fix various linter errorsGravatar ruperts2017-09-29
| | | | | RELNOTES: None. PiperOrigin-RevId: 170418147
* Automated rollback of commit 411039319c1c67f2b9c8a7ada9e0a11d9bd4023f.Gravatar elenairina2017-09-28
| | | | | | | | | | | | | | | | | | | | *** Reason for rollback *** Breaks coverage for android_test (N/A). Can be reproduced with unknown commit. *** Original change description *** Rollforward change of Java coverage logic. RELNOTES: None. *** Original change description *** Automated rollback of commit 8d6fc64b18c7e35b93f5c43dae1dbd2f8cae2147. PiperOrigin-RevId: 170322801
* Add charset to action key computation of ParameterFileWriteAction.Gravatar twerth2017-09-27
| | | | | RELNOTES: None PiperOrigin-RevId: 170088757
* Ensure that SpawnResults make their way back to the SpawnActions that caused ↵Gravatar ruperts2017-09-27
| | | | | | | them to be created. RELNOTES: None. PiperOrigin-RevId: 170058295
* Rollforward change of Java coverage logic.Gravatar elenairina2017-09-26
| | | | | | | | | | RELNOTES: None. *** Original change description *** Automated rollback of commit 8d6fc64b18c7e35b93f5c43dae1dbd2f8cae2147. PiperOrigin-RevId: 170038845
* Automated rollback of commit 743dc14f9f30b80d6d821612f77186afb025477d.Gravatar dslomov2017-09-19
| | | | | | | | | | | | | | | | | | | | | | | *** Reason for rollback *** Rollforward with a fix *** Original change description *** Automated rollback of commit 0ee3aa622fc13b8a5072ebddf5cd65823413b4ff. *** Reason for rollback *** Likely causing artifact conflicts for middleman artifacts in some cases due to accidental change of getMiddlemanDir() to getBinDir() in RunfilesSupport.createManifestMiddleman. *** Original change description *** Cleanup ActionConstructionContext. Do not expose the underlying Rule. RELNOTES: None. PiperOrigin-RevId: 169241011
* Implement support for Skylark param files.Gravatar tomlu2017-09-19
| | | | PiperOrigin-RevId: 169234249
* Automated rollback of commit 0ee3aa622fc13b8a5072ebddf5cd65823413b4ff.Gravatar ulfjack2017-09-19
| | | | | | | | | | | | | | | *** Reason for rollback *** Likely causing artifact conflicts for middleman artifacts in some cases due to accidental change of getMiddlemanDir() to getBinDir() in RunfilesSupport.createManifestMiddleman. *** Original change description *** Cleanup ActionConstructionContext. Do not expose the underlying Rule. RELNOTES: None. PiperOrigin-RevId: 169230095
* Cleanup ActionConstructionContext.Gravatar dslomov2017-09-19
| | | | | | | Do not expose the underlying Rule. RELNOTES: None. PiperOrigin-RevId: 169109552
* Change param file arg string to a format string instead of a prefix string.Gravatar tomlu2017-09-18
| | | | | | Makes it easier to do Skylark param file support which uses a format string. PiperOrigin-RevId: 169019600