aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/java/com/google/devtools/build/lib/skyframe
Commit message (Collapse)AuthorAge
* Fix test compilation failure.Gravatar felly2018-02-05
| | | | PiperOrigin-RevId: 184587712
* Fix Fileset incrementality bug when Fileset consumes a generated file. The ↵Gravatar felly2018-02-05
| | | | | | | | | | | | | | | | native skyframe implementation was actually quite incorrect in this case: It was adding a skyframe dependency on a FileValue for the output file. Without a transitive dependency on the source files and actions that determine the output file's state, this could never work (and explains why the incremental build would fail). Instead, we now depend on the Artifact corresponding to the output file instead. This change updates the business logic RecursiveFilesystemTraversalFunction. This approach keeps the business logic of Fileset filesystem traversal centralized in RFTF. To avoid making weird recursive Skyframe nodes in the output tree, we inline Skyframe dependencies and do direct filesystem operations over the output tree. There are now three states we can be in when looking up a file: 1. Source file: As before, make a skyframe dep on the corresponding file 2. Top-level file of an output tree: Make a dep on the corresponding Artifact 3. Recursive file under an output directory: Do direct filesystem operations. It doesn't make sense to make Skyframe nodes corresponding to these files. In the future, I think we should consider failing fast on this case. RELNOTES: None PiperOrigin-RevId: 184556044
* Refactor ArtifactSkyKey to get rid of an unnecessary wrapper class: actually ↵Gravatar janakr2018-02-05
| | | | | | | | essentially promote OwnedArtifact to ArtifactSkyKey and rename it to ArtifactSkyKey. The king is dead... Also add some other execution-phase codecs. PiperOrigin-RevId: 184552706
* Add type assertion that TreeFileArtifact's parentTreeArtifact member is aGravatar cpeyser2018-02-05
| | | | | | SpecialArtifact. PiperOrigin-RevId: 184539696
* Pass ctime to the TimestampGranularityMonitorGravatar ulfjack2018-02-05
| | | | | | | | We're now using ctime to detect file changes, so the timestamp granularity monitor should as well. Unfortunately, we currently get nanosecond ctime from Linux, but then only return millis from FileStatus, so this doesn't change the accuracy of the monitor at all. PiperOrigin-RevId: 184536539
* Remove Root#getCodec, to bring Root in line with general style for codecGravatar cpeyser2018-02-02
| | | | | | declaration. PiperOrigin-RevId: 184304653
* Add a CODEC for Artifact.Gravatar cpeyser2018-02-01
| | | | PiperOrigin-RevId: 184144301
* Rename Transition to ConfigurationTransition.Gravatar gregce2018-01-30
| | | | PiperOrigin-RevId: 183859414
* Obsolete and begin removing the toolchain_resolution_override flag.Gravatar John Cater2018-01-30
| | | | | | | | | It is not compatible with multiple execution platforms. Part of #4442. Change-Id: I683beaae1624130352a6f02bae3f4dfff263ea00 PiperOrigin-RevId: 183855561
* Fix RegularFileArtifactValue.equalsGravatar ulfjack2018-01-30
| | | | | | | | If two SkyValue objects are equal, then Skyframe caches and returns the old one, instead of the new one. That's a problem for the detection of file changes, which uses the FileContentsProxy, which wasn't part of the equals check before this change. Progress on #3360. PiperOrigin-RevId: 183834897
* Remove DynamicTransitionMapper, ConfigurationTransitionProxy.Gravatar gregce2018-01-30
| | | | PiperOrigin-RevId: 183826311
* Remove unused "pattern" feature in RecursiveFilesystemTraversalFunction.Gravatar felly2018-01-29
| | | | PiperOrigin-RevId: 183731563
* Rephrase RootCodec as an InjectingObjectCodec.Gravatar cpeyser2018-01-29
| | | | PiperOrigin-RevId: 183677348
* Remove hard coded prelude names from some unit tests.Gravatar shreyax2018-01-29
| | | | PiperOrigin-RevId: 183662908
* Explicitly make fragments option to BuildConfigurationValue#key an ↵Gravatar janakr2018-01-23
| | | | | | | | ImmutableSortedSet wherever possible, and use a known explicit ImmutableSortedSet in the case of two sets being equal. This is mainly a cosmetic cleanup for the sequel changes. Also rename test-only methods in SkyframeExecutor to indicate that, and do a drive-by clean-up of a test that reported hard crashes confusingly because it wrapped RuntimeExceptions. PiperOrigin-RevId: 182984572
* Add new skyfunction to load registered execution platformsGravatar John Cater2018-01-22
| | | | | | | Part of #4442. Change-Id: I49d6d851787727739f50348df2e2ef48392af479 PiperOrigin-RevId: 182795733
* Start serializing ArtifactOwner: put in a simple codec for the null artifact ↵Gravatar janakr2018-01-19
| | | | | | owner and fix up BuildConfigurationValue.Key. ConfiguredTargetKey is going to need some modifications to AutoCodec: probably the long-awaited static "create" method. PiperOrigin-RevId: 182630181
* Simplify the toolchain test case setup.Gravatar jcater2018-01-19
| | | | | | Also add a new appendFile method on Scratch. PiperOrigin-RevId: 182558199
* Rename relativePath -> rootRelativePath in Root and friends.Gravatar tomlu2018-01-19
| | | | | | This makes it clearer that the path fragments in question are relative *to the root*. Confusingly, when the root is absolute, the root relative fragment is also absolute. This makes it a tiny bit clearer that the path fragment may be absolute. PiperOrigin-RevId: 182544893
* Prevent broken cache entries on concurrent file changesGravatar ulfjack2018-01-19
| | | | | | | | | | | | | | | | Local execution has an inherent race condition: if a user modifies a file while an action is executed, then it is impossible for Bazel to tell which version of the file was actually read during action execution. The file may have been modified before or after the tool has read it, or, in the worst case, the tool may have read both the original and the modified version. In addition, the file may be changed back to the original state before Bazel can check the file, so computing the digest before / after may not be sufficient. This is a concern for both local and remote caches, although the cost of poisoning a shared remote cache is significantly higher, and is what has triggered this work. Fixes #3360. We solve this by keeping a reference to the FileContentsProxy, and using that to check for modificaitons before storing the cache entry. We output a warning if this check fails. This change does not increase memory consumption; Java objects are always allocated in multiples of 8 bytes, we use compressed oops, and the FileArtifactValue currently has 12 bytes worth of fields (excl. object overhead), so adding another pointer is effectively free. As a possible performance optimization on purely local builds, we could also consider not computing digests at all, and only use the FileContentsProxy for caching. PiperOrigin-RevId: 182510358
* Clean up ArtifactRoot.Gravatar tomlu2018-01-18
| | | | | | | * Use an enum instead of booleans and null fields having special meaning. * Remove the exec root from ArtifactRoot. This is only used to calculate artifact exec paths, which can be done from the root's exec path and the root relative path. PiperOrigin-RevId: 182411710
* Add absolute root concept.Gravatar tomlu2018-01-18
| | | | | | | | An absolute root accepts any absolute path fragments and simply returns it. This concept replaces the FileSystem root directory concept. PiperOrigin-RevId: 182400471
* Start the process of getting Target out of ConfiguredTarget: add a new ↵Gravatar janakr2018-01-18
| | | | | | | | | | | | container, ConfiguredTargetAndTarget, that can be used to access Targets, and deprecate ConfiguredTarget#getTarget. ConfiguredAndTargetObjects are intended to be limited in scope, not being persisted to Skyframe. The eventual plan is to remove the target field from ConfiguredTarget. This CL is mostly straightforward, except for dealing with AliasConfiguredTargets, which cause some complications. A significant cleanup is still needed before #getTarget can be removed, but I don't see any impossible blockers. We will may still need to store a Target-like object in ConfiguredTarget (that has the RuleClass, or at least a string representation of it, for instance), but that will let us avoid storing a full Target together with its associated Package. PiperOrigin-RevId: 182371566
* Introduce Root class.Gravatar tomlu2018-01-17
| | | | | | | | | | | This class represents a root (such as a package path or an output root) used for file lookups and artifacts. It is meant to be as opaque as possible in order to hide the user's environment from sky keys and sky functions. Roots are used by RootedPaths and ArtifactRoots. This CL attempts to make the minimum number of modifications necessary to change RootedPath and ArtifactRoot to use these fields. Deprecated methods and invasive accessors are permitted to minimise the risk of any observable changes. RELNOTES: None PiperOrigin-RevId: 182271759
* Remove mtime field from FileStateValue.Gravatar janakr2018-01-16
| | | | | | We stopped treating empty files specially in the execution phase after unknown commit. So this code is mostly if not entirely orphaned. The only scenario in which this would lead to a semantic difference that I can think of is if the user is running with --nouse_action_cache and a running Bazel server, and they have an action they want to re-run when an empty input file changes, which isn't something we need to be concerned about. PiperOrigin-RevId: 182109952
* Remove EventBus from SkyframeActionExecutorGravatar ulfjack2018-01-16
| | | | | | Post to the Skyframe Environment instead. PiperOrigin-RevId: 182096559
* Rename Root to ArtifactRoot.Gravatar tomlu2018-01-16
| | | | | | This is slightly more descriptive, and we will potentially want to use the name Root for a broader concept shared between ArtifactRoot and RootedPath. PiperOrigin-RevId: 182082367
* Remove trivial instances of FileSystem#getRootDirectory from testing code.Gravatar tomlu2018-01-11
| | | | PiperOrigin-RevId: 181686136
* Convert ActionLookupKey implementations to directly implement SkyKey, ↵Gravatar janakr2018-01-11
| | | | | | removing the layer of indirection of getting SkyKey out of ActionLookupKey, which uses more memory for no reason. PiperOrigin-RevId: 181658615
* Adds a CODECs for Package and PackageValue.Gravatar shahan2018-01-11
| | | | PiperOrigin-RevId: 181624201
* Codec for BuildConfigurationValue.Gravatar shahan2018-01-10
| | | | PiperOrigin-RevId: 181545835
* Cleanup: move some tests {ArtifactFunction,FileArtifactValue}TestGravatar ulfjack2018-01-09
| | | | | | | | These tests don't require a full Skyframe instance, so we might as well move them to a lighter-weight test class. Also, it turns out that we have duplicate tests for equality and hashing - this is now explicit. PiperOrigin-RevId: 181285144
* Move PatchTransition and kin to analysis.config.transitions.Gravatar gregce2018-01-04
| | | | | | | HostTransition can't be migrated yet because it depends on BuildConfiguration. PiperOrigin-RevId: 180842784
* Consolidate GlobDescriptor functionalityGravatar michajlo2018-01-03
| | | | | | | | Makes GlobDescriptor directly implement SkyKey and adds custom serialization logic. This lets us narrow visibility and migrate yet another SkyKey away from LegacySkyKey. PiperOrigin-RevId: 180705483
* Replace Attribute.SplitTransition with config.transitions.SplitTransition.Gravatar gregce2017-12-22
| | | | PiperOrigin-RevId: 179948322
* Replace Attribute.Transition with config.transitions.Transition.Gravatar gregce2017-12-22
| | | | PiperOrigin-RevId: 179936355
* Move FileStateValue.Type to Metadata; add Metadata.getType()Gravatar ulfjack2017-12-21
| | | | | | | | This is in preparation for merging FileArtifactValue and FileStateValue. Progress on #3360. PiperOrigin-RevId: 179832948
* Makes PathFragment have internal CODEC definition.Gravatar Googler2017-12-19
| | | | PiperOrigin-RevId: 179588512
* Automated rollback of commit 82e68b75304438c96ff878a0c2b8d18b42002486.Gravatar aehlig2017-12-19
| | | | | | | | | | | | | | Fixes #4322, #4306. *** Reason for rollback *** Introduces a deadlock (see https://github.com/bazelbuild/bazel/issues/4322) *** Original change description *** Make FileSystem operate on LocalPath instead of Path. PiperOrigin-RevId: 179549866
* Make FileSystem operate on LocalPath instead of Path.Gravatar tomlu2017-12-14
| | | | PiperOrigin-RevId: 179082062
* Implement --(no)expand_test_suites flag.Gravatar dslomov2017-12-13
| | | | | | | | | --noexpand_test_suites flag will suppress expansion of test_suite targets into constituent tests, so that command-line aspects can analyze test_suite targets. RELNOTES: Added --(no)expand_test_suites flag. PiperOrigin-RevId: 178892829
* Removes skyframe/serialization's dependency on cmdline and vfs. Instead, ↵Gravatar Googler2017-12-11
| | | | | | make cmdline and vfs depend on serialization. This allows a class to have a pointer to its codec, which simplifies automatic recursive composite codecs. PiperOrigin-RevId: 178683500
* Automated rollback of commit d0f06a6e4b61adc39bf5e1cfbae39501a89dc8e3.Gravatar nharmata2017-12-05
| | | | | RELNOTES: None PiperOrigin-RevId: 177965330
* Platform options are no longer experimental.Gravatar jcater2017-12-04
| | | | | RELNOTES: The --host_platform and --platform flags are no longer experimental. PiperOrigin-RevId: 177863761
* Set default value of incompatible_load_argument_is_label to true.Gravatar laurentlb2017-12-04
| | | | | | | RELNOTES: First argument of 'load' must be a label. Path syntax is removed. (label should start with '//' or ':'). PiperOrigin-RevId: 177802628
* Move bazel conditions into src/conditions.Gravatar tomlu2017-11-30
| | | | | | | This will enable an easier transition from checked-in BUILD files to ones generated by copybara. RELNOTES: None PiperOrigin-RevId: 177514519
* Update tests to use the label-based load() syntax.Gravatar laurentlb2017-11-30
| | | | | RELNOTES: None. PiperOrigin-RevId: 177487913
* Add ActionKeyContext to Action#getKey.Gravatar tomlu2017-11-29
| | | | | | | This key context can be used by actions to share partial key computations, for instance when computing MD5s for nested sets. RELNOTES: None PiperOrigin-RevId: 177359607
* Remove the concept of a mandatory input which is allowed to be missing.Gravatar Googler2017-11-29
| | | | | RELNOTES: None. PiperOrigin-RevId: 177332323
* Convert TestAspects to MockRule.Gravatar gregce2017-11-29
| | | | | | It'd be nice to go further and break out a bunch of this code into more generally useful places (especially for callers that don't care about aspects). But that's a big mess and beyond the scope of what I'm aiming for here. PiperOrigin-RevId: 177307854