aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java
Commit message (Collapse)AuthorAge
* Make load() work in remote repositories too.Gravatar Lukacs Berki2015-08-27
| | | | | | | | | Previously, load() always looked up .bzl files in the main repository. Ideally, it would just take a label and then it would work by default, but for the time being, this quick fix will do. I had to put in an evil hack to make load() statements work in the prelude, because we currently have no way to distinguish load() statements from the prelude and from the BUILD file. Again, a proper label-based load() would solve this. -- MOS_MIGRATED_REVID=101677502
* Expose FilesToRun provider to Skylark.Gravatar Brian Silverman2015-08-27
| | | | | | | | | | It is now possible to get the main executable of *_binary rules with target.files_to_run.executable. -- Change-Id: I4a81f216bdd237fc5b0e7dbd7d0a312558f3cf2c Reviewed-on: https://bazel-review.googlesource.com/#/c/1760/ MOS_MIGRATED_REVID=101675365
* EvalExceptionWithStackTrace does no longer remove non-EvalException ↵Gravatar Florian Weikert2015-08-27
| | | | | | | exceptions from its cause. -- MOS_MIGRATED_REVID=101673097
* Fix link order for all rules using the java library helper.Gravatar Ulf Adams2015-08-27
| | | | | | | | | | | By default, we collect Java-specific link options first, and only collect C++ link options if the dependency does not have Java ones. Longer term, the language-specific link options providers should be replaced by aspects. -- MOS_MIGRATED_REVID=101669588
* Remove the awkward default value marker from --symlink_prefix.Gravatar Lukacs Berki2015-08-27
| | | | | | | The wording of the help text is somewhat awkward, but we cannot mention "Bazel" explicitly because the string "Bazel" comes from Constants.java . -- MOS_MIGRATED_REVID=101664076
* Ensures that EvalExceptionWithStackTrace does not have an empty exception ↵Gravatar Florian Weikert2015-08-27
| | | | | | | message. -- MOS_MIGRATED_REVID=101659996
* Distinguish between user-supplied ios_cpu and the default, and don't ↵Gravatar Michael Thvedt2015-08-27
| | | | | | | propagate the default to the XCode project control. -- MOS_MIGRATED_REVID=101644957
* Description redacted.Gravatar Michajlo Matijkiw2015-08-27
| | | | | -- MOS_MIGRATED_REVID=101635740
* Expose the #asByteSource() method in FileSystemUtils.Gravatar Eric Fellheimer2015-08-27
| | | | | -- MOS_MIGRATED_REVID=101628787
* Add a isLoadingPhase flag to EnvironmentGravatar Francois-Rene Rideau2015-08-27
| | | | | | | | | Have loadingPhase-only methods check that flag. It's no use removing the initial bindings to these methods when they may have been copied anyway. -- MOS_MIGRATED_REVID=101624770
* Description redacted.Gravatar Michajlo Matijkiw2015-08-27
| | | | | -- MOS_MIGRATED_REVID=101598188
* Create ValidationEnvironment from EnvironmentGravatar Francois-Rene Rideau2015-08-27
| | | | | | | | Allow ValidationEnvironment to be created from initial Environment so that there is no need to manually keep two different sets of constructors in synch. -- MOS_MIGRATED_REVID=101588695
* Use a concurrent LoadingCache for SkylarkType.Simple as opposed to having to ↵Gravatar Nathan Harmata2015-08-27
| | | | | | | hold a global lock in order to get a skylark type. -- MOS_MIGRATED_REVID=101585120
* Fix check for srcs-less android_* rulesGravatar Liam Miller-Cushon2015-08-27
| | | | | | | | | | | | In android rules with no srcs, deps are treated like exports by strict java deps. This fixes the check for srcs-less targets to consider srcjars in addition to .java files. This bug was fixed for java_* rules by adding the runtime_deps attribute, and disallowing deps in srcs-less rules. -- MOS_MIGRATED_REVID=101581572
* Expose java_import and android_library information to skylarkGravatar Liam Miller-Cushon2015-08-27
| | | | | -- MOS_MIGRATED_REVID=101579648
* Add string.capitalize()Gravatar Laurent Le Brun2015-08-27
| | | | | -- MOS_MIGRATED_REVID=101575207
* Skylark stack traces are now displayed in Python format.Gravatar Florian Weikert2015-08-27
| | | | | -- MOS_MIGRATED_REVID=101572295
* Clean up the link command action code a bit.Gravatar Ulf Adams2015-08-27
| | | | | -- MOS_MIGRATED_REVID=101568873
* Make Bazel compile (a previous change added a graph -> jsr305 dependency ↵Gravatar Lukacs Berki2015-08-26
| | | | | | | that was not reflected in the BUILD file) -- MOS_MIGRATED_REVID=101553809
* Don't mark ErrorInfo transient if one of its child ErrorInfos is transient.Gravatar Janak Ramakrishnan2015-08-26
| | | | | | | | | Parents should depend on their children's transience to force their re-evaluation, not say directly that they are transient. This can lead to an inconsistency between whether an ErrorInfo says it is transient and whether the node depends on the ErrorTransienceValue. This should reduce the number of edges in the graph in case of transient error without sacrificing correctness. -- MOS_MIGRATED_REVID=101537029
* Allow ErrorTransienceValue to be added back as a dep during change pruning ↵Gravatar Janak Ramakrishnan2015-08-26
| | | | | | | | | if it isn't newer than the current node. ErrorTransienceValue has to be treated specially during pruning because normally deps added during pruning remain if the node is actually rebuilt. The whole point of ErrorTransienceValue is that on a re-evaluation, the node may not depend on it anymore. So we have special logic to force a rebuild if the ErrorTransienceValue has changed. If it hasn't, however, it is ok for pruning to add it back as a dep -- we'll end up marking this value clean, since ErrorTransienceValue is always the last dep. -- MOS_MIGRATED_REVID=101522197
* Rename isSkylarkEnabled to isSkylarkGravatar Francois-Rene Rideau2015-08-26
| | | | | -- MOS_MIGRATED_REVID=101518833
* Replace query option --order_results with --order_output, which can take ↵Gravatar Janak Ramakrishnan2015-08-26
| | | | | | | | | | | three values for a given output formatter: 'no', 'deps', or 'full'. A fourth value, 'auto', means either 'deps' or 'full' depending on the formatter. The option 'no' is equivalent to --noorder_results. 'full' means that output will be deterministically ordered, using alphabetization if necessary. 'deps' means that graph order will be preserved (where applicable), but further efforts to order the output may not be undertaken. 'auto' is equivalent to 'full' for all output formatters except for proto, minrank, maxrank, and graph, for which it is equivalent to 'deps'. The purpose of this cl is to enable genquery to force completely deterministic output, which requires that it be able to specify a total ordering on the graph that is consistent across runs. Which ordering doesn't matter very much, so depending on the output formatter, or even within the same one, there may be some groups of nodes that are ordered alphabetically, and some reverse alphabetically. -- MOS_MIGRATED_REVID=101512292
* Add toString() for PrepareDepsOfTargetsUnderDirectoryValue key.Gravatar Eric Fellheimer2015-08-26
| | | | | -- MOS_MIGRATED_REVID=101510850
* Only perform one read of the hashCode field in our benign-data-racy ↵Gravatar Nathan Harmata2015-08-26
| | | | | | | hashCode() implementation. See http://jeremymanson.blogspot.com/2008/12/benign-data-races-in-java.html. -- MOS_MIGRATED_REVID=101490349
* Get rid of unnecessary synchronization. This is a contention point when we ↵Gravatar Nathan Harmata2015-08-26
| | | | | | | have lots of threads. -- MOS_MIGRATED_REVID=101485204
* Implement the core structure for dynamic configurations.Gravatar Greg Estren2015-08-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a big change, so let me walk you through the key pieces: 1) This cl provides an alternative mechanism for creating configurations and doing configuration transitions that's "dynamic" in that the configurations can be created on the fly and the transitions are arbitrary mappings from BuildOptions --> BuildOptions that can also be created on the fly. It also integrates this with ConfiguredTargetFunction, so the configured target graph automatically uses this framework. 2) It does *not* replace old-style (which we'll call "static") configurations. For a number of important reasons: It's not yet at feature parity (particularly: no LIPO). It's not remotely tested across real projects enough to have confidence that it's battle-ready. It doesn't yet handle certain "special" functions like BuildConfiguration.prepareToBuild() and BuildConfiguration.getRoots(). It still relies on the old static transition logic to determine what transitions to apply (eventually we'll distribute that logic out, but that's too much for a single cl). We need the option to toggle it on and off until we have enough confidence in it. So with this cl, builds can be done in either mode. 3) The new flag --experimental_dynamic_configs toggles use of dynamic configurations. 4) Dynamic configurations are created with the Skyframe function BuildConfigurationFunction (this was already created in an earlier change). This consumes a BuildOptions and a set of configuration fragments to produce a BuildConfiguration. 5) Dynamic transitions are instances of the new class PatchTransition, which simply maps an input BuildOptions to an output BuildOptions. 6) Since static and dynamic configurations have to co-exist (for now), this cl tries hard to keep today's transition logic defined in a single place (vs. forking a dedicated copy for each configuration style). This is done via the new interface BuildConfiguration.TransitionApplier. BuildConfiguration.evaluateTransition is modified to feed its transition logic into TransitionApplier's common API. Both dynamic and static configurations have their own implementations that "do the right thing" with the results. 7) The transition applier for dynamic configurations basically stores the Transition, then allows DependencyResolver (which calls BuildConfiguration.evaluateTransition) to return Dependency instances containing that Transition (vs. a BuildConfiguration, which they traditionally contain). 7.5) An earlier variation of the dynamic transition applier retained BuildOptions (e.g. when it got a Transition it immediately applied it to get its output BuildOptions, then stored that). This had the advantage of making composing of transitions easier, especially within BuildConfiguration.evaluateTransition (which can theoretically apply multiple transitions to the input configuration). But it turns out that applying transitions has a cost, and it's simply more performant to pass them through until they're really needed. 8) In dynamic configuration mode, after ConfiguredTargetFunction gets its deps (e.g. an <Attribute, Dependency> multimap), it "trims" the configurations for its dependencies by a) only including config fragments required by the deps' subtrees and b) applying the transitions that came from 7). This all happens in the new method ConfiguredTargetFunction.trimConfigurations. 9) trimConfigurations is heavily performance-optimized based on a lot of experience running this through a large project within Google. As it turns out, the cost of host transitions can be atrocious (because there are a lot of them). Also, BuildOptions.clone() is expensive. And just creating BuildConfiguration SkyKeys also has a cost (largely because of BuildOptions cloning), so that shouldn't be done except when really necessary. My experience with this convinced me it's worth making this method complicated for the sake of making it fast. Since it basically visits every edge in the configured target graph (at least), it really needs to be slick. 10) Since host transitions in particular are problematic w.r.t. speed, I compute the host *once* in ConfigurationCollectionFunction.getHostConfiguration() and expose that reference to ConfiguredTargetFunction and other Skyframe functions. This limits recomputation to just when the fragments are trimmed. 11) Since options cloning is expensive, I'm doing something scary: exposing a BuildConfiguration.getOptions() method that returns a direct reference. Since BuildOptions is mutable, this is dangerous in the wrong hands. I can experiment with going back to cloning (with the caching of host transitions it may not matter as much), but we may ultimately have to put up with this risk for the sake of performant analysis time. What would be *really* awesome would be to make BuildOptions immutable. But that's not going to happen in this cl. So in short, the key abstractions in this cl are: - PatchTransition - BuildConfiguration.TransitionApplier - ConfiguredTargetFunction.trimConfigurations The current implementation imposes no analysis time penalty -- MOS_MIGRATED_REVID=101474620
* Make sandboxed execution the default in Bazel. This should be safe, as the ↵Gravatar Philipp Wollermann2015-08-26
| | | | | | | strategy is only used if your Linux kernel is new enough and your running system supports it. If this breaks you, please file a bug and you can always go back to non-sandboxed execution by using --spawn_strategy=standalone. -- MOS_MIGRATED_REVID=101464269
* No-op refactoring of output formatters to re-use common code.Gravatar Janak Ramakrishnan2015-08-26
| | | | | | | This will make it easier for future changes to modify this common code. -- MOS_MIGRATED_REVID=101464103
* Remove unnecessary use of ResolvedTargets in SkyQueryEnvironment.Gravatar Janak Ramakrishnan2015-08-26
| | | | | | | ResolvedTargets#getTargets already doesn't contain any of ResolvedTargets#filteredTargets, and there is a 1-1 mapping between Labels and Targets, so the filtering we were doing was useless. -- MOS_MIGRATED_REVID=101463111
* Link to tools/objc/dummy.c from output directory to allow xcodeproj to ↵Gravatar Chris Parsons2015-08-26
| | | | | | | resolve the file even while outside a workspace which contains it -- MOS_MIGRATED_REVID=101462428
* Port to FreeBSD.Gravatar Doug Rabson2015-08-26
| | | | | | | -- Change-Id: I4e65cc583e758d2f7e45209ffcb37f6a871e2ed7 Reviewed-on: https://bazel-review.git.corp.google.com/#/c/1840 MOS_MIGRATED_REVID=101462155
* Instead of assuming that sandboxing will generally work on everything that ↵Gravatar Philipp Wollermann2015-08-26
| | | | | | | | | is Linux, do real auto-detection whether it is supported on the host or not and enable / disable it based on the result. The warning that is printed when the Linux kernel is too old to support sandboxing can be disabled via a flag. -- MOS_MIGRATED_REVID=101461120
* Refactor skylark format internalsGravatar Francois-Rene Rideau2015-08-26
| | | | | | | | | | Rename some methods to avoid clashes. Add function formattable to create lazily-formatted objects, remove now unused strFormattable and reprFormattable. Also some whitespace cleanup. -- MOS_MIGRATED_REVID=101459565
* Rules created by Skylark macros now have values for the attributes ↵Gravatar Florian Weikert2015-08-26
| | | | | | | | | generator_name and generator_function. Additionally, both Skylark macros and build extensions set the attribute generator_location in order to store the name of the file where generator_function was defined. -- MOS_MIGRATED_REVID=101458757
* Replace quick hack for handling non-sandboxable spawns with a better solution.Gravatar Philipp Wollermann2015-08-26
| | | | | -- MOS_MIGRATED_REVID=101458091
* Execute spawns inside sandboxes to improve hermeticity (spawns can no longer ↵Gravatar Philipp Wollermann2015-08-26
| | | | | | | | | | | | use non-declared inputs) and safety (spawns can no longer affect the host system, e.g. accidentally wipe your home directory). This implementation works on Linux only and uses Linux containers ("namespaces"). The strategy works with all actions that Bazel supports (C++ / Java compilation, genrules, test execution, Skylark-based rules, ...) and in tests, Bazel could successfully bootstrap itself and pass the whole test suite using sandboxed execution. This is not the default behavior yet, but can be activated explicitly by using: bazel build --genrule_strategy=sandboxed --spawn_strategy=sandboxed //my:stuff -- MOS_MIGRATED_REVID=101457297
* Add an --experimental_disable_jvm flag.Gravatar Ulf Adams2015-08-26
| | | | | -- MOS_MIGRATED_REVID=101457236
* Require an android_local_tools_repository stanza in the WORKSPACE file so ↵Gravatar Lukacs Berki2015-08-26
| | | | | | | | | | | | | | | that Bazel finds Android tools and update the tools themselves to handle their new location. This paves the way for eventually referencing every tool this way. We have to figure out if android_http_tools_repository is the right way to distribute the Android tools, but now that we don't have a binary distribution yet, it's not an immediate problem. This will break existing users of Android support in Bazel, whom I'll inform over bazel-discuss. Fixes #384. -- MOS_MIGRATED_REVID=101456190
* Lock down the requirement of fragment declaration.Gravatar Ulf Adams2015-08-26
| | | | | | | | | All affected rules were annotated, and all known affected Skylark rules were also annotated. The documentation was updated, so it looks like we're good to go. -- MOS_MIGRATED_REVID=101450297
* Rename some variables missed by a codebase-wide renaming a long time ago.Gravatar Nathan Harmata2015-08-25
| | | | | -- MOS_MIGRATED_REVID=101388809
* Memoize SkyFunctionNamesGravatar Michajlo Matijkiw2015-08-25
| | | | | | | | In practice there are generally very few of these, keep a chache to avoid dups. -- MOS_MIGRATED_REVID=101386883
* Improve the Python launcher to be smarter and make less assumptions when ↵Gravatar Philipp Wollermann2015-08-25
| | | | | | | looking for the .runfiles path and the Python interpreter binary. -- MOS_MIGRATED_REVID=101380117
* Make ValueWithMetadata#normal public, for use in alternate graph ↵Gravatar Janak Ramakrishnan2015-08-25
| | | | | | | implementations. -- MOS_MIGRATED_REVID=101379672
* Return raw SkyValue instead of wrapped ValueWithMetadata.Gravatar Janak Ramakrishnan2015-08-25
| | | | | -- MOS_MIGRATED_REVID=101377320
* Using aliases in load() may no longer lead to false positives in ↵Gravatar Florian Weikert2015-08-25
| | | | | | | SkylarkEnvironment's recursion detection. -- MOS_MIGRATED_REVID=101374341
* Copies shared object dependencies when building Android native binaries.Gravatar Michael Staib2015-08-25
| | | | | | | | | | | | Previously, shared objects in the transitive closure of an Android binary would be linked in, but not be sent to the apkbuilder. This sends all the shared objects used for linking to join the other native libraries in the APK, so they will be loadable when the main library created by the link step is loaded. Fixes #357. -- MOS_MIGRATED_REVID=101365491
* Introduce '|' operator for set union.Gravatar Laurent Le Brun2015-08-25
| | | | | -- MOS_MIGRATED_REVID=101363350
* Make Bazel handle visibility through //external: labels correctly: ↵Gravatar Lukacs Berki2015-08-25
| | | | | | | | | //external: targets can depend on anything and visibility is checked a the edges incoming to said labels. Fixes #388. -- MOS_MIGRATED_REVID=101363086
* Do not consider //external: a repository-local reference.Gravatar Lukacs Berki2015-08-25
| | | | | | | Fixes #360. -- MOS_MIGRATED_REVID=101360551