aboutsummaryrefslogtreecommitdiffstats
path: root/build_scripts/main.py
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2018-05-07 17:19:57 +0200
committerAlexandru Croitor <alexandru.croitor@qt.io>2018-05-08 08:27:57 +0000
commit928a5249dad9543a669ab07a0108aca26c0642cb (patch)
tree76be12a83fe278cfcfdfa025c5a2ed2c5982d9ce /build_scripts/main.py
parent31e38f359e92291aa009aa91fb292928dc31b341 (diff)
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 <qt_ci_bot@qt-project.org> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Diffstat (limited to 'build_scripts/main.py')
-rw-r--r--build_scripts/main.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/build_scripts/main.py b/build_scripts/main.py
index a98a254e..eb1a12ac 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(