diff --git a/python/mozbuild/mozbuild/vendor/vendor_manifest.py b/python/mozbuild/mozbuild/vendor/vendor_manifest.py index d12f961e0934..9f591eaca3dc 100644 --- a/python/mozbuild/mozbuild/vendor/vendor_manifest.py +++ b/python/mozbuild/mozbuild/vendor/vendor_manifest.py @@ -470,7 +470,9 @@ class VendorManifest(MozbuildObject): # GitLab puts everything down a directory; move it up. if has_prefix: tardir = mozpath.join(tmpextractdir.name, one_prefix) - mozfile.copy_contents(tardir, tmpextractdir.name) + mozfile.copy_contents( + tardir, tmpextractdir.name, ignore_dangling_symlinks=True + ) mozfile.remove(tardir) if self.should_perform_step("include"): diff --git a/testing/mozbase/mozfile/mozfile/mozfile.py b/testing/mozbase/mozfile/mozfile/mozfile.py index 9fd8794ae25c..923e38a86acc 100644 --- a/testing/mozbase/mozfile/mozfile/mozfile.py +++ b/testing/mozbase/mozfile/mozfile/mozfile.py @@ -305,7 +305,7 @@ def remove(path): _call_with_windows_retry(shutil.rmtree, (path,)) -def copy_contents(srcdir, dstdir): +def copy_contents(srcdir, dstdir, ignore_dangling_symlinks=False): """ Copy the contents of the srcdir into the dstdir, preserving subdirectories. @@ -346,7 +346,12 @@ def copy_contents(srcdir, dstdir): if errors: raise Exception(errors) else: - shutil.copytree(srcdir, dstdir, dirs_exist_ok=True) + shutil.copytree( + srcdir, + dstdir, + dirs_exist_ok=True, + ignore_dangling_symlinks=ignore_dangling_symlinks, + ) def move(src, dst):