aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/analysis
Commit message (Collapse)AuthorAge
* Generalize ConfigSetting's special options handling.Gravatar mstaib2017-04-05
| | | | | | | | | | | | | | | | Currently ConfigSetting is treated specially; TransitiveTargetFunction identifies it by name, then runs a special function on it. This change makes ConfigSetting use a new options reference function in RuleClass, which TransitiveTargetFunction will evaluate over the rule and use with the options-to-fragments map to figure out which fragments are needed. Although this is still a hack and not really a new feature on RuleClass, this avoids a dependency on ConfigSettingRule from TransitiveTargetFunction, which is necessary for ConfigSettingRule to be moved to rules/config. RELNOTES: None. PiperOrigin-RevId: 152156905
* Refactor all ctor callsites of PathFragment to instead call a static ↵Gravatar nharmata2017-04-05
| | | | | | | | | | | | 'create' method. This paves the way for changing PathFragment to e.g. an abstract class with multiple subclasses. This way we can split out the windows-specific stuff into one of these concrete classes, making the code more readable and also saving memory (since the shallow heap size of the NonWindowsPathFragment subclass will hopefully be smaller than that of the current PathFragment). This also lets us pursue gc churn optimizations. We can now do interning in PathFragment#create and can also get rid of unnecessary intermediate PathFragment allocations. RELNOTES: None PiperOrigin-RevId: 152145768
* BEP: provide events a generic converter classGravatar aehlig2017-04-04
| | | | | | | | | | | Change the BuildEvent interface to accept a generic class of converters. In this way, we won't have to change it again in the future, once more converters are needed. In fact, a new converter is needed right now (will be added in a follow-up patch) to allow build events to know the name of named artifact groups already reported in the stream. Change-Id: Ibb32ea5fff361e21bcf2d34818d8351a1da7a2e3 PiperOrigin-RevId: 152131870
* Automated g4 rollback of commit 1d9e1ac90197b1d3d7b137ba3c1ada67bb9ba31b.Gravatar hlopko2017-04-04
| | | | | | | | | | | | | | | | | | *** Reason for rollback *** Breaks //src/test/shell/integration:force_delete_output_test *** Original change description *** Symlink output directories to the correct directory name If the workspace directory is /path/to/my/proj and the name in the WORKSPACE file is "floop", this will symlink the output directories to output_base/execroot/floop instead of output_base/execroot/proj. More prep for #1262, fixes #1681. PiperOrigin-RevId: 152126545
* Add isConfigMatcher property to rule classes.Gravatar mstaib2017-04-03
| | | | | | | | | | | | | | BuildConfiguration currently depends directly on the name of a rule class to see if it is config_setting. This creates a circular dependency between ConfigSetting and BuildConfiguration. As ConfigSetting is being moved to rules/config, this circular dependency will no longer work. This replaces the name special case for a special property of the rule class, which only config_setting should set. RELNOTES: None. PiperOrigin-RevId: 151871084
* Move BuildConfiguration option data access to a new class.Gravatar mstaib2017-04-03
| | | | | | | | | | | | | | | | | ConfigSetting is being moved to rules/config, and that means that it no longer has its special package-private access to BuildConfiguration. The solution: a new TransitiveOptionDetails class which cuts down on clutter in BuildConfiguration and is publicly accessible. However, we don't really want anyone accessing BuildConfiguration's TransitiveOptionsDetails - only config-related rules should ever need it. As a result, BuildConfigurationOptionDetails provides public access to BuildConfiguration's TransitiveOptionDetails, but is limited via Blaze visibility to only configuration rules. RELNOTES: None. PiperOrigin-RevId: 151828068
* If --batch, --keep_going, --discard_analysis_cache, and the new ↵Gravatar janakr2017-03-31
| | | | | | | | | | | | | | | --noexperimental_enable_critical_path_profiling flags are all specified, then Bazel will delete Actions from ActionLookupValues as they are executed in order to save memory. Because an already-run action may output an artifact that is only requested later in the build, we need to maintain a way for the artifact to look up the action. But in most cases we don't need to keep the action itself, just its output metadata. Some actions unfortunately are needed post-execution, and so we special-case them. Also includes dependency change with description: Move action out of key. This keeps action references from polluting the graph -- actions are just stored in one SkyValue, instead of being present in SkyKeys. This does mean additional memory used: we have a separate ActionLookupData object per Action executed. That may reach ~24M for million-action builds. PiperOrigin-RevId: 151756383
* Add ctx.experimental_new_directory (undocumented) to create tree artifacts ↵Gravatar allevato2017-03-31
| | | | | | | | in Skylark. RELNOTES: None. PiperOrigin-RevId: 151744710
* Change the tag experimental_testrunner into a couple of flags.Gravatar kush2017-03-31
| | | | | | | | | | | | | | | Note 1) Explanation of the flags: --explicit_java_test_deps: This is a flag independent of the others, and forces users to specify the JUnit deps. We should try to make this flag default to true in a future release, irrespective of the work around persistent java tests. --experimental_testrunner: Bazel-only flag affecting switching from the BazelTestRunner to the ExperimentalTestRunner which will run the tests in a separate classloader. --explicit_java_test_deps is desired for this to ensure once we split the classpaths of the TestRunner and the TestTarget, the TestTarget does not hit a ClassNotFoundException, due to missing JUnit deps. --test_strategy=experimental_worker: This is the existing flag, which in turn depends on --experimental_testrunner flag, since only the ExperimentalTestRunner is capable to running java tests persistently. Note 2) There was no clean way to check for the flags defined in JavaOptions within TestActionBuilder (as I was checking the "tag=experimental_testrunner" before), without making TeasActionBuilder's build rules depend on java rules (yikes!). Hence, I created a new method compatibleWithStrategy() within each fragment, so I could check if WorkerTestStrategy could be compatible with the user specified flags. Thanks to Greg for suggesting this approach! RELNOTES: None PiperOrigin-RevId: 151729869
* Symlink output directories to the correct directory nameGravatar kchodorow2017-03-31
| | | | | | | | | | If the workspace directory is /path/to/my/proj and the name in the WORKSPACE file is "floop", this will symlink the output directories to output_base/execroot/floop instead of output_base/execroot/proj. More prep for #1262, fixes #1681. PiperOrigin-RevId: 151712384
* BuildView#getConfiguredTargetForTesting respects null transitions.Gravatar mstaib2017-03-31
| | | | | | | | RuleTransitionFactory#buildTransitionFor is @Nullable, but the SkyframeExecutor expects a non-null Transition. If the factory returns null, the SkyframeExecutor should be passed NONE, not null. PiperOrigin-RevId: 151615724
* Resolve special provider names when checking for mandatory providersGravatar vladmos2017-03-29
| | | | | | | | | | If a rule requires a special provider that's (maybe) not provided explicitly but nevertheless available from a target, i.e. "files", the mandatory providers check should pass. Fixes #1490 PiperOrigin-RevId: 151571187
* Clear AspectValues when discarding analysis cache, along with ↵Gravatar janakr2017-03-29
| | | | | | | | ConfiguredTargetValues. Also clear transitive packages for both, even for top-level targets. This is not expected to save significant memory, but is expected to reduce the number of references to Packages, allowing them to be dropped more easily when discarding analysis cache and running in batch mode. PiperOrigin-RevId: 151508877
* introduce hidden flag to configure bytecode optimizersGravatar Kevin Bierhoff2017-03-27
| | | | | | -- PiperOrigin-RevId: 151170448 MOS_MIGRATED_REVID=151170448
* Unit tests respect top-level rule-class transitions.Gravatar Cal Peyser2017-03-27
| | | | | | -- PiperOrigin-RevId: 151129669 MOS_MIGRATED_REVID=151129669
* Remove provider safety check and make all old ctx objects featurelessGravatar Vladimir Moskva2017-03-23
| | | | | | | | | | | | It's now allowed to return anything from a rule implementation function. If a ctx object is returned it becomes featureless and cannot be used from anywhere else (i.e. from an implementation function of another rule). Fixes #2319 -- PiperOrigin-RevId: 151015919 MOS_MIGRATED_REVID=151015919
* Honor SOURCE_DATE_EPOCH in bootstrapping Gravatar Klaus Aehlig2017-03-23
| | | | | | | | | | | | | | | | | | | | | | | | | | Currently, a stamped bazel binary contains the actual timestamp at build time. This means, that building bazel we either include no version information at all, or the binary contains a not reproducible time stamp. Both are not acceptable from the point of view of a downstream maintainer of a bazel package, where the requirement is that the package be reproducible, but the binary still provide sensible version information. Fortunately, there is a suggested standard to solve this problem taking the "current time" from the SOURCE_DATE_EPOCH environment variable, if set, rather than the actual time. See https://reproducible-builds.org/specs/source-date-epoch/. Honor this proposed standard, so that bazel can reasonably be packaged downstream. See issue #2240. Note that we only use the environment variable in our bootstrap script; for bazel itself we communicate that information via an appropriate option. -- Change-Id: I55409a117285b9a3446421179c20f4e8c59088f8 Reviewed-on: https://cr.bazel.build/9467 PiperOrigin-RevId: 150896326 MOS_MIGRATED_REVID=150896326
* Fix dir() on Targets with aspects applied.Gravatar Dmitry Lomov2017-03-22
| | | | | | -- PiperOrigin-RevId: 150869561 MOS_MIGRATED_REVID=150869561
* Enable rules to transition based on their Rule objects.Gravatar Michael Staib2017-03-21
| | | | | | | | | | | | This begins to allow for cases where a rule sets configuration based on its attributes, such as where a rule attribute names flags and their values - sort of a reverse select. There are no such cases yet, but they're coming! -- PiperOrigin-RevId: 150648357 MOS_MIGRATED_REVID=150648357
* Rationalize null-ness checks in RunfilesGravatar Ulf Adams2017-03-21
| | | | | | | | | | | This now also checks symlink maps for null pointers, which it previously did not. Unfortunately, there's still one case where we add a null target to Runfiles (to represent an empty file) - this happens in Runfiles itself, and this change prevents any callers from doing so. -- PiperOrigin-RevId: 150634481 MOS_MIGRATED_REVID=150634481
* Use a relative path for the runfiles treeGravatar Ulf Adams2017-03-21
| | | | | | | | | | Add preconditions to enforce this and remove some now unnecessary code. A small step towards #1593. -- PiperOrigin-RevId: 150625693 MOS_MIGRATED_REVID=150625693
* Fix a bug whereupon a String was compared to a PathFragment.Gravatar Lukacs Berki2017-03-21
| | | | | | -- PiperOrigin-RevId: 150623623 MOS_MIGRATED_REVID=150623623
* Rollback of commit 59180a4ea66b1395b5b85defd732859ecae919ea.Gravatar Yue Gan2017-03-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | *** Reason for rollback *** Break bazel-tests and many other jobs on CI. http://ci.bazel.io/job/bazel-tests/BAZEL_VERSION=HEAD,PLATFORM_NAME=linux-x86_64/651/console *** Original change description *** Add SpawnInputExpander helper class to arrange runfiles for spawn strategies This new class is a combination of SpawnHelper and our internal code; the plan is to migrate all spawn strategies to the new class. The strict flag should be enabled by default, but that's a breaking change, so we need to do it later. - Use it in SandboxStrategy. - Add ActionInput.getExecPath to return a PathFragment; this avoids lots of back and forth between path fragments and strings. This is a step towards #159... *** -- PiperOrigin-RevId: 150610616 MOS_MIGRATED_REVID=150610616
* Create "internal" category of command-line options.Gravatar Michael Staib2017-03-20
| | | | | | | | | | | | | | | | | | | | This is intended to be used for "flags" which should never appear on the command line - things like configuration distinguishers, which are used internally and must be part of the build options, but should always be set to their default value at the top level. This is already a convention within Bazel, but doesn't actually work the way Bazel expects - flags with spaces can be set by simply escaping or quoting the spaces so that word splitting will not break on them. This means they can also be matched by config_settings, which pass a single string. Forbidding the parser from matching these flags solves both of these unintended cases. Existing cases like this have also been converted to internal. -- PiperOrigin-RevId: 150497246 MOS_MIGRATED_REVID=150497246
* Add SpawnInputExpander helper class to arrange runfiles for spawn strategiesGravatar Ulf Adams2017-03-17
| | | | | | | | | | | | | | | | | This new class is a combination of SpawnHelper and our internal code; the plan is to migrate all spawn strategies to the new class. The strict flag should be enabled by default, but that's a breaking change, so we need to do it later. - Use it in SandboxStrategy. - Add ActionInput.getExecPath to return a PathFragment; this avoids lots of back and forth between path fragments and strings. This is a step towards #1593. -- PiperOrigin-RevId: 150427021 MOS_MIGRATED_REVID=150427021
* Improve javadoc for the environment functions in the BuildConfiguration Gravatar Klaus Aehlig2017-03-16
| | | | | | | | | | | | In particular, emphasize that that both, the static and dynamic part of the configuration has to be collected to get the environment to be used by actions. -- Change-Id: I035def947d06dbd8f58460b5bf293b35a8ae038c Reviewed-on: https://cr.bazel.build/9373 PiperOrigin-RevId: 150319122 MOS_MIGRATED_REVID=150319122
* Fix typo in help string for --action_envGravatar Klaus Aehlig2017-03-16
| | | | | | | | -- Change-Id: I3221e27e99c740b8ff2bdec8c242cc5cf30c16b5 Reviewed-on: https://cr.bazel.build/9375 PiperOrigin-RevId: 150229108 MOS_MIGRATED_REVID=150229108
* Make AspectCompleteEvent an instance of BuildEvent Gravatar Klaus Aehlig2017-03-16
| | | | | | | | | | | | | | | In this way, we can also report the artifacts generated by aspects in the build event protocol. For the time being, those events are reported unsolicitly (i.e., as children of progress events), but they may be linked to pattern expansion later. -- Change-Id: I7fb83088d7fdb5424f77bfb78700e8371231b13c Reviewed-on: https://cr.bazel.build/9370 PiperOrigin-RevId: 150181433 MOS_MIGRATED_REVID=150181433
* Type strip Python sources when building a target incompatible with inlineGravatar Googler2017-03-14
| | | | | | | | annotations. -- PiperOrigin-RevId: 150088575 MOS_MIGRATED_REVID=150088575
* Simplify Attribute.Configurator, add dynamic configs support.Gravatar Greg Estren2017-03-14
| | | | | | | | | | | | | | Specifically: 1) Read BuildOptions instead of BuildConfiguration 2) Remove unused extra parameters 1) is especially useful for dynamic configs. Before this change, dynamic configs just didn't support attribute configurators. This is because support would require Skyframe-instantiating temporary intermediate configurations, which is horribly awkward and would massively complicate Bazel's dependency evaluation logic. Using BuildOptions instead of BuildConfiguration completely eliminates the problem. As a bonus, dynamic configs can compose attribute configurators with any other transitions (including splits). This actually makes them more powerful than static configs. Whether anyone wants to use that composition is a different story, but that's now a policy decision vs. a technical limitation. This should also come in handy for RuleClass configurators, which will likely also leverage this. -- PiperOrigin-RevId: 150080977 MOS_MIGRATED_REVID=150080977
* A partial, manual rollback of commit 7af14dfdbd6addb779226c0a103b2a8dc72c16b1.Gravatar Lukacs Berki2017-03-14
| | | | | | | | This became necessary because extra actions for C++ compile actions require .h files, but the compiler only returns the .pcm files in the .d file for headers that it reads from the .pcm file. This is not a problem for correctness because the .pcm files depend on the headers, but that doesn't help the extra actions that would then only get the .pcm files. -- PiperOrigin-RevId: 150052839 MOS_MIGRATED_REVID=150052839
* Support composed dependency transitions with dynamic configs.Gravatar Greg Estren2017-03-08
| | | | | | -- PiperOrigin-RevId: 149439502 MOS_MIGRATED_REVID=149439502
* Support declared providers in AdvertisedProviderSet.Gravatar Dmitry Lomov2017-03-06
| | | | | | -- PiperOrigin-RevId: 149165836 MOS_MIGRATED_REVID=149165836
* Remove all the action resource estimation codeGravatar Ulf Adams2017-03-06
| | | | | | -- PiperOrigin-RevId: 149110466 MOS_MIGRATED_REVID=149110466
* Pass the repository name through to build info factoriesGravatar Kristina Chodorow2017-03-06
| | | | | | | | | | | | I was fixing the Android tests and I noticed that the bazel_workspace_status_test was failing. It was like when you have a thread coming out of a sweater and you start pulling and pretty soon you have no sweater. Long story short, my "Android tests fix" cl ended up needing ~1k more lines changed (on top of the existing enormous CL). So, I'm creating some smaller CLs with the changes that I can extract from the mega CL. Again. Prep for #1681. -- PiperOrigin-RevId: 149106039 MOS_MIGRATED_REVID=149106039
* Support declared providers for aspectsGravatar Vladimir Moskva2017-03-06
| | | | | | | | Fixes #2016 -- PiperOrigin-RevId: 149102037 MOS_MIGRATED_REVID=149102037
* Refactor implementation of native and Skylark declared providers.Gravatar Dmitry Lomov2017-03-03
| | | | | | | | | | | | 1) Instead of having a single class for both, split them into {Skylark,Native}ClassObjectConstructors 2) Allow NativeClassObjectConstructors to customize their instantiation logic. 3) Prepare ClassObjectConstructor.Key to be serializable. -- PiperOrigin-RevId: 148997553 MOS_MIGRATED_REVID=148997553
* Do not execute aspect implementation if target advertizes but fails to ↵Gravatar Dmitry Lomov2017-03-01
| | | | | | | | | | | provide a provider. Previously we always executed the function, but didn't add the aspect to the deps. -- PiperOrigin-RevId: 148887089 MOS_MIGRATED_REVID=148887089
* BEP: Add tags and output files to TargetComplete event Gravatar Jakob Buchgraber2017-02-28
| | | | | | | | | | | | | | | A target's tags and output files are reported as part of the TargetComplete event of the build event protocol (BEP). The output files are grouped by their corresponding output group. If an output file belongs to more than one output group it appears once in each output group. -- Change-Id: Ia37db68709850d8550e478dcc30064dc7366bd1b Reviewed-on: https://cr.bazel.build/8955 PiperOrigin-RevId: 148667599 MOS_MIGRATED_REVID=148667599
* Fixes issue with ObjcCompileAction where extra action funcitonality is unableGravatar Googler2017-02-27
| | | | | | | | to generate extra action proto file. -- PiperOrigin-RevId: 148479293 MOS_MIGRATED_REVID=148479293
* Provide more reporting options to SkyFunctions Gravatar Klaus Aehlig2017-02-27
| | | | | | | | | | | | | With more specific information to be reported by Skyfunctions, e.g., to inform the build-event protocol on missing files, the EventHandler interface is no longer enough. Therefore, provide an enriched context for reporting events. -- Change-Id: I2d06166fe4d5b9054e24ad8c752fafc039e3f9f8 Reviewed-on: https://cr.bazel.build/8794 PiperOrigin-RevId: 148463437 MOS_MIGRATED_REVID=148463437
* Report inconsistent aspect order error to the user.Gravatar Dmitry Lomov2017-02-24
| | | | | | -- PiperOrigin-RevId: 148342788 MOS_MIGRATED_REVID=148342788
* Remove ctx.aspect_id and Target.aspect_ids.Gravatar Dmitry Lomov2017-02-23
| | | | | | -- PiperOrigin-RevId: 148322874 MOS_MIGRATED_REVID=148322874
* Add ctx.aspect_ids, deprecate ctx.aspect_id and Target.aspect_ids.Gravatar Dmitry Lomov2017-02-23
| | | | | | | | BUG=35456356 -- PiperOrigin-RevId: 148317662 MOS_MIGRATED_REVID=148317662
* If dynamic configurations are turned on, ruleclass configuration transitionsGravatar Cal Peyser2017-02-22
| | | | | | | | apply on the top level. -- PiperOrigin-RevId: 148155171 MOS_MIGRATED_REVID=148155171
* Rollback of commit 4b73e972d909bcd533f2f9940f95a00b9b73bdde.Gravatar Dmitry Lomov2017-02-17
| | | | | | | | | | | | | | | | | | | | | | | *** Reason for rollback *** Broke tests on CI: http://ci.bazel.io/job/bazel-tests/570/ *** Original change description *** Roll forward execroot change 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. Cust... -- PiperOrigin-RevId: 147833177 MOS_MIGRATED_REVID=147833177
* Fix --run_under to work with labels that describe source or output filesGravatar Ulf Adams2017-02-17
| | | | | | | | | Before this change, running with --run_under=//foo:foo.sh gave an error, if foo.sh is an executable shell script. -- PiperOrigin-RevId: 147831484 MOS_MIGRATED_REVID=147831484
* Make the interface dynamic library builder a regular label instead of a ↵Gravatar Lukacs Berki2017-02-17
| | | | | | | | magic artifact. -- PiperOrigin-RevId: 147830857 MOS_MIGRATED_REVID=147830857
* Roll forward execroot changeGravatar Kristina Chodorow2017-02-16
| | | | | | | | | | | | | | | | | 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. Custom crosstools that hardcode external/<repo> paths will have to be updated. Issue #1262. -- PiperOrigin-RevId: 147726370 MOS_MIGRATED_REVID=147726370
* Restrict aspects visible to other aspects according to their advertised ↵Gravatar Dmitry Lomov2017-02-15
| | | | | | | | providers. -- PiperOrigin-RevId: 147526961 MOS_MIGRATED_REVID=147526961