aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/analysis
Commit message (Collapse)AuthorAge
* Refactoring: Types report what class of labels they contain.Gravatar Michael Staib2017-02-14
| | | | | | | | | | | | | | | | | | | | | Currently label-type attributes are detected in many places across the codebase by simply reference-comparing against each of the label types. This CL aims to generalize most of these cases, moving the encoding of this logic into a single place (Type/BuildType itself). Not all of these cases can be made general without further refactoring, and some perhaps shouldn't be - serialization and Skylark rule context, for example, need to do exotic things based on the type. But most sites can avoid having to enumerate all the types they work with explicitly. This causes LABEL_DICT_UNARY to start being treated like the other label types, which means that CcToolchainSuiteRule and JavaRuntimeSuiteRule need to include a set of allowed file types (none, in their case). Skylark will continue treating it as a dictionary from String to Label in its rule context, however, to avoid visible behavior changes. -- PiperOrigin-RevId: 147471542 MOS_MIGRATED_REVID=147471542
* Fix the documentation of set/depsetGravatar Vladimir Moskva2017-02-14
| | | | | | -- PiperOrigin-RevId: 147456653 MOS_MIGRATED_REVID=147456653
* Remove special handling of name attribute. Fixes #278Gravatar Googler2017-02-14
| | | | | | | | | | | | | | | | | | | | | | | | | The name attribute gets special treatment in the codebase, in that it's not simply yet another attribute but stored in it's own field. Thus, every callside dealing with attributes needs to be aware of this special case and explicitly handle the name attribute. It's easy to see that this can lead to bugs. For example, querying for the name attribute is currently broken due the querying code not being aware of the special case [1]. Discussions with experienced bazel developers came to the conclusion that there is no need (anymore) to treat the name attribute specially and thus we decided it's best to remove the special treatment and handle the name attribute as any other attribute. This change removes the handling of name attributes and also adds a test case to verify that bug [1] is fixed. [1] https://github.com/bazelbuild/bazel/issues/278 -- PiperOrigin-RevId: 147446345 MOS_MIGRATED_REVID=147446345
* Rollback of commit cdbad585187dfe7bbb4d69ad68a1baf852beb691.Gravatar Michael Staib2017-02-14
| | | | | | | | | | | | | | | | | | | | | | *** Reason for rollback *** Breaks Skylark aspects running over rules with LABEL_DICT_UNARY attributes. *** Original change description *** Refactoring: Types report what class of labels they contain. Currently label-type attributes are detected in many places across the codebase by simply reference-comparing against each of the label types. This CL aims to generalize most of these cases, moving the encoding of this logic into a single place (Type/BuildType itself). Not all of these cases can be made general without further refactoring, and some perhaps shouldn't be - serialization and Skylark rule context, for example, need to do... -- PiperOrigin-RevId: 147385072 MOS_MIGRATED_REVID=147385072
* Add an algorithm to reduce aspect paths according to aspects' visibility to ↵Gravatar Dmitry Lomov2017-02-14
| | | | | | | | | | | | each other. Aspects negotiate their visibility by advertizing and requiring providers. The algorithm is not used yet (that is future work). -- PiperOrigin-RevId: 147354682 MOS_MIGRATED_REVID=147354682
* Refactoring: Types report what class of labels they contain.Gravatar Michael Staib2017-02-13
| | | | | | | | | | | | | | | | | | | Currently label-type attributes are detected in many places across the codebase by simply reference-comparing against each of the label types. This CL aims to generalize most of these cases, moving the encoding of this logic into a single place (Type/BuildType itself). Not all of these cases can be made general without further refactoring, and some perhaps shouldn't be - serialization and Skylark rule context, for example, need to do exotic things based on the type. But most sites can avoid having to enumerate all the types they work with explicitly. This causes LABEL_DICT_UNARY to start being treated like the other label types, which means that CcToolchainSuiteRule and JavaRuntimeSuiteRule need to include a set of allowed file types (none, in their case). -- PiperOrigin-RevId: 147175424 MOS_MIGRATED_REVID=147175424
* 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
* Allow aspects to adveritise providers they provide.Gravatar Dmitry Lomov2017-02-07
| | | | | | -- PiperOrigin-RevId: 146794883 MOS_MIGRATED_REVID=146794883
* 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
* Update GenRule to include the Cpp and Jdk toolchains and properly handleGravatar John Cater2017-02-06
| | | | | | | | expanded make variables. -- PiperOrigin-RevId: 146478427 MOS_MIGRATED_REVID=146478427
* Also report individual test results via BEP Gravatar Klaus Aehlig2017-02-02
| | | | | | | | | | | | Only having a test summary for each test target is not enough for timely error reporting. Also individual test actions and attempts are of interest. Report those by making TestResult an instance of BuildEvent. -- Change-Id: Iee1c988b6d467ebda8230b9edacbe3b66600c30e Reviewed-on: https://cr.bazel.build/8532 PiperOrigin-RevId: 146342845 MOS_MIGRATED_REVID=146342845
* 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
* Test strategy unification - extract env setup to a new classGravatar Ulf Adams2017-02-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce a new class TestPolicy that computes the test environment and use it from all the test strategies instead of the previous duplicated code. Note how the TestPolicy constructs the environment in four steps, each of which can override variables set in a previous step: 1. set env variables for which we have a hard-coded policy 2. set env variables from --action_env 3. set env variables from --test_env 4. set env variables that are specific to the test (path locations, coverage collection protocol, test sharding protocol, etc.); the code for this lives in TestRunnerAction This changes the order in which env variables are set, which can change the resulting environment if --test_env or --action_env are set. We should consider not allowing the command-line flags to override TEST_SRCDIR, RUNFILES_DIR, or TEST_TMPDIR. We should also try to find a way to drop the RUNTEST_PRESERVE_CWD variable in coverage mode. I'm fairly sure that it's current use breaks the combination of coverage and --run_under. My current thinking is that we change the test setup script to source the coverage collector before changing the CWD. Another option is to merge the coverage collector into the test setup script. -- PiperOrigin-RevId: 146237448 MOS_MIGRATED_REVID=146237448
* 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
* Split transitions that return an empty list of options do not suppress ↵Gravatar Cal Peyser2017-01-30
| | | | | | | | | | dynamic ruleclass transitions. -- PiperOrigin-RevId: 146000375 MOS_MIGRATED_REVID=146000375
* 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
* Create a base implementation of GenRule that can be used by both Bazel andGravatar John Cater2017-01-30
| | | | | | | | internal Google code. -- PiperOrigin-RevId: 145795255 MOS_MIGRATED_REVID=145795255
* Minimize SpawnAction constructor exposureGravatar Michajlo Matijkiw2017-01-23
| | | | | | | | One's unused, the other is ok as protected. -- PiperOrigin-RevId: 145291062 MOS_MIGRATED_REVID=145291062
* Update GenRuleRule attribute documentation. Also rename files pending a mergeGravatar John Cater2017-01-23
| | | | | | | | with the internal GenRule implementation. -- PiperOrigin-RevId: 145087704 MOS_MIGRATED_REVID=145087704
* Remove the ability for an aspect to propagate a different aspect.Gravatar Dmitry Lomov2017-01-20
| | | | | | | | | This functionality is never used, have never been exposed to Skylark and is a continuous pain to maintain and test. -- PiperOrigin-RevId: 145079832 MOS_MIGRATED_REVID=145079832
* 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
* --cpu no longer reads its value from the CROSSTOOL.Gravatar Greg Estren2017-01-18
| | | | | | | | | | | | When the code below was first written, the default value for @Option cpu was null. This value was then overwritten with whatever target_cpu got loaded from the CROSSTOOL, which became the basis for all code queries of the value "cpu". This behavior was deprecated some months ago after the default @Option cpu was changed to auto-read from the host machine. So the CROSSTOOL "override" no longer ever happens. Also made the relevant test more hermetic. -- PiperOrigin-RevId: 144850329 MOS_MIGRATED_REVID=144850329
* Support mapping of Paths to URIsGravatar Klaus Aehlig2017-01-18
| | | | | | | | | | | Bazel-created files (like log files of test runs) are internally reported as Paths. However, this is not always the most useful representation of the location of that artifact for a consumer of build events. Therefore, support a mapping of paths to more useful URIs. -- PiperOrigin-RevId: 144843525 MOS_MIGRATED_REVID=144843525
* Change TargetContext.findDirectPrerequisite from config1 == config2 to ↵Gravatar Greg Estren2017-01-18
| | | | | | | | | | config1.equals(c2). This fixes an obscure bug between dynamic configurations, host configuration caching, and Skyframe skyKey interning that makes Bazel crash under certain sequences of builds. See changes for details. -- PiperOrigin-RevId: 144766296 MOS_MIGRATED_REVID=144766296
* Allows a rule class to specify a configuration transtion that will apply to allGravatar Cal Peyser2017-01-12
| | | | | | | | | | incoming edges if dynamic configurations are turned on. This CL does not cover top-level nodes. -- PiperOrigin-RevId: 144258789 MOS_MIGRATED_REVID=144258789
* Add new flag to specify if output_licenses attribute should be checked for ↵Gravatar Irina Iancu2017-01-10
| | | | | | | | | | licenses. Also flipped :jvm attribute from HOST to TARGET and set the new flag on it. -- PiperOrigin-RevId: 144084000 MOS_MIGRATED_REVID=144084000
* Encapsulate the required provider logic in RequiredProviders class.Gravatar Dmitry Lomov2017-01-10
| | | | | | | | | For now, only for aspects, but eventually expand to Attribute's mandatory providers as well. -- PiperOrigin-RevId: 144063369 MOS_MIGRATED_REVID=144063369
* Extract a set of advertised providers into a separate class.Gravatar Dmitry Lomov2017-01-10
| | | | | | -- PiperOrigin-RevId: 143991903 MOS_MIGRATED_REVID=143991903
* Advertise java Skylark provider from java proto aspects.Gravatar Googler2017-01-10
| | | | | | | | The skylark provider is bound as "proto_java" to avoid collisions with the base, which is called "java". -- PiperOrigin-RevId: 143960605 MOS_MIGRATED_REVID=143960605
* 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
* Exempt config_setting from license checking.Gravatar Greg Estren2017-01-05
| | | | | | -- PiperOrigin-RevId: 143666208 MOS_MIGRATED_REVID=143666208
* Fix an obscure crash scenario with static configs and BuildConfiguration.equals.Gravatar Greg Estren2017-01-04
| | | | | | | | | | See OutputFileConfiguredTargetTest for deep details. Also more strongly enforce the expectation that all output files have generating rules. -- PiperOrigin-RevId: 143570028 MOS_MIGRATED_REVID=143570028
* Manually add periods to documentation strings where needed.Gravatar John Cater2017-01-03
| | | | | | | | -- Change-Id: I9ec3209a69ba5a51943b334f278ba93d67d4f9f4 Reviewed-on: https://cr.bazel.build/8090 PiperOrigin-RevId: 143470915 MOS_MIGRATED_REVID=143470915
* Make BuildConfiguration reference-equals for static configs.Gravatar Greg Estren2016-12-29
| | | | | | | | | Value equality is unsafe due to embedded transitions. This will become safe with dynamic configs. See diff for details. -- PiperOrigin-RevId: 143131700 MOS_MIGRATED_REVID=143131700
* Expose to Skylark a merge() method for runfiles objectsGravatar Jon Brandvein2016-12-28
| | | | | | | | | This is a quick way to make it possible for Skylark rules to aggregate and pass on symlinks from their dependencies. -- PiperOrigin-RevId: 143111353 MOS_MIGRATED_REVID=143111353
* Exposes the Android split transition configuration to Skylark.Gravatar Alex Humesky2016-12-22
| | | | | | -- PiperOrigin-RevId: 142709934 MOS_MIGRATED_REVID=142709934
* Introduce a distinguisher for cpu value as set in --experimental_multi_cpu.Gravatar Cal Peyser2016-12-21
| | | | | | | | | This is required for a configuration transtion to set cpu. Without a distinguisher, such a transition will lead to two identical configurations. -- PiperOrigin-RevId: 142603930 MOS_MIGRATED_REVID=142603930
* 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
* Names of extra-action protos now take into account all aspect names.Gravatar Dmitry Lomov2016-12-16
| | | | | | | | | | | | | 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
* Enables the propagation of the XcodeVersionProperties provider for reading ↵Gravatar Sergio Campama2016-12-13
| | | | | | | | from Skylark. -- PiperOrigin-RevId: 141912220 MOS_MIGRATED_REVID=141912220
* Fix error message that gives incomplete informationGravatar Jon Brandvein2016-12-13
| | | | | | -- PiperOrigin-RevId: 141896569 MOS_MIGRATED_REVID=141896569
* Migrates TestEnvironmentProvider to using the new Skylark declared providers ↵Gravatar Sergio Campama2016-12-12
| | | | | | | | API. This enables creating a TestEnvironmentProvider from Skylark. -- PiperOrigin-RevId: 141775285 MOS_MIGRATED_REVID=141775285
* Style edits for ActionsProvider and provider constructorsGravatar Jon Brandvein2016-12-12
| | | | | | -- PiperOrigin-RevId: 141769552 MOS_MIGRATED_REVID=141769552
* Add a testing Skylark module that exposes an ExecutionInfoProvider constructor.Gravatar Sergio Campama2016-12-12
| | | | | | -- PiperOrigin-RevId: 141594768 MOS_MIGRATED_REVID=141594768
* 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
* Skip constraint checking on generated sources with null generating rules.Gravatar Greg Estren2016-12-07
| | | | | | | | | | Null generating rules shouldn't actually happen. That's its own bug that needs its own attention. This change is just a workaround to prevent NullPointerExceptions when the bug hits. -- PiperOrigin-RevId: 141329624 MOS_MIGRATED_REVID=141329624
* Add coverage support for java test.Gravatar Yue Gan2016-12-07
| | | | | | | | (series 4/4 of open-sourcing coverage command for java test) -- PiperOrigin-RevId: 141292977 MOS_MIGRATED_REVID=141292977
* Fix private visibility for aliased targets. Gravatar Lukacs Berki2016-12-06
| | | | | | | | | | Also a drive-by improvement on some related error messages. RELNOTES[INC]: Only targets with public visibility can be bound to something in //external: . -- PiperOrigin-RevId: 141178039 MOS_MIGRATED_REVID=141178039
* Override BuildConfiguration.equals() for dynamic configs.Gravatar Greg Estren2016-12-06
| | | | | | | | | | | | | | | | This makes tests that unnecessarily relied on reference equality pass with --experimental_dynamic_configs=notrim. In particular, with --nodistinct_host_configuration dynamic configurations still use distinct instances even though the options are the same. This is a roll forward of original change: https://github.com/bazelbuild/bazel/commit/2a2be3907981d9654575493c7012d95d1241f373 That was rolled back because of lots of expensive hashCode() calls. This version precomputes the hash code. -- PiperOrigin-RevId: 141095789 MOS_MIGRATED_REVID=141095789