aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/rules/cpp
Commit message (Collapse)AuthorAge
* Implement input pruning using .d files in objc behind a flag that defaults toGravatar Cal Peyser2016-09-28
| | | | | | | false. -- MOS_MIGRATED_REVID=134452391
* Don't use link action feature configuration in LTO Backend command lineGravatar Googler2016-09-23
| | | | | | | | | | | | | | The link action feature configuration command line options aren't needed in the LTO Backend compile command line. This additionally causes a failure when trying to compile ThinLTO and FDO, as the build variables for the FDO link options in the feature configuration are not set. Confirmed that this is a no-op for non-FDO builds (there are no c++-link* features), which is probably why I didn't notice this and remove it earlier. We add the lto-backend features later in LTOBackendArtifacts.scheduleLTOBackendAction() -- MOS_MIGRATED_REVID=134076174
* Rollback of commit 4946ab9d5b5d78862c043e35342107a1b9b2f398.Gravatar Cal Peyser2016-09-23
| | | | | | | | | | | | | *** Reason for rollback *** We *still* have case discrepancies in objc code, which appears to be a hard blocker to .d pruning. This change will not work until we've found some way to enforce case-consistency. *** Original change description *** Implement input pruning using .d files in objc. -- MOS_MIGRATED_REVID=134069949
* Implement input pruning using .d files in objc.Gravatar Cal Peyser2016-09-22
| | | | | -- MOS_MIGRATED_REVID=133944059
* Split dynamic configurations mode into:Gravatar Greg Estren2016-09-22
| | | | | | | | | | | | | | | --experimental_dynamic_configs=off - don't use dynamic configs --experimental_dynamic_configs=on - use dynamic configs with trimmed fragments --experimental_dynamic_configs=notrim - use dynamic configs with all fragments This lets us decouple two independent dimensions of dynamic configurations: 1) being able to trigger new configurations and transitions anywhere and 2) only including the fragments needed by a target's transitive closure. 2) is likely to take much more time and effort to properly finesse (three notable challenges: late-bound attributes, aspects, and dynamic shedding of output path names). But 1) by itself already yields significant benefits. So in the name of starting to shift the config work from backend theory to stuff real builds actually use, this change lets us focus on productionizing 1) without blocking on getting all of 2) working first. tl;dr: iterable deployment and all that. -- MOS_MIGRATED_REVID=133874661
* Some updates to C++ to support Clif, an automatic interface generator for ↵Gravatar Googler2016-09-22
| | | | | | | C++/Python. -- MOS_MIGRATED_REVID=133863929
* Replace BuildConfiguration.Fragment#collectExecutables() with a ↵Gravatar Lukacs Berki2016-09-22
| | | | | | | | | #getShellExecutable() method. That's all it was used for anyway. -- MOS_MIGRATED_REVID=133824769
* Rollback of commit 82d43279f93d95e4c41b4bc598a3cc05ddd1ae1a.Gravatar Laszlo Csomor2016-09-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | *** Reason for rollback *** Breaks TensorFlow and other Bazel jobs on ci.bazel.io *** Original change description *** Change execution root for external repositories to be ../repo Some of the important aspect of this change: * Remote repos in the execution root are under output_base/execroot/repo_name, so the prefix is ../repo_name (to escape the local workspace name). * Package roots for external repos were previously "output_base/", they are now output_base/external/repo_name (which means source artifacts always have a relative path from their repository). * Outputs are under bazel-bin/external/repo_name/ (or similarly under genfiles). Note that this is a bit of a change from how this was implemented in the previous cl. Fixes #1262. RELNOTES[INC]: Previously, an external repository would be symlinked into the execution root at execroot/local_repo/external/remote_repo. This changes it to be at execroot/remote_repo. This may break genrules/Skylark actions that hardcode execution root paths. If this causes breakages for you, ensure that genrules are using $(location :target) to access files and Skylark rules are using http://bazel.io/docs/skylark/lib/File.html's path, dirname, etc. functions. Roll forward of bdfd58a. -- MOS_MIGRATED_REVID=133709658
* Move ThinLTO indexing and backend options to Crosstool feature configurationGravatar Googler2016-09-20
| | | | | -- MOS_MIGRATED_REVID=133609638
* Change execution root for external repositories to be ../repoGravatar Kristina Chodorow2016-09-20
| | | | | | | | | | | | | | | | | | | | | | | Some of the important aspect of this change: * Remote repos in the execution root are under output_base/execroot/repo_name, so the prefix is ../repo_name (to escape the local workspace name). * Package roots for external repos were previously "output_base/", they are now output_base/external/repo_name (which means source artifacts always have a relative path from their repository). * Outputs are under bazel-bin/external/repo_name/ (or similarly under genfiles). Note that this is a bit of a change from how this was implemented in the previous cl. Fixes #1262. RELNOTES[INC]: Previously, an external repository would be symlinked into the execution root at execroot/local_repo/external/remote_repo. This changes it to be at execroot/remote_repo. This may break genrules/Skylark actions that hardcode execution root paths. If this causes breakages for you, ensure that genrules are using $(location :target) to access files and Skylark rules are using http://bazel.io/docs/skylark/lib/File.html's path, dirname, etc. functions. Roll forward of bdfd58a. -- MOS_MIGRATED_REVID=133606309
* Description redacted.Gravatar Googler2016-09-19
| | | | | -- MOS_MIGRATED_REVID=133442221
* Add a specialized TransitiveInfoProviderMap to map TransitiveInfoProviders ↵Gravatar Googler2016-09-19
| | | | | | | | | | | | by class. TransitiveInfoProviderMap enforces that the provider implements the interface it's keyed by and provides accessors the reduce the amount of casting. This in general reduces boilerplate throughout wherever TransitiveInfoProviders are mapped by their class. Also add shorthand for adding a provider where it only implements TransitiveInfoProvider once, reducing the redundant specification of the TransitiveInfoProvider class. Infer the class as the exclusive direct implementor of TransitiveInfoProvider to account for special cases like AutoValue and LicenseProvider. -- MOS_MIGRATED_REVID=133386336
* Rollback of commit a85bf4b19c680a6db11f21758847dc88ec0aa658.Gravatar Cal Peyser2016-09-16
| | | | | | | | | | | | | *** Reason for rollback *** Breaks Bigtop incremental build *** Original change description *** Implement input pruning using .d files in objc. -- MOS_MIGRATED_REVID=133271059
* Fix a bug that leads to unnecessary compiles of .pic.o files (and possibly)Gravatar Googler2016-09-12
| | | | | | | | | | | | | | | | | | | | | | others in opt compiles. A while back, we added a HIDDEN_TOP_LEVEL output group to CcBinary targets to ensure that --process_headers_in_dependencies works as expected for them. However, adding all HIDDEN_TOP_LEVEL files is actually too much and e.g. also contains .pic.o files which are expensive to build but not actually needed for the compile. The fundamental difference between CcLibrary and CcBinary targets here is that a CcBinary already declares most of its inputs as it needs all of them to link the binary. In contrast, CcLibraries wouldn't need any of they dependent .o files and thus wouldn't even try to build them. This changes splits out the header token files which are required to make --process_headers_in_dependencies work correctly and only adds those to HIDDEN_TOP_LEVEL outputs of binaries files. Also removing some unused code that was producing warnings. -- MOS_MIGRATED_REVID=132883722
* Automatically detect the setting for --cpu.Gravatar Ulf Adams2016-09-12
| | | | | | | | | | | | | | | | | | In some cases, Bazel has already been doing this. In other cases, Bazel tried to infer the default cpu from the CROSSTOOL, but it did not do so consistently across different configuration fragments. I.e., Bazel ended up with an inconsistent set of toolchains for e.g., Python, C++, and Java. After this change, Bazel ignores any default_cpu setting in the CROSSTOOL. Note that the Jvm is still inconsistent with all others, as it uses "default" as the cpu value and ignores both command-line-specified and CROSSTOOL-specified values. -- MOS_MIGRATED_REVID=132879102
* Do not discover inputs for an action that will not scan includes. This isGravatar Cal Peyser2016-09-12
| | | | | | | necessary for objc compiles, for which include scanning can be incorrect. -- MOS_MIGRATED_REVID=132876916
* Restore sane behavior after a really bad merge (?) in commit ↵Gravatar Googler2016-09-12
| | | | | | | | | | a85bf4b19c680a6db11f21758847dc88ec0aa658. The bad merge undid part of the behavior around pruning header modules and also passed in "shouldPruneModules" as "usePic". -- MOS_MIGRATED_REVID=132846871
* Make cc_toolchain not croak if something that is not a shared library is ↵Gravatar Lukacs Berki2016-09-12
| | | | | | | mentioned in the dynamic_runtime_libs attribute. -- MOS_MIGRATED_REVID=132676097
* Make the code that is using execRoot paths use execRoot pathsGravatar Kristina Chodorow2016-09-09
| | | | | | | | | | | Chipping away at making the big CL for #1262 smaller. Only runfiles paths are different right now, so this makes getPathUnderExecRoot and getSourceRoot return the same thing. Also corrected a couple places where Label.EXTERNAL_PATH_PREFIX and Label.EXTERNAL_PACKAGE_NAME were being used incorrectly. -- MOS_MIGRATED_REVID=132671081
* Add repository parameter to source artifact resolverGravatar Kristina Chodorow2016-09-09
| | | | | | | Needed for #1262. Doesn't do anything, yet, other than make the CL smaller. -- MOS_MIGRATED_REVID=132671036
* Add an "is main repo" field to RootsGravatar Kristina Chodorow2016-09-09
| | | | | | | This is part of prepping for #1262. -- MOS_MIGRATED_REVID=132553178
* Implement input pruning using .d files in objc.Gravatar Cal Peyser2016-09-09
| | | | | -- MOS_MIGRATED_REVID=132550233
* Make FdoSkyException static.Gravatar Lukacs Berki2016-09-09
| | | | | | | It was an ugly oversight. -- MOS_MIGRATED_REVID=132549653
* Correct documentation for CcLibraryHelper#addIncludeDirs.Gravatar Cal Peyser2016-09-08
| | | | | -- MOS_MIGRATED_REVID=132547161
* Disable pruning header modules for FakeCppCompileActions. Those currently run aGravatar Googler2016-09-07
| | | | | | | | build first before discovering their inputs and this build doesn't properly declare its inputs if we do pruning. -- MOS_MIGRATED_REVID=132414200
* Remove support for filegroup-based C++ toolchains:Gravatar Lukacs Berki2016-09-07
| | | | | | | RELNOTES[INC]: filegroup-based C++ toolchains are not supported anymore. --*_crosstool_top options must always point to a cc_toolchain_suite rule (or an alias of one). -- MOS_MIGRATED_REVID=132410829
* Don't verify include paths automatically. This enables objc to disable ↵Gravatar Cal Peyser2016-09-07
| | | | | | | include paths. -- MOS_MIGRATED_REVID=132345416
* Fix typoGravatar Marcel Hlopko2016-09-06
| | | | | -- MOS_MIGRATED_REVID=132261111
* Rollback of commit 4689c5d1d2faf902846b100b8d858d172a0ceb3d.Gravatar Cal Peyser2016-09-06
| | | | | | | | | | | | | *** Reason for rollback *** Prunes .modulemap files incorrectly. See []. *** Original change description *** Implement input pruning using .d files in objc. -- MOS_MIGRATED_REVID=132246906
* Implement input pruning using .d files in objc.Gravatar Cal Peyser2016-09-06
| | | | | -- MOS_MIGRATED_REVID=132061988
* Disable module file pruning for the build of other modules.Gravatar Googler2016-09-06
| | | | | | | | | | | | | | | | | | Pruning here can lead to a insufficient rebuilds which in turn cause module-out-of-date errors. The problem surfaces if a module A depends on a module B, but the headers of module A don't actually use any of B's headers. Then we would currently not need to rebuild A when B changes although we are storing a dependency in it. If B changes and we then build something that uses A (a header of it), we mark A as well as all of its transitive dependencies as inputs. We still don't need to rebuild A, as none of its inputs have changed, but we do rebuild B now and then the two modules are out of sync. For now, just disable pruning of header modules while building the modules. In the long run, it would be even better to not embed a dependency on B into A, but that requires signficantly larger changes. -- MOS_MIGRATED_REVID=132039754
* Description redacted.Gravatar Cal Peyser2016-09-02
| | | | | -- MOS_MIGRATED_REVID=131990160
* Adds support for experimental_objc_library.includesGravatar Cal Peyser2016-09-02
| | | | | -- MOS_MIGRATED_REVID=131965224
* Implement input pruning using .d files in objc.Gravatar Cal Peyser2016-09-02
| | | | | -- MOS_MIGRATED_REVID=131951535
* Create injectable semantics for include validation, to allow it to be turnedGravatar Cal Peyser2016-09-01
| | | | | | | off in the objc case. -- MOS_MIGRATED_REVID=131943500
* Remove the "cc_*.includes attribute must refer to the third_party directory" ↵Gravatar Lukacs Berki2016-08-31
| | | | | | | | | | | warning from Bazel. This behavior doesn't really make sense except within Google. Fixes #1286. -- MOS_MIGRATED_REVID=131813322
* Do not load the transitive closure of the Android SDK on every build.Gravatar Lukacs Berki2016-08-31
| | | | | | | This makes the sanity check dependent on the configuration fragments returning proper roots, but it's not that bad because it already depends on them returning the proper set of implicit labels and #getImplicitLabels() will go away soon anyway. -- MOS_MIGRATED_REVID=131705535
* Remove the dependency from the C++ rules to Apple stuff.Gravatar Ulf Adams2016-08-29
| | | | | | | | | | | This makes the C++ rules standalone, and the CcCommonTest ensures that (at least) analysis of C++ targets works even if no Apple / Xcode rules are present. We can also compile them separately, in a future change. -- MOS_MIGRATED_REVID=131583691
* Action#discoverInputs returns an Iterable<Artifact> instead of aGravatar Cal Peyser2016-08-25
| | | | | | | Collection<Artifact> -- MOS_MIGRATED_REVID=131285541
* Fix nocompile tests after commit b6fd4ed25b6201eaaabb14c389c02819184ad4a6. I ↵Gravatar Googler2016-08-24
| | | | | | | | | | | | | can't say that I fully know what I am doing, but this basically reinstantiates the old behavior. Before commit b6fd4ed25b6201eaaabb14c389c02819184ad4a6, transitive modules were added in getAdditionalInputs() (by adding both topLevelHeaderModules and impliedHeaderModules). I removed that, but we still need to create the corresponding symlinks, so adding transitiveModules outside of getAdditionalInputs now. -- MOS_MIGRATED_REVID=131139735
* Adds a flag to generate LLVM coverage symbols.Gravatar Erik Abair2016-08-23
| | | | | | | | | This change adds a new --experimental_use_llvm_covmap flag which may be used in conjunction with the --collect_code_coverage flag to generate LLVM style coverage symbols instead of gcov. -- MOS_MIGRATED_REVID=131065609
* Prune .pcm files based on the results of include scanning.Gravatar Googler2016-08-23
| | | | | | | Basically, take the set of headers found by #include scanning and check what modules they are coming from. If a module provides at least one of the required headers, it is required as are all of its dependent modules (because of the way modules are implemented). Only use the actually required modules as compilation inputs and as flags handed in on the command line. Also move the logic to calculate top-level modules from the analysis phase into the execution phase. In the long run, we might be able to completely remove this logic now, but for now, we want to be able to quickly switch between the old and the new behavior. Thus, pruning of modules is now guarded on a feature prune_module_headers. -- MOS_MIGRATED_REVID=131058820
* Remove CppCompilationContext.equals/hashCode. Making them throw an exceptionGravatar Googler2016-08-23
| | | | | | | | | shows that they aren't actually used anymore. If they were, they wouldn't work as expected as the nested sets that are used in the comparison don't implement hashCode or equals. -- MOS_MIGRATED_REVID=130945911
* Remove support for thin archives.Gravatar Lukacs Berki2016-08-23
| | | | | -- MOS_MIGRATED_REVID=130938527
* Instead of filtering for dynamic libraries when creating solib symlinks, ↵Gravatar Lukacs Berki2016-08-22
| | | | | | | | | assert that solib symlinks always point to dynamic libraries. Note that this makes it possible to crash Bazel with a malicious CROSSTOOL file, but since we are migrating to cc_toolchain_suite which raises a user-friendly error earlier, this is okay. -- MOS_MIGRATED_REVID=130915262
* Make Bazel not crash when a cc_library is in the hdrs of another cc_library.Gravatar Lukacs Berki2016-08-22
| | | | | -- MOS_MIGRATED_REVID=130914217
* Implement the fully link action in the OSX crosstool.Gravatar Cal Peyser2016-08-18
| | | | | -- MOS_MIGRATED_REVID=130547971
* Set the LibraryIdentifier before building the LTO Indexing link actionGravatar Googler2016-08-18
| | | | | | | | | | Otherwise we fail the Precondition check added at the start of CppLinkAction build() for a shared library target's indexing action. Added a test which reproduces the issue without the fix. -- MOS_MIGRATED_REVID=130513291
* Remove the awkward logic that used to look at the string form at a command ↵Gravatar Lukacs Berki2016-08-18
| | | | | | | line option to determine if it should be a whole archive one and use the artifact category in LinkerInput to make that decision instead. -- MOS_MIGRATED_REVID=130508699
* Differentiate between regular and alwayslink static libraries in ↵Gravatar Lukacs Berki2016-08-17
| | | | | | | LinkerInput#getArtifactCategory() and use this information to remove one use of LINK_LIBRARY_FILETYPES. -- MOS_MIGRATED_REVID=130400793