You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've recently taken over maintainership of unix-compat, and I intend to push out a unix-2.8-compatible release as soon as I can. One remaining issue is what to make of the System.PosixCompat.User module, as the UserEntry type has changed.
And here is my preferred solution, to delete the System.PosixCompat.User module entirely, based on the observation that System.PosixCompat.User doesn't seem useful at all, as all functions either return dummy data or throw exceptions: jacobstanley/unix-compat#62
However, I see that stack and yi-core actually use this module. For example:
--| Check whether the current user (determined with 'getEffectiveUserId') is
-- the owner for the given path.
--
-- Will always pure 'True' on Windows.
isOwnedByUser::MonadIOm=>PathAbst->mBool
isOwnedByUser path = liftIO $
if osIsWindows
thenpureTrue
elsedo
fileStatus <- getFileStatus (toFilePath path)
user <- getEffectiveUserID
pure (user == fileOwner fileStatus)
This code looks dubious to me: it claims to always return True on Windows, yet I believe it instead always throws an exception on Windows, which may be getting swallowed somewhere else.
But there are other uses, too, in Stack/Docker.hs. So, could you please consider the effect of deleting System.PosixCompat.User on the stack codebase, and let me know if that is a reasonable option, or if you'd rather see a different approach to unix-2.8 support?
Thanks.
The text was updated successfully, but these errors were encountered:
@mitchellwrosen, thanks for asking. From Stack's perspective, I think it is a reasonable option to delete System.PosixCompat.User.
osIsWindows is True on Windows, so I would not expect Stack.Config.isOwnedByUser to throw an exception. Stack's Docker support throws unsupported exceptions on Windows - #2421.
Hi there,
I've recently taken over maintainership of
unix-compat
, and I intend to push out aunix-2.8
-compatible release as soon as I can. One remaining issue is what to make of theSystem.PosixCompat.User
module, as theUserEntry
type has changed.Here is the first PR that attempts to graft over the differences: https://github.com/jacobstanley/unix-compat/pull/60/files
And here is my preferred solution, to delete the
System.PosixCompat.User
module entirely, based on the observation thatSystem.PosixCompat.User
doesn't seem useful at all, as all functions either return dummy data or throw exceptions: jacobstanley/unix-compat#62However, I see that
stack
andyi-core
actually use this module. For example:stack/src/Stack/Config.hs
Lines 888 to 899 in 835318b
This code looks dubious to me: it claims to always return
True
on Windows, yet I believe it instead always throws an exception on Windows, which may be getting swallowed somewhere else.But there are other uses, too, in
Stack/Docker.hs
. So, could you please consider the effect of deletingSystem.PosixCompat.User
on thestack
codebase, and let me know if that is a reasonable option, or if you'd rather see a different approach tounix-2.8
support?Thanks.
The text was updated successfully, but these errors were encountered: