diff --git a/src/main/java/com/google/devtools/build/lib/analysis/config/CoreOptions.java b/src/main/java/com/google/devtools/build/lib/analysis/config/CoreOptions.java index 286657b630560d..bc68d184dab915 100644 --- a/src/main/java/com/google/devtools/build/lib/analysis/config/CoreOptions.java +++ b/src/main/java/com/google/devtools/build/lib/analysis/config/CoreOptions.java @@ -947,6 +947,7 @@ public FragmentOptions getHost() { host.archivedArtifactsMnemonicsFilter = archivedArtifactsMnemonicsFilter; host.enableAspectHints = enableAspectHints; + host.allowUnresolvedSymlinks = allowUnresolvedSymlinks; return host; } diff --git a/src/test/shell/bazel/bazel_symlink_test.sh b/src/test/shell/bazel/bazel_symlink_test.sh index 5e0772c247781d..cee345e22db55a 100755 --- a/src/test/shell/bazel/bazel_symlink_test.sh +++ b/src/test/shell/bazel/bazel_symlink_test.sh @@ -584,4 +584,21 @@ EOF expect_log "cycle in dependency graph" } +function test_unresolved_symlink_in_exec_cfg() { + mkdir -p a + cat > a/BUILD <<'EOF' +load("//symlink:symlink.bzl", "dangling_symlink") +dangling_symlink(name="a", link_target="non/existent") +genrule( + name = "exec", + srcs = [], + outs = ["out"], + cmd = "touch $@", + exec_tools = [":a"], +) +EOF + + bazel --windows_enable_symlinks build --experimental_allow_unresolved_symlinks //a:exec || fail "build failed" +} + run_suite "Tests for symlink artifacts"