diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/ArtifactFunction.java b/src/main/java/com/google/devtools/build/lib/skyframe/ArtifactFunction.java index 021a8ca39d4887..e5aef73e303c7a 100644 --- a/src/main/java/com/google/devtools/build/lib/skyframe/ArtifactFunction.java +++ b/src/main/java/com/google/devtools/build/lib/skyframe/ArtifactFunction.java @@ -282,13 +282,14 @@ private static SkyValue createSourceValue(Artifact artifact, Environment env) // // In the future, we need to make this result the source of truth for the files available to // the action so that we at least have consistency. - TraversalRequest request = TraversalRequest.create( - DirectTraversalRoot.forRootedPath(path), - /*isRootGenerated=*/ false, - PackageBoundaryMode.CROSS, - /*strictOutputFiles=*/ true, - /*skipTestingForSubpackage=*/ true, - /*errorInfo=*/ null); + TraversalRequest request = + TraversalRequest.create( + DirectTraversalRoot.forRootedPath(path), + /*isRootGenerated=*/ false, + PackageBoundaryMode.CROSS, + /*strictOutputFiles=*/ true, + /*skipTestingForSubpackage=*/ true, + /*errorInfo=*/ "Directory artifact " + artifact.prettyPrint()); RecursiveFilesystemTraversalValue value; try { value = diff --git a/src/test/shell/integration/execution_phase_tests.sh b/src/test/shell/integration/execution_phase_tests.sh index fb40a396ac520b..7fc17457d03ce6 100755 --- a/src/test/shell/integration/execution_phase_tests.sh +++ b/src/test/shell/integration/execution_phase_tests.sh @@ -384,4 +384,13 @@ function test_resource_flags_syntax() { || fail "Empty build failed" } +function test_track_directory_crossing_package() { + mkdir -p foo/dir/subdir + touch foo/dir/subdir/BUILD + echo "filegroup(name = 'foo', srcs = ['dir'])" > foo/BUILD + bazel --host_jvm_args=-DBAZEL_TRACK_SOURCE_DIRECTORIES=1 build //foo \ + >& "$TEST_log" || fail "Expected success" + expect_log "WARNING: Directory artifact foo/dir crosses package boundary into" +} + run_suite "Integration tests of ${PRODUCT_NAME} using the execution phase."