Skip to contentSkip to conversation

docs: Add caveats for Windows as the build platform

PATCH Superseded Bin Meng 2 participants 2 messages Jul 19, 2022

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Bin Meng

author
#0 lore raw

PATCH 1/1 docs: Add caveats for Windows as the build platform

Commit cf60ccc3306c ("cutils: Introduce bundle mechanism") introduced a Python script to populate a bundle directory using os.symlink() to point to the binaries in the pc-bios directory of the source tree. Commit 882084a04ae9 ("datadir: Use bundle mechanism") removed previous logic in pc-bios/meson.build to create a link/copy of pc-bios binaries in the build tree so os.symlink() is the way to go.

However os.symlink() may fail [1] on Windows if an unprivileged Windows user started the QEMU build process, which results in QEMU executables generated in the build tree not able to load the default BIOS/firmware images due to symbolic links not present in the bundle directory.

This commits updates the documentation by adding such caveats for users who want to build QEMU on the Windows platform.

[1] https://docs.python.org/3/library/os.html#os.symlink

---

 docs/about/build-platforms.rst | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
docs/about/build-platforms.rst +9 -1
index ebde20f981..1b297e87ee 100644
@@ -94,8 +94,16 @@ not tested anymore, so it is recommended to use one of the latest versions of
 Windows instead.
 
 The project supports building QEMU with current versions of the MinGW
-toolchain, either hosted on Linux (Debian/Fedora) or via MSYS2 on Windows.
+toolchain, either hosted on Linux (Debian/Fedora) or via `MSYS2`_ on Windows.
+A more recent Windows version is always prefered as it is less likely to have
+problems with building via MSYS2. The building process of QEMU involves some
+Python scripts that call os.symlink() which needs special attention for the
+build process to successfully complete. On newer versions of Windows 10,
+unprivileged accounts can create symlinks if Developer Mode is enabled.
+When Developer Mode is not available/enabled, the SeCreateSymbolicLinkPrivilege
+privilege is required, or the process must be run as an administrator.
 
 .. _Homebrew: https://brew.sh/
 .. _MacPorts: https://www.macports.org/
+.. _MSYS2: https://www.msys2.org/
 .. _Repology: https://repology.org/
Signature · 1 line
2.34.1
Reviewed-by Stefan Weil on v1 1/1
#1 lore raw

Am 19.07.22 um 15:15 schrieb Bin Meng:

Quoted 28 lines

Commit cf60ccc3306c ("cutils: Introduce bundle mechanism") introduced a Python script to populate a bundle directory using os.symlink() to point to the binaries in the pc-bios directory of the source tree. Commit 882084a04ae9 ("datadir: Use bundle mechanism") removed previous logic in pc-bios/meson.build to create a link/copy of pc-bios binaries in the build tree so os.symlink() is the way to go.

However os.symlink() may fail [1] on Windows if an unprivileged Windows user started the QEMU build process, which results in QEMU executables generated in the build tree not able to load the default BIOS/firmware images due to symbolic links not present in the bundle directory.

This commits updates the documentation by adding such caveats for users who want to build QEMU on the Windows platform.

[1] https://docs.python.org/3/library/os.html#os.symlink

---

  docs/about/build-platforms.rst | 10 +++++++++-
  1 file changed, 9 insertions(+), 1 deletion(-)
docs/about/build-platforms.rst +0 -0
index ebde20f981..1b297e87ee 100644

docs/about/build-platforms.rst not tested anymore, so it is recommended to use one of the latest versions of · line 98

Quoted 6 lines
docs/about/build-platforms.rst +2 -1
@@ -94,8 +94,16 @@ not tested anymore, so it is recommended to use one of the latest versions of
  Windows instead.
 
  The project supports building QEMU with current versions of the MinGW
-toolchain, either hosted on Linux (Debian/Fedora) or via MSYS2 on Windows.
+toolchain, either hosted on Linux (Debian/Fedora) or via `MSYS2`_ on Windows.
+A more recent Windows version is always prefered as it is less likely to have

s/prefered/preferred/

docs/about/build-platforms.rst not tested anymore, so it is recommended to use one of the latest versions of · line 109

Quoted 11 lines
docs/about/build-platforms.rst +7 -0
+problems with building via MSYS2. The building process of QEMU involves some
+Python scripts that call os.symlink() which needs special attention for the
+build process to successfully complete. On newer versions of Windows 10,
+unprivileged accounts can create symlinks if Developer Mode is enabled.
+When Developer Mode is not available/enabled, the SeCreateSymbolicLinkPrivilege
+privilege is required, or the process must be run as an administrator.
 
  .. _Homebrew: https://brew.sh/
  .. _MacPorts: https://www.macports.org/
+.. _MSYS2: https://www.msys2.org/
  .. _Repology: https://repology.org/

With the fix above:

Thanks!