diff options
author | Yifan Hong <elsk@google.com> | 2024-01-12 14:25:37 -0800 |
---|---|---|
committer | Yifan Hong <elsk@google.com> | 2024-01-17 20:01:20 +0000 |
commit | 1750a21786d854b1dcbbb35b160211979bb6f9f7 (patch) | |
tree | 895c90afde69e60aa35946592227e9bfde17e54e | |
parent | 2690277e6d418a2be74d93994a0461fb6eb82c38 (diff) | |
download | build-1750a21786d854b1dcbbb35b160211979bb6f9f7.tar.gz |
kleaf: Fix KBUILD_MIXED_TREE for --incompatible_sandbox_hermetic_tmp.
Previously without the flag, the TreeArtifact contains symlinks to
files under execroot, which is allowed.
With the flag, the symlink points to a file in the sandbox, which
is no longer valid (the sandbox is teared down) when the TreeArtifact
is validated.
Change it to a cp so that it is straightforward to humans.
Performance: There are no obvious performance regression associated with
this change. The KbuildMixedTree action is on the critical path.
This change reduces the time for the action from 4.1s to 3.6s in a
one-time experiment.
Test: TH
Bug: 319893821
Bug: 319077326
Change-Id: I63f2364e0ffaa57a7ae57a1f7730f4b510ae3a8e
Signed-off-by: Yifan Hong <elsk@google.com>
(cherry picked from commit b626eb43be646d8efdfb57e7d832da39fd81284a)
-rw-r--r-- | kleaf/impl/kernel_build.bzl | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kleaf/impl/kernel_build.bzl b/kleaf/impl/kernel_build.bzl index 41b7344..b8874fa 100644 --- a/kleaf/impl/kernel_build.bzl +++ b/kleaf/impl/kernel_build.bzl @@ -778,7 +778,7 @@ def _create_kbuild_mixed_tree(ctx): rm -rf ${{KBUILD_MIXED_TREE}} mkdir -p ${{KBUILD_MIXED_TREE}} for base_kernel_file in {base_kernel_files}; do - ln -s $(readlink -m ${{base_kernel_file}}) ${{KBUILD_MIXED_TREE}} + cp -a -t ${{KBUILD_MIXED_TREE}} $(readlink -m ${{base_kernel_file}}) done """.format( base_kernel_files = " ".join([file.path for file in base_kernel_files.to_list()]), |