aboutsummaryrefslogtreecommitdiffstats
path: root/build_scripts/utils.py
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2024-10-09 09:22:30 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2024-10-09 09:59:24 +0000
commit29afca66064c41c5a6a8ce8a26647bef9a4df9ad (patch)
tree7ef1d958f466cc4f95b4460c2dcd19d26e651aa2 /build_scripts/utils.py
parent4ba137415c53d93186160d9b15404b08b495cdbd (diff)
build: Deal with read-only Qt installations
Make binaries writeable before patching. No care is taken to preserve the mode as installing the wheels creates rwxrwxrwx files when unpacking regardless of the mode set when bundling. Fixes: PYSIDE-2885 Pick-to: 6.5 Change-Id: I5cbb02667c3a195ac369bb83ea42e3ba0ea85367 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> (cherry picked from commit 39b0b466bf90ff3f0e1634359fbfc9c0e528a484) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'build_scripts/utils.py')
-rw-r--r--build_scripts/utils.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/build_scripts/utils.py b/build_scripts/utils.py
index edbe61c37..02a796897 100644
--- a/build_scripts/utils.py
+++ b/build_scripts/utils.py
@@ -796,6 +796,12 @@ def linux_run_read_elf(executable_path):
def linux_set_rpaths(patchelf, executable_path, rpath_string):
""" Patches the `executable_path` with a new rpath string. """
+ path = Path(executable_path)
+ mode = path.stat().st_mode
+ if (mode & stat.S_IWUSR) == 0:
+ log.info(f"patchelf: {executable_path} is read-only, making writeable.")
+ path.chmod(mode | stat.S_IWUSR)
+
cmd = [str(patchelf), '--set-rpath', str(rpath_string), str(executable_path)]
if run_process(cmd) != 0: