1 |
On Mon, Sep 26, 2016 at 3:58 PM, Kerin Millar <kfm@×××××××××.net> wrote: |
2 |
> On Sun, 25 Sep 2016 22:49:59 -0700 |
3 |
> Zac Medico <zmedico@g.o> wrote: |
4 |
> |
5 |
>> On Thu, Sep 22, 2016 at 8:48 PM, Zac Medico <zmedico@g.o> wrote: |
6 |
>> > On Thu, Sep 22, 2016 at 8:23 PM, Kerin Millar <kfm@×××××××××.net> wrote: |
7 |
>> >> Duly updated to use any instead of ==, as recommended by Brian Dolbec. |
8 |
>> >> |
9 |
>> >> -- |
10 |
>> >> Kerin Millar <kfm@×××××××××.net> |
11 |
>> > |
12 |
>> > My first choice would be to use a small test case to detect when ipc |
13 |
>> > is broken, and disable it dynamically. A good example of such a test |
14 |
>> > is the can_poll_device function here: |
15 |
>> > |
16 |
>> > https://gitweb.gentoo.org/proj/portage.git/tree/pym/portage/util/_eventloop/EventLoop.py?h=portage-2.3.1#n597 |
17 |
>> > |
18 |
>> > If it's not possible to use a test similar to the above, maybe it's |
19 |
>> > best to use /proc/version or /proc/sys/kernel/osrelease as mentioned |
20 |
>> > in the following issue: |
21 |
>> > |
22 |
>> > https://github.com/Microsoft/BashOnWindows/issues/423 |
23 |
>> > |
24 |
>> > Thanks, |
25 |
>> > Zac |
26 |
>> |
27 |
>> I've started playing around with WSL, and I've discovered that |
28 |
>> portage's ipc actually works if we use fcntl.flock instead of |
29 |
>> fcntl.lockf!!! Simply set _default_lock_fn = fcntl.flock in |
30 |
>> pym/portage/locks.py, and watch the tests succeed: |
31 |
>> |
32 |
>> $ pym/portage/tests/runTests.py pym/portage/tests/ebuild/test_ipc_daemon.py |
33 |
>> testIpcDaemon (portage.tests.ebuild.test_ipc_daemon.IpcDaemonTestCase) ... ok |
34 |
>> |
35 |
>> ---------------------------------------------------------------------- |
36 |
>> Ran 1 test in 1.282s |
37 |
>> |
38 |
>> OK |
39 |
> |
40 |
> How strange! |
41 |
|
42 |
While the ebuild-ipc helper waits for a response, it uses non-blocking |
43 |
lock calls to poll for liveliness, so it's critical that the locking |
44 |
api be usable here. We've seen a similar issue in the past with PyPy, |
45 |
where fcntl.lockf was broken while fcntl.flock worked just fine. |
46 |
|
47 |
Thanks, |
48 |
Zac |