aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java
Commit message (Collapse)AuthorAge
* Simplify exception handling in spawn strategiesGravatar ulfjack2017-07-17
| | | | | | | | | | | | | | | | | | | | | | | | | The main change here is to only catch SpawnExecException in StandaloneTestStrategy, so all other exceptions simplify propagate up. As a result, Bazel no longer retries tests that fail with an exception, we only retry tests that actually ran, had a spawn result, and resulted in a UserExecException. That is probably what we want. Also do some cleanup: - Remove ExecException.timedOut; nobody was calling it (but there's still SpawnExecException.timedOut) - Remove SpawnActionContext.shouldPropagateExecException; all exceptions (except SpawnExecException) are now propagated by default - Remote the SandboxOptions from the SandboxStrategies; all sandboxing options are now handled by the underlying SpawnRunner implementations I'll send a followup CL to remove the UserExecException and EnvironmentalExecException types; the types don't do anything special, and there are no catch blocks in production code that catch one of these more specific types. This should fix #3322 by removing a bunch of special handling. PiperOrigin-RevId: 161960919
* Update the gRPC channels for remote caching and execution to use a ↵Gravatar olaola2017-07-17
| | | | | | | | | RoundRobin client side load balancer instead of the default PickFirst. A RoundRobin rotates between all addresses returned by the resolver, while PickFirst sends all traffic to the first address. This might help resolve some of the load problems we encountered (see https://github.com/grpc/grpc/issues/11704 for more details). TESTED=remote worker PiperOrigin-RevId: 161960008
* CustomCommandLine.Builder: clean up its interfaceGravatar laszlocsomor2017-07-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In this commit: - remove unused methods and classes - turn CustomCommandLine.ArgvFragment into an interface - remove the CustomCommandLine.TreeFileArtifactArgvFragment abstract class; it only had one remaining subclass - add @Nullable annotations where nulls are fine - add Precondition checks for non-nullable args - simplify the interface by removing add* methods that can be composed of other add* methods; this makes it easier to see what the callers do with the Builder - remove add* methods that add a single argument followed by a list of other elements (or a joined string of them); these had a bug in that they didn't check if the collection was empty (only that it was not null), and if it was empty then the single argument was still added though it was not followed by any value - fix call sites of add* methods where we previously could have added a flag with an empty collection - audit every affected call site RELNOTES: none PiperOrigin-RevId: 161957521
* Promote getPossibleInputsForTesting from CppCompileAction to CommandAction, inGravatar cpeyser2017-07-17
| | | | | | | order to allow tests that depend on pruned inputs to work for both the legacy and crosstool cases. PiperOrigin-RevId: 161955432
* Expose transitive_compile_time_jars on java_common.provider.Gravatar elenairina2017-07-17
| | | | | | | | Fixes #3367. This is useful when implementing rules that comply with the strict deps feature. PiperOrigin-RevId: 161955236
* remote: Fix a bug where local executed results would not be uploaded. Fixes ↵Gravatar Ola Rozenfeld2017-07-14
| | | | | | | | | | | | | #3379 Commit dc24004873c335 broke the upload of locally executed action results. Also, update our unit tests who did not catch this error. P.S.: olaola@ is the author of this change, but due to time constraints we had to merge it while she was asleep. Change-Id: Ib150152c0bddc8311908c105aef208506d3b6a8d PiperOrigin-RevId: 161954553
* Add link options from feature config to the Go link lineGravatar Googler2017-07-14
| | | | | | | | | | The C++ link for Go links involving C++ objects did not add linker options from feature configurations in the crosstool to the link line. This caused failures in go_test links when linking with LIPO, since a recent change moved the necessary link options to the crosstool feature config (e.g. unknown commit), instead of explicitly specifying them for the tests. This issue affected other link types as well (I confirmed that an --fdo_instrument link of a go_binary failed because it did not pick up the necessary link options from the feature config). RELNOTES: None. PiperOrigin-RevId: 161952640
* Remove unused native aspect for ASwBGravatar Googler2017-07-14
| | | | | RELNOTES: None. PiperOrigin-RevId: 161952410
* Automated rollback of commit 8002b6205e004721f771df20d1d8c1402c03964e.Gravatar laszlocsomor2017-07-14
| | | | | | | | | | | | | | | | | *** Reason for rollback *** Broke various Bazel CI jobs Fixes https://github.com/bazelbuild/bazel/issues/3388 Fixes https://github.com/bazelbuild/bazel/issues/3386 Fixes https://github.com/bazelbuild/bazel/issues/3385 Fixes https://github.com/bazelbuild/bazel/issues/3384 *** Original change description *** Fix rules that provide both 'executable' and 'files' PiperOrigin-RevId: 161949099
* remote: Improve error handling for --remote_* cmd line flags. Fixes #3361, #3358Gravatar buchgr2017-07-14
| | | | | | | | | | | - Move flag handling into RemoteModule to fail as early as possible. - Make error messages from flag handling human readable. - Fix a bug where remote execution would only support TLS with a root certificate being specified. - If a remote executor without a remote cache is specified, assume the remote cache to be the same as the executor. PiperOrigin-RevId: 161946029
* LocalSpawnRunner now always logs as itselfGravatar ulfjack2017-07-14
| | | | PiperOrigin-RevId: 161944209
* remote: Don't cache test if marked "external". Fixes #3362Gravatar buchgr2017-07-14
| | | | | RELNOTES: None. PiperOrigin-RevId: 161937673
* experimental UI: keep console updated till the endGravatar Klaus Aehlig2017-07-14
| | | | | | | | | | | | | | | | For commands that do not send a BuildFinishedEvent, we normally use the NoBuildEvent to determine the end of the build and hence the moment where the UI should not any more interfere with the output. For some requests, like fetch, however, we should continue to report progress till the very end (as there is no output to interfere with). Do so, and also be sure that the experimental UI also reports downloads if not explicitly in a loading or analysis phase. While there, also group digits in the number of downloaded bytes, to increase readability. Change-Id: I31efeee5bdb1d29b2ecf842acb3e383e297707f8 PiperOrigin-RevId: 161935456
* experimentalUI: agressively bufferGravatar Klaus Aehlig2017-07-14
| | | | | | | | | | | | | | | | | To update the progress bar, we first have to remove it and then write the new one. For this to look smooth, the control sequence removing the old progress bar and the characters of the new progress bar have to arrive "in one go" at the (actual) terminal. As AnsiTerminal sends each control sequence as a separate write to the underlying stream, we have to buffer the underlying stream. Therefore, if the experimental UI is used, buffer that stream unconditionally until flushed, and not by line. For the experimental UI this is save, as it flushes the stream appropriately. For the old UI, we keep the line buffering, as the old UI relies on an implicit flush whenever a new-line character is written. Change-Id: I3a914e4b93ce17c3de05df0d860cf98849c3b4a1 PiperOrigin-RevId: 161935218
* Aspects-on-aspects correctness fix.Gravatar dslomov2017-07-14
| | | | | | | | Fixes an issue where an aspect propagates over a target that depends on another target twice with different set of aspects applied. RELNOTES: None. PiperOrigin-RevId: 161931168
* Fix documentation: no best effort guarantees to waitGravatar aehlig2017-07-14
| | | | PiperOrigin-RevId: 161930826
* docs: Document --spawn_strategy=standalone for testGravatar Harmandeep Kaur2017-07-14
| | | | | | | | Resolves #2571 Closes #3316. PiperOrigin-RevId: 161930376
* Sorting the Action output files.Gravatar olaola2017-07-14
| | | | PiperOrigin-RevId: 161925075
* remote: Chunker should open files lazily.Gravatar buchgr2017-07-14
| | | | | | | | | | The Chunker should only open a file on the first call to next(). We noticed that when remote executing with hundreds of actions in parallel bazel would sometimes run out of file descriptors. That's because on creating a new Chunker object it would already open a file, eventhough the first call to next would happen at a much later stage. PiperOrigin-RevId: 161923568
* Bring back the very useful stacktrace printouts on --verbose_failures (#3380).Gravatar olaola2017-07-14
| | | | | | TESTED=remote worker RELNOTES: fixes #3380 PiperOrigin-RevId: 161922635
* Refactor the logic to determine Xcode configuration so that getting the ↵Gravatar lberki2017-07-14
| | | | | | | | | | | information from the BUILD files and determining what to do with them is separated. This is so that we can eventually determine this information not in AppleConfiguration.Loader, but in the implementation of the xcode_config rule so that the former doesn't need to look at BUILD files anymore. Of course, this requires changing Skylark code that uses ctx.fragments.apple.$WHATEVER, but it's a good first step. RELNOTES: None. PiperOrigin-RevId: 161916770
* Detect one version violations while building android_binary targetsGravatar Googler2017-07-14
| | | | PiperOrigin-RevId: 161910195
* Partial rollback of action_config validation logicGravatar cparsons2017-07-14
| | | | | | | This was causing some builds to error more aggressively than before. RELNOTES: None. PiperOrigin-RevId: 161907484
* If globbing throws an IOException, fail to construct the package instead of ↵Gravatar janakr2017-07-14
| | | | | | | | constructing the package with an error. Prior to this change, if a Package.Builder object was constructed, it was guaranteed that a Package (possibly with errors) would be created. This is no longer true: if an IOException is set on the Package.Builder object, it will throw a NoSuchPackageException during #build(). PiperOrigin-RevId: 161832111
* Add flag to turn Android resource merge conflicts from warnings into errorsGravatar Googler2017-07-14
| | | | | RELNOTES: none PiperOrigin-RevId: 161831232
* Add module_map attribute to objc_libraryGravatar Googler2017-07-14
| | | | | | This allows users to specify a custom module map. PiperOrigin-RevId: 161827651
* Add a SkyFunction to perform toolchain resolution.Gravatar John Cater2017-07-14
| | | | | | | Part of #2219. Change-Id: I339009c13639144ca756eb07c520df7d430a64e3 PiperOrigin-RevId: 161826487
* Fix rules that provide both 'executable' and 'files'Gravatar vladmos2017-07-14
| | | | PiperOrigin-RevId: 161821800
* Fix crash when unioning depsets with different ordersGravatar brandjon2017-07-14
| | | | | | | Also refactor FAIL_FAST_HANDLER to throw something more specific than IllegalArgumentException. This bug was masked because the test assertion that would've caught it considered IllegalArgumentException to be an expected error, the same as EvalException. RELNOTES: None PiperOrigin-RevId: 161809957
* Remove the cc_common.cc_toolchain_attr and java_common.java_runtime_attr in ↵Gravatar lberki2017-07-14
| | | | | | | | | | favor of the cc_toolchain_alias() and the java_runtime_alias() rules introduced in https://github.com/bazelbuild/bazel/commit/440919933dc11d8aa4394dbd53790271a2073bc5. These two serve the same purpose; the attributes were originally introduced in https://github.com/bazelbuild/bazel/commit/28c9617d53bf58dcba9572bcfdc165c62421d983 and https://github.com/bazelbuild/bazel/commit/4634ff903d1aaec59d545bd28a139d6cf2b95e0d respectively in order to avoid introducing the magic rule classes. However, the magic rule classes needed to be introduced anyway so that existing rules can declare which Make variables they use and there is no point in having two mechanisms to do the same thing. RELNOTES[INC]: cc_common.cc_toolchain_attr and java_common.java_runtime_attr are not supported anymore and were replaced with the cc_toolchain_alias() and java_runtime_alias() rules. PiperOrigin-RevId: 161799608
* Fix declared providers behaviorGravatar vladmos2017-07-14
| | | | | | | | | DefaultInfo used to not be used when old-style and declared providers were mixed (struct=(custom='key', providers=[DefaultInfo(...)])). Also when a single declared provider was returned it used to be treated as an old-style struct. PiperOrigin-RevId: 161796415
* Remove some unused codeGravatar ulfjack2017-07-14
| | | | PiperOrigin-RevId: 161789899
* BEP: Report configuration for all actionsGravatar Klaus Aehlig2017-07-14
| | | | | | | | | | Whenever we report an action in the build event protocol that has a configuration associated with it, report the configuration as well in the protocol (and not only the checksum, if the configuration is not that of one of the top-level configured targets). Change-Id: I9b085d5381b3c3509b4f3b99c8a77bc8fba6abfe PiperOrigin-RevId: 161789745
* Remove the java_common.java_toolchain_attr field in favor of a ↵Gravatar lberki2017-07-14
| | | | | | | | java_toolchain_alias() rule, depending on which will accomplish the same thing. RELNOTES[INC]: java_common.java_toolchain_attr is removed. Depend on the java_toolchain_alias() rule to accomplish the same thing. PiperOrigin-RevId: 161789578
* 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
* Also generate a build stream for fetchGravatar Klaus Aehlig2017-07-14
| | | | | | | | | | | Bazel's fetch command is also related to building. So generate a build-event stream for this as well. As a first step, generate a minimal stream with only the console output by white listing the command, setting the separateFinishedEvent flag on the NoBuildEvent, and generating a NoBuildRequestFinishedEvent. Change-Id: Iee0c4e84ee5a060565ac86692a2b1917691a84ab PiperOrigin-RevId: 161782448
* Refactor CcCommon a bit.Gravatar lberki2017-07-14
| | | | | RELNOTES: None. PiperOrigin-RevId: 161774151
* Categorize Python options.Gravatar lberki2017-07-13
| | | | | RELNOTES: None. PiperOrigin-RevId: 161772560
* Add ObjcProvider.LINK_INPUTS as inputs to CROSSTOOL link actions.Gravatar allevato2017-07-13
| | | | | RELNOTES: None. PiperOrigin-RevId: 161734511
* Fixing the handling of retries for watch and execute calls.Gravatar olaola2017-07-13
| | | | | | TESTED=remote worker, triggered some errors RELNOTES: fixes #3305, helps #3356 PiperOrigin-RevId: 161722997
* Add skyfunction to return all registered toolchain labels.Gravatar John Cater2017-07-13
| | | | | | | Part of #2219. Change-Id: I7293fd13bd8e0931f92afd051e18a9e7ce63762d PiperOrigin-RevId: 161721445
* First pass of @Option documentation for apple/objc/swiftGravatar cparsons2017-07-13
| | | | | RELNOTES: None. PiperOrigin-RevId: 161720296
* Avoid races while deleting output directory ancestorsGravatar mschaller2017-07-13
| | | | | | | | | | | | | When an output file becomes a directory from one build to another, the filesystem operations performed by several threads can race while they prepare output directories. Without synchronization, these races can cause failures. See the comments added in this CL for more detail. This CL adds synchronization around these filsystem operations and gets rid of the problematic races. RELNOTES: None. PiperOrigin-RevId: 161714702
* Delete EventHandlerPreconditions. With ↵Gravatar janakr2017-07-13
| | | | | | https://github.com/bazelbuild/bazel/blob/master/src/main/java/com/google/devtools/build/lib/runtime/BlazeRuntime.java#L1097, we log exceptions in the EventBus already. No need to have a crusty auxiliary class. PiperOrigin-RevId: 161707461
* New flag --incompatible_string_is_not_iterable to forbid iteration over strings.Gravatar laurentlb2017-07-13
| | | | | RELNOTES: None. PiperOrigin-RevId: 161706309
* Fix compiler detection when mapping LIPO to ThinLTOGravatar Googler2017-07-13
| | | | | RELNOTES: None PiperOrigin-RevId: 161670197
* Split the sandbox strategies into SpawnRunner implementations and strategiesGravatar ulfjack2017-07-13
| | | | | | | | This adds a bunch of classes that only implement the SpawnRunner interface, and will allow us to support remote caching in combination with local sandboxed execution in a subsequent change. PiperOrigin-RevId: 161664556
* remote: Refactor GrpcRemoteExecutor to only take what it needs.Gravatar buchgr2017-07-12
| | | | | | | | | | - Only pass to the GrpcRemoteExecutor constructor the objects it really needs. - Share a Retrier between GrpcRemoteCache and GrpcRemoteExecutor. RELNOTES: None PiperOrigin-RevId: 161660054
* Make native declared providers not implement TransitiveInfoCollection.Gravatar dslomov2017-07-12
| | | | | | | | | | | | (Almost) all native declared providers are accessed as such and not as native non-declared providers (inheritors of TransitiveInfoCollaction). There are still three providers that use TransitiveInfoCollection.WithLegacySkylarkName mechanism, I'll address them in the follow-up CL. RELNOTES: None. PiperOrigin-RevId: 161655315
* Add --experimental_strict_action_env and --shell_executable flagsGravatar ulfjack2017-07-12
| | | | | | | | | | | | | | | | | - --experimental_strict_action_env makes Bazel not forward PATH, LD_LIBRARY_PATH, and TMPDIR to all actions. This is intended to be a transitional flag; as part of rollout, we'll need to update all users that rely on the current behavior to specify their needs explicitly (with --action_env). But note that action_env is not yet applied to all actions, which also needs to be fixed. - --shell_executable can be used to explicitly set the shell executable to use in actions. On Windows, if --experimental_strict_action_env is unset, then the PATH is computed to include the path to the shell executable. Progress on #2574. PiperOrigin-RevId: 161652996