Skip to contentSkip to conversation

Add information how to fix common build error on Windows in symlink-install-tree

PATCH Superseded Mateusz Krawczuk 2 participants 2 messages May 3, 2023 – May 4, 2023

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Add information how to fix common build error on Windows in symlink-install-tree

By default, Windows doesn't allow to create soft links for user account and only administrator is allowed to do this. To fix this problem you have to raise your permissions or enable Developer Mode, which available since Windows 10. Additional explanation when build fails will allow developer to fix the problem on his computer faster.

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1386

---
 scripts/symlink-install-tree.py | 5 +++++
 1 file changed, 5 insertions(+)
scripts/symlink-install-tree.py +5 -0
index 67cb86dd52..bb3a2d708c 100644
@@ -7,12 +7,14 @@
 import subprocess
 import sys
 
+
 def destdir_join(d1: str, d2: str) -> str:
     if not d1:
         return d2
     # c:\destdir + c:\prefix must produce c:\destdir\prefix
     return str(PurePath(d1, *PurePath(d2).parts[1:]))
 
+
 introspect = os.environ.get('MESONINTROSPECT')
 out = subprocess.run([*introspect.split(' '), '--installed'],
                      stdout=subprocess.PIPE, check=True).stdout
@@ -28,5 +30,8 @@ def destdir_join(d1: str, d2: str) -> str:
         os.symlink(source, bundle_dest)
     except BaseException as e:
         if not isinstance(e, OSError) or e.errno != errno.EEXIST:
+            if os.name == 'nt':
+                print('\nPlease enable Developer Mode to support soft link '
+                      'without Administrator permission\n')
             print(f'error making symbolic link {dest}', file=sys.stderr)
             raise e
Signature · 1 line
2.40.1.windows.1
#1 lore raw
Quoted 14 lines · Mateusz Krawczuk

By default, Windows doesn't allow to create soft links for user account and only administrator is allowed to do this. To fix this problem you have to raise your permissions or enable Developer Mode, which available since Windows 10. Additional explanation when build fails will allow developer to fix the problem on his computer faster.

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1386

---
  scripts/symlink-install-tree.py | 5 +++++
  1 file changed, 5 insertions(+)
scripts/symlink-install-tree.py +0 -0
index 67cb86dd52..bb3a2d708c 100644
@@ -7,12 +7,14 @@
  import subprocess

scripts/symlink-install-tree.py line 17

Quoted 10 lines
scripts/symlink-install-tree.py +2 -0
  import sys
 
+
  def destdir_join(d1: str, d2: str) -> str:
      if not d1:
          return d2
      # c:\destdir + c:\prefix must produce c:\destdir\prefix
      return str(PurePath(d1, *PurePath(d2).parts[1:]))
 
+

Please avoid such white space damage. QEMU coding style is to use only one empty line between functions.

Thomas

Quoted 12 lines
scripts/symlink-install-tree.py +3 -0
  introspect = os.environ.get('MESONINTROSPECT')
  out = subprocess.run([*introspect.split(' '), '--installed'],
                       stdout=subprocess.PIPE, check=True).stdout
@@ -28,5 +30,8 @@ def destdir_join(d1: str, d2: str) -> str:
          os.symlink(source, bundle_dest)
      except BaseException as e:
          if not isinstance(e, OSError) or e.errno != errno.EEXIST:
+            if os.name == 'nt':
+                print('\nPlease enable Developer Mode to support soft link '
+                      'without Administrator permission\n')
              print(f'error making symbolic link {dest}', file=sys.stderr)
              raise e