| Commit message (Collapse) | Author | Age |
|
|
|
|
|
|
|
| |
function, discoverInputs() can be implemented to return null upon encountering
missing ActionExecutionValues.
RELNOTES: None.
PiperOrigin-RevId: 206913969
|
|
|
|
|
|
|
|
|
| |
CppCompileAction.discoverInputsStage2 retrieves values of discovered modules
from ActionExecutionValue.
This addresses a possible a correctness issue.
PiperOrigin-RevId: 202162180
|
|
|
|
|
|
|
| |
The memory savings from this flag are not worth the complexity, and it interferes with action restarting.
RELNOTES: Remove support for --discard_actions_after_execution.
PiperOrigin-RevId: 201077905
|
|
|
|
|
|
|
|
| |
The constructors which don't accept an action environment should not be called,
with the exception of subclasses that don't run any subprocesses, and therefore
don't need an environment.
PiperOrigin-RevId: 197706734
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a cleanup to clarify the code.
1. The getEnvironment method in the CommandAction interface does not have
access to the clientEnv, so it's return value is necessarily incomplete.
Rename to getIncompleteEnvironmentForTesting.
2. Add a final getEnvironment method to AbstractAction, which returns the
ActionEnvironment, which is intended to be a complete description of the
intended final environment of the action (technically, of any spawn running
within the action). This is not currently used, but is provided to prevent
action subclasses to add such a method (it may be used in the future).
PiperOrigin-RevId: 196991091
|
|
|
|
|
|
|
|
|
|
| |
These were previously ignoring the inhertied environment, i.e.,
--action_env=PATH did _not_ result in the PATH variable being forwarded from
the client environment.
Fixes #5142.
PiperOrigin-RevId: 196966822
|
|
|
|
|
| |
RELNOTES: None.
PiperOrigin-RevId: 195011200
|
|
|
|
| |
PiperOrigin-RevId: 194985157
|
|
|
|
| |
PiperOrigin-RevId: 192628723
|
|
|
|
|
| |
RELNOTES: Exposed "mnemonic" and "env" fields on skylark "Action" objects.
PiperOrigin-RevId: 192479783
|
|
|
|
|
| |
RELNOTES: None
PiperOrigin-RevId: 188625855
|
|
|
|
|
|
|
| |
Rewrite that part of rules.md and update rule() docs. Also clarify the Action object's docs to put it in context.
RELNOTES: None
PiperOrigin-RevId: 187636896
|
|
|
|
|
|
|
|
|
|
| |
Needed so that actions are properly invalidated and re-run when the platform's remote execution properties change.
Fixes #4756.
Closes #4728.
Change-Id: Ia227d110c10c9aad2164cefa8a90361cc4359332
PiperOrigin-RevId: 187621349
|
|
|
|
|
|
| |
for every type of action.
PiperOrigin-RevId: 187368369
|
|
|
|
|
|
| |
to select a codec.
PiperOrigin-RevId: 186378153
|
|
|
|
|
|
| |
AbstractAction.
PiperOrigin-RevId: 186316435
|
|
|
|
| |
PiperOrigin-RevId: 185733313
|
|
|
|
|
|
|
|
|
|
|
| |
This class represents a root (such as a package path or an output root) used for file lookups and artifacts. It is meant to be as opaque as possible in order to hide the user's environment from sky keys and sky functions.
Roots are used by RootedPaths and ArtifactRoots.
This CL attempts to make the minimum number of modifications necessary to change RootedPath and ArtifactRoot to use these fields. Deprecated methods and invasive accessors are permitted to minimise the risk of any observable changes.
RELNOTES: None
PiperOrigin-RevId: 182271759
|
|
|
|
|
|
|
|
|
| |
more cases.
Part of #4128.
Change-Id: Ife5e4581f91ac07931d193ed5eaa256aab3ad047
PiperOrigin-RevId: 180826445
|
|
|
|
|
|
|
|
| |
This is in preparation for merging FileArtifactValue and FileStateValue.
Progress on #3360.
PiperOrigin-RevId: 179832948
|
|
|
|
|
|
|
| |
Part of #4128.
Change-Id: Id822d3ae6f8daf7c92a75bd8bd28590d4f625845
PiperOrigin-RevId: 177905460
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
| |
RELNOTES: None.
PiperOrigin-RevId: 177326265
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
Update the callers that only need getMetadata to use the new interface.
PiperOrigin-RevId: 167992239
|
|
|
|
|
|
| |
This is a prerequisite for merging the two interfaces.
PiperOrigin-RevId: 167843789
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This paves the way for Skylark-side compact command lines that can fail during expansion.
In general, expansion happens in these scenarios:
* Action execution expands the command line to execute it. This is fine since we are well equipped already to handle failing actions.
* In the analysis phase we expand command lines to investigate whether we need a params file. This could be moved to the execution phase, which would have the benefit of getting params files out of the action graph and saving memory.
* Key computation expands the command line. This could be fixed by allowing command lines to compute their own keys (which wouldn't try to expand the command line). This could have the benefit of being more efficient.
* Extra actions expand the command line to construct the extra action proto. This could maybe be deferred to the execution phase (writing the extra action), which would also be more memory efficient.
For failed key computations, we return a singleton "error" key. This means multiple actions that will fail will map to the same key. These actions will necessarily fail if executed, so we should not need to worry about these ending up in the action cache. If we do manage to make the command line compute its own keys then this will become moot in the future.
RELNOTES: None
PiperOrigin-RevId: 166266385
|
|
|
|
|
|
|
| |
This is part of splitting up the build-base library into separate libraries for
analysis, exec, and rules.
PiperOrigin-RevId: 164835678
|
|
|
|
|
|
|
| |
Instead use MetadataHandler.getMetadata().isFile(), which is basically what
isRegularFile did before.
PiperOrigin-RevId: 163351014
|
|
|
|
|
|
|
|
|
|
| |
Simplify the code by providing the default implementation of
`SkylarkValue$isImmutable` that always returns false. All objects are
considered mutable unless their `isImmutable` method is overridden.
This change doesn't affect the current behavior.
PiperOrigin-RevId: 161422029
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
| |
It also changes the return value of ctx.template_action to None, so a
very minor breaking change. There are no internal usages at least.
RELNOTES: None.
PiperOrigin-RevId: 160825636
|
|
|
|
|
| |
RELNOTES: None.
PiperOrigin-RevId: 160817326
|
|
|
|
|
|
|
| |
It's now easier to customize Printer if in different situations objects should
be printed differently. Also its API is cleaner now. Names of methods of SkylarkValue objects now reflect names of Skylark functions: SkylarkValue#repr and SkylarkPrintableValue#str.
PiperOrigin-RevId: 160635154
|
|
|
|
|
| |
RELNOTES: None.
PiperOrigin-RevId: 160630261
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
--noexperimental_enable_critical_path_profiling flags are all specified, then Bazel will delete Actions from ActionLookupValues as they are executed in order to save memory.
Because an already-run action may output an artifact that is only requested later in the build, we need to maintain a way for the artifact to look up the action. But in most cases we don't need to keep the action itself, just its output metadata.
Some actions unfortunately are needed post-execution, and so we special-case them.
Also includes dependency change with description:
Move action out of key. This keeps action references from polluting the graph -- actions are just stored in one SkyValue, instead of being present in SkyKeys.
This does mean additional memory used: we have a separate ActionLookupData object per Action executed. That may reach ~24M for million-action builds.
PiperOrigin-RevId: 151756383
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
| |
This time, if the action discovers inputs, the extra action is made to depend on the outputs of the action so that by the time the extra action runs, the inputs of the original action are discovered. This avoids us having to think about the state the shadowed action may keep.
Yes, actions should not keep state, but they do. Such is life.
--
PiperOrigin-RevId: 148627715
MOS_MIGRATED_REVID=148627715
|
|
|
|
|
|
| |
--
PiperOrigin-RevId: 148445872
MOS_MIGRATED_REVID=148445872
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
AbstractAction#getInputFilesForExtraAction().
Turns out, we didn't add *mandatory* inputs of the shadowed action to the extra action, thus, breakage.
Original description:
Remove AbstractAction#getInputFilesForExtraAction().
This method was used to return the discovered inputs for extra actions, but it turns out that we can use #discoverInputs() just as well.
Note that this makes it possible for #discoverInputs() to be called more than once per action instance (once for the action and once for each extra action), but this appears to work. A followup change may be able to dispense with that, but let's take baby steps for now.
Also note that this introduces synchronization between an action and its associated extra action.
--
PiperOrigin-RevId: 148429641
MOS_MIGRATED_REVID=148429641
|
|
|
|
|
|
|
|
|
|
| |
This is not a clean rollback:
I had to change CppCompileAction on line 1278 and pass cppSemantics.getIncludeProcessing().
Please flag this if it doesn't make sense :)
--
PiperOrigin-RevId: 147868235
MOS_MIGRATED_REVID=147868235
|
|
|
|
|
|
|
|
|
|
|
|
| |
This method was used to return the discovered inputs for extra actions, but it turns out that we can use #discoverInputs() just as well.
Note that this makes it possible for #discoverInputs() to be called more than once per action instance (once for the action and once for each extra action), but this appears to work. A followup change may be able to dispense with that, but let's take baby steps for now.
Also note that this introduces synchronization between an action and its associated extra action.
--
PiperOrigin-RevId: 146450132
MOS_MIGRATED_REVID=146450132
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If an Aspect registered an action that an extra-action is
shadowing, its name is used when creating the extra-action's ID and
name.
Since recently, an aspect can see other aspects applied to the same
target. This CL record the names of other aspects applied to the target
as well, disambiguating the action owners.
--
PiperOrigin-RevId: 142264153
MOS_MIGRATED_REVID=142264153
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
| |
Currently, we fail in deleting outputs from a previous invocation in a write-protected directory.
This change retries deleting the outputs, after making the parent write-protected directory writable again.
--
MOS_MIGRATED_REVID=140035023
|
|
|
|
|
| |
--
MOS_MIGRATED_REVID=139569372
|