Gentoo Archives: gentoo-portage-dev

From: Kerin Millar <kfm@×××××××××.net>
To: gentoo-portage-dev@l.g.o
Cc: Zac Medico <zmedico@g.o>
Subject: Re: [gentoo-portage-dev] [PATCH v2] AbstractEbuildProcess: disable ipc_daemon under Windows Subsystem for Linux
Date: Mon, 26 Sep 2016 22:58:20
Message-Id: 20160926235815.4d835f1c8c9da95e85f7a702@plushkava.net
In Reply to: Re: [gentoo-portage-dev] [PATCH v2] AbstractEbuildProcess: disable ipc_daemon under Windows Subsystem for Linux by Zac Medico
1 On Sun, 25 Sep 2016 22:49:59 -0700
2 Zac Medico <zmedico@g.o> wrote:
3
4 > On Thu, Sep 22, 2016 at 8:48 PM, Zac Medico <zmedico@g.o> wrote:
5 > > On Thu, Sep 22, 2016 at 8:23 PM, Kerin Millar <kfm@×××××××××.net> wrote:
6 > >> Duly updated to use any instead of ==, as recommended by Brian Dolbec.
7 > >>
8 > >> --
9 > >> Kerin Millar <kfm@×××××××××.net>
10 > >
11 > > My first choice would be to use a small test case to detect when ipc
12 > > is broken, and disable it dynamically. A good example of such a test
13 > > is the can_poll_device function here:
14 > >
15 > > https://gitweb.gentoo.org/proj/portage.git/tree/pym/portage/util/_eventloop/EventLoop.py?h=portage-2.3.1#n597
16 > >
17 > > If it's not possible to use a test similar to the above, maybe it's
18 > > best to use /proc/version or /proc/sys/kernel/osrelease as mentioned
19 > > in the following issue:
20 > >
21 > > https://github.com/Microsoft/BashOnWindows/issues/423
22 > >
23 > > Thanks,
24 > > Zac
25 >
26 > I've started playing around with WSL, and I've discovered that
27 > portage's ipc actually works if we use fcntl.flock instead of
28 > fcntl.lockf!!! Simply set _default_lock_fn = fcntl.flock in
29 > pym/portage/locks.py, and watch the tests succeed:
30 >
31 > $ pym/portage/tests/runTests.py pym/portage/tests/ebuild/test_ipc_daemon.py
32 > testIpcDaemon (portage.tests.ebuild.test_ipc_daemon.IpcDaemonTestCase) ... ok
33 >
34 > ----------------------------------------------------------------------
35 > Ran 1 test in 1.282s
36 >
37 > OK
38
39 How strange!
40
41 > So, I'm thinking that we should add a dynamic test inside
42 > pym/portage/locks.py which checks for a broken fcntl.lockf, and falls
43 > back to fcntl.flock in that case.
44
45 Sounds good to me. Thank you for looking into it.
46
47 --
48 Kerin Millar <kfm@×××××××××.net>

Replies