| Commit message (Collapse) | Author | Age |
|
|
|
|
|
| |
TransitiveVersionTable uses futures.
PiperOrigin-RevId: 208402465
|
|
|
|
|
|
|
|
| |
computeTransitivelyUsedModules to return early on missing values instead of
starting to create datastructures.
RELNOTES: None.
PiperOrigin-RevId: 208351193
|
|
|
|
|
|
|
| |
need them later.
RELNOTES: None.
PiperOrigin-RevId: 208345603
|
|
|
|
|
|
|
|
|
|
| |
set of all declared headers, iterate over them and remove them from a (often
much smaller) set.
This should improve runtime as well as amount of garbage produced.
RELNOTES: None.
PiperOrigin-RevId: 207710867
|
|
|
|
|
|
|
|
| |
Since builtin include directories affect validation, they have to be part of the
action key.
RELNOTES: None.
PiperOrigin-RevId: 206960988
|
|
|
|
|
|
|
|
| |
function, discoverInputs() can be implemented to return null upon encountering
missing ActionExecutionValues.
RELNOTES: None.
PiperOrigin-RevId: 206913969
|
|
|
|
|
|
|
|
| |
Modular codegen simply transforms a .pcm file to a .o file containing the code
of inline functions of the module's headers.
RELNOTES: None
PiperOrigin-RevId: 206902693
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a step towards making CppCompileAction work without input discovery.
This works because:
- filterDiscoveredHeaders() is not necessary if we don't discover any
- shouldPruneModules is always false if `shouldScanIncludes` is false (see CppCompileActionBuilder#shouldPruneModules())
RELNOTES: None.
PiperOrigin-RevId: 206721143
|
|
|
|
|
|
|
|
|
| |
supposed to be shared.
Note that CppCompileAction#discoversInputs() will still almost always return true because it's still set to true when .d file pruning is enabled.
RELNOTES: None.
PiperOrigin-RevId: 206716704
|
|
|
|
|
|
|
|
|
| |
the declared directories. Especially when doing validation during input
discovery, the discovery's over-approximation can lead to isDeclaredIn walking
the full path to the root without finding a declared include directory.
RELNOTES: None.
PiperOrigin-RevId: 205958078
|
|
|
|
|
|
|
| |
For now, implicitly convert "warn" to "loose".
RELNOTES: None.
PiperOrigin-RevId: 205652060
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
makes it possible to disable .d file scanning when input discovery is used
without allowing the usage of undeclared headers.
The way this is implemented relies on having a sand-boxed or remote execution
environment and simply removes undeclared files from discovered inputs. As a
result, the compiler cannot see them and can diagnose missing headers.
The input discovery itself cannot (usually) diagnose undeclared headers as it
is often implemented to be an over-approximation. It needs to find all used
headers, but it is allowed to find more. Diagnosing these additional headers
would not be useful.
RELNOTES: None.
PiperOrigin-RevId: 205628312
|
|
|
|
|
|
|
|
|
| |
being executed if the action requires input discovery. Input discovery might
actually change the action's command line, which in turn can become part of the
file being written.
RELNOTES: None.
PiperOrigin-RevId: 205207109
|
|
|
|
|
|
|
| |
to the include scanner and slightly reshuffle code.
RELNOTES: None.
PiperOrigin-RevId: 204906167
|
|
|
|
|
|
|
|
|
|
|
| |
- Don't duplicate usedModules into additionalInputs (this shouldn't be
necessary).
- Use ImmutableLists instead of ImmutableSets where possible to reduce memory
consumption.
- Use set operations to make the code more readable.
RELNOTES: None.
PiperOrigin-RevId: 204268489
|
|
|
|
|
|
|
|
|
| |
the result of include validation if dotd file scanning (and in turn input
validation) is disabled. Fingerprinting these data structures is costly as they
are large NestedSets.
RELNOTES: None.
PiperOrigin-RevId: 204112075
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
compose a nested set encompassing both). The current prunableHeaders were used
in various places, at least two of which let to a duplicate iteration through
the comparatively large declaredIncludeSrcs: CppCompileAction.computeKey() and
CppCompileAction.getAllowedDerivedInputs().
Also do some other minor optimizations:
- CcCompileActionBuilder.buildAllInputs() now just returns a NestedSet with the
same order as its parameter. As inputsForValidation is almost always empty,
this makes this NestedSet pass the underlying one through.
- CcCompilationContext.directModuleMaps is just a list of the module maps of
direct dependencies. As such, there is no use for keeping them in a
NestedSet.
RELNOTES: None.
PiperOrigin-RevId: 203938011
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Don't use NestedSets of NestedSets. Not sure whether this is a performance
improvement or has serialization benefits, but it does make understanding the
structure a lot easier.
- Use the same large NestedSet for all header information (whether or not they
are modular and what pregrepped headers might exist). This speeds up the
include scanner calls getLegalGeneratedScannerFileMap and getModularHeaders
because they now iterate over just a single NestedSet and the second
evaluation of a NestedSet is much cheaper. In a subsequent change, we can
likely fold all three iterations over this NestedSet into one (in
getLegalGeneratedScannerFileMap, getModularHeaders and getUsedModules).
Measurements show a small reduction in heap usage.
RELNOTES: None.
PiperOrigin-RevId: 203909308
|
|
|
|
|
|
|
| |
want to use input discovery when building modules for performance reasons.
RELNOTES: None.
PiperOrigin-RevId: 203463009
|
|
|
|
|
|
|
|
|
|
|
| |
building with C++ modules, .d file scanning is not effective as Clang (only
compiler supporting Bazel's version of C++ modules) reads all of the files
passed in anyway.
This is not meant to be activated yet, but for running experiments.
RELNOTES: None.
PiperOrigin-RevId: 203459168
|
|
|
|
|
|
|
| |
modules.
RELNOTES: None.
PiperOrigin-RevId: 203454562
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
| |
RELNOTES: Support for LIPO has been fully removed.
PiperOrigin-RevId: 200724578
|
|
|
|
|
|
| |
- migrate all startTask/completeTask pairs to the new API
PiperOrigin-RevId: 200038703
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This cl adds Skylark constants allowing users to specify which C++ action they
want for the feature configuration Skylark API. This is done by exposing a
Skylark file at @bazel_tools//tools/cpp:action_names.bzl.
Skylark api to the C++ toolchain doc:
https://docs.google.com/document/d/1g91BWJITcYw_X-VxsDC0VgUn5E9g0kRBGoBSpoO41gA/edit#.
Progress on #4571.
RELNOTES: None.
PiperOrigin-RevId: 199596778
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In the process, make it so that running an extra action attached to a
CppCompileAction does not change the state of the CppCompileAction (yes, this
happened: if include scanning was not done, topLevelModules would be changed)
There are two changes in behavior this will: introduce
1. topLevelModules will no longer be set if include scanning is not in effect, but that's okay: it's never read except when shouldPruneModules is true, and if that is true, #discoverInputsStage2() will set it.
2. Extra actions attached to CppCompileAction will not get .pcm files on their inputs that were not used by the compiler
RELNOTES: None.
PiperOrigin-RevId: 199285276
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- declaredIncludeSrcs don't need to be looked at as they also become part of
the compilation prerequisites (see
CcCompilationContext.addDeclaredIncludeSrc())
- transitiveModules can never be "incorrect" as they get computed and added by
Bazel itself.
- declaredIncludeDirs/warnIncludeDirs can be computed lazily. As most people
aim for a warning-free build, it is rarely necessary to compute either set in
practice.
RELNOTES: None.
PiperOrigin-RevId: 198386262
|
|
|
|
|
|
|
| |
It's unused.
RELNOTES: NONE.
PiperOrigin-RevId: 198316668
|
|
|
|
|
|
|
|
| |
discovery at the boundary of modular headers. C++ modules generally should be
self-contained and a using a C++ module doesn't require any of it's transitive
source files to be present.
PiperOrigin-RevId: 198299936
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The difference between them is that user_link_flags will stay after we remove
legacy fields from the crosstool.
This is an encore of https://github.com/bazelbuild/bazel/commit/2661abb96b1fe51fb726a63eb08698564a82eb20 after mitigating the memory regression.
Original cl regressed 12mb (on a big enough internal project :):
objsize chg instances space KB class name
------------------------------------------------------
24 +0 190265 4459 KB com.google.common.collect.ImmutableMapEntry
40 +0 95154 3716 KB com.google.common.collect.RegularImmutableMap
47 -2 95154 2230 KB [Ljava.util.Map$Entry;
44 -1 95154 2230 KB [Lcom.google.common.collect.ImmutableMapEntry;
24 +0 95149 2230 KB com.google.devtools.build.lib.rules.cpp.CcToolchainVariables$MapVariables
16 +0 95149 1486 KB com.google.devtools.build.lib.rules.cpp.CcToolchainVariables$StringSequence
89 +0 3188 176 KB [B
64 -8 0 -743 KB com.google.devtools.build.lib.rules.cpp.LinkCommandLine
76 +0 -1918 -1323 KB [Ljava.lang.Object;
24 +0 -95149 -2230 KB com.google.devtools.build.lib.rules.cpp.CcToolchainVariables$SingleVariables
------------------------------------------------------
The reason was that before legacy_link_flags were the only build variable
patched because of thinlto in CppLinkActionBuilder, so it used optimized
SingleVariables subclass. With the split, the patched variables instance had 2
variables therefore it received the full blown Variables instance. That
accounted for the ~7mb.
The fix was to move the patching logic to the initial link variables creation
and not to create patched variables at all. Now the regression is ~4.8mb, which
is perfectly expected since I introduce another variable and this is the
overhead of additional hashmap entry:
objsize chg instances space KB class name
------------------------------------------------------
24 +0 190418 4462 KB com.google.common.collect.ImmutableMapEntry
44 +1 31 1487 KB [Lcom.google.common.collect.ImmutableMapEntry;
16 +0 95149 1486 KB com.google.devtools.build.lib.rules.cpp.CcToolchainVariables$StringSequence
47 +0 31 744 KB [Ljava.util.Map$Entry;
89 +0 5723 315 KB [B
24 +0 5721 134 KB java.lang.String
64 -8 0 -743 KB com.google.devtools.build.lib.rules.cpp.LinkCommandLine
76 +0 -2387 -840 KB [Ljava.lang.Object;
24 +0 -95149 -2230 KB com.google.devtools.build.lib.rules.cpp.CcToolchainVariables$SingleVariables
------------------------------------------------------
I'll pay this dept back once we get rid of legacy crosstool fields (= removal of
legacy_link_flags variable).
RELNOTES: None.
PiperOrigin-RevId: 197574153
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
*** Reason for rollback ***
Breaks perf regtest
*** Original change description ***
Split user_link_flags from legacy_link_flags
The difference between them is that user_link_flags will stay after we remove
legacy fields from the crosstool.
RELNOTES: None.
PiperOrigin-RevId: 197180518
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
| |
The difference between them is that user_link_flags will stay after we remove
legacy fields from the crosstool.
RELNOTES: None.
PiperOrigin-RevId: 196940832
|
|
|
|
|
|
|
| |
separate class
RELNOTES: None.
PiperOrigin-RevId: 196517537
|
|
|
|
|
|
|
| |
Since it's not a provider, it doesn't need the Info suffix anymore.
RELNOTES:none
PiperOrigin-RevId: 196498526
|
|
|
|
| |
PiperOrigin-RevId: 195973862
|
|
|
|
| |
PiperOrigin-RevId: 195094385
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently we report "Analyzing" when include scanning runs. But since we can
have shared C++ compile actions, only one of the group will be executed and only
one will be reported completed. Remaining shared actions currently stay with
"analyzing" forever.
This cl makes sure that these actions are properly handled when finished.
This is an encore of https://github.com/bazelbuild/bazel/commit/24f19ec2679dd93b1ac5b06e46f3b35807d6e217. In this incarnation I make sure that all actions that discover inputs are consistent in reporting their Analyzing status. Originally only CppCompileAction was doing that. Apparently we have more actions that discover inputs (e.g. LtoBackendAction) but these were not reporting Analyzing and therefore crashing on preconditions. This cl makes sure that all actions discovering inputs report their analyzing status.
RELNOTES: None
PiperOrigin-RevId: 194066513
|
|
|
|
|
|
|
| |
This allows a C++ file to include headers from a tree artifact, and pass header inclusion checks.
RELNOTES: None.
PiperOrigin-RevId: 193967617
|
|
|
|
|
|
|
|
|
|
|
| |
We always prepend crosstool top path anyway, so let's create Tool instances with
the already prepared path.
I don't expect this affects memory usage since we don't have many cc_toolchain
targets in the graph.
RELNOTES: None
PiperOrigin-RevId: 193660445
|
|
|
|
|
|
| |
Action execution.
PiperOrigin-RevId: 192488641
|
|
|
|
| |
PiperOrigin-RevId: 192153123
|
|
|
|
|
|
|
|
|
| |
* Skylark serialization was previously dropping location in error, which this fixes.
* Deletes a lot of codecs with fidelity issues (DynamicCodec has full fidelity).
* Deletes EnumRuntimeCodec which can now be replaced with the superior EnumCodec.
* This should eventually allow us to delete Serializable from all Blaze. The remaining blocker is NoSuchPackageExceptionCodec.
PiperOrigin-RevId: 191603929
|
|
|
|
|
|
|
|
|
| |
This is done so that the name CcCompilationInfo can be used for the C++
provider that will wrap all providers for compilation, similar to JavaInfo in
Java.
RELNOTES:none
PiperOrigin-RevId: 191445120
|
|
|
|
|
|
|
|
|
|
|
| |
infrastructure.
This was added in unknown commit to provide a different environment to Apple toolchains, then its use removed in unknown commit in favor of getting the environment variables from the CToolchain proto.
I haven't done my research if that's a better approach, but it looks like it (the less hard-coded stuff we have in Java, the better), but worst of all is surely to have *two* such mechanisms.
RELNOTES: None.
PiperOrigin-RevId: 191411878
|
|
|
|
|
|
| |
Profiling can hold onto objects for the duration of the build, and some of those objects may be temporary that should not be persisted. In particular, UnixGlob and its inner classes should not outlive loading and analysis. For the most part, care was taken in this CL to only use strings that required no additional construction, mainly to minimize garbage (retaining references to newly created strings is not as great a concern since only the strings corresponding to the slowest K tasks are retained, for some relatively small values of K). Action descriptions for actually executing actions are eagerly expanded because that work is minimal compared to the work of actually executing an action.
PiperOrigin-RevId: 191251488
|
|
|
|
|
|
|
| |
files for include statments. This binary is currently only used for an internal feature - but that feature may be supported externally eventually.
RELNOTES: None
PiperOrigin-RevId: 188173513
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Link inputs are there only to invalidate the action, they don't affect the
execution of the compile action. This cl optimizes the action execution by not
having to collect unnecessary inputs into the sandbox.
Since this is CppCompileAction and nothing is easy here, let me elaborate on my
assumptions. The goal of this cl is to stop passing unneeded inputs into Spawns.
This is implemented by introducing a dispensableInputs field to the
CppCompileAction. SpawnGccStrategy then doesn't forward these further.
I'm not adding dispensableInputs to the ActionKey. I think it's enough to put
them to the inputs and into the updateActionInputs method.
RELNOTES: None.
PiperOrigin-RevId: 187849482
|