aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/analysis/BaseRuleClasses.java
Commit message (Collapse)AuthorAge
* test-wrapper: add empty impl + Bazel flagGravatar Laszlo Csomor2018-08-14
| | | | | | | | | | | | | | | | | | | | | | | This commit adds: - the skeleton implementation of the Windows native test wrapper - a depenency on the native test wrapper from test rules, through the new $test_wrapper rule attribute - the --windows_native_test_wrapper Bazel flag, which is currently a no-op See https://github.com/bazelbuild/bazel/issues/5508 Change-Id: I8df95c8ce8bab53c51c257698ec95416065a836e Closes #5854. Change-Id: I2ffc78bceec5dd867af775b5878f105fa87c3dba PiperOrigin-RevId: 208650699
* Add a flag to split test.xml generation into a separate SpawnGravatar ulfjack2018-07-27
| | | | | | | | | | At this time, this is only implemented for the StandaloneTestStrategy. This solves a race condition on Posix-like systems, where we cannot guarantee that the pipes are actually fully flushed to disk when the test process exits, and this can cause the test.xml to be empty, which makes it hard to debug issues. (The test.log files do not show up in normal CI systems, only the test.xml files.) Progress on #4608. PiperOrigin-RevId: 206292179
* Create Bazel coverage report action.Gravatar elenairina2018-07-06
| | | | | | | Fixes #5246 RELNOTES: None. PiperOrigin-RevId: 203453340
* Make variable providers coming from the toolchains attribute shouldn't beGravatar jcater2018-06-19
| | | | | | | checked for restricted_to and compatible_with constraints, because they are part of the execution, not providing new dependencies. PiperOrigin-RevId: 201196891
* Remove LIPO supportGravatar hlopko2018-06-15
| | | | | RELNOTES: Support for LIPO has been fully removed. PiperOrigin-RevId: 200724578
* Enable per-target execution for genrule, sh_*, and *_test.Gravatar jcater2018-06-13
| | | | PiperOrigin-RevId: 200410988
* Add LabelLateBoundDefault to :coverage_report_generator attributeGravatar dbabkin2018-06-07
| | | | | RELNOTES:none PiperOrigin-RevId: 199619691
* Add LabelLateBoundDefault to :coverage_support attributeGravatar dbabkin2018-06-07
| | | | | RELNOTES:none PiperOrigin-RevId: 199604462
* Automated rollback of commit 1b041c86147098451bffc94d2602aea26ee16e06.Gravatar juliexxia2018-06-05
| | | | | | | | | | | | | *** Reason for rollback *** http://b/109733929 This CL breaks Blaze_CorpTest which must pass for Blaze's nightly candidate to form *** Original change description *** Add LabelLateBoundDefault to :coverage_support attribute RELNOTES:none PiperOrigin-RevId: 199352111
* Automated rollback of commit 52c4d05d1bfd54ea901e9926be7b262dd45e34de.Gravatar dbabkin2018-06-05
| | | | | | | | | | | | | *** Reason for rollback *** http://b/109733929 *** Original change description *** Add LabelLateBoundDefault to :coverage_report_generator attribute RELNOTES:none PiperOrigin-RevId: 199308190
* Add LabelLateBoundDefault to :coverage_report_generator attributeGravatar dbabkin2018-06-05
| | | | | RELNOTES:none PiperOrigin-RevId: 199280443
* Add LabelLateBoundDefault to :coverage_support attributeGravatar dbabkin2018-06-05
| | | | | RELNOTES:none PiperOrigin-RevId: 199256705
* Enable manual trimming of config_feature_flags.Gravatar mstaib2018-05-16
| | | | | | | This enables users of config_feature_flags to specify the flags used by the transitive closure of a particular target in the transitive_configs attribute of all targets. It also adds a flag - --enforce_transitive_configs_for_config_feature_flag - which enforces this specification and uses it to trim the set of flags available to that target. RELNOTES: None. PiperOrigin-RevId: 196846092
* Clean up code that directly imports nested classes like Builder, Entry, etc.Gravatar jcater2018-05-01
| | | | PiperOrigin-RevId: 194985259
* Make a bunch more stuff serializable, especially anonymous classes and ↵Gravatar janakr2018-03-26
| | | | | | lambdas. Give a bit more information in JavaSerializableCodec when serialization fails on an anonymous class or lambda. PiperOrigin-RevId: 190472245
* Remove hard-wired basenames for the test setup and the coverage collection ↵Gravatar lberki2018-02-09
| | | | | | | | | script. Accomplished by creating an explicit attribute for both of them on test actions. RELNOTES: None. PiperOrigin-RevId: 185132460
* Stop allowing generic LateBoundDefault value types. Such types are always ↵Gravatar janakr2018-02-02
| | | | | | | | either a Label or a List<Label>. We can easily enforce this through static type checking, so do it. This will help with LateBoundDefault serialization, since we don't have to serialize an arbitrary object. PiperOrigin-RevId: 184347100
* Add alternative interface for LIPO data transitions, opt in native rules.Gravatar gregce2018-01-29
| | | | | | | | | | | This removes the need for ConfigurationTransitionProxy.DATA by providing a way for the C++ rule defs to directly inject the transition for all rules to use. Skylark attributes work differently, so they'll be addressed in another change. PiperOrigin-RevId: 183721293
* Remove ConfigurationTransitionProxy.NONE and ↵Gravatar gregce2018-01-18
| | | | | | | | BaseRuleClasses.DYNAMIC_TRANSITION_MAP. This leaves DATA as the last remaining legacy transition. PiperOrigin-RevId: 182422552
* Remove ConfigurationTransitionProxy.NULLGravatar gregce2018-01-16
| | | | PiperOrigin-RevId: 182099803
* Move PatchTransition and kin to analysis.config.transitions.Gravatar gregce2018-01-04
| | | | | | | HostTransition can't be migrated yet because it depends on BuildConfiguration. PiperOrigin-RevId: 180842784
* Replace Attribute.ConfigurationTransition with ↵Gravatar gregce2017-12-28
| | | | | | | | | | | | | | | | config.transitions.ConfigurationTransitionProxy. The "proxy" part is to dissuade people from writing: void myfunc(ConfigurationTransition transition) signatures casually. Maybe that's actually a better name than "Transition". But I'd rather rename Transition to ConfigurationTransition in its own change if we want to do that. PiperOrigin-RevId: 180285321
* Replace Attribute.Transition with config.transitions.Transition.Gravatar gregce2017-12-22
| | | | PiperOrigin-RevId: 179936355
* Remove ConfigurationTransition.HOST.Gravatar gregce2017-12-21
| | | | | | Use HostTransition.INSTANCE instead. PiperOrigin-RevId: 179851769
* Change cfg(HOST) to cfg(HostTransition.INSTANCE).Gravatar gregce2017-12-21
| | | | | | Preparatory step for removing ConfigurationTransition.HOST. PiperOrigin-RevId: 179838374
* Add platform_common.MakeVariableInfo so that Skylark code has access to the ↵Gravatar lberki2017-10-27
| | | | | | | Make variables provider. RELNOTES: None. PiperOrigin-RevId: 173527191
* LateBoundDefault: enforce access to a single fragment (or none).Gravatar mstaib2017-09-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, there is no way to enforce that LateBoundDefaults only access the fragments that they declare. This means that LateBoundDefaults can fail to declare fragments at all, or declare the wrong ones, and still have no troubles. But when trimming, these fragments must be declared, because otherwise they will not necessarily be available. This change refactors LateBoundDefault to declare a single fragment type, not a set. All existing LateBoundDefaults use sets with a single element or no elements at all for their set of fragment classes, so this does not limit anything being done currently. To account for LateBoundDefaults which do not use configuration at all, typically those which only want to access the configured attribute map, it is possible for Void to be the fragment class which is requested. To account for LateBoundDefaults which need to access methods of the BuildConfiguration instance itself, it is possible for BuildConfiguration to be the fragment class which is requested; however, this is unsafe, so it is only a temporary state until a way to do this without also giving access to all of the fragments can be added. Drive-by refactoring: LateBoundDefaults' values are now typed. All actual production LateBoundDefaults were Label or List<Label> typed, through the LateBoundLabel and LateBoundLabelList subclasses. These subclasses have been removed, and LateBoundDefault has two type parameters, one for the type of its input, and one for the type of its output. RELNOTES: None. PiperOrigin-RevId: 169242278
* Add a new toolchain type for c++. In order to do this, ↵Gravatar cpeyser2017-09-08
| | | | | | | | PlatformConfiguration is made a legal configuration fragment for every rule class. Add a default "dummy" c++ toolchain to prevent resolution errors when legacy toolchain selection logic is used. Add toolchain mocks to java and shell tests. PiperOrigin-RevId: 167901210
* Automated rollback of commit 2b983bdf508e010a3d4ee9dbaf446b7666749799.Gravatar cpeyser2017-09-01
| | | | | | | | | | | | *** Reason for rollback *** Breaks rules_go CI *** Original change description *** Rollforward of c++ toolchain-relevant BUILD file and Bazel mocking changes. That is, a c++ toolchain is added, but a Bazel dependency on that toolchain is not. PiperOrigin-RevId: 167198874
* Rollforward of c++ toolchain-relevant BUILD file and Bazel mocking changes. ↵Gravatar cpeyser2017-08-31
| | | | | | That is, a c++ toolchain is added, but a Bazel dependency on that toolchain is not. PiperOrigin-RevId: 167006332
* Automated rollback of commit 9d5bce66280094c0531ddfde2752e596d0d78c79.Gravatar plf2017-08-30
| | | | PiperOrigin-RevId: 166966182
* Add a new toolchain type for c++. In order to do this, ↵Gravatar cpeyser2017-08-29
| | | | | | | | PlatformConfiguration is made a legal configuration fragment for every rule class. Add a default "dummy" c++ toolchain to prevent resolution errors when legacy toolchain selection logic is used. Add toolchain mocks to java and shell tests. PiperOrigin-RevId: 166854893
* Automated rollback of commit 363413110f3a63a11d900864be1852adbaed2899.Gravatar cpeyser2017-08-29
| | | | | | | | | | | | | | | | | | | | | | | | | | *** Reason for rollback *** Breaks //src/test/shell/bazel:bazel_bootstrap_distfile_test: INFO: You can skip this first step by providing a path to the bazel binary as second argument: INFO: ./compile.sh compile /path/to/bazel 🍃 Building Bazel from scratch...... 🍃 Building Bazel with Bazel. .WARNING: /tmp/bazel_cHivhPBc/out/external/bazel_tools/WORKSPACE:1: Workspace name in /tmp/bazel_cHivhPBc/out/external/bazel_tools/WORKSPACE (@io_bazel) does not match the name given in the repository's definition (@bazel_tools); this will cause a build error in future versions. ERROR: in target '//external:cc_toolchain': error loading package '@local_config_cc//': Extension file not found. Unable to load file '@local_config_cc//:dummy_toolchain.bzl': file doesn't exist or isn't a file. INFO: Elapsed time: 3.343s ERROR: Could not build Bazel Found by git bisect. *** Original change description *** Add a new toolchain type for c++. In order to do this, PlatformConfiguration is made a legal configuration fragment for every rule class. Add a default "dummy" c++ toolchain to prevent resolution errors when legacy toolchain selection logic is used. Add toolchain mocks to java and shell tests. PiperOrigin-RevId: 166750885
* Add a new toolchain type for c++. In order to do this, ↵Gravatar cpeyser2017-08-28
| | | | | | | | PlatformConfiguration is made a legal configuration fragment for every rule class. Add a default "dummy" c++ toolchain to prevent resolution errors when legacy toolchain selection logic is used. Add toolchain mocks to java and shell tests. PiperOrigin-RevId: 166509298
* Rename some of native declared providers according to the new naming scheme.Gravatar dslomov2017-08-21
| | | | | RELNOTES: None PiperOrigin-RevId: 165910455
* Move core test classes to lib.analysis.testGravatar ulfjack2017-08-11
| | | | | | | | These are depended upon by analysis code, so need to live in the same library as lib.analysis. Moving them here makes it possible to split the build-base library into separate libraries for analysis, execution, and rules. PiperOrigin-RevId: 164847161
* Move MakeVariableProvider to lib.analysisGravatar ulfjack2017-08-08
| | | | | | | This is part of splitting up the build-base library into separate libraries for analysis, exec, and rules. PiperOrigin-RevId: 164456961
* Break out --test_filter into a test configuration fragment.Gravatar tomlu2017-08-03
| | | | | | The other test configuration options will follow in subsequent CLs to keep size manageable. PiperOrigin-RevId: 164068510
* Add a toolchains= attribute to *_binary, *_test, cc_library and extra_action ↵Gravatar lberki2017-07-14
| | | | | | | | | rules to declare which Make variables they need. The idea is that they would depend on the future java_runtime_alias / cc_toolchain_alias and similar rules and thus Bazel will know which Make variables they actually need instead of pulling in the whole BuildConfiguration and also making it possible to compute these Make variables during analysis instead of configuration creation. RELNOTES: None. PiperOrigin-RevId: 161785868
* Factor out BuildConfigurationCollection.Transitions.getDynamicTransition.Gravatar gregce2017-07-07
| | | | | | | | | | | | This is a legacy dependency on the configuration transition table, which is only needed for static configurations. Dynamic configurations didn't actually use anything in that table: this was just a convenience interface that could have equally been defined somewhere else. So this cl defines it somewhere else. There's still one last dependency: Transitions.configurationHook. We'll tackle that in a followup cl. PiperOrigin-RevId: 161141650
* 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
* 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
* Move constraint enforcement policy into attribute definitions.Gravatar Greg Estren2016-12-02
| | | | | | | | | This makes is easier to understand and change which attributes are checked. Also turn off checking for "data" and java_* "resources" attributes. -- MOS_MIGRATED_REVID=140771015
* Merge BazelBaseRuleClasses into BaseRuleClasses.Gravatar Ulf Adams2016-10-14
| | | | | | | There doesn't seem to be any reason to keep them separate. -- MOS_MIGRATED_REVID=136145734
* Proper error messages when built-in rule attributes are overridden #1811Gravatar Vladimir Moskva2016-10-05
| | | | | -- MOS_MIGRATED_REVID=135241715
* Rollback of commit 3c0d64886d2f7f6b2015780f1628b1391c320d0f.Gravatar Carmi Grushko2016-10-04
| | | | | | | | | | | | | *** Reason for rollback *** Blaze with this CL breaks ~all targets: "There is already a built-in attribute 'name' which cannot be overridden." *** Original change description *** Proper error messages when built-in rule attributes are overridden #1811 -- MOS_MIGRATED_REVID=134857179
* Proper error messages when built-in rule attributes are overridden #1811Gravatar Vladimir Moskva2016-10-04
| | | | | -- MOS_MIGRATED_REVID=134823021
* Make test "args" attribute configurable.Gravatar Greg Estren2016-08-19
| | | | | | | | A valid argument has been made for opening it up, and it's not clear it's helping anyone by locking it down. -- MOS_MIGRATED_REVID=130686109
* Refactor how coverage support files get to test actions.Gravatar Lukacs Berki2016-06-29
| | | | | | | | | Previously we used labels in each configuration fragment that then got added to every test action. Instead, we now have a filegroup under //tools/test for coverage files that truly need to be on the inputs of every test action and collect language-specific support files in InstrumentedFilesProvider. This makes configuration creation simpler and makes it possible to turn --crosstool_top into something else other than a filegroup (previously, it was that filegroup that got added to every test action) -- MOS_MIGRATED_REVID=126170241
* Make compatible_with / restricted_to nonconfigurable.Gravatar Greg Estren2016-05-03
| | | | | | | | | | | | | | | | As of 18c277f, we have special logic for mixing selects and constraints. With that logic, a multiplaform libray declares all environments it supports across all select paths, then each path supports some subset of those environments. With this approach, there's no need for compatible_with = select(). So we'd like to disallow that pattern (and all its downsides) in preference for what 18c277f allows. -- MOS_MIGRATED_REVID=121294433