aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/packages
Commit message (Collapse)AuthorAge
* Implements dynamic split transitions (minus latebound attribute splits).Gravatar Greg Estren2016-08-08
| | | | | | | | | | With the prereq work behind this, this is surprisingly straightforward. The main change is to eliminate BuildConfiguration.SplittableTransitionApplier, make both DynamicTransitionApplier and StaticTransitionApplier split-aware, and add awareness of this to ConfiguredTargetFunction.trimConfigurations. Latebound splits will follow next. -- MOS_MIGRATED_REVID=129480309
* Make SkylarkClassObject "Bazel-specific".Gravatar Dmitry Lomov2016-08-05
| | | | | | | This in preparation to DeclaredProviders implementation. -- MOS_MIGRATED_REVID=129420617
* Emphasize that default_strict_deps_java_protos is subject to change at any ↵Gravatar Carmi Grushko2016-08-05
| | | | | | | time without prior notice. -- MOS_MIGRATED_REVID=129409727
* Delete unused RuleClass.createPlaceholderBuilderGravatar Michajlo Matijkiw2016-08-05
| | | | | -- MOS_MIGRATED_REVID=129360870
* Start removing the parsePython booleanGravatar Laurent Le Brun2016-08-03
| | | | | | | It's still used in one place and should be removed completely in October. -- MOS_MIGRATED_REVID=129207133
* Allow objc rule deps to include any rule that exports an "objc" provider.Gravatar Googler2016-08-01
| | | | | | | | | | | This change was motivated by a need to write pure Skylark rules that expose their own objc providers so they can be used as deps to other libraries/application targets (e.g., SceneKit/SpriteKit compiled resources, []) without having to whitelist them and wait for a Blaze release. This CL fixes what seems to be a bug in validateRuleDependency, where the behavior in the doc comment implies that it will accept a whitelisted rule name *or* a list of mandatory providers, but as implemented today it seems to require the rule to be whitelisted even if the mandatory native providers matched. RELNOTES: objc_* rules can now depend on any target that returns an "objc" provider. -- MOS_MIGRATED_REVID=128835096
* Rename some PackageId and RepositoryName fields/methods in prep for deep ↵Gravatar Kristina Chodorow2016-07-28
| | | | | | | | | | | | | execroot change This is in prep for making the execution root path for external repositories ../repo_name (instead of external/repo_name). Right now, the getRunfilesPath() returns that path, so that is renamed getExecRoot() (since the runfiles are really just a reflection of the execRoot structure). getSourceRoot() replaces getPathFragment, which has always been a confusing name (it's not clear from the name what the difference is between it and getPackageFragment()). It returns the relative path to source files for external repositories (external/repo_name). Also renamed/moved to more sensible class a few static RepositoryName fields. -- MOS_MIGRATED_REVID=128594419
* Clean up DependencyResolver's interface for the dynamic config migration and ↵Gravatar Greg Estren2016-07-28
| | | | | | | | | | | | | | | | | | | | for general readability. Major changes: - Remove the intermediate Attribute -> LabelAndConfiguration multimap (computed in resolveAttributes). Instead, feed discovered values directly into the final Attribute -> Dependency map via a new RuleResolver interface. - Remove all references to LabelAndConfiguration. The configuration is always the owning rule's configuration except for two special cases: late-bound attributes with splits and late-bound attributes with LateBoundDefault.useHostConfiguration. The original interface made this very unclear and required a lot of awkward and sometimes incorrect logic. The new interface only involves configurations for the cases that actually need them. - Remove an ugly hack caused by BuildConfiguration.evaluateTransition mixing poorly with LateBoundDefault.useHostConfiguration (https://github.com/bazelbuild/bazel/blo[]e172693c27f3efc95ed163e43a9f0a7a6fb4017/src/main/java/com/google/devtools/build/lib/analysis/DependencyResolver.java#L488). - Remove a hack that applies split transitions twice because of BuildConfiguration.evaluateTransition mixing poorly with late-bound split attributes (https://github.com/bazelbuild/bazel/blo[]e172693c27f3efc95ed163e43a9f0a7a6fb4017/src/main/java/com/google/devtools/build/lib/analysis/DependencyResolver.java#L319). This happens to be innocent now but won't be when nested splits are possible. - Solidifies the API contract for Attribute.LateBoundDefault.useHostConfiguration. - Applies clearer naming and more consistent ordering to method parameters. - Better documentation. This is all also prep work for dynamic split transitions. tl;dr: late-bound attributes are legitimately special. Treat them that way to make the rest of DependencyResolver cleaner and hack-free. -- MOS_MIGRATED_REVID=128582618
* java_proto_library strict deps: add attributes for gradual migrationGravatar Carmi Grushko2016-07-27
| | | | | | | | | Control strict-deps through a rule-level and a package-level attribute, allowing finer-grained migration in conjunction with a global flag. RELNOTES: java_proto_library: control strict-deps through a rule-level and a package-level attribute. -- MOS_MIGRATED_REVID=128542363
* Remove outdated commentGravatar Michajlo Matijkiw2016-07-27
| | | | | -- MOS_MIGRATED_REVID=128510907
* Adjust visibility of ComputedDefault dependenciesGravatar Mark Schaller2016-07-27
| | | | | | | Also clarify that the returned list is immutable. -- MOS_MIGRATED_REVID=128482720
* Slim down RuleClass#createUncheckedGravatar Michajlo Matijkiw2016-07-26
| | | | | -- MOS_MIGRATED_REVID=128391351
* Optimize Rule.getLabels(void) to avoid ImmutableSortedSet.construct().Gravatar Googler2016-07-26
| | | | | | | | | This is called only from Package$Builder.checkForInputOutputConflicts() which just wants the name of each input label; there's no need to sort or deduplicate. -- MOS_MIGRATED_REVID=128355375
* Bring PackageSpecification docs up-to-date, clean up its interfaceGravatar Mark Schaller2016-07-22
| | | | | | | | Focuses on documenting the Strings that PackageSpecifications can be translated from and to. -- MOS_MIGRATED_REVID=128195540
* JavaBuilder: for jars that are produced by aspects (e.g., JavaProtoAspect), ↵Gravatar Carmi Grushko2016-07-22
| | | | | | | | | pass the name of the injecting rule (e.g., java_proto_library), if the rule registered it. Registration is done using AspectParameters and a specially-named key. -- MOS_MIGRATED_REVID=128179548
* Remove Rule's dependence on a RawAttributeMapper instanceGravatar Michajlo Matijkiw2016-07-21
| | | | | | | | | The things Rule needs it for aren't terribly complex. Instead inline functionality where sensible, and refactor into static methods where not. This reduces each Rule's memory footprint by 38%. -- MOS_MIGRATED_REVID=128011760
* Remove unused AttributeContainer#getAttrGravatar Michajlo Matijkiw2016-07-20
| | | | | -- MOS_MIGRATED_REVID=127895738
* Prohibit duplicate addition of aspect to an attribute and improve diagnostics.Gravatar Dmitry Lomov2016-07-19
| | | | | -- MOS_MIGRATED_REVID=127808009
* Sort the results returned by the HybridGlobber if we are using results from ↵Gravatar Janak Ramakrishnan2016-07-19
| | | | | | | | | Skyframe globbing. This adds a log(n) factor to uses of globs, but getting globs to be returned in a reasonable order that can be emulated by legacy globbing is hard and bug-prone right now, and we must sort anyway if we are merging legacy and Skyframe globs. Note that this log(n) factor is already present on clean builds with legacy globbing. If we end up seeing performance issues on incremental loading, we can investigate making GlobFunction efficiently return elements in sorted order. (We would still need to sort if merging legacy and Skyframe globs, but that should be a relatively rare occurrence, and can be dealt with by a more efficient merge sort if necessary.) -- MOS_MIGRATED_REVID=127752554
* Don't store workspace name on ruleGravatar Michajlo Matijkiw2016-07-18
| | | | | | | Instead have callers get it via package. -- MOS_MIGRATED_REVID=127715494
* Remove GlobList formatting logicGravatar Michajlo Matijkiw2016-07-18
| | | | | | | Isn't strictly necessary, remove it before anyone decides they want to use it. -- MOS_MIGRATED_REVID=127585617
* Remove not-quite necessary serialization bitsGravatar Michajlo Matijkiw2016-07-15
| | | | | | | What we really are doing here is formatting. -- MOS_MIGRATED_REVID=127481183
* Memoize TestSize.name().toLowerCase() -> TestSize mappingsGravatar Michajlo Matijkiw2016-07-14
| | | | | | | | | | Saves some needless garbage generation. We expect TestSize#getTestSize(String) to always pass in a lowercase value, which we promptly change to uppercase for the enum lookup. Instead memoize the lowercase -> TestSize mapping to avoid this call. -- MOS_MIGRATED_REVID=127362499
* Fix native.existing_rule() when argument is an existing fileGravatar Laurent Le Brun2016-07-13
| | | | | -- MOS_MIGRATED_REVID=127218963
* Glob arguments 'exclude' and 'exclude_directories' must be namedGravatar Laurent Le Brun2016-07-13
| | | | | | | | | | | Unamed arguments are confusing, e.g. glob(["*.java"], ["testing/*.java"]) The second list is actually excluded. RELNOTES: Glob arguments 'exclude' and 'exclude_directories' must be named -- MOS_MIGRATED_REVID=127190991
* Add allow_single_file in attr.label, deprecate single_file.Gravatar Laurent Le Brun2016-07-05
| | | | | -- MOS_MIGRATED_REVID=126620866
* Ignore make variables undefined for requested platform.Gravatar Dmitry Lomov2016-07-01
| | | | | -- MOS_MIGRATED_REVID=126333303
* Reorganize Skylark Reference documentation.Gravatar Dmitry Lomov2016-06-29
| | | | | -- MOS_MIGRATED_REVID=126081020
* Expose versions of Package.Builder#addRule and RuleClass#createRule that ↵Gravatar Nathan Harmata2016-06-29
| | | | | | | don't perform internal sanity checks. -- MOS_MIGRATED_REVID=126073693
* Get rid of a bunch of IOExceptions that were being unnecessarily thrown. We ↵Gravatar Janak Ramakrishnan2016-06-23
| | | | | | | don't want to throw IOExceptions unless there is an actual IOException. Syntax errors in WORKSPACE files don't qualify, and neither do badly written Skylark rules. I may have misunderstood some code here, so please do push back if the root causes here really can be filesystem issues. -- MOS_MIGRATED_REVID=125591177
* Added more pointers to Aspect-related documentation.Gravatar Florian Weikert2016-06-21
| | | | | -- MOS_MIGRATED_REVID=125428066
* Add license types to the documentationGravatar Kristina Chodorow2016-06-21
| | | | | | | Fixes #642. -- MOS_MIGRATED_REVID=125351602
* Avoid the main use of String.format() during loading and analysis. This isGravatar Googler2016-06-21
| | | | | | | | a noticeable hotspot in profiles. (It would be even better if we could avoid constructing this string until we actually need to produce an error message.) -- MOS_MIGRATED_REVID=125323226
* Rollback of commit bdfd58a8ca2ed5735d6aaa5b238fb0f689515724.Gravatar Laurent Le Brun2016-06-20
| | | | | -- MOS_MIGRATED_REVID=125160288
* Make the execution root match the runfiles tree structure for external ↵Gravatar Kristina Chodorow2016-06-17
| | | | | | | | | | | | | | | | | | | | | repositories One interesting side effect of how this is implemented is that for external repositories, bin/ and genfiles/ are combined. External repo output is under bazel-out/local-fastbuild/repo_name for each repo. Fixes #1262. 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. -- MOS_MIGRATED_REVID=125095799
* Fix hypothetical crash bug in AspectDefinition#addAllAttributesOfAspect when ↵Gravatar Nathan Harmata2016-06-16
| | | | | | | the default value of a parameterized aspect attribute is null. This is hypothetical because I couldn't figure out an end-to-end way to tickle the bug. Still, the surrounding code is very brittle and things may change in the future such that the bug is trivially tickle-able. -- MOS_MIGRATED_REVID=124977450
* Don't include null values in AggregatingAttributeMapper#visitAttribute. Null ↵Gravatar Nathan Harmata2016-06-16
| | | | | | | values arise when a None is used as the value of a Selector for a type without a default value. -- MOS_MIGRATED_REVID=124961388
* Optimize memory use of AttributeContainer:Gravatar Googler2016-06-15
| | | | | | | | | | | | | - Relatively few locations are set relative to the number of attributes. Replace the sparse array with a dense one. - BitSet requires a minimum of two objects (48 bytes in our current JVM), but we set an average of just six bits. Replace it with a list of indices packed into a byte[], shared with the locations array. Also add some assertions to help the next reader. -- MOS_MIGRATED_REVID=124830576
* Use only one list of parameters for SkylarkSignatureGravatar Damien Martin-Guillerez2016-06-14
| | | | | | | | | | | | | Optional and named parameters are now specified using `defaultValue` and `named` (and `positional`). The new structure allow for parameters that are both named and positional (which was forbidden before). This new structure will be used to give the @SkylarkCallable annotation the possibility to provide named and default arguments. It should be a functional no-op for Bazel users. -- MOS_MIGRATED_REVID=124821455
* Introduce TestConstants#PACKAGE_FACTORY_FACTORY_FOR_TESTING for the sake of ↵Gravatar Nathan Harmata2016-06-10
| | | | | | | making it easier to create PackageFactory instances in unit tests. -- MOS_MIGRATED_REVID=124566862
* Small tweak to make Attribute serialization more testableGravatar Michajlo Matijkiw2016-06-10
| | | | | -- MOS_MIGRATED_REVID=124483721
* Add equals & hashcode for FilesetEntyGravatar Michajlo Matijkiw2016-06-10
| | | | | -- MOS_MIGRATED_REVID=124481285
* Extract the @Param annotation from @SkylarkSignatureGravatar Damien Martin-Guillerez2016-06-10
| | | | | | | | The @SkylarkCallable annotation is very limited and to extend it it is best to share a similar API than the @SkylarkSignature annotation. -- MOS_MIGRATED_REVID=124473056
* Add a hook to Package.Builder.Helper that gets called by PackageFunction ↵Gravatar Nathan Harmata2016-06-07
| | | | | | | after the Package is fully loaded. -- MOS_MIGRATED_REVID=124260910
* ErrorProne (http://errorprone.info/) suggested fixes for PackageFactory.Gravatar Nathan Harmata2016-06-07
| | | | | -- MOS_MIGRATED_REVID=124161557
* Make a 'did you mean' suggestion when referencing a non-existent label.Gravatar Laurent Le Brun2016-06-06
| | | | | | | It works for both labels on the command-line and labels in BUILD files. -- MOS_MIGRATED_REVID=123967347
* Allow BlazeModules to expose a helper that PackageFactory will use for ↵Gravatar Nathan Harmata2016-05-27
| | | | | | | creating fresh Package instances. Also make a few Package methods public. -- MOS_MIGRATED_REVID=123247246
* Better error message when combine //visibility:(public|private) with other ↵Gravatar Yue Gan2016-05-25
| | | | | | | forms. -- MOS_MIGRATED_REVID=123201777
* Remove Package.LegacyBuilder (unneeded as of commit ↵Gravatar Nathan Harmata2016-05-25
| | | | | | | 3a95f353704dc2f7061e2c0786c2459ac1db0fd1). -- MOS_MIGRATED_REVID=123107954
* Allow use of Exceptions to exit early out of configured-target creation, ↵Gravatar Chris Parsons2016-05-24
| | | | | | | | | | instead of passing and checking null in all helpers. Demonstrates this pattern usage in a few select rules (e.g. AndroidBinary) where this was particularly egregious. There are many places which can benefit from this pattern -- this change doesn't try to fix them all at once. -- MOS_MIGRATED_REVID=123012378