aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/java/com/google/devtools/build/lib
Commit message (Collapse)AuthorAge
* 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
* 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
* 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
* New flag --incompatible_string_is_not_iterable to forbid iteration over strings.Gravatar laurentlb2017-07-13
| | | | | RELNOTES: None. PiperOrigin-RevId: 161706309
* 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
* Rewrite all the sandbox strategy implementationsGravatar ulfjack2017-07-12
| | | | | | | | | | | | | | - Make use of existing abstractions like SpawnRunner and SpawnExecutionPolicy. - Instead of having the *Strategy create a *Runner, and then call back into SandboxStrategy, create a single SandboxContainer which contains the full command line, environment, and everything needed to create and delete the sandbox directory. - Do all the work in SandboxStrategy, including creation and deletion of the sandbox directory. - Use SpawnResult instead of throwing, catching, and rethrowing. - Simplify the control flow a bit. PiperOrigin-RevId: 161644979
* remote: fix flaky test. Fixes #3348Gravatar buchgr2017-07-12
| | | | | | | | | | | | | The sameBlobsShouldNotBeUploadedTwice() test was found flaky on bazel ci [1]. This can happen when the first upload finishes before the second is started. Add a CountDownLatch to stop the first upload from completing, before the second is started. [1] https://github.com/bazelbuild/bazel/issues/3348 PiperOrigin-RevId: 161641110
* remote: Rewrite ChunkerGravatar buchgr2017-07-12
| | | | | | | | | | | | | | | | | - Remove the Chunker.Builder and use the Chunker constructors instead. - Fix a correctness bug, where the chunker would ignore the return value of InputStream.read(byte[]). - Have Chunk.getData() return a ByteString as opposed to a byte[]. All callsides need ByteString objects and this change makes the subsequent change possible. - Have the Chunker use a preallocated byte[] in order to avoid allocating a new one on every call to next(). RELNOTES: None. PiperOrigin-RevId: 161637158
* Automated rollback of commit 937350211dcd55a4714ec32ebbf33fffcc42cdf2.Gravatar kchodorow2017-07-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | *** Reason for rollback *** Broke the go rules (of course) See http://ci.bazel.io/job/rules_go/BAZEL_VERSION=HEAD,PLATFORM_NAME=linux-x86_64/1044/console. *** Original change description *** Resolve references to @main-repo//foo to //foo Bazel was creating an dummy external repository for @main-repo, which doesn't work with package paths and will cause conflicts once @main-repo//foo and //foo refer to the same path. This adds a "soft pull" option to WorkspaceNameFunction: it can either parse the entire WORKSPACE file to find the name or just the first section. That way PackageLookupFunction can find the repository name without causing a circular dependency. This should have no ch... *** PiperOrigin-RevId: 161572272
* Automated rollback of commit 0d2aa6369b09940d584b544fb10796387e0fafa0.Gravatar brandjon2017-07-12
| | | | | | *** Reason for rollback *** PiperOrigin-RevId: 161567104
* Remove apple_watch1_extension and apple_watch_extension_binary rulesGravatar cparsons2017-07-12
| | | | | RELNOTES: Remove apple_watch1_extension and apple_watch_extension_binary rules. Users should be using the skylark watchos_application and watchos_extension rules. https://github.com/bazelbuild/rules_apple has details. PiperOrigin-RevId: 161555395
* Misc cleanups of AST node APIGravatar brandjon2017-07-12
| | | | | | | | | - changed field names and a couple accessors to consistently use full words ("statement" instead of "stmt") - applied several local analyzers (from IntelliJ) to remove redundant modifiers, unnecessary explicit types (yay Java 8), etc. RELNOTES: None PiperOrigin-RevId: 161551096
* Clean up string representations for unknown objectsGravatar vladmos2017-07-12
| | | | | | | | Don't call the `toString` method on unknown objects as it potentially breaks hermeticity and determinism. Use a generic string like "<unknown object package.ClassName>" instead. PiperOrigin-RevId: 161544828
* Resolve references to @main-repo//foo to //fooGravatar kchodorow2017-07-11
| | | | | | | | | | | | | | | | Bazel was creating an dummy external repository for @main-repo, which doesn't work with package paths and will cause conflicts once @main-repo//foo and //foo refer to the same path. This adds a "soft pull" option to WorkspaceNameFunction: it can either parse the entire WORKSPACE file to find the name or just the first section. That way PackageLookupFunction can find the repository name without causing a circular dependency. This should have no change of behavior and is already tested in https://github.com/bazelbuild/bazel/blob/master/src/test/shell/bazel/workspace_test.sh#L176. PiperOrigin-RevId: 161536466
* Expose current java_toolchain target to Skylark.Gravatar elenairina2017-07-11
| | | | | | | | This value can be passed in Skylark to java_common.compile#java_toolchain in order to avoid incompatibility issues when the value of --java_toolchain uses a different Java version. PiperOrigin-RevId: 161528114
* Add register_toolchains function to the WORKSPACE for registering toolchains ↵Gravatar John Cater2017-07-11
| | | | | | | | | to use. Part of #2219. Change-Id: Id6dfe6ec102f609bb19461242a098bf977be29ae PiperOrigin-RevId: 161527986
* MakeVariableProvider should be declared provider only.Gravatar dslomov2017-07-11
| | | | | RELNOTES: None. PiperOrigin-RevId: 161527470
* Add a string representations test for glob valuesGravatar vladmos2017-07-11
| | | | PiperOrigin-RevId: 161521237
* ProfilerTest: Removes flakiness from ProfilerTestGravatar plf2017-07-11
| | | | | | | | The test now uses a fake clock and replaces calls to Thread.sleep() by manual changes to the clock. RELNOTES:none PiperOrigin-RevId: 161520781
* Add a cc_toolchain_alias and java_runtime_alias rules so that e.g. genrules ↵Gravatar lberki2017-07-11
| | | | | | | | | | | can depend on the C++ toolchain/Java runtime being used. The naive way to do this would be via @bazel_tools//, except that that does not take configuration transitions into account and e.g. will be the same in the host and the target configurations even if different toolchains are used. Eventually, this will be supplanted by the toolchain selection mechanism. However, that is not live yet and the migration cost this will incur is not a lot; just replacing the one single instance of these undocumented rules with the reference to the toolchain type. RELNOTES: None. PiperOrigin-RevId: 161519229
* Fold OptionUsageRestrictions into OptionDocumentationCategory and ↵Gravatar ccalvarin2017-07-11
| | | | | | | | | | OptionMetadataTags. These are similar, no need to have both fields. Removing the "DOCUMENTED" default, the absence of UNDOCUMENTED will be used instead. Since requiring a documentation category for undocumented options doesn't make sense, list that as one of the OptionDocumentationCategories, but list HIDDEN and INTERNAL as part of OptionMetadata. These options should list UNDOCUMENTED as their category. PiperOrigin-RevId: 161515674
* BuildEventWithConfiguration: represent configurations as BuildEventGravatar Klaus Aehlig2017-07-11
| | | | | | | | | | | From a BEP point of view, the only interface of a configuration we care about is its BuildEvent structure. Represent it as such, so that we can move this class to the rest of the buildeventstream module. This is a prerequisite for ActionOwners refering to configurations in the BEP. Change-Id: I6d1c1bf2951aac91607e83cad664553cd6620df8 PiperOrigin-RevId: 161510049
* remote: Fix flaky ByteStreamUploaderTest.Gravatar buchgr2017-07-11
| | | | | | | | | | | | | | | | | | Running locally, I noticed that the multipleBlobsUploadShouldWork() test is flaky (~1% of all runs). The flakiness exists due to Future.get() being notified about completion before the future's listeners are executed. We make use of future listeners to remove an upload digest from an internal hashmap, after the upload completed. Thus, checking for this map to be empty immediately after uploadBlob (aka Future.get()) returned, could sometimes fail due to the listeners not having executed yet. The fix is to periodically poll the hashmap until all listeners have executed. RELNOTES: None. PiperOrigin-RevId: 161507486
* Make information about the Java runtime in use available in Skylark using a ↵Gravatar lberki2017-07-11
| | | | | | | dependency. RELNOTES: None. PiperOrigin-RevId: 161504700
* Make CcToolchainProvider#equals() be the object identity.Gravatar lberki2017-07-11
| | | | | | | That's the only way to provide sane behavior both in Skylark and in Java. RELNOTES: None. PiperOrigin-RevId: 161496153
* Make SkylarkValue instances mutable by defaultGravatar vladmos2017-07-11
| | | | | | | | | | Simplify the code by providing the default implementation of `SkylarkValue$isImmutable` that always returns false. All objects are considered mutable unless their `isImmutable` method is overridden. This change doesn't affect the current behavior. PiperOrigin-RevId: 161422029
* Make native declared providers type-safe.Gravatar dslomov2017-07-10
| | | | | RELNOTES: None. PiperOrigin-RevId: 161395570
* Remove the functionality from alias() to point nowhere.Gravatar lberki2017-07-10
| | | | | | | | | It's never used and was broken anyway (see #getLabel()). The functionality has been laying there unused since the initial checkin in unknown commit. RELNOTES: None. PiperOrigin-RevId: 161378717
* BEP: Positively identify the last messageGravatar Klaus Aehlig2017-07-10
| | | | | | | | | | | Set an additional flag in the last BEP message to indicate the end of the proto sequence. While the last event is implicit from the child-relation (the sequence of protos is finished, if at least one event is seen and all announced events have occurred in the stream), an explicit marking of the last event simplifies processing. Change-Id: I6554476f975dc9e52fdb27fb3221bd27f6097ed9 PiperOrigin-RevId: 161377092
* Only run the tests in ExternalPackageUtilTest if we are testing Bazel.Gravatar lberki2017-07-10
| | | | | RELNOTES: None. PiperOrigin-RevId: 161375413
* remote: Rewrite the ByteStream upload.Gravatar buchgr2017-07-10
| | | | | | | | | | | | | | The current ByteStream upload implementation has no support for application-level flow control, which resulted in excessive buffering and OOM errors. The new implementation respects gRPCs flow control. Additionally, this code adds support for multiple uploads of the same digest. That is, if a digest (i.e. file) is uploaded several times concurrently, only one upload will be performed. RELNOTES: None. PiperOrigin-RevId: 161287337
* Remove objc_includes_prioritize_static_libsGravatar cparsons2017-07-10
| | | | | | | This flag was experimental but is now always-on. RELNOTES: None. PiperOrigin-RevId: 161234569
* Add doc argument to attr.*, rule, aspect, and provider.Gravatar allevato2017-07-10
| | | | | | | | Skydoc can use these arguments to obtain documentation instead of (or in addition to) Python-style docstrings. RELNOTES: None. PiperOrigin-RevId: 161233014
* Clean up string representations for artifactsGravatar vladmos2017-07-10
| | | | | | | | | If --incompatible_descriptive_string_representations is passed, artifacts are converted to strings using `str`, `repr` and `print` functions differently (more descriptive, without leaking information that shouldn't be accessible). PiperOrigin-RevId: 161230209
* Add toolchain() rule for declaring toolchains with type and constraints.Gravatar John Cater2017-07-07
| | | | | | | Part of #2219. Change-Id: Ia0effac6e6c362c04c6501b21dde89e9e5b154a4 PiperOrigin-RevId: 161216492
* Clean up string representations for configured targetsGravatar vladmos2017-07-07
| | | | | | | | | If --incompatible_descriptive_string_representations is passed, configured targets are converted to strings using `str`, `repr` and `print` functions differently (more descriptive, without leaking information that shouldn't be accessible). PiperOrigin-RevId: 161212989
* Fix BuildRuleWithDefaultsBuilder to work properly with NODEP_LABEL attributes.Gravatar jcater2017-07-07
| | | | | | | | NODEP_LABEL attributes are not allowed to set file types, but populateLabelAttributes assumes that every label attribute has a file type set. Fix this by adding in better checks. PiperOrigin-RevId: 161212141