aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/rules/cpp
Commit message (Collapse)AuthorAge
* Disable include scanning for C++ linkstamp compile actions, which are ↵Gravatar lberki2018-07-31
| | | | | | | | | 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
* Internal changeGravatar ruperts2018-07-30
| | | | PiperOrigin-RevId: 206642715
* Automated rollback of commit 71479d3ef1627a30b9ec75ca50e6a90cf7db6377.Gravatar ruperts2018-07-27
| | | | | | | | | | | | | | | | | | | | | *** Reason for rollback *** http://https://github.com/bazelbuild/bazel/commit/71479d3ef1627a30b9ec75ca50e6a90cf7db6377 broke thousands of targets in the nightly, notably: //abuse/ares/rulesystem/generator/python/rule_set:main (x1754) //net/encapdecap/common/templates:gen_dr_scopes (x903) //testing/cloud/vex/public:vex_main_internal (x782) //wireless/android/play/playlog/server:playlog_server (x401) *** Original change description *** C++: Removes calls to setCcLinkparamsStore of CcLinkingInfo.Builder This is in preparation for deleting CcLinkParamsStore. All remaining calls to the setCcLinkparamsStore method of the CcLinkingInfo builder have been removed. RELNOTES:none PiperOrigin-RevId: 206361808
* C++: Removes calls to setCcLinkparamsStore of CcLinkingInfo.BuilderGravatar plf2018-07-26
| | | | | | | | This is in preparation for deleting CcLinkParamsStore. All remaining calls to the setCcLinkparamsStore method of the CcLinkingInfo builder have been removed. RELNOTES:none PiperOrigin-RevId: 206128439
* C++: Removes calls to setCcLinkparamsStore of CcLinkingInfo.BuilderGravatar plf2018-07-26
| | | | | | | | | | This is in preparation for deleting CcLinkParamsStore. Not all calls to setCcLinkparamsStore have been removed in this CL. Roll forward with bzl change in separate CL (unknown commit) and giving a proper error in Skylark instead of a crash when CcLinkingInfo is not built correctly. RELNOTES:none PiperOrigin-RevId: 206122870
* Automated rollback of commit 16dde0de06a3a4157a13e7e7264afeb6a50b2dde.Gravatar janakr2018-07-25
| | | | | | | | *** Reason for rollback *** Crash (see linked bug). PiperOrigin-RevId: 206060905
* C++: Removes calls to setCcLinkparamsStore of CcLinkingInfo.BuilderGravatar plf2018-07-25
| | | | | | | | This is in preparation for deleting CcLinkParamsStore. Not all calls to setCcLinkparamsStore have been removed in this CL. RELNOTES:none PiperOrigin-RevId: 205998687
* C++: Remove AbstractCcLinkParamsStore from providers.Gravatar plf2018-07-25
| | | | | | | | | | | | | 3 providers had AbstractCcLinkParamsStore as a class field, now they wrap CcLinkingInfo instead. This is being rolled forward, first try caused a NullPointerException in go_wrap_cc rules that had the attribute use_default_import set to False. GoWrapCcConfiguredTargetTest now has a go_wrap_cc rule that has this attribute set to false and fails with the previous version of this CL. RELNOTES:none PiperOrigin-RevId: 205959266
* Prevent unnecessary file stats when looking at whether an include is in one ofGravatar Googler2018-07-25
| | | | | | | | | 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
* Automated rollback of commit 6f1915114ec7af104a2649a454cc1519ce7806bf.Gravatar laurentlb2018-07-24
| | | | | | | | | | | | | | | | *** Reason for rollback *** Crash with NullPointerException *** Original change description *** C++: Remove AbstractCcLinkParamsStore from providers. 3 providers had AbstractCcLinkParamsStore as a class field, now they wrap CcLinkingInfo instead. RELNOTES:none PiperOrigin-RevId: 205885939
* Automated rollback of commit f309ad3be36363070e87eef0ee04b12f4956d601.Gravatar janakr2018-07-24
| | | | | | | | | | *** Reason for rollback *** Fixed duplicate derived inputs bug. Test is in diffbase. RELNOTES[INC]: If the same artifact is generated by two distinct but identical actions, and a downstream action has both those actions' outputs in its inputs, the artifact will now appear twice in the downstream action's inputs. If this causes problems in Skylark actions, you can use the uniquify=True argument in Args.add_args. PiperOrigin-RevId: 205863806
* C++: Remove AbstractCcLinkParamsStore from providers.Gravatar plf2018-07-24
| | | | | | | | 3 providers had AbstractCcLinkParamsStore as a class field, now they wrap CcLinkingInfo instead. RELNOTES:none PiperOrigin-RevId: 205821081
* Only expand dynamic_library_linker_tool feature when ↵Gravatar hlopko2018-07-23
| | | | | | | | | generate_interface_library is available This way users of the Skylark API don't see this feature expanded. RELNOTES: None. PiperOrigin-RevId: 205704719
* Remove "warn" setting for hdrs_check. This has not proven useful.Gravatar Googler2018-07-23
| | | | | | | For now, implicitly convert "warn" to "loose". RELNOTES: None. PiperOrigin-RevId: 205652060
* Add --experimental_enable_cc_toolchain_label_from_crosstool_proto flag for ↵Gravatar rosica2018-07-23
| | | | | | | | | disabling relying on CROSSTOOL file in order to select the cc_toolchain label CROSSTOOL file should not have any influence over selection of the cc_toolchain label. Ultimately the information that CROSSTOOL offers will be rerouted through an attribute of cc_toolchain. RELNOTES: None. PiperOrigin-RevId: 205651369
* Remove special casing for --incremental-changed and --incremental-unchanged.Gravatar lberki2018-07-23
| | | | | RELNOTES: None. PiperOrigin-RevId: 205646506
* C++: Refactors every provider wrapping CcLinkParamsStoreGravatar plf2018-07-23
| | | | | | | | Providers that were wrapping CcLinkParamsStore now wrap CcLinkingInfo instead. CcLinkParamsStore will be deleted in a future CL. RELNOTES:none PiperOrigin-RevId: 205629924
* Implement a way to do include validation as a part of input discovery. ThisGravatar Googler2018-07-23
| | | | | | | | | | | | | | | | | 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
* Tweak GUID for WriteBuildInfoHeaderAction to force it to be rebuiltGravatar Googler2018-07-20
| | | | | | | for this upgrade. RELNOTES=None. PiperOrigin-RevId: 205437116
* Do not check if features named include_paths or preprocessor_definesGravatar Googler2018-07-20
| | | | | | | | are enabled before setting the corresponding build variables for the crosstool. Such a conditional is unnecessary. RELNOTES: None. PiperOrigin-RevId: 205397072
* Open source SwigIncludeScanningContextGravatar ulfjack2018-07-20
| | | | | | This is in preparation for open sourcing our include scanning implementation. PiperOrigin-RevId: 205386312
* C++: Removes logic for linkopts expansion.Gravatar plf2018-07-20
| | | | | | | RELNOTES[INC]:Labels in C++ rules' linkopts attribute are not expanded anymore unless they are wrapped, e.g: $(location //foo:bar) PiperOrigin-RevId: 205385711
* Open source IncludeScanning glue codeGravatar ulfjack2018-07-20
| | | | | | One tiny step after the other. PiperOrigin-RevId: 205378056
* C++: Cleans up C++ Skylark APIGravatar plf2018-07-20
| | | | | | | | Feature configuration and toolchain are now mandatory arguments. Rule context is no longer a positional argument. RELNOTES:none PiperOrigin-RevId: 205367825
* C++: Implements Skylark cc_common.compile()/link().Gravatar plf2018-07-19
| | | | | | | Working towards #4570. RELNOTES:none PiperOrigin-RevId: 205274676
* Move --linkopt flags into user_link_flagsGravatar hlopko2018-07-19
| | | | | | | | | | | | | | | | Previous behavior was to put flags coming from Bazel option --linkopt into legacy_link_flags. They should be in user_link_flags instead (together with flags coming from linkopts rule attribute). This cl introduces --experimental_linkopts_in_user_link_flags option that flips the behavior. There is another incompatible change. Previously cc_common.create_link_variables() included flags from --linkopt, with the flag flipped it doesn't anymore. I believe --linkopt flags shouldn't be there by default because: * We don't tie the API with the specifics of C++ rules/options, enabling theoretical use with other languages (objc) * Users are free to use ctx.fragments.cpp to access C++ options and add them explicitly (https://github.com/bazelbuild/bazel/issues/5602) * New behavior maintains the symmetry with --copt and user_compile_flags RELNOTES: None. PiperOrigin-RevId: 205274272
* Remove workspace status language filter, and C++ linkstamp "VERBATIM" output ↵Gravatar Googler2018-07-19
| | | | | | | type. RELNOTES: None. PiperOrigin-RevId: 205237848
* Require the ActionExecutionMetadata to be passed to IncludeScannerGravatar ulfjack2018-07-19
| | | | | | | Also add an execution requirement that allows disabling reporting to the CLI; this will be used in a future change. PiperOrigin-RevId: 205216096
* Ensure that gathering the info for an extra action can rely on the actionGravatar Googler2018-07-19
| | | | | | | | | 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
* Rename CrosstoolInfo.java to CcToolchainConfigInfo.javaGravatar rosica2018-07-18
| | | | | RELNOTES: None. PiperOrigin-RevId: 205060182
* C++: Removes check for host configurationGravatar plf2018-07-18
| | | | | | | | | | | | | The C++ Skylark API is protected by a flag and whitelist. The flag's value should be true by default for non-Bazel. This is set with an invocation policy. In Bazel the default value is false. When this was checked in I couldn't find a way to use the default value in the host configuration, so when checking the flag we ignored the value for these cases. In this CL we copy the target config value to the host config. RELNOTES:none PiperOrigin-RevId: 205059612
* Remove a few unused fields from CrosstoolInfo.Gravatar lberki2018-07-18
| | | | | RELNOTES: None. PiperOrigin-RevId: 205046100
* Expose AndroidCcLinkParamsProvider to Skylark as AndroidCcLinkParamsInfo.Gravatar Googler2018-07-17
| | | | | RELNOTES: None PiperOrigin-RevId: 204927047
* Add flags for disabling legacy crosstool fieldsGravatar hlopko2018-07-17
| | | | | | | | | | | | This cl adds following flags: * --experimental_disable_legacy_cc_compilation_api * --experimental_disable_legacy_cc_linking_api * --experimental_disable_linking_mode_flags * --experimental_disable_compilation_mode_flags * --experimental_disable_legacy_crosstool_fields RELNOTES: None PiperOrigin-RevId: 204924599
* Pull out a class to hold the data that is transferred from a compilation actionGravatar Googler2018-07-17
| | | | | | | to the include scanner and slightly reshuffle code. RELNOTES: None. PiperOrigin-RevId: 204906167
* PiperOrigin-RevId: 204896222Gravatar Googler2018-07-17
|
* C++: Remove CcDynamicLibrariesForRuntime.Gravatar plf2018-07-16
| | | | | | | | | | | This was providing runtime libraries. This provider is redundant because the same libraries are in CcLinkParamsStore. Note to sheriff: Shouldn't break anything. If any, breakages would most likely be in Go test rules. I will look at the nightly tomorrow anyway. The breakages in the linked TGP re-run are not caused by this change, later re-runs have unrelated changes. TESTED=[] RELNOTES:none PiperOrigin-RevId: 204738136
* C++: New functionality exposed to Skylark for external libs.Gravatar plf2018-07-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - CcLinkingInfo has a getter for CcLinkParams. - Artifacts and linkopts of CcLinkParams are accessible. - CcCompilationInfo constructor now accepts defines and include dirs. - CcCompilation now has getters for headers, defines and include dirs. CcCompiilationInfo( headers=depset([Artifacts]), defines=depset([Strings]), include_dirs=depet([Strings]) CcCompilationInfo.headers CcCompilationInfo.defines CcCompilationInfo.include_dirs -- cc_common.merge([CcLinkingInfos]) returns CcLinkingInfo -- CcLinkingInfo.static_shared_params CcLinkingInfo.static_no_shared_params CcLinkingInfo.no_static_shared_params CcLinkingInfo.no_static_no_shared_params -- CcLinkParams.libraries CcLinkParams.linkopts CcLinkParams.dynamic_libraries_for_runtime RELNOTES:none PiperOrigin-RevId: 204700779
* Stop setting G3_VERSION_INFO C++ linkstamp variable.Gravatar Googler2018-07-13
| | | | | | RELNOTES: No longer define G3_VERSION_INFO for c++ linkstamp compiles, as it was a duplicate of G3_TARGET_NAME. PiperOrigin-RevId: 204466459
* Remove bazel info crosstool-configurationGravatar hlopko2018-07-13
| | | | | | | It was not opensourced, and even internally was not used. And we hate having internal-only code. RELNOTES: None. PiperOrigin-RevId: 204441702
* Do not expose interface building related variables in the Skylark C++ ↵Gravatar hlopko2018-07-12
| | | | | | | toolchain API RELNOTES: None. PiperOrigin-RevId: 204291210
* Simplify (hopefully) usage of modules during input discovery. Goals:Gravatar Googler2018-07-12
| | | | | | | | | | | - 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
* Set the version of a computed node to the max of its child versions rather ↵Gravatar janakr2018-07-11
| | | | | | | | | | | | | | | | | than the graph version when that is feasible. * It's not feasible when the computation accesses outside state, i.e. is non-hermetic, so see below. * It's also more complicated (and not worth the trouble) when the computation is taking place just for the error status. Have SkyFunctionName declare whether the function it corresponds to is hermetic or non-hermetic. Only non-hermetically-generated SkyValues can be directly marked changed, and non-hermetic SkyFunctions have their values saved at the graph version, not the max of the child versions. All SkyFunctions are hermetic except for the ones that can be explicitly dirtied. A marked-hermetic SkyFunction that has a transient error due to filesystem access can be re-evaluated and get the correct version: if it throws an IOException at version 1 and then, when re-evaluated at version 2 with unchanged dependencies, has a value, the version will be version 1. All Skyframe unit tests that were doing non-hermetic things to nodes need to declare that those nodes are non-hermetic. I tried to make the minimal set of changes there, so that we had good incidental coverage of hermetic+non-hermetic nodes. Also did some drive-by clean-ups around that code. Artifacts are a weird case, since they're doing untracked filesystem access (for source directories). Using max(child versions) for them gives rise to the following correctness bug: 1. do a build at v1 that creates a FileStateValue for dir/ at v1. Then at v2, add a file to dir/ and do a build that consumes dir/ as a source artifact. Now the artifact for dir/ will (incorrectly) have v1. Then at v1, do that build again. We'll consume the "artifact from the future". However, this can only have an effect when using the local action cache, since the incorrect value of the artifact (the mtime) is only consumed by the action cache. Bazel is already broken in this way (incremental builds don't invalidate directories), so this change doesn't make things worse. PiperOrigin-RevId: 204210719
* Deprecate py_extension "outs" attribute.Gravatar Googler2018-07-11
| | | | | RELNOTES: PiperOrigin-RevId: 204126150
* Skip fingerprinting stuff into a CppCompileAction's key that can only affectGravatar Googler2018-07-11
| | | | | | | | | 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
* Automated rollback of commit 3ea6c18a623d6495a81f12baace40d3bc8a72bbe.Gravatar lberki2018-07-11
| | | | | | | | | | | | | | | *** Reason for rollback *** Breaks non-Rabbit builds, see b/111275650. *** Original change description *** Avoid long, duplicated directory structures. In the common case, generated files are going to be beneath the target that generates them. In this case, don't duplicated the package's path. RELNOTES: None. PiperOrigin-RevId: 204084475
* C++: Exposes new parameters of C++ Skylark API.Gravatar plf2018-07-10
| | | | | | | This will be needed by py_wrap_cc in a follow up CL. RELNOTES:none PiperOrigin-RevId: 203964457
* Remove old implementation for object file pathGravatar pcloudy2018-07-10
| | | | | | RELNOTES: --experimental_shortened_obj_file_path is removed. PiperOrigin-RevId: 203944948
* Track additionallyPrunableIncludes separately from declaredIncludeSrcs (don'tGravatar Googler2018-07-10
| | | | | | | | | | | | | | | | | | 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
* Only compile a single source file once for a given cc_* rule.Gravatar lberki2018-07-10
| | | | | RELNOTES: None. PiperOrigin-RevId: 203934582