Let http_archive copy WORKSPACE and BUILD files instead of symlinking them.

When using the "workspace_file" or "build_file" attributes of e.g. http_archive, we symlinked the files into the external repository. However, this means that they cannot be patched via the "patch_cmds" feature, because then the patch would modify the original source files.

Copying seems fine, because these files are usually small (I would argue that if a WORKSPACE or BUILD file is so huge that copying vs. symlinking it here makes a performance difference, then something is very wrong with these files). On Windows, we used copies anyway, because symlinking is weird. So, this change just normalizes the behavior over all platforms.

RELNOTES: None.
PiperOrigin-RevId: 291144287
diff --git a/tools/build_defs/repo/utils.bzl b/tools/build_defs/repo/utils.bzl
index 23ff2dc..6c01a47 100644
--- a/tools/build_defs/repo/utils.bzl
+++ b/tools/build_defs/repo/utils.bzl
@@ -48,16 +48,14 @@
         ctx.fail("Only one of workspace_file and workspace_file_content can be provided.")
 
     if ctx.attr.workspace_file:
-        ctx.delete("WORKSPACE")
-        ctx.symlink(ctx.attr.workspace_file, "WORKSPACE")
+        ctx.file("WORKSPACE", ctx.read(ctx.attr.workspace_file))
     elif ctx.attr.workspace_file_content:
         ctx.file("WORKSPACE", ctx.attr.workspace_file_content)
     else:
         ctx.file("WORKSPACE", "workspace(name = \"{name}\")\n".format(name = ctx.name))
 
     if ctx.attr.build_file:
-        ctx.delete("BUILD.bazel")
-        ctx.symlink(ctx.attr.build_file, "BUILD.bazel")
+        ctx.file("BUILD.bazel", ctx.read(ctx.attr.build_file))
     elif ctx.attr.build_file_content:
         ctx.file("BUILD.bazel", ctx.attr.build_file_content)