aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/java/com/google
Commit message (Collapse)AuthorAge
* Parse the workspace name when a repository is loadedGravatar Kristina Chodorow2016-01-29
| | | | | | | | | Moved RepositoryValue to RepositoryDirectoryValue so that it could be cached (and not re-downloaded) even if the WorkspaceAST caused a Skyframe restart (as mentioned in https://github.com/bazelbuild/bazel/blob/master/src/main/java/com/google/devtools/build/lib/rules/repository/RepositoryDelegatorFunction.java#L130-L133). -- MOS_MIGRATED_REVID=113358489
* Rollback of commit e379f28f464faacc4db21f4fed3a48fa6d4d23f0.Gravatar Googler2016-01-29
| | | | | | | | | | | | | *** Reason for rollback *** The new test apparently breaks some targets. Rolling back to fix the build. *** Original change description *** Include .dwp file in the runfiles for cc_test when building with Fission. -- MOS_MIGRATED_REVID=113310353
* Clear up some confusion about glob prefetching (the old comment was wrong). ↵Gravatar Nathan Harmata2016-01-29
| | | | | | | | | Also add some TODOs for potentially improving package loading performance. This CL has no semantic impact. -- MOS_MIGRATED_REVID=113301656
* Include .dwp file in the runfiles for cc_test when building with Fission.Gravatar Googler2016-01-29
| | | | | -- MOS_MIGRATED_REVID=113295790
* Make Skylark dicts mutableGravatar Francois-Rene Rideau2016-01-29
| | | | | | | | | | Represent Skylark dict using a new subclass SkylarkDict<K, V> of Map<K, V>. Back it with a TreeMap to provide a deterministic iteration order. Also make SkylarkList generic in its element type <E>. Have Artifact implement Comparable<Object> so it can be used as TreeMap key. -- MOS_MIGRATED_REVID=113277489
* Refactor DependencyResolver to collect and return loading errors.Gravatar Ulf Adams2016-01-28
| | | | | | | | | This should never be triggered in production, where we always run a loading phase first and only analyze targets that load successfully. I.e., this is just plumbing which will be hooked up in a subsequent change. -- MOS_MIGRATED_REVID=113258593
* Resolve repository-relative labels within the current repositoryGravatar Kristina Chodorow2016-01-28
| | | | | | | | | | | Using $(location //foo) from an external repository was resolving to @//foo, not @repo//foo, which generally wouldn't be in the main repository. This may also fix other cases where getRelative was resolving incorrectly. Fixes #819. -- MOS_MIGRATED_REVID=113256854
* Rename native.rule and native.rules to {existing_rule,existing_rules}Gravatar Han-Wen Nienhuys2016-01-28
| | | | | | | | | | | | This is to avoid confusion between rule(), which declares a new build rules, and native.rule(), which can only be used in macros to inspect the BUILD file processed so far. native.{rule,rules} is maintained and marked deprecated to smooth the transition for early adopters. -- MOS_MIGRATED_REVID=113250194
* Intern IntVersions.Gravatar Janak Ramakrishnan2016-01-28
| | | | | -- MOS_MIGRATED_REVID=113197641
* Ensure repository names are valid workspace namesGravatar Kristina Chodorow2016-01-28
| | | | | | | RELNOTES: Repository rules must use names that are valid workspace names. -- MOS_MIGRATED_REVID=113197588
* Fix SkyframeBuilder's error handling, and change the contract of ↵Gravatar Janak Ramakrishnan2016-01-28
| | | | | | | | | | | EvaluationResult to return true for hasError() iff errorMap is non-empty or there is a catastrophe. There was no good reason for the previous behavior of saying hasError even if there was a transitive recovered-from error, since callers shouldn't care. This was a latent bug that was only benign since none of the consumers of hasError were invoking Skyframe with recoverable SkyFunctions. Also add an EvaluationResultSubject so that tests can more fluently assert things about EvaluationResult objects going forward. -- MOS_MIGRATED_REVID=113192415
* Fix: return an error from the analysis phase with keep_going in error cases.Gravatar Ulf Adams2016-01-27
| | | | | | | | | | | - if there are failed top-level aspects - if there are conflicting actions I ended up rewriting how errors are signaled from the SkyframeBuildView. I think this is safe, but please review carefully. -- MOS_MIGRATED_REVID=113150100
* Store data about aspect configurations on Dependencies.Gravatar Michael Staib2016-01-27
| | | | | | | | | | | | | | | | | | | | Dependencies are the data structure which needs to propagate the configuration for each aspect as created by trimConfigurations down to the point where it's actually used. We need this to store different configurations for different aspects in a world where aspects have their own configurations, which may have more fragments than the target they're attached to. That world is on its way. Also in this CL: * Refactor Dependency to be an abstract parent class with separate implementations for Attribute.Transitions and BuildConfigurations, as well as null configurations, to avoid having to check nullness in various places. Users of the API will not see this, but get factory methods instead of constructors. As a consequence of this, refactor Dependency to be its own top-level class instead of a nested class in DependencyResolver. -- MOS_MIGRATED_REVID=113109615
* Rename FilesystemUtils to NativePosixFiles.Gravatar Lukacs Berki2016-01-27
| | | | | | | This helps avoid confusion with File*S*ystemUtils, which differs in only the case of a character but is a completely different class. -- MOS_MIGRATED_REVID=113054116
* Return opaque value for native.rule() on a select() statement.Gravatar Han-Wen Nienhuys2016-01-27
| | | | | | | | | | | | | | | | | | | | | | | | | This is imperfect in many ways: 1) the value is opaque, and not a BUILD value, so it cannot be used in rule arguments 2) its representation has a pointer address, so it breaks hermeticity. Despite its problem, we return this value because otherwise native.rules() fails if there is any rule using a select() in the BUILD file. A future solution would be to convert BuildType.SelectorList back to syntax.SelectorList. To do so, we would have to 1) recurse into the Selector contents of SelectorList, so those values are run through skylarkifyValue too 2) get the right Class<?> value. We could probably get at that by looking at ((SelectorList)val).getSelectors().first().getEntries().first().getClass(). -- MOS_MIGRATED_REVID=113051612
* Make local_repository and new_local_repository work with the limitations of ↵Gravatar Lukacs Berki2016-01-26
| | | | | | | our plans for symlink support on Windows. -- MOS_MIGRATED_REVID=113043269
* Separate runfiles middlemen into two layers: one that is a middleman for the ↵Gravatar Lukacs Berki2016-01-26
| | | | | | | | | | | files itself, and one that contains this middleman and the runfiles output manifest. This is in preparation for Windows symlink support in runfiles manifests: on Windows, we'll need the target files created before we can create the runfiles symlinks for them, but we can't do that by adding the current runfiles middleman to the inputs of SymlinkTreeAction because it would create a cycle (output manifest -> SymlinkTreeAction -> runfiles manifest -> MiddlemanAction -> output manifest) The alternative is to just add the artifacts to the inputs of SymlinkTreeAction, but that would create a bunch of extra edges and, more importantly, reverse edges in the action graph which we don't want. -- MOS_MIGRATED_REVID=113041344
* RELNOTES[INC]: Set stamping to false by default (i.e., --nostamp)Gravatar Damien Martin-Guillerez2016-01-26
| | | | | | | Stamping make build non-deterministic and should not be the default. -- MOS_MIGRATED_REVID=113040937
* Add documentation for workspace functionGravatar Kristina Chodorow2016-01-26
| | | | | -- MOS_MIGRATED_REVID=112971086
* Move RepositoryName to its own top-level classGravatar Kristina Chodorow2016-01-26
| | | | | | | | | | As it's about to get more important in its own right. The only change that isn't just moving code around is making RepositoryName.validate package-private. -- MOS_MIGRATED_REVID=112956571
* Rollback of commit bd9f25c593a140acb15d3fd3fc7f66d091e1a898.Gravatar Ulf Adams2016-01-25
| | | | | | | | | | | | | | | | *** Reason for rollback *** Violates layering - genrule should not depend on platform- or language-specific parts. *** Original change description *** Add a DEVELOPER_DIR make variable to genrules to propagate the apple xcode environment variable DEVELOPER_DIR to commands. If $(DEVELOPER_DIR) is included in the genrule command, we bootstrap the XCODE_VERSION_OVERRIDE environment variable to the command. The contract with the actual action executor is, if XCODE_VERSION_OVERRIDE is present in the environment, to additionally bootstrap the DEVELOPER_DIR absolute path to the command. -- MOS_MIGRATED_REVID=112951074
* Add test coverage that failures and printed errors are consistent.Gravatar Ulf Adams2016-01-25
| | | | | | | | Apparently, there's at least one case where errors are printed, but we exit with a zero exit code. How's that. -- MOS_MIGRATED_REVID=112950105
* Always generate a workspace name for new repositoriesGravatar Kristina Chodorow2016-01-25
| | | | | -- MOS_MIGRATED_REVID=112790992
* Allow switching on header processing (parse_headers or preprocess_headers)Gravatar Manuel Klimek2016-01-22
| | | | | | | | | | | | | | | | | for targets in the transitive closure of a target that is built. Previously, this would only happen if a link action for the library containing the headers was also built; this specifically means it did not trigger if a library didn't contain source files, as there is no link action for such libraries. That led to no header-only libraries would get their headers parsed, which includes all cc_public_library rules. Adding a flag to introduce this under so we can switch it on independently from the blaze release. Once it is switched on, we can remove the edges in the action graph from the link actions to the header processing actions. -- MOS_MIGRATED_REVID=112782219
* Restore the test for analysis root cause reporting.Gravatar Ulf Adams2016-01-22
| | | | | -- MOS_MIGRATED_REVID=112780859
* Do not compile source files mentioned in 'hdrs'.Gravatar Manuel Klimek2016-01-22
| | | | | | | | | | | | Currently for a library: cc_library(name='a', hdrs=['a.cc']) we compile a.cc into a.pic.o and link that into its reverse dependencies. With this change, a .cc file in hdrs will be treated like a .inc file or a file in textual_hdrs. -- MOS_MIGRATED_REVID=112770625
* Extract parsing of the WORKSPACE file in two partsGravatar Damien Martin-Guillerez2016-01-22
| | | | | | | | | | | The WORKSPACE file AST is now parsed as a separate SkyFunction and this will be used to have multiple SkyValue for the same WORKSPACE file, splitting the execution of the AST after load statements to enable load statement of external dependencies in the WORKSPACE file. -- MOS_MIGRATED_REVID=112768897
* Make SkylarkList a List.Gravatar Francois-Rene Rideau2016-01-22
| | | | | | | | | | | | | | | SkylarkList now implements the List interfaces, except that its mutating methods throw an UnsupportedOperationException, just like ImmutableList does. To actually mutate a SkylarkList, you need to pass a Location and a suitable Environment object with a matching Mutability while it is still active. Introduce SkylarkMutable and SkylarkMutable.MutableCollection to better handle mutable data structures. Remove some functions in EvalUtils made obsolete by this and previous changes regarding Skylark lists. -- MOS_MIGRATED_REVID=112768457
* Add test case to SingleBuildFileCache for unreadable filesGravatar Michajlo Matijkiw2016-01-22
| | | | | -- MOS_MIGRATED_REVID=112713014
* Improve space efficiency of Blaze action cache: For actions that don't ↵Gravatar Eric Fellheimer2016-01-22
| | | | | | | perform input discovery, there is no need to store the full set of edges in the action cache. This data is only used to formulate the set of input files for an action prior to checking the validity of a cache entry. For non-input-discovering actions, the set of input files is known statically and the action cache data is not used. -- MOS_MIGRATED_REVID=112704382
* Raise error if we find an unknown type in native.rule().Gravatar Han-Wen Nienhuys2016-01-21
| | | | | | | | | | | | Handle more types: * Boolean * TriState * SkylarkValue (eg. FileSetEntry) * skip Licenses, Distribs. -- MOS_MIGRATED_REVID=112690550
* Perform package loading in parallel with transitive target visitation. This ↵Gravatar Janak Ramakrishnan2016-01-21
| | | | | | | is a partial rollback of commit f1e257d because it turns out that loading sequentially can be a bottleneck. -- MOS_MIGRATED_REVID=112628616
* Enforce aspect configuration fragment specification when present.Gravatar Michael Staib2016-01-21
| | | | | | | | | | | | | | | | | If an aspect has specified its configuration fragment dependencies, use these in place of the rule's. Note that the dynamic configuration support for this is yet to come. Also in this CL: * RuleContext is constructed with a ruleClassNameForLogging, which allows error messages involving aspects to be clearer. RELNOTES[NEW]: Skylark aspects can now specify configuration fragment dependencies with fragments and host_fragments like rules can. -- MOS_MIGRATED_REVID=112614357
* Add a DEVELOPER_DIR make variable to genrules to propagate the apple xcode ↵Gravatar Chris Parsons2016-01-21
| | | | | | | | | | environment variable DEVELOPER_DIR to commands. If $(DEVELOPER_DIR) is included in the genrule command, we bootstrap the XCODE_VERSION_OVERRIDE environment variable to the command. The contract with the actual action executor is, if XCODE_VERSION_OVERRIDE is present in the environment, to additionally bootstrap the DEVELOPER_DIR absolute path to the command. -- MOS_MIGRATED_REVID=112605616
* Rename defaultShellEnvironment to localShellEnvironment and clarifyGravatar Han-Wen Nienhuys2016-01-21
| | | | | | | its intended use. -- MOS_MIGRATED_REVID=112598772
* Add a Java property to influence symlinking strategy so that we can test ↵Gravatar Lukacs Berki2016-01-20
| | | | | | | what kind of performance we could get from how we imagine it would work under Windows. -- MOS_MIGRATED_REVID=112572621
* Fix a couple of bugs related to error handling for top-level aspects.Gravatar Ulf Adams2016-01-20
| | | | | -- MOS_MIGRATED_REVID=112561390
* Support unreadable filesGravatar Michajlo Matijkiw2016-01-20
| | | | | -- MOS_MIGRATED_REVID=112507181
* Skylark IDE info aspect: sources and dependencies.Gravatar Dmitry Lomov2016-01-19
| | | | | | | | | | | | | | 1. Refactored IntelliJSkylarkAspectTest. Eventually that test will be merged with AndroidStudioInfoAspect test to validate implementation equivalence. 2. Exposed ``root`` and ``is_source`` on Artifacts to Skylark. 3. Skylark aspect implementation outputs sources and dependencies information. -- MOS_MIGRATED_REVID=112473407
* Fileset (Google internal): code cleanup.Gravatar Laszlo Csomor2016-01-19
| | | | | -- MOS_MIGRATED_REVID=112466264
* Rewrite SkylarkAspectsTest to inherit AnalysisTestCase.Gravatar Ulf Adams2016-01-19
| | | | | | | | | | | | | | | | | | While BuildViewTestCase now has an update() function, it also has a lot of legacy cruft that doesn't match how the code is used in production. This also makes the test code a bit simpler. Also add a couple missing fail() statements. This is in preparation for adding a couple more tests; we don't have good test coverage for interaction between Skylark aspects and native rules and vice versa, especially for error scenarios. I may reuse some of the AspectTest code, but that inherits AnalysisTestCase. Inheriting AnalysisTestCase here also makes that easier. -- MOS_MIGRATED_REVID=112460142
* Set test_class for java_test test target where it is neededGravatar Damien Martin-Guillerez2016-01-19
| | | | | | | | | This make those test target compatible with --nolegacy_bazel_java_test. -- Change-Id: I2316c9aa53327b417ecce5fd5dab95ec726da11d Reviewed-on: https://bazel-review.googlesource.com/#/c/2690 MOS_MIGRATED_REVID=112446514
* Fix #757: Bazel does not copy xml test output from sandbox.Gravatar Philipp Wollermann2016-01-18
| | | | | -- MOS_MIGRATED_REVID=112404257
* Disallow loads from external repos in WORKSPACE files. Currently, attempting ↵Gravatar John Field2016-01-18
| | | | | | | | | to do such a load will result in a skyframe circular dependency exception. As a side effect of this change, SkylarkImportFailedExceptions thrown by SkylarkImportLookupFunction are now caught by PackageFunction and wrapped and rethrown as a PackageFunctionException. Previously, the first exception wasn't caught, generating an uncaught exception error at top level. -- MOS_MIGRATED_REVID=112328755
* Enable Aspects to specify their configuration fragment dependencies.Gravatar Michael Staib2016-01-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Note: This specification currently does not have any effect, but soon... In the default mode, when an aspect does not call any of the configuration fragment methods on its AspectDefinition.Builder, the old behavior will persist; aspects can only access fragments their associated rule has access to, and have no guarantee as to what those fragments are. This mode will become deprecated with a future CL. If an aspect does call a configuration fragment method, it will have a configuration fragment policy. In a future CL, this will mean it will be restricted to accessing only those fragments, but will be understood as requiring access to them for the purposes of dynamic configuration, even if the rule it is attached to or created by does not otherwise require them. Eventually, all aspects will be required to declare their configuration fragments this way. Skylark aspects may also declare configuration fragments as of this CL. Two new parameters are added to the aspect() function, fragments and host_fragments, mirroring the similar parameters for rules. If both of these parameters are empty or unspecified, the default mode is used, as with normal aspects. Also in this CL: * Minor javadoc fixes for AspectDefinition. * Additional tests for AspectDefinition. -- MOS_MIGRATED_REVID=112271713
* Adds support for invocation policy to the canonicalize-flags command.Gravatar Alex Humesky2016-01-15
| | | | | -- MOS_MIGRATED_REVID=112267123
* Add native.rule(NAME), which returns the attributes of a previously defined ↵Gravatar Han-Wen Nienhuys2016-01-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | rule. Add native.rules(), which returns all previously defined rules. These primitives can be used to write Skylark extensions that aggregate over the contents of a BUILD file, eg. def instantiate_if_needed(name): n = name + "_wrapped" if not native.rule(n): py_test(name = n , ... ) def archive_cc_src_files(tag): all_src = [] for r in native.rules().values(): if tag in r["tags"] and r["kind"] == "cc_library": all_src.append(r["srcs"]) native.genrule(cmd = "zip $@ $^", srcs = all_src, outs = ["out.zip"]) RELNOTES: Support aggregation over existing rules in Skylark extensions through native.rules and native.rule. -- MOS_MIGRATED_REVID=112249050
* Add a method for getting the root of a rule workspace to the Label methodGravatar Damien Martin-Guillerez2016-01-15
| | | | | | | | This method is exposed to Skylark and will enable correct handling of protobuf skylark files. See #784 -- MOS_MIGRATED_REVID=112235357
* ConfigurationFragmentPolicy: assume Skylark names, allow merging.Gravatar Michael Staib2016-01-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | In preparation for allowing aspects to have their own configuration fragments specified, allow ConfigurationFragmentPolicy.Builder to merge with built policies more easily, setting up SetMultimaps in place of maps of sets. This changes how named (Skylark) fragments are declared in the RuleContext builder, hopefully to be a bit easier to write. In order to do this, make SkylarkModuleNameResolver the only name resolver in use (because it is the only name resolver which exists) so as to not worry about collisions of different name resolvers. This also changes isLegalConfigurationFragment's one-argument form to mean "legal in ANY configuration" rather than "legal in the target (NONE) configuration", as that is how it's used by TransitiveTargetFunction. Uses of it to mean the latter have been revised to be more explicit. Also in this CL: * refactor ConfigurationFragmentPolicy to enforce its contracts about which ConfigurationTransitions are legal * use containsEntry or containsValue rather than looking in get(key) or values() for the configuration fragment multimaps * add tests for ConfigurationFragmentPolicy * make SkylarkModuleNameResolver a static method -- MOS_MIGRATED_REVID=112191439
* Display parsing errors for WORKSPACE filesGravatar Kristina Chodorow2016-01-15
| | | | | | | | | | | | | Previously, for some types of errors, you'd just see "WORKSPACE file could not be parsed" if there was a syntax error (instead of what the syntax error was). Change-Id: Ia278cf23b79f8daba02917cdfb4cc515a87080b1 -- Change-Id: Ia278cf23b79f8daba02917cdfb4cc515a87080b1 Reviewed-on: https://github.com/bazelbuild/bazel/pull/774 MOS_MIGRATED_REVID=112190322