On Mon, Sep 26, 2016 at 3:58 PM, Kerin Millar <[email protected]> wrote: > On Sun, 25 Sep 2016 22:49:59 -0700 > Zac Medico <[email protected]> wrote: > >> On Thu, Sep 22, 2016 at 8:48 PM, Zac Medico <[email protected]> wrote: >> > On Thu, Sep 22, 2016 at 8:23 PM, Kerin Millar <[email protected]> wrote: >> >> Duly updated to use any instead of ==, as recommended by Brian Dolbec. >> >> >> >> -- >> >> Kerin Millar <[email protected]> >> > >> > My first choice would be to use a small test case to detect when ipc >> > is broken, and disable it dynamically. A good example of such a test >> > is the can_poll_device function here: >> > >> > https://gitweb.gentoo.org/proj/portage.git/tree/pym/portage/util/_eventloop/EventLoop.py?h=portage-2.3.1#n597 >> > >> > If it's not possible to use a test similar to the above, maybe it's >> > best to use /proc/version or /proc/sys/kernel/osrelease as mentioned >> > in the following issue: >> > >> > https://github.com/Microsoft/BashOnWindows/issues/423 >> > >> > Thanks, >> > Zac >> >> I've started playing around with WSL, and I've discovered that >> portage's ipc actually works if we use fcntl.flock instead of >> fcntl.lockf!!! Simply set _default_lock_fn = fcntl.flock in >> pym/portage/locks.py, and watch the tests succeed: >> >> $ pym/portage/tests/runTests.py pym/portage/tests/ebuild/test_ipc_daemon.py >> testIpcDaemon (portage.tests.ebuild.test_ipc_daemon.IpcDaemonTestCase) ... ok >> >> ---------------------------------------------------------------------- >> Ran 1 test in 1.282s >> >> OK > > How strange!
While the ebuild-ipc helper waits for a response, it uses non-blocking lock calls to poll for liveliness, so it's critical that the locking api be usable here. We've seen a similar issue in the past with PyPy, where fcntl.lockf was broken while fcntl.flock worked just fine. Thanks, Zac
