On 03/05/2023 17.08, Mateusz Krawczuk wrote:
> 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
> Signed-off-by: Mateusz Krawczuk <mat.krawczuk@gmail.com>
> ---
> scripts/symlink-install-tree.py | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/scripts/symlink-install-tree.py b/scripts/symlink-install-tree.py
> index 67cb86dd52..bb3a2d708c 100644
> --- a/scripts/symlink-install-tree.py
> +++ b/scripts/symlink-install-tree.py
> @@ -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:]))
>
> +
Please avoid such white space damage. QEMU coding style is to use only one
empty line between functions.
Thomas
> 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