dxc: Move message_compiler.py off distutils
Based off the same change in Chrome:
https://chromium-review.googlesource.com/c/chromium/src/+/5362115
Change-Id: I437a1180e9b608aeee32c80d9ce4252ca1685222
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/178700
Auto-Submit: Antonio Maiorano <amaiorano@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
diff --git a/third_party/gn/dxc/build/message_compiler.py b/third_party/gn/dxc/build/message_compiler.py
index c050341..28ef64d 100644
--- a/third_party/gn/dxc/build/message_compiler.py
+++ b/third_party/gn/dxc/build/message_compiler.py
@@ -32,7 +32,6 @@
# Usage: message_compiler.py <environment_file> [<args to mc.exe>*]
import difflib
-import distutils.dir_util
import filecmp
import os
import re
@@ -69,7 +68,11 @@
# If these are new files, create the source directory. The diff will fail later to let
# the user know what files to copy.
os.makedirs(source, exist_ok=True)
- distutils.dir_util.copy_tree(source, header_dir, preserve_times=False)
+ # Set copy_function to shutil.copy to update the timestamp on the destination.
+ shutil.copytree(source,
+ header_dir,
+ copy_function=shutil.copy,
+ dirs_exist_ok=True)
# On non-Windows, that's all we can do.
if sys.platform != 'win32':