aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/java/com/google/devtools/build/lib/packages
Commit message (Collapse)AuthorAge
* Migrate Java tests to Truth.Gravatar lberki2017-05-30
| | | | | | RELNOTES: None. PiperOrigin-RevId: 157446717
* Fixes incorrectly-ordered arguments to calls to assertEqualsGravatar Googler2017-05-19
| | | | | | | | | | | | | | | [] This change has been automatically generated by an Error Prone check that detects incorrect argument ordering on calls to assertEquals-style methods. See [] Cleanup change automatically generated by javacflume/refactory Refactoring: third_party/java_src/error_prone/project/core/src/main/java/com/google/errorprone/bugpatterns/argumentselectiondefects:AssertEqualsArgumentOrderChecker_refactoring Tested: TAP --sample for global presubmit queue [] PiperOrigin-RevId: 156539781
* Add toolchains data to RuleClass and RuleContext.Gravatar John Cater2017-05-19
| | | | | | | | Also expose both sides to Skylark. Part of #2219. Change-Id: I4d749dd9981fe33f75310acb0ec3927cff6f28fe PiperOrigin-RevId: 156340638
* PiperOrigin-RevId: 156331430Gravatar nharmata2017-05-19
|
* Automated g4 rollback of commit 9dec9a09d1e4d27e7cff73c440195a32d3b90752.Gravatar plf2017-05-05
| | | | PiperOrigin-RevId: 155194438
* Introduce package_name() function to replace the magic PACKAGE_NAME constant.Gravatar laurentlb2017-05-04
| | | | | | | | Also, repository_name() replaces REPOSITORY_NAME. In .bzl files, they are prefixed with "native.". RELNOTES: None. PiperOrigin-RevId: 155102221
* Introduce BazelPackageLoader.Gravatar nharmata2017-05-04
| | | | | | | | | This is a standalone library for loading packages. It is intended to be used by clients outside of Bazel (for now, Kythe). Perform BazelPackageLoader#loadPackage in the testing hook used in all of Bazel's unit tests and integration tests. This gives us very good test coverage for BazelPackageLoader. RELNOTES: None PiperOrigin-RevId: 155004070
* Restoration of file incorrectly trunkated by the export processGravatar Damien Martin-Guillerez2017-05-03
| | | | | | Fixes #2924. PiperOrigin-RevId: 154825240
* Automated g4 rollback of commit d5217515002d468a3095243975e21e89eccc46b7.Gravatar ajmichael2017-05-02
| | | | | | | | | *** Reason for rollback *** Relies on a CL that is being rolled back due to breaking some LIPO builds. RELNOTES: None PiperOrigin-RevId: 154776370
* Add best practices docGravatar kchodorow2017-05-02
| | | | PiperOrigin-RevId: 154734540
* Support cpufeatures from Android NDK.Gravatar ajmichael2017-05-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes https://github.com/bazelbuild/bazel/issues/2499. Example usage: $ cat jni.cc #include "ndk/sources/android/cpufeatures/cpu-features.h" ... AndroidCpuFamily family = android_getCpuFamily(); $ cat BUILD cc_library( name = "jni", srcs = ["jni.cc"], deps = ["@androidndk//:cpufeatures"], ) android_binary( name = "app", manifest = 'AndroidManifest.xml', srcs = glob(["*.java"]), deps = [":jni"], ) $ cat WORKSPACE android_sdk_repository(name = 'androidsdk') android_ndk_repository(name = 'androidndk') RELNOTES: android_ndk_repository now creates a cc_library (@androidndk//:cpufeatures) for the cpufeatures library that is bundled in the Android NDK. See https://developer.android.com/ndk/guides/cpu-features.html for more details. PiperOrigin-RevId: 154732798
* Roll forward of ↵Gravatar Googler2017-05-02
| | | | | | | | | | | | | | | | | | | | | | | | https://github.com/bazelbuild/bazel/commit/5f31944b8942818aaf53571c76f5c6a9a9dafc72: Custom module map for j2objc_library Automated g4 rollback of commit e7fe50aa727df9ef0a3d37fa258d017971035515. *** Reason for rollback *** Roll forward. The bzl change is removed because it has to be submitted after next Blaze release. *** Original change description *** Automated g4 rollback of commit 5f31944b8942818aaf53571c76f5c6a9a9dafc72. *** Reason for rollback *** This caused some build breaks. *** Original change description *** Custom module map for j2objc_library PiperOrigin-RevId: 154726197
* Move platform providers to a new package to break cyclic dependencies.Gravatar John Cater2017-05-02
| | | | | | | Part of #2219. Change-Id: I87c7bc9fbfb38d3dbdf193b46247901d0f2a838d PiperOrigin-RevId: 154719063
* Only allocate some formerly frequently allocated PathFragment objects once.Gravatar nharmata2017-05-02
| | | | | | This reduces both gc churn and retained memory usage. PiperOrigin-RevId: 154718782
* Make Skylark interpreter read Skylark command-line flagsGravatar brandjon2017-04-30
| | | | | | | | | | | This is the second of two CLs for making command line options able to affect the Skylark interpreter. For the main kinds of evaluation contexts -- package loading, .bzl loading, rule analysis, aspect analysis, and computed defaults -- the SkylarkSemanticsOptions object is retrieved from Skyframe and passed along to the Environment builder. For other contexts such as tests, default values of builtin functions, and standalone Skylark, flags are currently not processed. In the future, we may want to split into separate files the options that affect "pure" Skylark vs the options that affect Bazel-flavored Skylark. One possibility is to subclass SkylarkSemanticsOptions into SkylarkBazelSemanticsOptions, and go through an indirection in SkylarkUtils. We could also pass SkylarkSemanticsOptions to the parser, to support --incompatible_* changes that alter Skylark's syntax. I don't think that's needed at the moment. RELNOTES: None PiperOrigin-RevId: 154628391
* Store Skylark command-line flags in SkyframeGravatar brandjon2017-04-28
| | | | | | | | | This is the first of two CLs for making command line options able to affect the Skylark interpreter. It introduces SkylarkSemanticsOptions, and stores it as a precomputed (injected) value in Skyframe. The next CL will read these options from Skyframe when constructing the Skylark environment. This CL affects the dataflow from command/test initialization to Skyframe. Some code paths, like those used for testing, use the default SkylarkSemanticsOptions and therefore won't be able to use (for example) --incompatible_* flags. The call sites to update were found by searching for uses of defaultVisibility and working upward from there. RELNOTES: None PiperOrigin-RevId: 154432058
* Init absent action configs for CppCompile actionsGravatar hlopko2017-04-27
| | | | | | | | | | So far only link actions were initialized in CppLinkActionConfigs. This cl changes this class to also initialize CppCompile actions. This is needed for our ongoing work removing hard-coded flags from Bazel and moving them into Crosstool. RELNOTES: None. PiperOrigin-RevId: 154397672
* Support using minimized bitcode for ThinLTO LTO indexing stepGravatar Googler2017-04-19
| | | | | | | | This is the Blaze side of the support for emitting and using minimized bitcode files during the LTO indexing (thin link) step of a ThinLTO build. The llvm support has already been released to stable, and this needs to be submitted after the companion Crosstool support (unknown commit, will send for review once this larger part is reviewed). This enables large applications successfully build using ThinLTO and -g, otherwise the bitcode files that are input to the LTO indexing step are huge and the maximum input size is exceeded. PiperOrigin-RevId: 153549687
* Remove special cases for "name" in implicit outputs codeGravatar Benjamin Peterson2017-04-13
| | | | | | | | | | | | | fa97703c1edf ("allow skylark implicit output callbacks to use the rule name") fixed a limitation of the skylark implicit outputs by adding a special case for "name" to the implicit outputs code. Later, 015e5954157a ("Remove special handling of name attribute") fixed the general problem of "name" being a special case in the attribute map. Therefore, we can remove my original fix. We may also excise an older special case in the implicit outputs templating code. Change-Id: I606c9decd98a8df492d2359abe540d3263f99fe1 PiperOrigin-RevId: 152974774
* Delete Preprocessor.Factory.SupplierGravatar laurentlb2017-04-12
| | | | | RELNOTES: None. PiperOrigin-RevId: 152882585
* fix: Allow parentheses in glob patternsGravatar Harmandeep Kaur2017-04-11
| | | | | | | More info here #2583 Closes #2679. PiperOrigin-RevId: 152685327
* Delete SubincludePreprocessorGravatar laurentlb2017-04-07
| | | | | RELNOTES: None. PiperOrigin-RevId: 152408223
* Disable SubincludePreprocessorGravatar laurentlb2017-04-07
| | | | | RELNOTES: None. PiperOrigin-RevId: 152395291
* Remove error handling from PreprocessorGravatar laurentlb2017-04-07
| | | | | RELNOTES: None. PiperOrigin-RevId: 152386957
* Delete more Python-preprocessing tests and documentationGravatar laurentlb2017-04-06
| | | | | | RELNOTES: None. PiperOrigin-RevId: 152369293
* Rephrase AbstractAttributeMapper#visitLabels such that we can avoid creating ↵Gravatar nharmata2017-04-05
| | | | | | | | a temporary Type.LabelVisitor instance per Attribute being visited. Instead, we can now create one temporary object per visitation. Getting rid of this dimension of scaling reduces the amount of garbage created. RELNOTES: None PiperOrigin-RevId: 152161836
* 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
* 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
* Rename ToolchainLookup rule to ToolchainType, to better explain the usage ofGravatar John Cater2017-03-28
| | | | | | | | | | | | | | | | | | | | the rule. Example: tools/newlang/BUILD: toolchain_type(name = "toolchain_type") Allows users to refer to //tools/newlang:toolchain_type when discussing the newlang toolchain. The previous usage: tools/newlang/BUILD: toolchain_lookup(name = "lookup") Lead to labels like //tools/newlang:lookup, which was unclear that each language's toolchain needs one unique instance of toolchain_(lookup|type). -- PiperOrigin-RevId: 151326827 MOS_MIGRATED_REVID=151326827
* 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
* Support declared providers in AdvertisedProviderSet.Gravatar Dmitry Lomov2017-03-06
| | | | | | -- PiperOrigin-RevId: 149165836 MOS_MIGRATED_REVID=149165836
* Allow ' ', '(', ')' and '$' in labels Gravatar Damien Martin-Guillerez2017-03-06
| | | | | | | | | | | | | | | | | | | | | | | This just add the special characters in labels and fixes the associated tests, left is the hard part to test adding those characters everywhere. This is experimental and several characters will break at several location especial in the runfiles manifest file. Follow-ups: Resolve quoting then test, test more and add even more tests. Issue found during development: Parentheses are not accepted in exclude pattern in globs Building a binary includes build-runfiles that relies on the runfiles manifest format so the added test would fails with a java_binary instead of a library. -- Change-Id: I9c87273a90318b931c61bdb86f1066962819960a Reviewed-on: https://cr.bazel.build/9055 PiperOrigin-RevId: 149108027 MOS_MIGRATED_REVID=149108027
* 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
* Add the LABEL_KEYED_STRING_DICT type for attributes.Gravatar Michael Staib2017-02-24
| | | | | | | | | This enables both native and Skylark rules to declare attributes which have labels/Targets as keys, and have string values. -- PiperOrigin-RevId: 148365033 MOS_MIGRATED_REVID=148365033
* Add detailed rule class/label info when report attribute checking error Gravatar Liangliang He2017-02-22
| | | | | | | | | | | This PR addresses comment by @gregestren in https://github.com/bazelbuild/bazel/pull/2531 Closes #2546. -- Reviewed-on: https://github.com/bazelbuild/bazel/pull/2546 PiperOrigin-RevId: 148201730 MOS_MIGRATED_REVID=148201730
* 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
* Early support for code generation directly from C++ module files. This canGravatar Googler2017-02-15
| | | | | | | | | | | | potentially reduce the linker input. The content of a C++ module (specifically the inline definitions) is currently put into every single .o file that uses them and thus can be input to the same final link many times. By generating a separate .o file for the module itself, we can avoid this unnecessary duplication of linker input. -- PiperOrigin-RevId: 147579947 MOS_MIGRATED_REVID=147579947
* Introduce a new SkyValue that merely contains the workspace name. The ↵Gravatar Nathan Harmata2017-02-09
| | | | | | | | | | | | workspace name is needed for package loading, and so splitting out this computation into a separate skyframe node that can be change-pruned gives us better incrementality; previously we'd need to reload all packages on a WORKSPACE file change. N.B. (i) This CL doesn't solve all the other performance issues with //external in Bazel/Blaze since it's still inefficiently used for resolving labels like @foo//bar:baz. (ii) This CL doesn't address the wasteful invalidation + change pruning of all the packages. -- PiperOrigin-RevId: 146925369 MOS_MIGRATED_REVID=146925369
* Introduce a Skyframe function: ActionEnvironmentFunction Gravatar Damien Martin-Guillerez2017-02-08
| | | | | | | | | | | | | | | | | | ActionEnvironmentFunction returns the list of environment variable with the one overwritten by --action_env being replaced. This let other Skyframe function declares dependency to any value of the environment and being influenced by the --action_env flag. This will be used to declare dependency of remote repositories on environment variables (step 3 of https://bazel.build/designs/2016/10/18/repository-invalidation.html) -- Change-Id: I1ed3fb6f48e8e17d4d64c903fccecb6ed7596350 Reviewed-on: https://cr.bazel.build/7974 PiperOrigin-RevId: 146918603 MOS_MIGRATED_REVID=146918603
* Remove dead code in SkyframeLabelVisitorGravatar Ulf Adams2017-02-07
| | | | | | | | | | Two of the functions are never used, several of the parameter are not used or can be simplified (require callers to convert from Target -> Label). -- PiperOrigin-RevId: 146787380 MOS_MIGRATED_REVID=146787380
* Add a flag that alters the behavior of the parse_headers feature. With theGravatar Googler2017-01-27
| | | | | | | | | | | | | flag, the headers of a target are compiled into a C++ module instead of being parsed as their own translation unit. The module otherwise remains unused. This way, parse_headers can be used to get a codebase ready for C++ modules. parse_headers currently already gets close, but there are still ways in which a header can be modules-incompatible although it parses fine. -- PiperOrigin-RevId: 145729231 MOS_MIGRATED_REVID=145729231
* Rename thinlto_param_file to thinlto_indexing_param_file for indexing actionsGravatar Marcel Hlopko2017-01-26
| | | | | | | | | | | | | | My assumption in commit 4cb32a994308e1b4921471e32a02c49d8ceffb84 was that lto-indexing action doesn't expand linking features. This was wrong, and lto-indexing was broken since then as -Wl,@thinlto_param_file was added to the command line. This cl changes the situation by actually exposing 2 different build variables, thinlto_indexing_param_file for lto-indexing actions, and thinlto_param_file for normal linking actions. -- PiperOrigin-RevId: 145669124 MOS_MIGRATED_REVID=145669124
* Add MockCcSupport for FissionGravatar Googler2017-01-25
| | | | | | | | | | Per review feedback from commit efb2f17075a3dbc3d5875699252db7e35a28c8d7, add Fission feature per_object_debug_info to MockCcSupport, replacing real -gsplit-dwarf with a fake name and use it in the added Fission tests. -- PiperOrigin-RevId: 145540550 MOS_MIGRATED_REVID=145540550
* Pass AutoFDO profiles to LTO backend.Gravatar Googler2017-01-18
| | | | | | -- PiperOrigin-RevId: 144841772 MOS_MIGRATED_REVID=144841772
* Expose thinlto_params_file and linker_param_file as build variablesGravatar Marcel Hlopko2017-01-17
| | | | | | | | | | | This cl exposes param files that were hard-coded before. This enables more precise placement on the link command line. This is a roll-forward of commit db7a9ea7f6b2af3c4c1f43ad4aa50cd4eca02921 -- PiperOrigin-RevId: 144708270 MOS_MIGRATED_REVID=144708270
* 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
* Rollback of commit 1da8ac3a8bb0780251976e0dbcfebd3a7ba6a066.Gravatar Pedro Liberal Fernandez2017-01-12
| | | | | | -- PiperOrigin-RevId: 144207746 MOS_MIGRATED_REVID=144207746
* Expose thinlto_params_file and linker_param_file as build variablesGravatar Marcel Hlopko2017-01-10
| | | | | | | | | This cl exposes param files that were hard-coded before. This enables more precise placement on the link command line. -- PiperOrigin-RevId: 144069927 MOS_MIGRATED_REVID=144069927
* 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