aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com
diff options
context:
space:
mode:
authorGravatar Damien Martin-Guillerez <dmarting@google.com>2016-02-25 12:14:42 +0000
committerGravatar Philipp Wollermann <philwo@google.com>2016-02-25 14:16:13 +0000
commit26f7f4849d4f56d23d21111ee17248ab64065009 (patch)
tree210a152f3ff5773c63616ef2887414fa6dab145c /src/main/java/com
parented51bd75a24b5fb8ccf4fd38bf6140697f8f7de0 (diff)
Testing correct invalidation of Skylark Remote Repositories
A Skylark remote repository should be invalidated only when the WORKSPACE file change, or one of its dependency or the Skylark file change. This change include two fixes: - The path of the RepositoryDirectoryValue was incorrect when the directory root is a symlink and the repository is not local (and not refetching). This was never triggered before because the only rule that were symlinking their root were the local one. - Directories were unitialized for the SkylarkRepositoryFunction (was forgotten as part of a refactor when introducing it). -- MOS_MIGRATED_REVID=115547540
Diffstat (limited to 'src/main/java/com')
-rw-r--r--src/main/java/com/google/devtools/build/lib/bazel/BazelRepositoryModule.java1
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/repository/RepositoryDelegatorFunction.java7
2 files changed, 3 insertions, 5 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/bazel/BazelRepositoryModule.java b/src/main/java/com/google/devtools/build/lib/bazel/BazelRepositoryModule.java
index 5e16483f6a..6d7c4f8886 100644
--- a/src/main/java/com/google/devtools/build/lib/bazel/BazelRepositoryModule.java
+++ b/src/main/java/com/google/devtools/build/lib/bazel/BazelRepositoryModule.java
@@ -110,6 +110,7 @@ public class BazelRepositoryModule extends BlazeModule {
for (RepositoryFunction handler : repositoryHandlers.values()) {
handler.setDirectories(directories);
}
+ skylarkRepositoryFunction.setDirectories(directories);
}
/**
diff --git a/src/main/java/com/google/devtools/build/lib/rules/repository/RepositoryDelegatorFunction.java b/src/main/java/com/google/devtools/build/lib/rules/repository/RepositoryDelegatorFunction.java
index c5cd01ef05..8c66b96469 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/repository/RepositoryDelegatorFunction.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/repository/RepositoryDelegatorFunction.java
@@ -123,15 +123,12 @@ public class RepositoryDelegatorFunction implements SkyFunction {
if (markerUpToDate && repoRoot.exists()) {
// Now that we know that it exists, we can declare a Skyframe dependency on the repository
// root.
- FileValue repoRootValue = RepositoryFunction.getRepositoryDirectory(repoRoot, env);
+ RepositoryFunction.getRepositoryDirectory(repoRoot, env);
if (env.valuesMissing()) {
return null;
}
- // NB: This returns the wrong repository value for non-local new_* repository functions.
- // This should sort itself out automatically once the ExternalFilesHelper refactoring is
- // finally submitted.
- return RepositoryDirectoryValue.create(repoRootValue.realRootedPath().asPath());
+ return RepositoryDirectoryValue.create(repoRoot);
}
if (isFetch.get()) {