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