aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/analysis/actions
Commit message (Collapse)AuthorAge
* CustomCommandLine: add emptiness checksGravatar laszlocsomor2017-07-19
| | | | | | | | | | | | | | | | | | | | | This is a semantic roll-forward of https://github.com/bazelbuild/bazel/commit/a76c94be7c56b93fc5a2f9ececfba7ac1f61f69c which was rolled back in https://github.com/bazelbuild/bazel/commit/33cd68e18f554b98194b4ce924580d3333ab9217 due to memory regressions. In this commit: - add @Nullable annotations to CustomCommandLine.Builder.add* methods where it makes sense - add Preconditions.checkNotNull for non-nullable arguments - add emptiness checks for Iterables in add(String, Iterable) style methods, to avoid adding the argument when the Iterable is empty and so the argument would not be followed by any values RELNOTES: none PiperOrigin-RevId: 162349842
* Automated rollback of commit a76c94be7c56b93fc5a2f9ececfba7ac1f61f69c.Gravatar laszlocsomor2017-07-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | *** Reason for rollback *** Caused memory regression. *** Original change description *** CustomCommandLine.Builder: clean up its interface In this commit: - remove unused methods and classes - turn CustomCommandLine.ArgvFragment into an interface - remove the CustomCommandLine.TreeFileArtifactArgvFragment abstract class; it only had one remaining subclass - add @Nullable annotations where nulls are fine - add Precondition checks for non-nullable args - simplify the interface by removing add* methods that can be composed of other add* methods; this makes it easier to see... *** RELNOTES: none PiperOrigin-RevId: 162320031
* Internal changeGravatar Googler2017-07-17
| | | | PiperOrigin-RevId: 162194755
* AndroidBusyBox: deprecate path-list-type flagsGravatar laszlocsomor2017-07-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit: - deprecates PathListConverter - removes ExistingPathListConverter because it was not used in production, only tests - deprecated List<Path> type flags that use PathListConverter - introduces new List<Path> type flags next to the deprecated ones that use @Options.allowMultiple and convert with PathConverter; the new and old lists are concatenated, yielding the flag value PathListConverter and all of its occurrences should be removed after 2018-01-31 (about 6 months from now, which is a safe enough timeframe for everyone to upgrade Bazel so it uses the new-style flags). Reason for deprecation is that colon-separated path lists don't work on Windows because paths have colons in them. Since the Android BusyBox is not intended to be executed by users but by Bazel only, there's no release notes necessary. See https://github.com/bazelbuild/bazel/issues/3264 RELNOTES: none PiperOrigin-RevId: 162193998
* CustomCommandLine.Builder: clean up its interfaceGravatar laszlocsomor2017-07-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In this commit: - remove unused methods and classes - turn CustomCommandLine.ArgvFragment into an interface - remove the CustomCommandLine.TreeFileArtifactArgvFragment abstract class; it only had one remaining subclass - add @Nullable annotations where nulls are fine - add Precondition checks for non-nullable args - simplify the interface by removing add* methods that can be composed of other add* methods; this makes it easier to see what the callers do with the Builder - remove add* methods that add a single argument followed by a list of other elements (or a joined string of them); these had a bug in that they didn't check if the collection was empty (only that it was not null), and if it was empty then the single argument was still added though it was not followed by any value - fix call sites of add* methods where we previously could have added a flag with an empty collection - audit every affected call site RELNOTES: none PiperOrigin-RevId: 161957521
* Promote getPossibleInputsForTesting from CppCompileAction to CommandAction, inGravatar cpeyser2017-07-17
| | | | | | | order to allow tests that depend on pruned inputs to work for both the legacy and crosstool cases. PiperOrigin-RevId: 161955432
* Fix memory regression from CL/160891204.Gravatar tomlu2017-07-10
| | | | | | | | | Java compile actions create unnecessary wrapper objects around a shared constant object. We can share the ActionEnviroment between these actions. In the general spawn case there will be a lot of empty action environments. Make sure that these are shared too. RELNOTES: None PiperOrigin-RevId: 161389056
* Do not NPE crash when C++ actions are not configured in crosstoolGravatar hlopko2017-07-07
| | | | | | | Show meaningful message instead. RELNOTES: None. PiperOrigin-RevId: 161196096
* Update SpawnAction to take an ActionEnvironmentGravatar ulfjack2017-07-05
| | | | | | | | | | Some of the callers are not using the proper one from the configuration, and are thus ignoring --action_env. Some are only using part of the configuration's action environment. I tried to carefully not change the semantics in any case. Semantic-changing changes come later. PiperOrigin-RevId: 160891204
* Decrease memory used by SpawnAction's param file builder.Gravatar tomlu2017-06-30
| | | | | | The previous implementation stores a copy of the param file's path fragment with an '@' prepended. This can add up if you have a lot of params files, but can be avoided by deferring that string expansion. PiperOrigin-RevId: 160559793
* Add a #getBytes() method to DeterministicWriter that returns a ByteString. ↵Gravatar janakr2017-06-30
| | | | | | | | By default it just delegates to the existing #writeOutputFile, but implementations may choose to override if they have easy access to a ByteString. Also change some DeterministicWriter implementations that do have easy access to the ByteString. PiperOrigin-RevId: 160550028
* Extract ActionContext to a top-level classGravatar ulfjack2017-06-19
| | | | PiperOrigin-RevId: 159423459
* Rewrite the Executor/ActionExecutionContext splitGravatar ulfjack2017-06-19
| | | | | | | Move everything to ActionExecutionContext, and drop Executor whereever possible. This clarifies the API, makes it simpler to test, and simplifies the code. PiperOrigin-RevId: 159414816
* Move ExecutionRequirements to the lib.actions packageGravatar ulfjack2017-06-06
| | | | | | | | | It was previously the odd-one out in lib.analysis.actions, due to other code that wanted to depend on it without pulling in all of analysis. However, it's needed to interpret Spawn instances, and Spawn lives in lib.actions, so it makes more sense to move it there, and remove the special-casing. PiperOrigin-RevId: 158116684
* Use nested sets for configured target runfiles instead of flattened lists.Gravatar Googler2017-05-26
| | | | | RELNOTES: None PiperOrigin-RevId: 157124371
* Automated g4 rollback of commit e2edf2e141a09c025a958d580c7cac7b57c70d83.Gravatar Googler2017-05-26
| | | | | | | | | | | | | | | | | | | | | | | | | *** Reason for rollback *** Rollforward with fix. *** Original change description *** Automated g4 rollback of commit c78c947e6a8cbb323304f872a3dcabb989a3d76b. *** Reason for rollback *** Breaks android targets in the nightly - see [] *** Original change description *** Do not retain transitive data in AndroidLocalTestBase... *** ROLLBACK_OF=156745610 RELNOTES: None PiperOrigin-RevId: 157028029
* Automated g4 rollback of commit c78c947e6a8cbb323304f872a3dcabb989a3d76b.Gravatar cpeyser2017-05-23
| | | | | | | | | | | | | | *** Reason for rollback *** Breaks android targets in the nightly - see [] *** Original change description *** Do not retain transitive data in AndroidLocalTestBase. The argument strings and artifacts were both transitive and flattened, causing O(N^2) memory consumption. PiperOrigin-RevId: 156745610
* Do not retain transitive data in AndroidLocalTestBase.Gravatar Googler2017-05-15
| | | | | | The argument strings and artifacts were both transitive and flattened, causing O(N^2) memory consumption. PiperOrigin-RevId: 156083738
* Remove methods from CommandLine, making it a simple argument list interface.Gravatar Googler2017-05-15
| | | | | | | * isShellCommand is now passed directly to SpawnAction * Getting the associated params file action was a test-only thing. We can pull this out of the action graph instead. PiperOrigin-RevId: 156060366
* Do not expand nested sets in resource merging action construction.Gravatar Googler2017-05-15
| | | | PiperOrigin-RevId: 155900259
* Set the local CPU reservation for tests based on their "cpu:<n>" tag.Gravatar philwo2017-05-03
| | | | | | | | | | | | | | | | | | This lets users specify that their test needs a minimum of <n> CPU cores to run and not be flaky. Example for a reservation of 4 CPUs: sh_test( name = "test", size = "large", srcs = ["test.sh"], tags = ["cpu:4"], ) This could also be used by remote execution strategies to tune their resource adjustment. RELNOTES: You can increase the CPU reservation for tests by adding a "cpu:<n>" (e.g. "cpu:4" for four cores) tag to their rule in a BUILD file. This can be used if tests would otherwise overwhelm your system if there's too much parallelism. PiperOrigin-RevId: 154856091
* Convert LLVM raw profiles to indexed format if necessary.Gravatar Googler2017-04-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Here is what is done today: bazel build -c opt --fdo_optimize=<path_to_profdata_file> //target The .profdata file is the LLVM profiles in indexed format and bazel creates a symlink to it from bazel-fdo/_fdo/... and compiles the target. However, the instrumented binary generates a .profraw file and hence the conversion to .profdata must be done manually using the llvm-profdata binary which is shipped along with the crosstool as: $ llvm-profdata -merge -o <path_to_profdata_file> <path_profraw_file> We are trying to avoid this intermediate step in this change by baking this into bazel. This implementation does the following: * In CppConfiguration.java, adds new tool llvm-profdata. * In CcToolchain.java, in function create, if LLVM instrumented FDO is desired, the profile format is checked and the profile conversion takes place. * FdoSupport.java checks for LLVM instrumented FDO is bypassed. RELNOTES[NEW]: Raw LLVM profiles are now supported. PiperOrigin-RevId: 154569896
* Refactor all ctor callsites of PathFragment to instead call a static ↵Gravatar nharmata2017-04-05
| | | | | | | | | | | | 'create' method. This paves the way for changing PathFragment to e.g. an abstract class with multiple subclasses. This way we can split out the windows-specific stuff into one of these concrete classes, making the code more readable and also saving memory (since the shallow heap size of the NonWindowsPathFragment subclass will hopefully be smaller than that of the current PathFragment). This also lets us pursue gc churn optimizations. We can now do interning in PathFragment#create and can also get rid of unnecessary intermediate PathFragment allocations. RELNOTES: None PiperOrigin-RevId: 152145768
* A partial, manual rollback of commit 7af14dfdbd6addb779226c0a103b2a8dc72c16b1.Gravatar Lukacs Berki2017-03-14
| | | | | | | | This became necessary because extra actions for C++ compile actions require .h files, but the compiler only returns the .pcm files in the .d file for headers that it reads from the .pcm file. This is not a problem for correctness because the .pcm files depend on the headers, but that doesn't help the extra actions that would then only get the .pcm files. -- PiperOrigin-RevId: 150052839 MOS_MIGRATED_REVID=150052839
* Remove all the action resource estimation codeGravatar Ulf Adams2017-03-06
| | | | | | -- PiperOrigin-RevId: 149110466 MOS_MIGRATED_REVID=149110466
* Fixes issue with ObjcCompileAction where extra action funcitonality is unableGravatar Googler2017-02-27
| | | | | | | | to generate extra action proto file. -- PiperOrigin-RevId: 148479293 MOS_MIGRATED_REVID=148479293
* Introduce CppCompileActionTemplate, which expands into a list of ↵Gravatar Rumou Duan2017-02-10
| | | | | | | | CppCompileActions that to be executed at execution time. -- PiperOrigin-RevId: 147163077 MOS_MIGRATED_REVID=147163077
* Fix action key computation for ParameterFileWriteAction.Gravatar Tobias Werth2017-02-06
| | | | | | | | It did not take the type (shell_quoted vs unquoted) into account and thus did not redo the action if only the type has changed. -- PiperOrigin-RevId: 146670962 MOS_MIGRATED_REVID=146670962
* proto_library: saner descriptor setsGravatar Carmi Grushko2017-02-02
| | | | | | | | | | | | | 1. proto_library exposes a direct descriptor set (built from its 'srcs') and a nested set of transitive descriptor (from all of its dependencies). 2. Alias libraries (=no 'srcs') produce empty files as their descriptor sets. 3. The direct descriptor set depends on the transitive ones, ensuring that building a top-most proto validates all of its dependencies are also valid protos. 4. The wire format of protos allows to concatenate the outputs to get a valid serialized proto that contains all of the descriptor sets in the proto tree. RELNOTES: proto_library: alias libraries produce empty files for descriptor sets. -- PiperOrigin-RevId: 146300520 MOS_MIGRATED_REVID=146300520
* Simplify the Spawn interfaceGravatar Ulf Adams2017-02-01
| | | | | | | | | | | | | | | | | | | | | | | | Remove getSpawnInfo and asShellCommand, which are never really overridden in a useful way. asShellCommand moves to the Spawns class, and getSpawnInfo is only ever called by SpawnAction, and the implementation moves there. I'm considering using Spawn as the general lower-level abstraction for both local and remote execution. It sort of is that already, except it's not used consistently - we often pass a tuple of (args, env) plus possibly input and output files through parameter-heavy method call hierarchies instead of using this existing abstraction. However, I'm concerned about the amount of baggage it's carrying as well as the number of implementations for what is supposed to be a simple interface (or possibly even a simple value class), and this is an attempt to slim it down a bit. This should have no visible effects on builds. -- PiperOrigin-RevId: 146109838 MOS_MIGRATED_REVID=146109838
* Switch to RunfilesSuppliers for communicating runfilesGravatar Michajlo Matijkiw2017-01-30
| | | | | | | | | | | | | | | | | | | | | | | ActionSpawn/SpawnAction now deal exclusively in RunfilesSuppliers, manifests maps are no more. There is some lingering awkwardness, in particular: - Manifests still need to be tracked in some places, we can work out if this is still necessary on a case by case basis. - Skylark makes actions' runfiles available via 'resolve_command' where they are consumed by 'action'. I've updated the documentation, though the name isn't entirely accurate anymore. That being said these interfaces _are_ marked as experimental, so we _should_ be able to be flexible here. Overall, I think the benefits consolidating runfiles into suppliers, from both code cleanliness and performance perspectives (no longer needing to parse manifests), outweights the awkwardnesses. RELNOTES: resolve_command/action's input_manifest return/parameter is now list -- PiperOrigin-RevId: 145817429 MOS_MIGRATED_REVID=145817429
* Minimize SpawnAction constructor exposureGravatar Michajlo Matijkiw2017-01-23
| | | | | | | | One's unused, the other is ok as protected. -- PiperOrigin-RevId: 145291062 MOS_MIGRATED_REVID=145291062
* Change SpawnAction members back to privateGravatar Googler2017-01-20
| | | | | | | | | | | As pointed out in the new review comments on commit df726eae7b6ef11df3b962d720df36f63d5cd3a3, the SpawnAction members did not need to be changed from private to protected, they just needed to be accessed via accessor methods in the derived LTOBackendAction class. -- PiperOrigin-RevId: 144989490 MOS_MIGRATED_REVID=144989490
* Move ExecutionInfoSpecifier to lib.actionsGravatar Ulf Adams2017-01-09
| | | | | | | | | We were previously jumping through hoops to avoid cyclic dependencies. It's unclear why the class was here in the first place rather than in lib.actions. -- PiperOrigin-RevId: 143948959 MOS_MIGRATED_REVID=143948959
* Update call sites to FileWriteAction to use the ↵Gravatar Jon Brandvein2016-12-20
| | | | | | | | | | --experimental_transparent_compression flag Also add test to ensure lazy strings aren't forced. -- PiperOrigin-RevId: 142496520 MOS_MIGRATED_REVID=142496520
* Cleanup FileWriteAction and add a flag that will guard transparent compressionGravatar Jon Brandvein2016-12-20
| | | | | | | | This clarifies documentation, renames or rearranges constructors, and defines a BuildConfiguration option that will be made to control transparent compression in a follow-up CL. The follow-up updates call sites to use the new create() factory method. -- PiperOrigin-RevId: 142491333 MOS_MIGRATED_REVID=142491333
* Transparently compress any FileWriteAction strings of > 256 length.Gravatar Googler2016-12-08
| | | | | | | | This should save on heap space for actions with long strings. -- PiperOrigin-RevId: 141440705 MOS_MIGRATED_REVID=141440705
* Minor fix to SpawnAction.BuilderGravatar Jon Brandvein2016-11-29
| | | | | | | useDefaultShellEnvironment is exclusive with clientEnvironmentVariables. -- MOS_MIGRATED_REVID=140366745
* Move some actions to language-specific packages, where they belong.Gravatar Lukacs Berki2016-11-23
| | | | | -- MOS_MIGRATED_REVID=140024976
* ObjcCompileAction does not signal to skyframe that it discovers inputs.Gravatar Cal Peyser2016-11-17
| | | | | | | | | | | Instead, it skips discovery (include scanning), but provides all headers to action execution to allow for re-adding pruned sources in a sandbox. This means that mis-capitalization errors will only break a build if --objc_use_dotd_pruning is one. -- MOS_MIGRATED_REVID=139456194
* Description redacted.Gravatar Cal Peyser2016-11-16
| | | | | -- MOS_MIGRATED_REVID=139219934
* ObjcCompileAction provides all headers to sandboxed execution. This allowsGravatar Cal Peyser2016-11-11
| | | | | | | headers pruned by .d pruning to be re-added if they are changed. -- MOS_MIGRATED_REVID=138866385
* For SpawnActions, also honor the dynamic environmentGravatar Klaus Aehlig2016-11-07
| | | | | | | | | | | | | For SpawnActions, depending on the value of use_default_shell_env, the specified environment is taken. The shell environment, however, consists of two parts: a static mapping of variables to values, and a set of variables where the value is to be taken from the client environment. Make sure, both parts are set correctly. Fixes #2035. -- Change-Id: I32253e9bf651b18ca25107edc5fc839813905726 Reviewed-on: https://bazel-review.googlesource.com/#/c/7211 MOS_MIGRATED_REVID=138376914
* Rollback, breaks dependent code.Gravatar Jon Brandvein2016-11-02
| | | | | -- MOS_MIGRATED_REVID=137864618
* ObjcCompileAction provides all headers to sandboxed execution. This allowsGravatar Cal Peyser2016-10-31
| | | | | | | headers pruned by .d pruning to be re-added if they are changed. -- MOS_MIGRATED_REVID=137697323
* [Roll-forward] Rollback of commit dd299dbc61be51112534a4698f7cf2deee43053b.Gravatar Jon Brandvein2016-10-12
| | | | | | | | | | | | | | | | | | | | | | | *** Reason for rollback *** Fixed underlying broken CL that was depended on *** Original change description *** Automated [] rollback of commit e025939e71b179ae0f6bd09ef3af474f49b853a2. *** Reason for rollback *** Depends on commit 9c25afe750a937b2152c21a93effc8b9ba82c27b, which needs to be rolled back. *** Original change description *** Add API for individual actions This exposes action inputs, outputs, argv, content, and substitutions (if applicable). -- MOS_MIGRATED_REVID=135821603
* Rollback of commit e025939e71b179ae0f6bd09ef3af474f49b853a2.Gravatar Ulf Adams2016-10-11
| | | | | | | | | | | | | | | *** Reason for rollback *** Depends on commit 9c25afe750a937b2152c21a93effc8b9ba82c27b, which needs to be rolled back. *** Original change description *** Add API for individual actions This exposes action inputs, outputs, argv, content, and substitutions (if applicable). -- MOS_MIGRATED_REVID=135783964
* Add API for individual actionsGravatar Jon Brandvein2016-10-05
| | | | | | | This exposes action inputs, outputs, argv, content, and substitutions (if applicable). -- MOS_MIGRATED_REVID=135226123
* cc_inc_library deletes its output directory before execution.Gravatar Janak Ramakrishnan2016-10-04
| | | | | | | | | | | | This ensures that stale outputs from prior builds do not remain to confuse the compiler. Fixes #1778. -- Change-Id: I31b5c3e7e5970cf45c3ff10144ddfc73540ef9af Reviewed-on: https://bazel-review.googlesource.com/6250 MOS_MIGRATED_REVID=134780501
* Implement input pruning using .d files in objc behind a flag that defaults toGravatar Cal Peyser2016-09-28
| | | | | | | false. -- MOS_MIGRATED_REVID=134452391