* [PATCH] Add information how to fix common build error on Windows in symlink-install-tree
@ 2023-05-03 15:08 Mateusz Krawczuk
2023-05-04 6:51 ` Thomas Huth
0 siblings, 1 reply; 2+ messages in thread
From: Mateusz Krawczuk @ 2023-05-03 15:08 UTC (permalink / raw)
Cc: Mateusz Krawczuk, John Snow, Cleber Rosa, Paolo Bonzini,
Marc-André Lureau, Daniel P. Berrangé, Thomas Huth,
Philippe Mathieu-Daudé, open list:All patches CC here
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:]))
+
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
--
2.40.1.windows.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] Add information how to fix common build error on Windows in symlink-install-tree
2023-05-03 15:08 [PATCH] Add information how to fix common build error on Windows in symlink-install-tree Mateusz Krawczuk
@ 2023-05-04 6:51 ` Thomas Huth
0 siblings, 0 replies; 2+ messages in thread
From: Thomas Huth @ 2023-05-04 6:51 UTC (permalink / raw)
To: Mateusz Krawczuk
Cc: John Snow, Cleber Rosa, Paolo Bonzini, Marc-André Lureau,
Daniel P. Berrangé, Philippe Mathieu-Daudé,
open list:All patches CC here
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-05-04 6:51 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-03 15:08 [PATCH] Add information how to fix common build error on Windows in symlink-install-tree Mateusz Krawczuk
2023-05-04 6:51 ` Thomas Huth
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).