From 181a0ce13a811f14f08e092dfd199188b98b389a Mon Sep 17 00:00:00 2001 From: Fabian Meumertzheim Date: Sun, 19 Jun 2022 17:42:29 +0200 Subject: [PATCH] Preserve --experimental_allow_unresolved_symlinks in exec cfg See https://github.com/bazelbuild/bazel/issues/10298#issuecomment-1097097541 Work towards https://github.com/bazelbuild/bazel/issues/10298 --- .../build/lib/analysis/config/CoreOptions.java | 1 + src/test/shell/bazel/bazel_symlink_test.sh | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) 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"