Lwt: Fix some of the new user and group tests on WSL

Created on 21 Mar 2019  路  6Comments  路  Source: ocsigen/lwt

Due to:

Test 'getlogin and Unix.getlogin' raised 'Unix.Unix_error(Unix.ENOENT, "getlogin", "")'
Test 'getpwnam and Unix.getpwnam' raised 'Unix.Unix_error(Unix.ENOENT, "getlogin", "")'
Test 'getpwuid and Unix.getpwuid' raised 'Unix.Unix_error(Unix.ENOENT, "getlogin", "")'

We may want to add a WSL-detection function to Lwt_sys.

See #673.

All 6 comments

I didn't think about WSL when adding these tests! Is checking for Microsoft in /proc/version the recommended way to detect WSL?

I didn't either, even though I'm on WSL :) I think a check like that is what's needed, but I can take care of it here, since I'm on the system, unless you really would like to :)

I don't think this issue is affecting anyone besides me right now, so no rush.

Also, rather than a check, we might just need a slightly different sequence of calls that works on WSL, Ubuntu, and macOS.

Since i don't have Windows I wouldn't be able to test my changes. Not sure if there is a CI platform that can test things on WSL. On a related note, i'll try and find some documentation about what are the gaps in the implementation on WSL when compared to a regular linux distribution. Also the link for apple's documentation in #539 seems broken. Not sure what is their more current documentation reference.

It looks like Apple made their man pages difficult to find online. I edited a note into #539 about that. Thanks for telling.

@anuragsoni - yup, seems like testing that is the recommended way (as per their core team: https://github.com/microsoft/WSL/issues/423#issuecomment-221627364)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ibukanov picture ibukanov  路  9Comments

CraigFe picture CraigFe  路  8Comments

aantron picture aantron  路  8Comments

m4b picture m4b  路  4Comments

foretspaisibles picture foretspaisibles  路  8Comments