From 928a5249dad9543a669ab07a0108aca26c0642cb Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Mon, 7 May 2018 17:19:57 +0200 Subject: Make sure copied libclang file has write permissions When doing a standalone rebuild on macOS, if the libclang library copied over has no write permissions set, the install procedure will fail with permission denied error. Make sure to make the file owner writable, so that any subsequent rebuilds don't cause a failure. Change-Id: I54bb3f6e8bd8db7f8ed2de17892fcedec09b6c32 Reviewed-by: Qt CI Bot Reviewed-by: Friedemann Kleint Reviewed-by: Cristian Maureira-Fredes --- build_scripts/main.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'build_scripts/main.py') diff --git a/build_scripts/main.py b/build_scripts/main.py index a98a254e0..eb1a12ac2 100644 --- a/build_scripts/main.py +++ b/build_scripts/main.py @@ -1211,7 +1211,12 @@ class pyside_build(_build): 'pyside_package')) if os.path.exists(clang_lib_path): log.info('Copying libclang shared library to the package folder.') - copyfile(clang_lib_path, destination_dir) + basename = os.path.basename(clang_lib_path) + destination_path = os.path.join(destination_dir, basename) + + # Need to modify permissions in case file is not writable + # (a reinstall would cause a permission denied error). + copyfile(clang_lib_path, destination_path, make_writable_by_owner=True) else: raise RuntimeError("Error copying libclang library " "from {} to {}. ".format( -- cgit v1.2.3