From: Kerin Millar <kfm@plushkava.net>
To: gentoo-portage-dev@lists.gentoo.org
Subject: [gentoo-portage-dev] [PATCH] AbstractEbuildProcess: disable ipc_daemon under Windows Subsystem for Linux
Date: Fri, 23 Sep 2016 03:22:25 +0100 [thread overview]
Message-ID: <20160923032225.74dc9398a248c4f150393cf9@plushkava.net> (raw)
[-- Attachment #1: Type: text/plain, Size: 203 bytes --]
Hi,
The attached patch renders portage functional under WSL, as tested with the "current branch" of Windows 10. Further details can be found in the commit message.
--
Kerin Millar <kfm@plushkava.net>
[-- Attachment #2: portage-wsl-support.patch --]
[-- Type: application/octet-stream, Size: 1722 bytes --]
commit fc706e5b21829cdeab2c40749639c4fceccd225a
Author: Kerin Millar <kfm@plushkava.net>
Date: Fri Sep 23 01:55:10 2016 +0000
AbstractEbuildProcess: disable ipc_daemon under Windows Subsystem for Linux
As of Windows 10 build 14393, WSL is unable to support EbuildIpcDaemon
correctly. The presence of /dev/lxss - as a character device - indicates that we
are running under WSL, in which case the use of the daemon should be disabled.
Note that stat calls directed at /dev/lxss are currently doomed to fail with
EPERM. Thus, this specific error is also used as a means to detect WSL. Should
Microsoft render this device node accessible in future builds, WSL will still
be detected correctly.
diff --git a/pym/_emerge/AbstractEbuildProcess.py b/pym/_emerge/AbstractEbuildProcess.py
index 8bd30a6..7c8fc18 100644
--- a/pym/_emerge/AbstractEbuildProcess.py
+++ b/pym/_emerge/AbstractEbuildProcess.py
@@ -128,7 +128,17 @@ class AbstractEbuildProcess(SpawnProcess):
# since we're not displaying to a terminal anyway.
self.settings['NOCOLOR'] = 'true'
- if self._enable_ipc_daemon:
+ # Determine whether we are running under WSL (Windows Subsystem for Linux).
+ # Trying to stat /dev/lxss under WSL will always fail with EPERM (for now).
+ running_wsl = False
+ try:
+ if platform.system() == 'Linux' and stat.S_ISCHR(os.stat('/dev/lxss')):
+ running_wsl = True
+ except OSError as e:
+ if (e.errno == errno.EPERM):
+ running_wsl = True
+
+ if self._enable_ipc_daemon and not running_wsl:
self.settings.pop('PORTAGE_EBUILD_EXIT_FILE', None)
if self.phase not in self._phases_without_builddir:
if 'PORTAGE_BUILDDIR_LOCKED' not in self.settings:
next reply other threads:[~2016-09-23 2:22 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-23 2:22 Kerin Millar [this message]
2016-09-23 2:50 ` [gentoo-portage-dev] [PATCH] AbstractEbuildProcess: disable ipc_daemon under Windows Subsystem for Linux Brian Dolbec
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160923032225.74dc9398a248c4f150393cf9@plushkava.net \
--to=kfm@plushkava.net \
--cc=gentoo-portage-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox